@font-face {
  font-family: "Noto Sans Myanmar";
  src: url("../fonts/NotoSansMyanmar-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
  unicode-range: U+1000-109F, U+A9E0-A9FF, U+AA60-AA7F;
}
@font-face {
  font-family: "Noto Sans Myanmar";
  src: url("../fonts/NotoSansMyanmar-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: block;
  unicode-range: U+1000-109F, U+A9E0-A9FF, U+AA60-AA7F;
}

:root {
  --bg: #0c1f1a;
  --bg-2: #123028;
  --surface: #f6f1e6;
  --surface-2: #efe6d2;
  --ink: #1a1610;
  --ink-soft: #5c5146;
  --ink-on-dark: #f6f1e6;
  --ink-on-dark-soft: #d9cbb0;
  --line: #e0d6c4;
  --teal: #0f2e24;
  --teal-2: #1a4a3a;
  --teal-soft: #dce8e2;
  --cream: #f6f1e6;
  --gold: #d4a64a;
  --gold-2: #e8c56a;
  --gold-dark: #7a5c28; /* bronze text on cream/surface-2 meets WCAG AA 4.5:1 */
  --gold-grad: linear-gradient(180deg, #e8c56a 0%, #d4a64a 48%, #b8862f 100%);
  --leather: #6b4228;
  --leather-soft: #efe0d2;
  --rose: #9f1239;
  --rose-soft: #fce7ee;
  --green: #166534;
  --green-soft: #dcfce7;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --shadow: 0 1px 2px rgba(26, 23, 20, 0.06), 0 8px 24px rgba(26, 23, 20, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 56px;
  --tab-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Noto Sans Myanmar", "Myanmar Text", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
html { background: var(--bg); }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
}

button, input, select, textarea { font-family: inherit; font-size: 16px; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: calc(var(--header-h) + var(--safe-t));
  padding: var(--safe-t) 12px 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, white);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-title {
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--teal);
  line-height: 1.3;
  padding: 12px 0;
}
.lang-toggle {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
}
.lang-toggle button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--teal);
  color: #fbfaf6;
}

/* ---------- Main / views ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tab-h) + var(--safe-b) + 20px);
}
body.onboarding-mode main { padding-bottom: 32px; max-width: 440px; }
body.onboarding-mode .tabbar,
body.onboarding-mode .app-header { display: none; }

.view h1, .view h2, .view h3 { line-height: 1.35; }
.view-title {
  font-size: 1.45rem;
  margin: 4px 0 4px;
  letter-spacing: -0.02em;
}
.lede {
  color: var(--ink-soft);
  margin: 0 0 18px;
  font-size: 0.95rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.card-head h2, .card-head h3 {
  margin: 0;
  font-size: 1rem;
}
.linkish {
  background: none;
  border: 0;
  color: var(--teal-2);
  font-weight: 700;
  padding: 0;
  font-size: 0.88rem;
}

/* ---------- Forms ---------- */
label.field {
  display: block;
  margin-bottom: 14px;
}
label.field > span,
.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="month"],
input[type="password"],
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  border-color: var(--teal-2);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}
.field-error { color: var(--rose); font-size: 0.8rem; margin-top: 4px; }
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  line-height: 1.3;
  width: 100%;
}
.btn-primary { background: var(--teal); color: #fbfaf6; }
.btn-primary:active { background: #0c3a37; }
.btn-secondary {
  background: var(--surface);
  color: var(--teal);
  border: 1px solid var(--line);
}
.btn-danger { background: var(--rose); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 0;
  width: auto;
  padding: 8px 4px;
}
.btn-row { display: flex; gap: 8px; margin-top: 8px; }
.btn-row .btn { flex: 1; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 4px 4px var(--safe-b);
  min-height: calc(var(--tab-h) + var(--safe-b));
}
.tabbar button {
  background: none;
  border: 0;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 12px;
  min-width: 0;
}
.tabbar button span {
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tabbar button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button[aria-current="page"] { color: var(--teal); }

/* ---------- Home ---------- */
.greet {
  margin: 0 0 4px;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}
.date-line { color: var(--ink-soft); margin: 0 0 16px; font-size: 0.9rem; }
.banner {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
}
.banner.birthday { background: var(--cream); }
.banner.warn { background: var(--amber-soft); }
.banner.good { background: var(--green-soft); }
.banner.sample { background: var(--teal-soft); color: var(--teal); font-size: 0.85rem; }

.ask-box {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.ask-box input { flex: 1; }
.ask-box .btn { width: auto; padding-inline: 16px; flex-shrink: 0; }
.advice-list { display: flex; flex-direction: column; gap: 8px; }
.advice-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.advice-item strong { display: block; margin-bottom: 2px; }
.advice-item p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.advice-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 1px 8px;
  margin-bottom: 4px;
}

/* ---------- Goals ---------- */
.goal-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  color: inherit;
  margin-bottom: 10px;
}
.goal-card h3 { margin: 0 0 2px; font-size: 1rem; }
.goal-meta { color: var(--ink-soft); font-size: 0.82rem; margin: 0; }
.progress-ring { width: 58px; height: 58px; }
.progress-ring text { font-size: 11px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 0; }
.steps li.done label { text-decoration: line-through; color: var(--ink-soft); }
.steps input[type="checkbox"] {
  width: 20px; height: 20px; margin-top: 3px; accent-color: var(--teal); flex-shrink: 0;
}
.pct-bar {
  height: 8px;
  background: var(--bg-2);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0;
}
.pct-bar > span {
  display: block;
  height: 100%;
  background: var(--teal-2);
  border-radius: 99px;
  width: 0;
  transition: width 0.35s ease;
}
.template-grid { display: grid; gap: 8px; }
.template-btn {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: inherit;
}
.template-btn strong { display: block; }
.template-btn span { color: var(--ink-soft); font-size: 0.85rem; }

/* ---------- Expenses ---------- */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.month-nav h2 { margin: 0; font-size: 1.05rem; text-align: center; flex: 1; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.total-hero {
  text-align: center;
  padding: 8px 0 4px;
}
.total-hero .amount {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--teal);
}
.total-hero .sub { color: var(--ink-soft); font-size: 0.85rem; }

.chart { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }
.chart-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(48px, 1.4fr) minmax(64px, auto); gap: 8px; align-items: center; font-size: 0.82rem; }
.chart-row .label { color: var(--ink); white-space: normal; overflow: visible; line-height: 1.35; word-break: break-word; }
.chart-row .track { height: 10px; background: color-mix(in srgb, var(--ink) 12%, var(--surface)); border-radius: 99px; overflow: hidden; }
.chart-row .track > span { display: block; height: 100%; background: var(--teal-2); border-radius: 99px; }
.chart-row .val { text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.expense-list { list-style: none; margin: 0; padding: 0; }
.expense-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  background: none;
  width: 100%;
  text-align: left;
  color: inherit;
  border-left: 0; border-right: 0; border-top: 0;
  border-radius: 0;
}
.expense-list button.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  width: 100%;
  text-align: left;
  color: inherit;
  border-radius: 0;
}
.expense-list .cat { font-weight: 700; }
.expense-list .note, .expense-list .when { color: var(--ink-soft); font-size: 0.82rem; }
.expense-list .amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  width: 56px; height: 56px;
  border-radius: 16px;
  border: 0;
  background: var(--teal);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(19, 78, 74, 0.28);
  z-index: 30;
}

