/* ============================================================
   Beres - design tokens
   Calm, charcoal, single restrained accent. Clarity over noise.
   ============================================================ */
:root {
  --bg:        #16181d;
  --bg-soft:   #1c1f26;
  --surface:   #21252e;
  --surface-2: #272c37;
  --line:      #2f3540;
  --line-soft: #262b34;

  --text:      #eef1f5;
  --text-mut:  #a3acbb;
  --text-dim:  #6b7484;

  --accent:    #2dd4a7;   /* beres green - the colour of "done" */
  --accent-dim:#1f9e7c;
  --accent-ink:#08130f;

  --amber:     #e6b450;
  --slate:     #7c89a0;
  --rose:      #d96a78;

  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 8px 30px rgba(0,0,0,.35);
  --ease:      cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* the hidden attribute must always win over component display rules */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

::selection { background: var(--accent); color: var(--accent-ink); }

.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 0 18px;
  position: sticky;
  top: 0;
  background: linear-gradient(var(--bg) 78%, rgba(22,24,29,0));
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 9px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-date {
  font-size: 11px; font-weight: 600;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
}

.steps {
  display: flex;
  gap: 4px;
  margin-left: auto;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  padding: 4px;
  border-radius: 12px;
}
.step {
  display: flex; align-items: center; gap: 7px;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-dim);
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  position: relative;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.step:hover { color: var(--text-mut); }
.step.is-active { background: var(--surface-2); color: var(--text); }
.step-num {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  font-size: 11px;
  border-radius: 50%;
  background: var(--line);
  color: var(--text-mut);
}
.step.is-active .step-num { background: var(--accent); color: var(--accent-ink); }
.step-badge {
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 8px;
}
.step-label { display: inline; }

.topbar-right { display: flex; align-items: center; }
.streak {
  display: flex; align-items: center; gap: 5px;
  color: var(--accent);
  font: inherit; font-size: 13px; font-weight: 600;
  background: rgba(45,212,167,.1);
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.streak:hover { background: rgba(45,212,167,.18); }
.streak.is-active { border-color: var(--accent-dim); background: rgba(45,212,167,.18); }

/* account / login */
.topbar-right { position: relative; gap: 8px; }
.acct {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-mut); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 5px 10px; border-radius: 9px;
  transition: color .15s, border-color .15s, background .15s;
}
.acct:hover { color: var(--text); border-color: var(--text-dim); }
.acct-ico { display: grid; place-items: center; width: 16px; height: 16px; }
.acct.is-in { padding: 4px; border-radius: 50%; }
.acct.is-in .acct-ico { width: 26px; height: 26px; }
.acct-ico img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: block; }
.acct-initial {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-size: 13px; font-weight: 700;
}
.acct-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
  z-index: 60;
  animation: pop .2s var(--ease);
}
.acct-email { font-size: 13px; font-weight: 600; color: var(--text); word-break: break-all; }
.acct-sync {
  display: flex; align-items: center; gap: 5px;
  margin-top: 6px; font-size: 12px; color: var(--accent);
}
.acct-logout {
  width: 100%; margin-top: 12px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-mut); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 9px; border-radius: 9px;
  transition: color .15s, border-color .15s;
}
.acct-logout:hover { color: var(--rose); border-color: var(--rose); }

/* ---------- Stage / views ---------- */
.stage { flex: 1; padding: 18px 0 40px; }

.view { display: none; animation: fade .3s var(--ease); }
.view.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head { margin-bottom: 26px; }
.view-head h1 {
  font-size: 26px; font-weight: 700; letter-spacing: -.02em;
  margin-bottom: 8px;
}
.view-head p { color: var(--text-mut); font-size: 15px; max-width: 56ch; }

/* ---------- Capture ---------- */
.capture-box {
  display: flex; gap: 10px;
  margin-bottom: 10px;
}
.capture-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit; font-size: 16px;
  padding: 15px 18px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.capture-input::placeholder { color: var(--text-dim); }
.capture-input:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(45,212,167,.13);
}

