* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  background: #08080a;
  color: #f5f1e6;
  font-family: -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  min-height: 100%;
  direction: rtl;
}
#app {
  max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative;
  background: linear-gradient(rgba(8,8,10,.88), rgba(8,8,10,.88)), url(images/bg-collage.jpg) center/cover fixed no-repeat #08080a;
}
#view { padding-bottom: 92px; }

h1,h2,h3 { font-weight: 700; }
.gold { color: #e8c15a; }
.muted { color: #9a958a; }
.small { font-size: 13px; }

/* ---------- header / hero ---------- */
.hero {
  position: relative;
  min-height: 340px;
  background-size: cover;
  background-position: center 30%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 18px 18px 20px;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(11,11,14,.35), rgba(11,11,14,.55) 55%, rgba(11,11,14,.97));
}
.hero > * { position: relative; }
.hero .date-line { font-size: 13px; color: #cfc7b4; margin-bottom: 6px; }
.hero h1 { font-size: 27px; letter-spacing: .2px; line-height: 1.35; text-shadow: 0 2px 12px rgba(0,0,0,.6); }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 6px;
}
.topbar img.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; border: 2px solid #d9b45b;
  filter: grayscale(100%);
}
.topbar .hello { flex: 1; }
.topbar .hello b { font-size: 17px; }
.topbar .hello div { font-size: 12px; color: #9a958a; }
.topbar .brand {
  color: #d9b45b !important; font-size: 11px !important; font-weight: 700;
  letter-spacing: .4px; text-align: right; margin-bottom: 2px;
}

/* ambient banner wrapping the topbar on every page */
.ambwrap {
  position: relative; overflow: hidden;
  border-radius: 18px; margin: 10px 12px 4px;
  border: 1px solid rgba(217,180,91,.22);
}
.ambwrap img.amb {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .5;
}
.ambfade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(11,11,14,.42), rgba(11,11,14,.93));
}
.ambwrap .topbar { position: relative; padding: 22px 16px 14px; }