/* ---------- Me / lists ---------- */
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  color: inherit;
  text-align: left;
  width: 100%;
}
.menu-item span { color: var(--ink-soft); font-size: 0.85rem; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 0.95rem; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; text-align: right; font-weight: 700; }

/* ---------- Permissions ---------- */
.perm-card { padding: 0; overflow: hidden; }
.perm-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
}
.perm-row + .perm-row { border-top: 1px solid var(--line); }
.perm-copy { flex: 1; }
.perm-copy h3 { margin: 0 0 4px; font-size: 1rem; }
.perm-copy p { margin: 0; color: var(--ink-soft); font-size: 0.88rem; }
.switch {
  position: relative;
  width: 48px; height: 28px;
  flex-shrink: 0;
  margin-top: 2px;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track {
  position: absolute; inset: 0;
  background: #cfc9be;
  border-radius: 99px;
  transition: background 0.15s;
}
.switch .track::after {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .track { background: var(--teal-2); }
.switch input:checked + .track::after { transform: translateX(20px); }
.note-box {
  background: var(--amber-soft);
  border: 1px solid #f5d98a;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.88rem;
  margin-bottom: 12px;
  color: #7c4a03;
}

/* ---------- Modals / sheets ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 23, 20, 0.45);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.overlay.center { align-items: center; padding: 16px; }
.sheet {
  background: var(--surface);
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow: auto;
  border-radius: 20px 20px 0 0;
  padding: 12px 16px calc(24px + var(--safe-b));
  animation: up 0.22s ease;
}
.sheet form .btn-row {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding-top: 10px;
  padding-bottom: 4px;
}
.overlay.center .sheet {
  border-radius: 20px;
  max-width: 400px;
  animation: pop 0.2s ease;
  padding: 20px 18px;
}
.sheet-handle {
  width: 40px; height: 4px; border-radius: 4px;
  background: var(--line); margin: 4px auto 12px;
}
@keyframes up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 28px 12px;
}
.back-row { margin: 0 0 8px; }
.muted { color: var(--ink-soft); }
.tiny { font-size: 0.8rem; color: var(--ink-soft); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.ask-answer { margin-top: 8px; }


/* ---------- Lock / onboarding extras ---------- */
body.lock-mode .tabbar { display: none; }
body.lock-mode main { padding-bottom: 32px; max-width: 440px; }

/* ---------- Finance ---------- */
.eye-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 10px;
  color: var(--teal);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.eye-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.finance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 4px;
}
.finance-stat {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px 12px;
}
.finance-stat .lbl { font-size: 0.78rem; color: var(--ink-soft); }
.finance-stat .val { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.finance-stat.income .val { color: var(--green); }
.finance-stat.expense .val { color: var(--rose); }
.amt.in { color: var(--green); }
.amt.out { color: var(--rose); }
.amt.xfer { color: var(--ink-soft); }

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.chips button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}
.chips button[aria-pressed="true"] {
  background: var(--teal);
  color: #fbfaf6;
  border-color: var(--teal);
}

.day-group { margin: 0 0 8px; }
.day-group h3 {
  margin: 16px 0 4px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.account-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  color: inherit;
  margin-bottom: 8px;
}
.account-card h3 { margin: 0; font-size: 1rem; }
.account-card .type { color: var(--ink-soft); font-size: 0.82rem; }
.account-card .bal { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Career lists ---------- */
.suggest-list { list-style: none; margin: 0; padding: 0; }
.suggest-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.suggest-list li:last-child { border-bottom: 0; }
.suggest-list strong { display: block; }
.suggest-list .why { color: var(--ink-soft); font-size: 0.85rem; margin: 2px 0 0; }
.level-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 2px 8px;
}

/* ---------- Profile / avatar ---------- */
.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--teal-soft);
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  overflow: hidden;
  border: 2px solid var(--line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}
.profile-head h1 { margin: 0; }
.photo-actions { display: flex; gap: 8px; margin: 8px 0 16px; }


/* ---------- Certificates ---------- */
.cert-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  width: 100%;
  text-align: left;
  color: inherit;
  display: block;
}
.cert-card.training {
  border: 1px solid var(--line);
}
.cert-card.framed {
  position: relative;
  border: 3px solid #8a6a2f;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--cream);
  box-shadow: inset 0 0 0 4px #f3ead7, 0 1px 2px rgba(26, 23, 20, 0.06), 0 8px 24px rgba(26, 23, 20, 0.06);
  padding: 18px 16px 16px;
}
.cert-card.framed::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(138, 106, 47, 0.45);
  border-radius: 10px;
  pointer-events: none;
}
.cert-ribbon {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b4f1a;
  background: #f3ead7;
  border: 1px solid #c4a35a;
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 6px;
}
.cert-card h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--ink); }
.cert-meta { color: var(--ink-soft); font-size: 0.85rem; margin: 0; }
.sample-flag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
}
.org-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.org-block h4 { margin: 10px 0 2px; font-size: 0.82rem; color: var(--ink-soft); }
.org-block p { margin: 0 0 4px; }
.org-block a { color: var(--teal-2); word-break: break-all; }
.file-preview {
  margin: 10px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
  text-align: center;
}
.file-preview img { width: 100%; height: auto; display: block; }
.file-preview iframe, .file-preview embed { width: 100%; min-height: 240px; border: 0; }

/* ---------- CV / Resume ---------- */
.match-hero { text-align: center; padding: 8px 0 4px; }
.match-hero .amount { font-size: 2.2rem; }
.req-list { list-style: none; margin: 0; padding: 0; }
.req-list li {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem;
}
.req-list .ok { color: var(--green); font-weight: 700; }
.req-list .bad { color: var(--rose); font-weight: 700; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 12px; }
.tpl-grid button {
  text-align: left; border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 8px 10px; color: inherit; font-size: 0.88rem;
}
.tpl-grid button[aria-pressed="true"] {
  border-color: var(--teal); background: var(--teal-soft);
}