.btn-primary {
  display: flex; align-items: center; gap: 7px;
  background: var(--accent); color: var(--accent-ink);
  border: none; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600;
  padding: 0 18px;
  border-radius: var(--radius);
  transition: filter .15s var(--ease), transform .08s var(--ease);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: scale(.97); }

.capture-hint { color: var(--text-dim); font-size: 13px; margin-bottom: 22px; }
.capture-hint kbd {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; font-size: 11px; font-family: inherit;
}

.inbox-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.inbox-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  animation: slideIn .25s var(--ease);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.inbox-item .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-dim); flex-shrink: 0;
}
.inbox-item .txt { flex: 1; font-size: 15px; }
.icon-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-dim); padding: 5px; border-radius: 7px;
  display: grid; place-items: center;
  transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--rose); background: var(--surface-2); }

/* ---------- Sort ---------- */
.sort-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.sort-item {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 15px 16px;
  animation: slideIn .25s var(--ease);
}
.sort-item .txt { font-size: 15px; margin-bottom: 13px; }
.bucket-row { display: flex; flex-wrap: wrap; gap: 8px; }
.bucket-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-mut);
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 12px;
  border-radius: 9px; cursor: pointer;
  transition: all .15s var(--ease);
}
.bucket-btn .bdot { width: 8px; height: 8px; border-radius: 50%; }
.bucket-btn:hover { border-color: var(--text-dim); color: var(--text); }
.bucket-btn[data-b="today"]:hover    { border-color: var(--accent); }
.bucket-btn[data-b="later"]:hover    { border-color: var(--slate); }
.bucket-btn[data-b="delegate"]:hover { border-color: var(--amber); }
.bucket-btn[data-b="drop"]:hover     { border-color: var(--rose); }
.bdot.today    { background: var(--accent); }
.bdot.later    { background: var(--slate); }
.bdot.delegate { background: var(--amber); }
.bdot.drop     { background: var(--rose); }

/* ---------- Focus ---------- */
.focus-progress { margin-bottom: 20px; }
.focus-progress-bar {
  height: 8px; background: var(--surface-2);
  border-radius: 99px; overflow: hidden;
}
.focus-progress-bar span {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width .5s var(--ease);
}
.focus-progress-meta {
  margin-top: 8px; font-size: 13px; color: var(--text-mut);
}

.focus-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  animation: pop .3s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.focus-card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 16px;
}
.focus-card-tag {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
  background: rgba(45,212,167,.12);
  padding: 4px 10px; border-radius: 7px;
}
.focus-card-due {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  color: var(--text-mut);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 4px 9px; border-radius: 7px;
}
.focus-card-due.is-over {
  color: var(--rose); border-color: var(--rose);
  background: rgba(217,106,120,.1);
}
.focus-card-text { font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; margin-bottom: 24px; }
.focus-card-actions { display: flex; gap: 10px; }

.btn-done {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
  border: none; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 700;
  padding: 13px 20px; border-radius: 12px;
  transition: filter .15s, transform .08s;
}
.btn-done:hover { filter: brightness(1.06); }
.btn-done:active { transform: scale(.97); }
.btn-ghost {
  display: flex; align-items: center; gap: 7px;
  background: transparent; color: var(--text-mut);
  border: 1px solid var(--line); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 13px 16px; border-radius: 12px;
  transition: all .15s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

.queue-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.queue-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--text-mut);
  font-size: 14px;
}
.queue-item .qnum {
  width: 20px; height: 20px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  background: var(--surface-2); border-radius: 6px; color: var(--text-dim);
}
.queue-item .qtxt { flex: 1; }
.queue-item.is-done { color: var(--text-dim); }
.queue-item.is-done .qtxt { text-decoration: line-through; }
.queue-item.is-done .qnum { background: rgba(45,212,167,.14); color: var(--accent); }
.qdue {
  display: inline-flex; align-items: center; gap: 4px;
  flex-shrink: 0;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
}
.qdue.is-over { color: var(--rose); }
.qdue svg { width: 13px; height: 13px; }
.qtime { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* ---------- Due date control ---------- */
.sort-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 13px; }
.sort-head .txt { flex: 1; margin-bottom: 0; }

