/* =========================================================================
   BKS Accounting Group: app shell (app.html)
   Loaded on top of styles.css; reuses the same design tokens.
   Standalone/TWA-first: fixed top bar, bottom tab bar, safe-area aware.
   ========================================================================= */

.app-body {
  background: var(--bg-soft);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

/* ---------- Top bar ---------- */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--navy);
  color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(15, 44, 77, 0.18);
}
.app-bar__logo {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
}
.app-bar__title { font-weight: 700; font-size: 1.02rem; line-height: 1.15; }
.app-bar__title small { display: block; font-weight: 400; font-size: .72rem; color: #a9bdd4; }
.app-bar__spacer { margin-left: auto; }
.app-bar__call {
  color: var(--gold); border: 1px solid rgba(200, 148, 43, .55);
  border-radius: 999px; padding: 6px 13px; font-size: .82rem; font-weight: 700;
  white-space: nowrap;
}
.app-bar__call:hover { color: #fff; background: var(--gold-600); border-color: var(--gold-600); }

/* ---------- Layout ---------- */
.app-wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 24px; }
.app-view[hidden] { display: none; }
.app-view h1 { font-size: 1.5rem; margin-bottom: .25em; }
.app-view h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
.app-sub { color: var(--muted); font-size: .92rem; margin: 0 0 1.1rem; }

.app-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.app-card h3 { font-size: 1.02rem; margin-bottom: .3em; }
.app-card p:last-child { margin-bottom: 0; }

/* ---------- Quick actions ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
@media (min-width: 560px) { .quick-grid { grid-template-columns: repeat(4, 1fr); } }
.quick {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 8px; text-align: center; font-size: .86rem; font-weight: 600;
  color: var(--navy); box-shadow: var(--shadow-sm); min-height: 92px;
}
.quick:hover { border-color: var(--gold); color: var(--navy); }
.quick svg { width: 24px; height: 24px; stroke: var(--gold); fill: none; stroke-width: 1.9; }

/* ---------- Profile switch ---------- */
.seg { display: flex; background: #e9eff6; border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.seg button {
  flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 9px 6px;
  font: inherit; font-size: .85rem; font-weight: 600; color: var(--slate); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* ---------- Deadlines ---------- */
.dl { display: flex; gap: 13px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.dl:last-child { border-bottom: 0; }
.dl__date {
  flex: 0 0 58px; text-align: center; background: var(--bg-navy-soft);
  border-radius: 10px; padding: 7px 4px; line-height: 1.1;
}
.dl__mon { display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; color: var(--navy-700); letter-spacing: .06em; }
.dl__day { display: block; font-size: 1.3rem; font-weight: 700; color: var(--navy); }
.dl__yr  { display: block; font-size: .64rem; color: var(--muted); }
.dl__body { min-width: 0; flex: 1; }
.dl__title { font-weight: 700; color: var(--navy); font-size: .98rem; }
.dl__note { color: var(--slate); font-size: .85rem; margin: 3px 0 6px; }
.dl__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill {
  font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 9px; background: var(--bg-navy-soft); color: var(--navy-700);
}
.pill--soon { background: #fdf1dc; color: #8a6410; }
.pill--now  { background: #fde8e6; color: #a3271b; }
.dl__link { font-size: .8rem; font-weight: 600; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: .8rem; font-weight: 600; color: var(--navy-700); cursor: pointer; text-decoration: underline; }
.linkish:hover { color: var(--gold-600); }

/* ---------- Checklist ---------- */
.progress { height: 8px; border-radius: 999px; background: #e3eaf2; overflow: hidden; margin: 6px 0 4px; }
.progress > span { display: block; height: 100%; background: var(--gold); width: 0; transition: width .25s ease; }
.progress-label { font-size: .82rem; color: var(--muted); margin-bottom: 14px; }

.check-group { margin-bottom: 6px; }
.check-group > h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 18px 0 6px; }
.check {
  display: flex; gap: 11px; align-items: flex-start; padding: 11px 12px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px; cursor: pointer;
}
.check input { margin: 2px 0 0; width: 19px; height: 19px; accent-color: var(--gold); flex: 0 0 auto; }
.check span { font-size: .92rem; color: var(--ink); }
.check__t { font-style: normal; }
.check small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.check.is-done { background: #fbfdff; border-color: #d8e6d9; }
/* Only the label is struck through. text-decoration can't be cancelled by a
   descendant, so the hint has to sit outside the struck element. */
.check.is-done .check__t { color: var(--muted); text-decoration: line-through; }

/* ---------- Estimator ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .9rem; color: var(--navy); margin-bottom: 5px; }
.field input[type="number"], .field select {
  width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 1rem; background: #fff; color: var(--ink);
}
.field input[type="range"] { width: 100%; accent-color: var(--gold); }
.field small { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 6px; }
.result {
  background: var(--bg-navy-soft); border-radius: 10px; padding: 13px;
}
.result b { display: block; font-size: 1.35rem; color: var(--navy); line-height: 1.2; }
.result span { font-size: .78rem; color: var(--slate); }
.disclaimer { font-size: .78rem; color: var(--muted); border-left: 3px solid var(--gold); padding-left: 11px; margin-top: 14px; }

/* ---------- Bottom tabs ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  border: 0; background: none; padding: 9px 2px 8px; font: inherit; font-size: .68rem; font-weight: 600;
  color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tabbar svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.tabbar button[aria-selected="true"] { color: var(--navy); }
.tabbar button[aria-selected="true"] svg { stroke: var(--gold); }

/* ---------- Misc ---------- */
.offline-banner {
  display: none; background: #fdf1dc; color: #8a6410; font-size: .84rem; font-weight: 600;
  text-align: center; padding: 8px 12px;
}
body.is-offline .offline-banner { display: block; }
.app-foot { text-align: center; color: var(--muted); font-size: .76rem; margin-top: 26px; }
.app-foot a { color: var(--navy-700); }
.btn--block { display: block; width: 100%; text-align: center; }