/* Resume is single-column, selectable text, no tables or decorative graphics */
#resume-sheet {
  background: #fff;
  color: #111;
  max-width: 800px;
  margin: 0 auto 16px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-family: "Liberation Serif", "Times New Roman", Times, serif;
  font-size: 12.5px;
  line-height: 1.45;
  user-select: text;
  -webkit-user-select: text;
}
#resume-sheet h1, #resume-sheet h2, #resume-sheet p, #resume-sheet li {
  margin: 0;
}
#resume-sheet h1 {
  font-size: 22px;
  letter-spacing: 0.02em;
  font-weight: 700;
  line-height: 1.2;
}
#resume-sheet h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 16px 0 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid #222;
  font-weight: 700;
}
#resume-sheet .contact { margin-top: 4px; font-size: 12px; }
#resume-sheet ul { margin: 0; padding: 0 0 0 16px; }
#resume-sheet li { margin: 0 0 2px; }
#resume-sheet .job { margin-bottom: 8px; }
#resume-sheet .job strong { display: block; }
#resume-sheet.ats-modern {
  font-family: system-ui, "Segoe UI", "Liberation Sans", Arial, sans-serif;
  font-size: 12.5px;
}
#resume-sheet.ats-modern h1 { font-size: 24px; letter-spacing: -0.02em; }
#resume-sheet.ats-modern h2 { color: #134e4a; border-bottom-color: #134e4a; }
#resume-sheet.ats-simple {
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  padding: 24px 28px;
}
#resume-sheet.ats-simple h2 { border-bottom: 0; border-left: 3px solid #222; padding: 0 0 0 8px; }
#resume-sheet.gulf-photo header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
#resume-sheet.gulf-photo .cv-photo {
  width: 96px; height: 96px; object-fit: cover;
  border: 1px solid #ccc; flex-shrink: 0;
}
#resume-sheet .cv-photo-missing { display: none; }

@media print {
  .app-header, .tabbar, .fab, .overlay, .back-row, .cv-toolbar, .lang-toggle, #tabbar {
    display: none !important;
  }
  body, #app, main, .view { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  main { max-width: none !important; }
  #resume-sheet {
    border: 0; box-shadow: none; max-width: none;
    padding: 12mm 14mm; margin: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #resume-sheet.ats-modern h2 { color: #111; border-bottom-color: #111; }
}