.due-add {
  flex-shrink: 0;
  display: grid; place-items: center;
  background: transparent; border: 1px dashed var(--line); cursor: pointer;
  color: var(--text-dim); padding: 6px; border-radius: 8px;
  transition: color .15s, border-color .15s, background .15s;
}
.due-add:hover { color: var(--accent); border-color: var(--accent-dim); background: rgba(45,212,167,.08); }

.due-set { display: inline-flex; align-items: center; flex-shrink: 0; }
.due-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-mut); cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 9px; border-radius: 8px 0 0 8px; border-right: none;
  transition: color .15s, border-color .15s;
}
.due-chip:hover { color: var(--text); }
.due-clear {
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-dim); cursor: pointer;
  padding: 5px 7px; border-radius: 0 8px 8px 0;
  transition: color .15s, background .15s;
}
.due-clear:hover { color: var(--rose); background: var(--surface); }
.due-set.is-over .due-chip {
  color: var(--rose); border-color: var(--rose); background: rgba(217,106,120,.1);
}
.due-set.is-over .due-clear { border-color: var(--rose); }

/* shared native date picker - visually hidden, opened via showPicker() */
.due-picker {
  position: fixed; bottom: 0; left: 0;
  width: 1px; height: 1px; opacity: 0; pointer-events: none;
  border: 0; padding: 0; margin: 0;
  color-scheme: dark;
}

/* ---------- Parked work (Boleh Tunggu / Wakilkan) ---------- */
.parked { display: flex; flex-direction: column; gap: 18px; }
.parked:not(:empty) { margin-top: 26px; }
.park-group { animation: fade .3s var(--ease); }
.park-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-mut);
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.park-head .bdot { width: 8px; height: 8px; border-radius: 50%; }
.park-count {
  margin-left: 2px;
  background: var(--surface-2); color: var(--text-dim);
  font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center; border-radius: 9px;
}
.park-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.park-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.park-item .txt { flex: 1; min-width: 0; font-size: 14px; }
.park-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.park-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-mut); cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 6px 9px; border-radius: 8px;
  transition: color .15s, border-color .15s, background .15s;
}
.park-btn.today:hover { color: var(--accent); border-color: var(--accent-dim); background: rgba(45,212,167,.08); }
.park-btn.done:hover  { color: var(--accent); border-color: var(--accent-dim); }
.park-btn.del:hover   { color: var(--rose); border-color: var(--rose); }
.park-btn.done, .park-btn.del { padding: 6px 8px; }

/* ---------- History / Siap ---------- */
.hist-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 26px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 15px 14px; text-align: center;
}
.stat-num {
  display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em;
  color: var(--accent); line-height: 1;
}
.stat-lbl { display: block; margin-top: 6px; font-size: 12px; color: var(--text-mut); }

.hist-head {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-dim);
  margin: 22px 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.hist-groups > .hist-head:first-child { margin-top: 0; }
.hist-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.hist-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  animation: slideIn .25s var(--ease);
}
.hist-check {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: rgba(45,212,167,.14); color: var(--accent);
  border-radius: 6px;
}
.hist-body { flex: 1; min-width: 0; }
.hist-txt { display: block; font-size: 15px; }
.hist-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.hist-time, .hist-due {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-dim);
}
.hist-due svg { width: 13px; height: 13px; }
.hist-actions { display: flex; gap: 4px; flex-shrink: 0; }
.hist-btn {
  display: grid; place-items: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-dim); padding: 6px; border-radius: 7px;
  transition: color .15s, background .15s;
}
.hist-btn[data-restore]:hover { color: var(--accent); background: var(--surface-2); }
.hist-btn[data-histdel]:hover { color: var(--rose); background: var(--surface-2); }