/* ---------- cards ---------- */
.card {
  background: #14151c;
  border: 1px solid #2e2c26;
  border-radius: 16px;
  margin: 12px 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.card.img-card {
  position: relative; overflow: hidden;
  min-height: 120px;
  background-size: cover; background-position: center;
  border: 1px solid #3a3220;
}
.card.img-card::before {
  content:""; position:absolute; inset:0;
  background: linear-gradient(to bottom, rgba(11,11,14,.25), rgba(11,11,14,.88));
}
.card.img-card > * { position: relative; }
.card h2 { font-size: 17px; margin-bottom: 10px; }
.card h2 .badge {
  font-size: 11px; background: #d9b45b; color: #141210;
  border-radius: 20px; padding: 2px 10px; margin-right: 8px; vertical-align: middle;
  font-weight: 700;
}

.goal-big {
  font-size: 20px; line-height: 1.7; font-weight: 700; color: #f2d98c;
  text-shadow: 0 2px 10px rgba(0,0,0,.7);
}
.edit-link { font-size: 12px; color: #d9b45b; text-decoration: underline; cursor: pointer; background:none;border:none;font-family:inherit; }

/* ---------- progress ---------- */
.bar { background: #26241e; border-radius: 20px; height: 10px; overflow: hidden; margin: 8px 0 4px; }
.bar > div { background: linear-gradient(90deg, #b08a2e, #f2d98c); height: 100%; border-radius: 20px; transition: width .3s; }
.count-pill {
  display: inline-block; background: rgba(217,180,91,.15); color: #f2d98c;
  border: 1px solid rgba(217,180,91,.4);
  border-radius: 20px; padding: 4px 14px; font-size: 13px; font-weight: 700; margin-top: 8px;
}

/* ---------- stat row ---------- */
.stat-row { display: flex; gap: 10px; margin: 12px 14px; }
.stat {
  flex: 1; background: #15151a; border: 1px solid #26241e; border-radius: 14px;
  padding: 12px 6px; text-align: center;
}
.stat b { display: block; font-size: 20px; color: #e8c15a; }
.stat span { font-size: 11px; color: #9a958a; }

/* ---------- lists ---------- */
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 2px; border-bottom: 1px solid #1f1e24;
}
.row:last-child { border-bottom: none; }
.row .txt { flex: 1; font-size: 15px; }
.row .txt.done { text-decoration: line-through; color: #6e6a5e; }
.row .time { font-size: 12px; color: #9a958a; min-width: 52px; text-align: left; direction: ltr; }
.chk {
  width: 26px; height: 26px; min-width: 26px; border-radius: 50%;
  border: 2px solid #d9b45b; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #141210; font-size: 15px; font-weight: 900;
}
.chk.on { background: #d9b45b; }
.del { background: none; border: none; color: #8e3a44; font-size: 17px; cursor: pointer; padding: 2px 6px; }
.area-badge {
  font-size: 11px; border-radius: 20px; padding: 2px 10px; margin-right: 8px;
  vertical-align: middle; font-weight: 700; color: #f5f1e6;
}
.streak { font-size: 11px; color: #f2d98c; background: rgba(217,180,91,.12); padding: 2px 9px; border-radius: 12px; }

/* ---------- forms ---------- */
.add-row { display: flex; gap: 8px; margin-top: 10px; }
input[type=text], input[type=number], input[type=date], select, textarea {
  background: #0f0f13; color: #f5f1e6;
  border: 1px solid #33301f; border-radius: 12px;
  padding: 11px 12px; font-size: 15px; font-family: inherit;
  width: 100%; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: #d9b45b; }
textarea { min-height: 74px; resize: vertical; }
.btn {
  background: linear-gradient(90deg, #c69a35, #e8c15a); color: #141210;
  border: none; border-radius: 12px; padding: 11px 18px;
  font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit;
  min-width: 70px;
}
.btn.ghost { background: transparent; border: 1px solid #d9b45b; color: #e8c15a; }
.btn.block { width: 100%; margin-top: 10px; }

/* ---------- section head ---------- */
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 2px;
}
.sec-head h2 { font-size: 19px; }
.back { color: #d9b45b; text-decoration: none; font-size: 14px; }

/* ---------- tabs (scopes) ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 14px 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  white-space: nowrap; padding: 8px 16px; border-radius: 20px;
  border: 1px solid #33301f; color: #cfc7b4; font-size: 14px; cursor: pointer;
  background: #15151a; font-family: inherit;
}
.tab.on { background: #d9b45b; color: #141210; font-weight: 800; border-color: #d9b45b; }

/* ---------- more grid ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px; }
.tile {
  position: relative; border-radius: 16px; overflow: hidden;
  min-height: 108px; display: flex; align-items: flex-end;
  background-size: cover; background-position: center;
  text-decoration: none; color: #f5f1e6;
  border: 1px solid #2c2a22;
}
.tile::before { content:""; position:absolute; inset:0; background: linear-gradient(to bottom, rgba(11,11,14,.15), rgba(11,11,14,.9)); }
.tile span { position: relative; padding: 12px; font-weight: 700; font-size: 15px; text-shadow: 0 1px 8px rgba(0,0,0,.8); }

/* ---------- coach ---------- */
.q-block { margin-bottom: 14px; }
.q-block label { display: block; font-size: 14px; color: #e8c15a; margin-bottom: 6px; font-weight: 700; }
.daypart {
  font-size: 13px; font-weight: 800; color: #141210; background: #d9b45b;
  display: inline-block; border-radius: 8px; padding: 3px 12px; margin: 8px 0 12px;
}

/* ---------- money ---------- */
.money-num { font-size: 26px; font-weight: 800; color: #6fbf8a; direction: ltr; text-align: right; }
.neg { color: #d0545e !important; }

/* ---------- nav ---------- */
#nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 480px; margin: 0 auto;
  display: flex; background: rgba(16,16,20,.97);
  border-top: 1px solid #2b2516;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}
#nav a {
  flex: 1; text-align: center; text-decoration: none;
  color: #8d887a; font-size: 11px;
  display: flex; flex-direction: column; gap: 3px; align-items: center;
}
#nav a .ic { font-size: 19px; }
#nav a.on { color: #e8c15a; }
#nav a { font-size: 10px; }

.goal-empty { color: #b9b2a0; font-size: 17px; font-weight: 400; }
.plan-head {
  margin: 14px 0 4px; font-size: 13px; font-weight: 800; color: #d9b45b;
  border-bottom: 1px solid #2b2516; padding-bottom: 5px;
}
.month-row { padding-right: 30px; }
.cta-card { border-color: #d9b45b; }

/* ---------- assistant chat ---------- */
.chat-box { padding: 10px 14px; }
.bubble {
  max-width: 85%; border-radius: 16px; padding: 10px 14px; margin: 8px 0;
  font-size: 14px; line-height: 1.8;
}
.bubble.bot { background: #15151a; border: 1px solid #2b2516; margin-left: auto; border-bottom-left-radius: 4px; }
.bubble.me { background: linear-gradient(90deg, #c69a35, #e8c15a); color: #141210; margin-right: auto; border-bottom-right-radius: 4px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 6px 0 10px; }
.chip {
  background: #15151a; color: #e8c15a; border: 1px solid #d9b45b;
  border-radius: 20px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.chip:active { background: #d9b45b; color: #141210; }
.chat-input {
  position: sticky; bottom: 78px; display: flex; gap: 8px;
  padding: 10px 14px; background: rgba(8,8,10,.95);
}

.empty { text-align: center; color: #7d8794; font-size: 14px; padding: 18px 0; }

/* ---------- links ---------- */
.link-tile {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  border-radius: 14px; padding: 14px; margin-top: 10px; color: #f5f1e6;
  border: 1px solid rgba(255,255,255,.12);
}
.link-tile .dot { width: 14px; height: 14px; border-radius: 50%; min-width: 14px; }
.link-tile .txt { flex: 1; font-weight: 700; font-size: 15px; }
.link-tile .url { font-size: 11px; color: #b9c0c9; direction: ltr; text-align: left; }
.color-dots { display: flex; gap: 8px; margin-top: 8px; }
.color-dots button {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
}
.color-dots button.on { border-color: #f5f1e6; }
.hint { font-size: 12px; color: #9a958a; margin-top: 8px; line-height: 1.7; }
.divider { height: 1px; background: #26241e; margin: 14px 0; }
.rating-row { display: flex; gap: 6px; direction: ltr; justify-content: center; margin: 8px 0; }
.rating-row button {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid #33301f;
  background: #0f0f13; color: #cfc7b4; font-size: 14px; cursor: pointer; font-family: inherit;
}
.rating-row button.on { background: #d9b45b; color: #141210; font-weight: 800; }

/* ---- grow hub ---- */
.chip.on { background: #e8c15a; color: #14151c; border-color: #e8c15a; font-weight: 700; }
.daily-card { border-color: #d9b45b; }
.daily-label { color: #e8c15a; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.daily-link { color: #e8c15a; font-size: 13px; display: inline-block; margin-top: 8px; }
.quote-big { font-size: 18px; font-weight: 700; line-height: 1.9; margin: 6px 0; }
.idea { margin-top: 8px; padding: 8px 10px; border-right: 3px solid #e8c15a; background: rgba(232,193,90,.07); border-radius: 8px; font-size: 13px; line-height: 1.9; }
.qline { padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14px; line-height: 1.9; }
.qline:last-child { border-bottom: none; }
a.person-link { color: inherit; text-decoration: none; display: flex; }
.person { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.person:last-child { border-bottom: none; }
.person img { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; border: 2px solid #d9b45b; flex: none; }
.mono { width: 62px; height: 62px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 30% 30%, #2a2f45, #14151c); border: 2px solid #d9b45b; color: #e8c15a; font-size: 26px; font-weight: 800; }

.wall { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.wall img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(217,180,91,.25); }