/* ---------- History, guide, confirm ---------- */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  font-size: 0.95rem;
}
.check-row input { margin-top: 3px; flex-shrink: 0; }
.guide-example {
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 8px 0 0;
}
.guide-example.incomplete {
  color: var(--ink-soft);
  padding: 8px 10px;
  background: var(--bg-2);
  border-radius: 10px;
}
.guide-mark {
  background: #dbeafe;
  border-radius: 6px;
  padding: 1px 2px 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.guide-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #134e4a;
  color: #fff;
  border-radius: 99px;
  padding: 1px 6px;
  margin: 0 4px 0 0;
  vertical-align: middle;
}
.guide-mark-start { background: #dbeafe; }
.guide-mark-end { background: #e0e7ff; }
.guide-mark-role { background: #fce7f3; }
.guide-mark-workplace { background: #fef3c7; }
.guide-mark-experience { background: #d1fae5; }
.guide-mark-reason { background: #ffedd5; }
.guide-mark-skills { background: #e0f2fe; }
.guide-watch-card { padding: 12px; }
.guide-watch-screen {
  min-height: 160px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.guide-typed { margin: 0 0 10px; min-height: 4.5em; line-height: 1.5; font-size: 0.95rem; }
.guide-labels { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-chip {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 3px 8px;
  background: var(--teal-soft, #d1fae5);
  color: var(--teal, #134e4a);
}
.guide-watch-progress {
  height: 6px;
  background: var(--bg-2);
  border-radius: 99px;
  overflow: hidden;
  margin: 10px 0 8px;
}
.guide-watch-progress .bar {
  height: 100%;
  width: 0;
  background: var(--teal, #134e4a);
  border-radius: 99px;
  transition: width 80ms linear;
}
.note-box.reject {
  border-color: #fecaca;
  background: #fef2f2;
}
.note-box.demo-mode {
  background: #fff7ed;
  border-color: #fed7aa;
}
.demo-code {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  margin: 8px 0 0;
  font-family: ui-monospace, monospace;
}
.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.88rem;
}
.choice.on { border-color: var(--teal, #134e4a); background: var(--teal-soft, #ecfdf5); }
.choice input { margin: 0; }

html[dir="rtl"] .app-header,
html[dir="rtl"] .tabbar { direction: rtl; }

/* Header lockup (icon may be wired later) */
.app-header { display: flex; align-items: center; gap: 10px; }
.brand-lockup { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.app-logo { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; object-fit: cover; }


/* Burmese typography: no tightened tracking, taller line-height, no unshipped Padauk */
html[lang="my"],
html[lang="my"] body {
  letter-spacing: 0;
  line-height: 1.7;
  word-break: break-word;
}
html[lang="my"] .app-title,
html[lang="my"] .view-title,
html[lang="my"] .greet,
html[lang="my"] .finance-stat .val,
html[lang="my"] .total-hero .amount,
html[lang="my"] .amt,
html[lang="my"] h1, html[lang="my"] h2, html[lang="my"] h3 {
  letter-spacing: 0 !important;
}

/* 44px tap targets and visible focus */
.eye-btn { width: 44px; height: 44px; min-width: 44px; }
button.linkish, .lang-toggle button, .tabbar button, .icon-btn {
  min-height: 44px;
  min-width: 44px;
}
:focus-visible {
  outline: 2px solid var(--teal-2);
  outline-offset: 2px;
}

.finance-hidden .chart-row .track > span { width: 0 !important; background: transparent; }
.card-head .head-actions { display: flex; align-items: center; gap: 4px; }
.card-head .head-actions .eye-btn { margin-inline-end: 4px; }
.amount-row { display: flex; align-items: center; gap: 8px; }
.amount-row .eye-btn { margin-inline-start: auto; }

/* Professional entry guide */
.guide-intro { margin: 0 0 14px; color: var(--ink-soft); line-height: 1.55; }
.guide-note { font-size: 0.86rem; background: var(--teal-soft); color: var(--teal); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; }
.guide-section { margin: 0 0 18px; }
.guide-section > h2 { font-size: 1.05rem; margin: 0 0 6px; }
.guide-section > .tiny { margin: 0 0 10px; }
.guide-steps { display: flex; flex-direction: column; gap: 10px; }
.guide-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 14px 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
}
.guide-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  margin-top: 2px;
}
.guide-step h3 { margin: 0 0 4px; font-size: 0.98rem; }
.guide-step p { margin: 0 0 6px; font-size: 0.9rem; color: var(--ink); line-height: 1.5; }
.guide-step .tip, .guide-step .ex {
  font-size: 0.84rem; line-height: 1.45; margin: 0 0 4px; color: var(--ink-soft);
}
.guide-step .tip strong, .guide-step .ex strong { color: var(--teal); font-weight: 650; }
.guide-sample { padding: 4px 0 0; }
.guide-sample .guide-example { margin: 8px 0 0; line-height: 1.7; font-size: 0.95rem; }
.compare-grid { display: flex; flex-direction: column; gap: 10px; }
.compare-card { border-radius: var(--radius); padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); }
.compare-card.weak { background: var(--rose-soft); border-color: #fecdd3; }
.compare-card.strong { background: var(--green-soft); border-color: #bbf7d0; }
.compare-card h3 { margin: 0 0 6px; font-size: 0.92rem; }
.compare-card .sample { margin: 0 0 8px; font-size: 0.92rem; line-height: 1.5; }
.dos-donts { display: flex; flex-direction: column; gap: 10px; }
.dos-donts ul { margin: 6px 0 0; padding-left: 1.15rem; }
.dos-donts li { margin: 0 0 6px; font-size: 0.9rem; line-height: 1.45; }
.dos-card { background: var(--green-soft); border: 1px solid #bbf7d0; border-radius: var(--radius); padding: 12px 14px; }
.donts-card { background: var(--rose-soft); border: 1px solid #fecdd3; border-radius: var(--radius); padding: 12px 14px; }
.guide-page { padding-bottom: 8px; }
.guide-page { padding-bottom: 8px; }
.guide-footer {
  position: static;
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px 10px 8px;
  margin-top: 8px;
}
.guide-footer .btn { width: 100%; margin-top: 4px; min-height: 40px; }
.guide-footer .tiny { margin: 0 0 2px; font-size: 0.8rem; line-height: 1.35; }
.guide-footer .check-row { margin: 2px 0; }
.guide-more { color: var(--gold); font-weight: 650; margin: 0 0 2px; }
#guide-end-sentinel { height: 1px; margin-bottom: 12px; }

/* Account pending deletion */
.account-card { text-align: left; width: 100%; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.account-card.pending { border-color: var(--amber); background: var(--amber-soft); }
.account-card.main-account { border-color: var(--teal-soft); }
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 99px;
  vertical-align: middle;
  margin-inline-start: 6px;
}
.badge-pending { background: #b45309; color: #fff; }
.badge-main { background: var(--teal); color: #fff; }
.badge-corrected { background: var(--ink-soft); color: #fff; }
.badge-correction { background: var(--teal-2); color: #fff; }
.tx-row { width: 100%; text-align: left; }
.tx-row .when { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.budget-bar { height: 10px; background: color-mix(in srgb, var(--ink) 12%, var(--surface)); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.budget-bar > span { display: block; height: 100%; background: var(--teal-2); border-radius: 99px; }
.budget-bar.warn > span { background: var(--amber); }
.budget-bar.over > span { background: var(--rose); }
.report-block { margin-bottom: 14px; }
@media print {
  .guide-footer, .tabbar, .app-header, .fab { display: none !important; }
  .view { display: block !important; }
}

/* ========== Official brand theme (Elias, Nov 2026) ========== */
html { background: var(--bg); }
body {
  color: var(--ink-on-dark);
  background-color: var(--bg);
  background-image: linear-gradient(180deg, #123028 0%, #0c1f1a 55%, #0a1814 100%);
  background-attachment: fixed;
}
.app-header {
  background: linear-gradient(180deg, #14362c 0%, #0f2e24 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 55%, #3a2a12);
  color: var(--ink-on-dark);
}
.app-title { color: var(--gold-2); }
.app-logo {
  width: 36px; height: 36px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 70%, transparent);
}
.lang-toggle {
  background: rgba(8, 24, 20, 0.7);
  border-color: color-mix(in srgb, var(--gold) 40%, transparent);
}
.lang-toggle button { color: var(--ink-on-dark-soft); }
.lang-toggle button[aria-pressed="true"] {
  background: var(--gold-grad);
  color: #1a1408;
}

.view-title { color: var(--ink-on-dark); }
.lede { color: var(--ink-on-dark-soft); }
.tiny { color: var(--ink-on-dark-soft); }
.empty { color: var(--ink-on-dark-soft); }
.linkish, .back-link, a.linkish, button.linkish { color: var(--gold-2); }
.card .card-head h1, .card .card-head h2, .card .view-title { color: var(--ink); }
.card-head > .view-title, .card-head > h1 { color: var(--ink-on-dark); }

.card, .account-card, .goal-card, .menu-item, .advice-item, .sheet, .note-box,
.perm-card, .compare-card, .guide-step, .dos-card, .donts-card,
.cert-card, .org-block {
  color: var(--ink);
}
.card .lede, .card .tiny, .sheet .tiny, .account-card .type, .goal-card .goal-meta {
  color: var(--ink-soft);
}
.card, .account-card, .goal-card, .menu-list .menu-item, .advice-item {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
  box-shadow: 0 1px 0 rgba(212, 166, 74, 0.22), 0 10px 28px rgba(0, 0, 0, 0.22);
}
.card h1, .card h2, .card h3, .account-card h3, .goal-card h3, .menu-item strong,
.cert-card h3, .org-block p {
  color: var(--ink);
}

.btn-primary {
  background: var(--gold-grad);
  color: #1a1408;
  border: 1px solid #b8862f;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.25);
}
.btn-primary:active { filter: brightness(0.94); background: var(--gold-grad); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
}
.tabbar {
  background: linear-gradient(180deg, #102820 0%, #0a1814 100%);
  border-top: 1px solid color-mix(in srgb, var(--gold) 45%, #3a2a12);
  color: var(--ink-on-dark-soft);
}
.tabbar button { color: var(--ink-on-dark-soft); }
.tabbar button[aria-current="page"] { color: var(--gold-2); }

input, select, textarea {
  background: #fffdf8;
  color: var(--ink);
  border-color: color-mix(in srgb, var(--gold) 30%, var(--line));
}
.chips button[aria-pressed="true"] {
  background: var(--gold-grad);
  color: #1a1408;
  border-color: #b8862f;
}

/* Hero banner */
.hero-banner {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 168px;
  margin: 0 0 16px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent), 0 14px 32px rgba(0,0,0,0.35);
}
.hero-banner img {
  width: 100%;
  height: 168px;
  object-fit: cover;
  object-position: center 28%;
  filter: saturate(1.05);
}
.hero-banner.onboarding img { height: 200px; }
.hero-banner .hero-copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, rgba(8,24,20,0.05) 20%, rgba(8,24,20,0.72) 100%);
  color: var(--ink-on-dark);
}
.hero-banner .hero-copy h1,
.hero-banner .hero-copy .view-title {
  color: var(--gold-2);
  margin: 0 0 4px;
  font-size: 1.25rem;
  text-shadow: 0 1px 8px rgba(0,0,0,0.45);
}
.hero-banner .hero-copy p {
  margin: 0;
  color: var(--ink-on-dark);
  font-size: 0.88rem;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

/* Gold rounded-square frame (matches official app icon) */
.cert-card.framed {
  background: var(--surface);
  border: 3px solid transparent;
  background-image:
    linear-gradient(var(--surface), var(--surface)),
    linear-gradient(160deg, #f0d78a 0%, #d4a64a 40%, #8a6a2f 70%, #e8c56a 100%);
  background-origin: border-box, border-box;
  background-clip: padding-box, border-box;
  border-radius: 18px;
  box-shadow: 0 0 0 1px #3a2a12, 0 8px 24px rgba(0,0,0,0.2), inset 0 0 0 2px rgba(15,46,36,0.15);
}
.app-logo, .framed-icon {
  border-radius: 22%;
}

.date-line, .greet { color: var(--ink-on-dark); }
.greet { color: var(--gold-2); }

/* Finance cards stay cream with dark figures */
.finance-stat .val, .total-hero .amount { color: var(--teal-2); }
.finance-stat.expense .val, .amt.out { color: var(--rose); }
.finance-stat.income .val, .amt.in { color: var(--green); }
.month-nav h2 { color: var(--ink-on-dark); }
.month-nav .icon-btn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line));
}
.fab {
  background: var(--gold-grad);
  color: #1a1408;
  box-shadow: 0 8px 24px rgba(184, 134, 47, 0.45);
}
.guide-footer {
  background: var(--surface);
  color: var(--ink);
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
}
.guide-note {
  background: color-mix(in srgb, var(--teal-2) 55%, #0c1f1a);
  color: var(--ink-on-dark);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}
.guide-step-num { background: var(--gold-grad); color: #1a1408; }
.badge-main { background: var(--teal-2); }
.badge-pending { background: var(--leather); color: #f6f1e6; }
.back-row .btn-ghost { color: var(--gold-2); }
.profile-head .view-title { color: var(--ink-on-dark); }
.profile-head .lede { color: var(--ink-on-dark-soft); }

/* Welcome lockup — app icon only, no large hero photo */
.welcome-lockup {
  text-align: center;
  margin: 4px 0 18px;
}
.welcome-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22%;
  background: var(--gold-grad);
  color: #1a1408;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 70%, #3a2a12), 0 10px 24px rgba(0,0,0,0.35);
}
.welcome-lockup h1,
.welcome-lockup .view-title {
  color: var(--gold-2);
  margin: 0 0 6px;
  font-size: 1.35rem;
}
.welcome-lockup p {
  margin: 0 auto;
  max-width: 28em;
  color: var(--ink-on-dark-soft);
  font-size: 0.95rem;
}

/* Dashboard certificates tile */
.certs-tile .tiny { margin: 0 0 8px; }
.cert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 10px 0;
  color: inherit;
}
.cert-row:last-child { padding-bottom: 2px; }
.cert-mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--ink-soft);
}
.cert-mark.framed {
  background: var(--gold-grad);
  box-shadow: 0 0 0 1px #8a6a2f;
  border-radius: 3px;
}
.cert-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cert-row-body strong { font-size: 0.95rem; }
.cert-row-chevron { color: var(--ink-soft); font-size: 1.1rem; }
.cert-rank {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--ink);
}
.cert-rank strong { color: var(--gold-dark); }

/* Compact 7-part list for the short entry guide */
.guide-parts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.guide-parts li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 calc(50% - 6px);
  min-width: 140px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 0.86rem;
  line-height: 1.3;
}
.guide-parts .guide-step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  font-size: 0.72rem;
}
.guide-page .guide-section { margin: 0 0 12px; }
.guide-page .guide-intro { margin: 0 0 8px; }
.guide-page .guide-note { margin: 0 0 10px; padding: 8px 10px; }
.guide-example { font-size: 0.92rem; line-height: 1.55; }
.guide-mark { padding: 0 2px; }
.guide-footer { padding: 6px 10px 8px; }



.avatar.monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22%;
  background: var(--gold-grad);
  color: #1a1408;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 70%, #3a2a12);
  overflow: hidden;
}

/* Short guide should fit a 390x844 phone screen */
.guide-page .view-title { font-size: 1.2rem; margin: 0 0 4px; }
.guide-page .guide-section > h2 { font-size: 0.98rem; margin: 0 0 2px; }
.guide-page .guide-section > .tiny { margin: 0 0 6px; }
.guide-page .back-row { margin-bottom: 4px; }
.guide-parts li { padding: 5px 8px; min-height: 0; }
.guide-sample { padding: 10px 12px; margin-bottom: 8px; }
.guide-sample .guide-example { margin: 6px 0 0; font-size: 0.88rem; line-height: 1.45; }

/* Home — about-me summary (no money or other sections) */
.about-summary { margin: 0; }
.about-summary > div {
  display: grid;
  grid-template-columns: 8.2em 1fr;
  gap: 2px 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.about-summary dt { margin: 0; color: var(--ink-soft); font-size: 0.82rem; }
.about-summary dd { margin: 0; font-weight: 650; color: var(--ink); min-width: 0; overflow-wrap: anywhere; word-break: break-word; }

/* ---------- v5 professional lists, analysis, filters, ID flow ---------- */
.finance-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.finance-stat.saving .val { color: var(--gold-dark); }
.amt.save { color: var(--gold-dark); }

.perf-list, .gap-list { list-style: none; margin: 0; padding: 0; }
.perf-row, .gap-row {
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.perf-row:first-child, .gap-row:first-child { border-top: 0; }
.perf-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.perf-top strong { display: block; font-size: 0.92rem; }
.perf-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.pct-num {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--teal);
}
.perf-bar {
  height: 7px;
  background: color-mix(in srgb, var(--ink) 10%, var(--surface));
  border-radius: 99px;
  overflow: hidden;
}
.perf-bar > span {
  display: block;
  height: 100%;
  background: var(--gold-grad);
  border-radius: 99px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip-ready, .chip-advanced, .chip-high { background: var(--green-soft); color: var(--green); border-color: transparent; }
.chip-close, .chip-inProgress, .chip-medium, .chip-pending { background: #fef3c7; color: var(--amber); border-color: transparent; }
.chip-build, .chip-start { background: var(--leather-soft); color: var(--leather); border-color: transparent; }
.chip-should, .chip-career { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.chip-now, .chip-financial { background: #f5e6c8; color: var(--gold-dark); border-color: transparent; }

.subhead {
  margin: 14px 0 6px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 800;
}
.job-group + .job-group { margin-top: 8px; }

.gap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}
.gap-row .chip { margin-left: auto; }
.gap-mark { width: 1.1em; text-align: center; color: var(--gold-dark); font-weight: 800; }
.gap-row.met .gap-mark { color: var(--green); }
.gap-row.missing { color: var(--ink); }

.analysis-card .analysis-block + .analysis-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.analysis-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.analysis-head h3 { margin: 0; font-size: 1.02rem; }
.analysis-stats { display: grid; gap: 6px; margin: 10px 0; }
.kv-inline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
}
.kv-inline span { color: var(--ink-soft); }
.suggest-bullets { margin: 0; padding: 0 0 0 1.1em; }
.suggest-bullets li { margin: 0 0 6px; line-height: 1.4; }

.account-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 0 0 10px;
  background: var(--surface);
}
.account-block.main-account { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.account-block-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}
.account-block-head h3 { margin: 0 0 2px; font-size: 1rem; }
.account-block .bal { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--teal); }
.mini-activity { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); }
.mini-activity li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  padding: 3px 0;
  color: var(--ink-soft);
}
.mini-activity .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.tiny.muted { color: var(--ink-soft); }

.history-filters { margin-bottom: 8px; }
.lang-toggle.wrap, .chips.wrap { flex-wrap: wrap; }

.owned-cert-list { display: flex; flex-direction: column; gap: 8px; }
.owned-cert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
}
.owned-cert-body { flex: 1; min-width: 0; }
.owned-cert-body strong { display: block; color: var(--ink); }
.owned-cert-row .chev { color: var(--ink-soft); font-size: 1.2rem; }
.cert-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--surface-2);
  color: var(--ink-soft);
}
.cert-mark.gold {
  background: var(--gold-grad);
  color: var(--teal);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold-dark) 50%, transparent);
}

.choice-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
}
.choice-card.on {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}
.choice-card input { margin-right: 8px; }
.id-file-meta {
  margin: 10px 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--gold-dark);
}
.id-file-name { margin: 0 0 4px; font-weight: 700; word-break: break-all; }

html[lang="my"] .subhead { letter-spacing: 0; text-transform: none; }
html[lang="my"] .chip { white-space: normal; }

.cert-mark.plain {
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink);
}
.choice-card { padding: 9px 12px; }
#view-id-verify .lede { font-size: 0.92rem; margin-bottom: 10px; }

/* ---------- Splash / loading (cover at 78% 45%; CEO-approved crop) ---------- */
.splash {
  font-family: "Noto Sans Myanmar", "Noto Sans", ui-sans-serif, system-ui, sans-serif;
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: var(--bg);
  color: var(--ink-on-dark);
  transition: opacity 0.4s ease;
}
.splash.splash-hide { opacity: 0; pointer-events: none; }
body.splash-on { overflow: hidden; }
.splash-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
}
.splash-visual picture,
.splash-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% 45%;
}
/* Portraits narrower than 43:75 (~0.573): a full-height cover would crop
   the flag (pole x=905, tip x=1235 of the 1500x750 source). Cap the image
   box at 43:75 so it always shows a 430-px source window (x≈856-1286 at
   80%), i.e. the whole flag with ~50 px margin each side, and fill the
   leftover bands with a sky-to-ground gradient sampled from the splash
   edges (#082d27 top, #020606 bottom). P-01 / S1-09. */
@media (max-aspect-ratio: 43/75) {
  .splash-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #082d27 0%, #0a302a 22%, #0c1f1a 50%, #070c0c 78%, #020606 100%);
  }
  .splash-visual picture {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 43 / 75;
    display: block;
    overflow: hidden;
    flex: 0 0 auto;
  }
  .splash-visual img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 80% 45%;
  }
}
.splash-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
  padding: 48px 28px calc(28px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(8, 24, 20, 0) 0%, rgba(8, 24, 20, 0.72) 36%, rgba(8, 24, 20, 0.92) 100%);
}
.splash-quote {
  margin: 0 auto;
  max-width: 36rem;
  font-size: 1.12rem;
  line-height: 1.55;
  font-weight: 600;
  color: #f6f1e6;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
html[lang="my"] .splash-quote { font-size: 1.05rem; line-height: 1.7; }
.splash-bar {
  width: 84px;
  height: 3px;
  margin: 28px auto 0;
  border-radius: 99px;
  background: color-mix(in srgb, var(--gold) 25%, var(--bg-2));
  overflow: hidden;
}
.splash-bar > span {
  display: block;
  height: 100%;
  width: 30%;
  border-radius: 99px;
  background: var(--gold-grad);
  transform-origin: left center;
  animation: splash-load 1.4s ease-in-out infinite;
}
@keyframes splash-load {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
/* Loading finished (app.js adds .splash-hide): bar completes, then the splash fades. */
.splash.splash-hide .splash-bar > span {
  animation: none;
  width: 100%;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .splash { transition: none; }
  .splash-bar > span,
  .splash.splash-hide .splash-bar > span {
    animation: none;
    width: 100%;
    transform: none;
  }
}

/* ---------- Daily plan, debt, PIN, documents ---------- */
.plan-hours { display: grid; gap: 6px; margin: 8px 0 4px; }
.plan-tasks { list-style: none; margin: 0; padding: 0; }
.plan-tasks li {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  align-items: flex-start;
}
.plan-tasks li:first-child { border-top: 0; }
.plan-time {
  flex-shrink: 0;
  min-width: 6.6em;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--gold-dark);
}
.day-toggle { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.day-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}
.day-chip input { margin-right: 4px; }
.day-chip.on {
  background: var(--teal);
  color: #fbfaf6;
  border-color: var(--teal);
}

.debt-list { list-style: none; margin: 0 0 12px; padding: 0; }
.debt-row {
  display: flex;
  width: 100%;
  text-align: left;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 10px 0;
  color: inherit;
}
.debt-list li:first-child .debt-row { border-top: 0; }

.soft-hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.lock-hero { display: flex; justify-content: center; margin: 12px 0 8px; }
.pin-pad-wrap { margin: 8px auto 0; max-width: 280px; }
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 18px;
}
.pin-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: transparent;
}
.pin-dots span.on { background: var(--gold-grad); border-color: var(--gold-dark); }
.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pin-key {
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 700;
}
.pin-key.pin-ok {
  background: var(--gold-grad);
  color: var(--teal);
  border-color: var(--gold-dark);
  font-size: 0.85rem;
}
body.lock-mode .pin-key {
  background: color-mix(in srgb, var(--bg-2) 70%, white);
  color: var(--ink-on-dark);
  border-color: color-mix(in srgb, var(--gold) 35%, transparent);
}
body.lock-mode .pin-key.pin-ok {
  background: var(--gold-grad);
  color: var(--teal);
  border-color: var(--gold-dark);
}
body.lock-mode .lede, body.lock-mode .view-title { color: var(--ink-on-dark); }