/* ---------- Next-step CTA ---------- */
.cta { margin-top: 24px; padding-top: 22px; border-top: 1px dashed var(--line); }
.btn-next {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--accent); color: var(--accent-ink);
  border: none; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 700; letter-spacing: -.01em;
  padding: 16px 22px;
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(45,212,167,.18);
  transition: filter .15s var(--ease), transform .08s var(--ease), box-shadow .15s var(--ease);
}
.btn-next:hover { filter: brightness(1.06); box-shadow: 0 8px 24px rgba(45,212,167,.26); }
.btn-next:active { transform: translateY(1px) scale(.995); }
.btn-next svg { transition: transform .2s var(--ease); }
.btn-next:hover svg { transform: translateX(3px); }

/* ---------- Empty states ---------- */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
}
.empty svg { color: var(--line); margin-bottom: 14px; }
.empty p { font-size: 15px; line-height: 1.6; }
.link-inline {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  padding: 0;
}

/* ---------- Footer ---------- */
.footer {
  display: flex; flex-direction: column; gap: 4px;
  padding: 24px 0 30px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-dim); font-size: 13px;
}
.footer-by { color: var(--text-dim); font-weight: 600; opacity: .7; }

/* ---------- Bottom tab bar (mobile) ---------- */
.tabbar { display: none; }

@media (max-width: 640px) {
  .tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: rgba(28,31,38,.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
  }
  .tab {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: transparent; border: none; cursor: pointer;
    color: var(--text-dim);
    font: inherit; font-size: 11px; font-weight: 600;
    padding: 8px 4px 6px;
    border-radius: 12px;
    transition: color .15s var(--ease);
    -webkit-tap-highlight-color: transparent;
  }
  .tab-ico { position: relative; display: grid; place-items: center; height: 24px; }
  .tab.is-active { color: var(--accent); }
  .tab.is-active .tab-ico::after {
    content: ''; position: absolute; bottom: -7px; left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
  }
  .tab:active { transform: scale(.94); }
  .tab-badge {
    position: absolute; top: -5px; right: -9px;
    background: var(--accent); color: var(--accent-ink);
    font-size: 10px; font-weight: 700;
    min-width: 16px; height: 16px; padding: 0 4px;
    display: grid; place-items: center; border-radius: 8px;
    border: 2px solid var(--bg-soft);
  }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(16px);
  background: var(--accent); color: var(--accent-ink);
  font-size: 14px; font-weight: 600;
  padding: 12px 20px; border-radius: 11px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Install banner ---------- */
.install {
  position: fixed;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 440px;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 12px 14px;
  box-shadow: var(--shadow);
  z-index: 45;
  animation: pop .3s var(--ease);
}
.install-ico {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 10px;
}
.install-text { flex: 1; min-width: 0; line-height: 1.3; }
.install-text strong { display: block; font-size: 14px; }
.install-text span { font-size: 12px; color: var(--text-mut); }
.install-btn {
  flex-shrink: 0;
  background: var(--accent); color: var(--accent-ink);
  border: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700;
  padding: 9px 16px; border-radius: 10px;
  transition: filter .15s, transform .08s;
}
.install-btn:hover { filter: brightness(1.06); }
.install-btn:active { transform: scale(.96); }
.install-x {
  flex-shrink: 0;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-dim); padding: 6px; border-radius: 8px;
  display: grid; place-items: center;
  transition: color .15s, background .15s;
}
.install-x:hover { color: var(--text); background: var(--surface); }