/* ---------- v6: calmer chrome, compact money, suggestion rows, vault lists ---------- */
body {
  background-image: none;
  background-color: var(--bg);
}
.app-header {
  background: #0f2e24;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 22%, #3a2a12);
}
.tabbar {
  background: #0a1814;
  border-top: 1px solid color-mix(in srgb, var(--gold) 22%, #3a2a12);
}
.card, .account-card, .goal-card, .menu-list .menu-item, .advice-item {
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(26, 23, 20, 0.06);
}
.btn-primary {
  background: var(--teal);
  color: #f6f1e6;
  border: 0;
  text-shadow: none;
  font-weight: 650;
}
.btn-primary:active {
  filter: none;
  background: #0c241c;
}
.btn { font-weight: 650; }
.chips button[aria-pressed="true"] {
  background: var(--teal);
  color: #f6f1e6;
  border-color: var(--teal);
}
.fab {
  background: var(--teal);
  color: #f6f1e6;
  box-shadow: 0 4px 14px rgba(12, 36, 28, 0.35);
}
.perf-bar { height: 4px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.perf-bar > span { background: var(--gold); }
.subhead {
  letter-spacing: 0.01em;
  text-transform: none;
  font-weight: 650;
  font-size: 0.88rem;
}
.banner {
  padding: 10px 12px;
  border-radius: 12px;
}
.banner.warn {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
}

.suggest-list { list-style: none; margin: 0; padding: 0; }
.suggest-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.suggest-row:first-child { border-top: 0; padding-top: 8px; }
.suggest-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.suggest-top strong { font-weight: 650; font-size: 0.98rem; line-height: 1.35; }
.suggest-row .why {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}
.suggest-row .next-line {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.4;
}
.chip-priority {
  flex-shrink: 0;
  font-weight: 650;
  letter-spacing: 0;
  border: 0;
}
.chip-priority.high { background: color-mix(in srgb, var(--rose) 10%, var(--surface-2)); color: var(--rose); }
.chip-priority.medium { background: var(--surface-2); color: var(--gold-dark); }
.chip-priority.low { background: var(--surface-2); color: var(--ink-soft); }

.total-hero { padding: 4px 0 12px; }
.total-hero .amount { font-weight: 700; letter-spacing: -0.02em; }
.account-compact { border-top: 1px solid var(--line); padding-top: 10px; }
.account-compact .card-head { margin-bottom: 4px; }
.account-compact-list { list-style: none; margin: 0; padding: 0; }
.account-compact-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 10px 0;
  color: inherit;
}
.account-compact-list li:first-child .account-compact-row { border-top: 0; }
.account-compact-row .acc-name {
  grid-column: 1;
  grid-row: 1;
  font-weight: 650;
  color: var(--ink);
}
.account-compact-row .acc-type {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.account-compact-row .acc-bal {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--teal);
}
.finance-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 4px 2px 12px;
}

.segment { margin-bottom: 12px; }
.vault-list { list-style: none; margin: 0; padding: 0; }
.vault-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  color: inherit;
  border-radius: 0;
}
.vault-list li:first-child .vault-row { border-top: 0; }
.vault-body { flex: 1; min-width: 0; }
.vault-body strong { display: block; font-weight: 650; color: var(--ink); }
.vault-row .chev { color: var(--ink-soft); font-size: 1.15rem; }
.vault-row.framed {
  margin: 4px -10px;
  padding: 12px 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 6%, var(--surface));
}
.vault-list li + li .vault-row.framed { margin-top: 8px; }
.badge-expiry {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-expiry.expired { background: var(--rose-soft); color: var(--rose); }
.badge-expiry.soon { background: var(--amber-soft); color: var(--amber); }
.expiry-notice {
  margin: 0 0 12px;
  padding: 0;
  color: var(--ink-on-dark-soft);
  font-size: 0.88rem;
}
.cert-card.framed {
  border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--line));
  background: var(--surface);
  background-image: none;
  box-shadow: none;
  border-radius: 12px;
}
.cert-type-label { margin: 0 0 6px; color: var(--ink-soft); }
.level-pill { font-weight: 650; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.history-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 8px;
}
.history-toolbar .field { margin: 0; position: relative; }
.history-toolbar .field > span {
  /* visually hidden, still exposed to assistive tech (do not use display:none) */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.history-toolbar select {
  padding: 8px 10px;
  font-size: 0.88rem;
  min-height: 44px;
}
.chips.compact { gap: 6px; margin: 0 0 8px; }
.chips.compact button {
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 650;
  border-radius: 999px;
}

html[lang="my"] body,
html[lang="my"] {
  line-height: 1.95;
}
html[lang="my"] .greet,
html[lang="my"] .date-line,
html[lang="my"] h1,
html[lang="my"] h2,
html[lang="my"] h3,
html[lang="my"] .suggest-top strong,
html[lang="my"] .vault-body strong,
html[lang="my"] .acc-name,
html[lang="my"] .card-head h2 {
  letter-spacing: 0;
  line-height: 2.05;
}
html[lang="my"] .suggest-row .why,
html[lang="my"] .suggest-row .next-line,
html[lang="my"] .tiny,
html[lang="my"] .lede {
  line-height: 1.95;
  letter-spacing: 0;
}
html[lang="my"] .suggest-top {
  align-items: flex-start;
  gap: 12px;
}
html[lang="my"] .suggest-top strong {
  flex: 1;
  min-width: 0;
  padding-bottom: 2px;
}
html[lang="my"] .chip,
html[lang="my"] .chip-priority,
html[lang="my"] .level-pill,
html[lang="my"] .badge-expiry {
  line-height: 1.7;
  letter-spacing: 0;
  padding: 3px 8px;
}
.level-pill {
  text-align: right;
  max-width: 46%;
  line-height: 1.35;
  font-size: 0.72rem;
  font-weight: 650;
}

.history-toolbar { grid-template-columns: 1fr 1fr; }
.history-toolbar .field:first-child { grid-column: 1 / -1; }
.chips.compact { flex-wrap: nowrap; overflow-x: auto; }
#view-finance { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 80px); }

.vault-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  margin: 0;
}
.vault-body { grid-column: 1; min-width: 0; }
.vault-body .tiny {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vault-row .badge-expiry { grid-column: 2; }
.vault-row .chev { grid-column: 3; }
.vault-row.framed {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 6%, var(--surface));
}
.vault-row .sample-flag {
  display: inline;
  padding: 0;
  background: none;
  border: 0;
  color: var(--ink-soft);
  font-weight: 650;
  font-size: inherit;
}