@media (max-width: 640px) {
  /* sit above the bottom tab bar on mobile */
  .install { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  /* top step nav hidden on mobile; bottom tabbar takes over */
  .steps { display: none; }
  .topbar { gap: 0; justify-content: space-between; }
  .topbar-right { margin-left: auto; }
  /* clear the fixed bottom tab bar */
  .app { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .footer { padding-bottom: 16px; }
  .toast { bottom: calc(82px + env(safe-area-inset-bottom)); }
}

@media (max-width: 560px) {
  .app { padding-left: 14px; padding-right: 14px; }
  .view-head h1 { font-size: 22px; }
  .focus-card-text { font-size: 19px; }
  .btn-primary span { display: none; }
  .btn-primary { padding: 0 15px; }
}

/* ============================================================
   Landing page
   ============================================================ */
.landing {
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.lp-nav {
  max-width: 980px; width: 100%; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
}
.lp-login {
  color: var(--text-mut); text-decoration: none;
  font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line);
  transition: color .15s, border-color .15s;
}
.lp-login:hover { color: var(--text); border-color: var(--text-dim); }

.lp-main {
  flex: 1;
  max-width: 980px; width: 100%; margin: 0 auto;
  padding: 24px;
  display: flex; flex-direction: column; justify-content: center;
}
.lp-hero { max-width: 640px; margin: 30px auto 0; text-align: center; }
.lp-eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 600; color: var(--accent);
  background: rgba(45,212,167,.1);
  padding: 6px 13px; border-radius: 99px;
  margin-bottom: 22px;
}
.lp-hero h1 {
  font-size: 42px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  margin-bottom: 18px;
}
.lp-hero > p {
  font-size: 17px; color: var(--text-mut); line-height: 1.6;
  max-width: 56ch; margin: 0 auto 28px;
}
.lp-cta { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lp-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent); color: var(--accent-ink);
  text-decoration: none;
  font-size: 16px; font-weight: 700; letter-spacing: -.01em;
  padding: 15px 30px; border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(45,212,167,.2);
  transition: filter .15s var(--ease), transform .08s var(--ease);
}
.lp-btn:hover { filter: brightness(1.06); }
.lp-btn:active { transform: translateY(1px); }
.lp-secondary { color: var(--text-mut); text-decoration: none; font-size: 14px; font-weight: 600; }
.lp-secondary:hover { color: var(--accent); }
.lp-note { margin-top: 26px; font-size: 13px; color: var(--text-dim); }

.lp-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin: 64px auto 20px; max-width: 820px; width: 100%;
}
.lp-step {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px 20px;
}
.lp-step-num {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--accent);
  font-size: 14px; font-weight: 700;
  border-radius: 9px; margin-bottom: 14px;
}
.lp-step h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.lp-step p { font-size: 14px; color: var(--text-mut); line-height: 1.55; }

.lp-foot {
  text-align: center; padding: 30px 24px;
  color: var(--text-dim); font-size: 13px; font-weight: 600;
}

@media (max-width: 640px) {
  .lp-hero h1 { font-size: 32px; }
  .lp-hero > p { font-size: 16px; }
  .lp-steps { grid-template-columns: 1fr; margin-top: 44px; }
  .lp-main { justify-content: flex-start; }
}

/* ============================================================
   Auth page (daftar / log masuk)
   ============================================================ */
.auth {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.auth-brand {
  display: flex; align-items: center; gap: 9px;
  justify-content: center; margin-bottom: 24px;
}
.auth-card h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-sub { font-size: 14px; color: var(--text-mut); margin-bottom: 22px; }
.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-mut); margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit; font-size: 15px;
  padding: 13px 15px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.auth-field input:focus {
  outline: none; border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(45,212,167,.13);
}
.auth-submit {
  width: 100%; margin-top: 8px;
  background: var(--accent); color: var(--accent-ink);
  border: none; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 700;
  padding: 14px; border-radius: var(--radius-sm);
  transition: filter .15s, transform .08s;
}
.auth-submit:hover { filter: brightness(1.06); }
.auth-submit:active { transform: scale(.99); }
.auth-submit:disabled { opacity: .6; cursor: default; }
.auth-error {
  font-size: 13px; color: var(--rose);
  background: rgba(217,106,120,.1);
  border: 1px solid rgba(217,106,120,.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 14px;
}
.auth-toggle { margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-mut); }
.auth-toggle button {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; padding: 0;
}
.auth-back {
  margin-top: 22px; text-align: center;
}
.auth-back a { color: var(--text-dim); text-decoration: none; font-size: 13px; }
.auth-back a:hover { color: var(--text-mut); }