.suggest-top strong { flex: 1; min-width: 0; }
.chip-priority { flex: 0 0 auto; }
html[lang="my"] .suggest-top {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
html[lang="my"] { font-synthesis: none; }
#view-certs { padding-bottom: 55vh; }

/* ---------- Empty states: short line + one action ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 16px 24px;
  gap: 14px;
}
.empty-state .empty {
  margin: 0;
  padding: 0;
  max-width: 22rem;
}
.card .empty-state .empty,
.card .empty {
  color: var(--ink-soft);
}
.empty-state .btn {
  width: auto;
  min-width: 10rem;
  max-width: 100%;
}
/* Calm in-app update prompt (markup comes from app.js showUpdateBanner) */
#sw-update {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  z-index: 80;
  max-width: 520px;
  margin-inline: auto;
  /* Leave a column clear of the 56px FAB (right: 16px). */
  margin-right: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(12, 31, 26, 0.28);
}
#sw-update p {
  margin: 0;
  flex: 1 1 10rem;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: start;
}
#sw-update .btn {
  width: auto;
  flex-shrink: 0;
  min-width: 7.5rem;
}

/* Save-failure / recovery banner: warm, not alarming, gold border. */
#app-notice,
#app-notice.banner.warn {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 14px;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--gold) 16%, var(--surface));
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--gold) 60%, var(--line));
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(212, 166, 74, 0.22);
}
#app-notice p {
  margin: 0;
  flex: 1 1 12rem;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
}
#app-notice .linkish {
  color: var(--gold-dark);
  font-weight: 700;
  flex-shrink: 0;
  padding: 4px 0;
}
#app-notice:empty,
#app-notice.banner:empty,
#app-notice.banner.warn:empty,
#app-notice > :empty {
  display: none !important;
}

/* Start-up failure: full-screen calm card, readable in EN and MY. */
#fatal-error,
#fatal-error.card {
  position: fixed;
  inset: 0;
  z-index: 180;
  margin: 0 !important;
  width: auto;
  max-width: none;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 28px 20px calc(28px + var(--safe-b));
  background: var(--bg);
  color: var(--ink);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
}
#fatal-error::before {
  content: "";
  position: absolute;
  inset: 20px 16px calc(20px + var(--safe-b));
  max-width: 28rem;
  width: calc(100% - 32px);
  margin: auto;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--line));
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
#fatal-error p,
#fatal-error .btn {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 24rem;
}
#fatal-error p {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.6;
  text-align: start;
}
#fatal-error p[lang="my"] {
  font-size: 1rem;
  line-height: 1.75;
}
#fatal-error .btn {
  width: 100%;
  margin-top: 6px;
}

/* Backup password fields must fill the card. */
#view-backup input[type="password"],
#backup-export-form input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
  display: block;
}

/* Burmese typography: tab labels, no mid-syllable ellipsis, 360px room */
html[lang="my"] .tabbar button {
  font-size: 12px;
  letter-spacing: 0;
}
html[lang="my"] .tabbar button span {
  line-height: 1.45;
  overflow: visible;
  -webkit-line-clamp: unset;
  white-space: normal;
}
html[lang="my"] .vault-body .tiny {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
@media (max-width: 360px) {
  .tabbar button { font-size: 11px; padding: 6px 1px 8px; }
  html[lang="my"] .tabbar button { font-size: 11px; }
  main { padding-left: 12px; padding-right: 12px; }
}

/* Money: keep filter chips on one line and clear the FAB at 360px */
html[lang="my"] .chips.compact button {
  white-space: nowrap;
  line-height: 1.4;
}
#view-finance {
  /* Main already clears the tab bar; this clears the FAB (56px + 16px offset + air). */
  padding-bottom: calc(56px + 16px + 16px + var(--safe-b));
}
/* COMPAT-004/005: the filter chips sit in a calm 3-column grid (3 + 2) instead of a scrolling row, so
   every chip is fully visible at load (no half-cut last chip), and each pill is 44px tall like its tap area. */
#view-finance .chips.compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding-top: 4px;
  padding-bottom: 4px;
  margin-right: 0;
}
/* If a FAB is shown on Money (r3 layout), reserve its column so no chip ever sits under it. */
body:has(.fab:not([hidden])) #view-finance .chips.compact { padding-inline-end: calc(56px + 16px); }
#view-finance .chips.compact button {
  position: relative;
  white-space: nowrap;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  line-height: 1.3;
}
#view-finance .chips.compact::after { content: none; }
#view-finance .empty,
#view-finance .empty-state {
  /* FAB is 56px wide, 16px from the viewport edge; keep copy/button clear of it. */
  padding-right: calc(56px + 16px + 8px);
  padding-bottom: calc(56px + 16px + 8px);
  box-sizing: border-box;
}
#view-finance .empty-state .empty {
  padding-right: 0;
}

/* ---- compat-r3 a11y / layout ---- */
/* Gold-2 stays on dark chrome (title, tabs, greet). On cream cards use bronze ink. */
.card .linkish, .card a.linkish, .card button.linkish,
.sheet .linkish, .sheet a.linkish, .sheet button.linkish,
.account-card .linkish, .goal-card .linkish, .menu-item .linkish,
.cert-card .linkish, .overlay .linkish, #app-notice .linkish,
.guide-footer .guide-more, .guide-more {
  color: var(--gold-dark);
}

/* Compact chips keep their pill size; the hit area is at least 44px. */
.chips.compact button {
  position: relative;
}
.chips.compact button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: max(100%, 44px);
  height: 44px;
}

/* Certificates: at 360px, keep the MY heading and action on coherent lines. */
@media (max-width: 360px) {
  html[lang="my"] #documents-section .card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  html[lang="my"] #documents-section .card-head .linkish {
    align-self: flex-start;
  }
}

/* Section subheads placed directly on the dark page (e.g. Goals), not inside a cream card:
   #cfc4ad on #0c1f1a = 9.9:1 (was #5c5146, 2.21:1). */
.view > .subhead { color: #cfc4ad; }
