:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191a18;
  --surface: #222320;
  --surface-2: #2e2f2b;
  --text: #f1eee5;
  --muted: #a3a59b;
  --line: #41433b;
  --accent: #ff603f;
  --accent-ink: #171813;
  --good: #bad0b8;
  --warning: #e9b270;
  --danger: #ff846d;
  --radius: 3px;
  --font: Vazirmatn, system-ui, sans-serif;
  --nav: #eeeae0;
  --nav-ink: #23251f;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2efe7;
  --surface: #fcfaf4;
  --surface-2: #e5e2d8;
  --text: #20231d;
  --muted: #65695d;
  --line: #cecec0;
  --accent: #c53b1c;
  --accent-ink: #fff9ee;
  --good: #456143;
  --warning: #906219;
  --danger: #b52e24;
  --nav: #252821;
  --nav-ink: #f5f1e8;
}
body { font-size: 13px; }
.app-shell { max-width: 580px; overflow: clip; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(9px + max(env(safe-area-inset-top), var(--host-safe-top, 0px))) 22px 6px; }
.tempo-brand { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.tempo-symbol { width: 26px; height: 29px; display: flex; gap: 3px; transform: skew(-13deg); align-items: flex-end; color: var(--accent); }
.tempo-symbol i { width: 5px; background: currentColor; height: 100%; }
.tempo-symbol i:first-child { height: 55%; }
.tempo-symbol i:nth-child(2) { height: 80%; }
.tempo-tools { display: flex; align-items: center; gap: 3px; }
.tempo-language, .tempo-square { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; border-radius: 50%; }
.tempo-language { font-size: 11px; letter-spacing: 1px; }
.icon-only > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.app-main { padding: 5px 22px 124px; min-height: 80dvh; }
.app-main article { content-visibility: visible; contain-intrinsic-size: none; }
.tempo-edition { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 9px; font-weight: 600; color: var(--muted); letter-spacing: .8px; padding: 5px 0 11px; border-top: 1px solid var(--line); }
.tempo-edition time { font-family: ui-monospace, monospace; text-transform: uppercase; font-size: 9px; white-space: nowrap; }
.tempo-title-line { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.tempo-title-line h1 { font-size: clamp(37px, 10.5vw, 52px); font-weight: 850; line-height: 1.17; letter-spacing: -2px; }
[dir="rtl"] .tempo-title-line h1 { line-height: 1.17; font-size: clamp(37px, 10.2vw, 52px); letter-spacing: -1.7px; }
.tempo-count { display: flex; flex-direction: column; padding-bottom: 7px; color: var(--muted); text-align: end; }
.tempo-count b { font-size: 37px; line-height: 1.05; font-weight: 300; color: var(--accent); letter-spacing: -2px; }
.tempo-count span { font-size: 10px; margin-top: 7px; }
.tempo-overview { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 1px; }
.tempo-overview > span { font-size: 11px; display: flex; align-items: center; gap: 6px; color: var(--good); }
.tempo-overview > span > i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tempo-search-toggle { min-height: 44px; background: transparent; border: 0; display: flex; align-items: center; gap: 6px; padding: 5px 0; color: var(--muted); font-size: 11px; }
.tempo-filter-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.tempo-filter-tray { padding: 10px 0 20px; border-bottom: 1px solid var(--line); }
.tempo-filter-tray .list-controls { margin: 0; }
.tempo-filter-tray .search-box { border-radius: 3px; background: var(--surface); }
.tempo-filter-tray .segmented { border-radius: 3px; }
.tempo-filter-tray .segmented button { padding: 8px; font-size: 10px; border-radius: 2px; }
.tempo-timeline { position: relative; isolation: isolate; padding-top: 10px; }
.tempo-axis { position: absolute; z-index: -1; top: 39px; bottom: 16px; inset-inline-start: 78px; width: 1px; background: var(--line); transform-origin: center top; }
.tempo-section-label { position: relative; display: flex; align-items: center; gap: 10px; padding-bottom: 6px; padding-top: 3px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: 1.1px; }
.tempo-section-label > span { background: var(--bg); padding-inline-end: 6px; }
.tempo-section-label > i { height: 1px; background: var(--line); flex: 1; }
.tempo-section-label.group-past { color: var(--accent); }
.tempo-entry { display: grid; grid-template-columns: 62px minmax(0,1fr); column-gap: 33px; position: relative; padding: 4px 0 10px; }
.tempo-entry::before { content: ''; width: 7px; height: 7px; background: var(--bg); border: 1px solid var(--muted); position: absolute; inset-inline-start: 75px; top: 19px; border-radius: 50%; }
.tempo-entry.is-open::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--bg); }
.tempo-entry.group-past::before { border-radius: 0; border-color: var(--accent); }
.tempo-date { text-align: start; padding-top: 2px; white-space: nowrap; }
.tempo-date span { display: block; font-family: ui-monospace, monospace; font-size: 8px; letter-spacing: -.3px; color: var(--muted); }
.tempo-date strong { display: block; font-family: Arial, sans-serif; font-weight: 400; line-height: 1.1; font-size: 53px; letter-spacing: -3px; margin-top: 4px; }
.tempo-entry.is-open .tempo-date strong { color: var(--accent); }
.tempo-entry.group-review .tempo-date strong { color: var(--muted); }
.tempo-date.undated strong { line-height: 1; font-size: 38px; }
.tempo-date.undated span { font-family: inherit; font-size: 9px; margin-top: 8px; }
.tempo-entry-body { min-width: 0; }
.tempo-entry-toggle { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 0; min-height: 49px; width: 100%; background: transparent; border: 0; text-align: start; }
.tempo-name-block { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.tempo-name-block > strong { font-size: 14px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; max-width: 100%; }
.tempo-status { color: var(--muted); font-size: 9px; display: flex; align-items: center; gap: 5px; }
.tempo-status > i { width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
.tempo-status.status-10 { color: var(--good); }
.tempo-status.status-20 { color: var(--accent); }
.tempo-status.status-25, .tempo-status.status-50 { color: var(--warning); }
.tempo-expand-mark { flex-shrink: 0; width: 28px; height: 44px; display: grid; place-items: center; color: var(--muted); }
.tempo-username { font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.tempo-days { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.tempo-auto-indicator { color: var(--good); }
.tempo-category { color: var(--muted); font-size: 9px; line-height: 1.7; margin-top: 9px; }
.tempo-category > span { padding: 0 3px; }
.tempo-usage { padding-top: 13px; }
.tempo-data-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tempo-data-number { display: flex; align-items: baseline; gap: 5px; }
.tempo-data-number b { font-family: Arial, sans-serif; font-size: 32px; font-weight: 400; letter-spacing: -1.5px; line-height: 1.4; }
.tempo-data-number span { color: var(--muted); font-size: 10px; }
.tempo-data-label { font-size: 9px; color: var(--muted); }
.tempo-meter { height: 5px; width: 100%; background: var(--line); margin-top: 7px; position: relative; }
.tempo-meter::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 12px, var(--bg) 12px 14px); }
.tempo-meter > span { display: block; height: 100%; background: var(--good); transform-origin: left; }
[dir="rtl"] .tempo-meter > span { transform-origin: right; }
.tempo-meter.warning > span { background: var(--warning); }
.tempo-meter.critical > span { background: var(--danger); }
.tempo-used { color: var(--muted); font-size: 9px; margin-top: 7px; }
.tempo-usage.unavailable { display: flex; gap: 10px; color: var(--muted); align-items: center; font-size: 10px; min-height: 53px; }
.tempo-loading { width: 25px; height: 3px; background: var(--line); position: relative; overflow: hidden; }
.tempo-loading::after { content: ''; position: absolute; inset: 0; background: var(--accent); animation: tempo-load 1s ease-in-out 3; transform-origin: left; }
.tempo-entry-actions { display: flex; gap: 5px; margin-top: 15px; }
.tempo-main-action { display: flex; flex: 1; align-items: center; justify-content: center; gap: 7px; min-height: 44px; background: var(--text); color: var(--bg); border: 0; border-radius: 2px; padding: 7px 9px; font-size: 10px; font-weight: 700; }
.tempo-entry-actions .tempo-square { min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 2px; }
.tempo-entry-foot { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 2px; }
.tempo-text { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; background: transparent; border: 0; padding: 4px 0; font-size: 9px; color: var(--muted); }
.tempo-text .icon { width: 13px; height: 13px; }
.tempo-endnote { color: var(--muted); font-size: 9px; text-align: center; border-top: 1px solid var(--line); padding-top: 16px; }
.app-nav.tempo-navigation { background: linear-gradient(0deg,var(--bg) 55%,transparent); border: 0; max-width: 580px; padding: 18px 22px calc(16px + max(env(safe-area-inset-bottom), var(--host-safe-bottom, 0px))); align-items: stretch; justify-content: space-between; gap: 10px; }
.tempo-nav-switch { flex: 1; display: flex; align-items: stretch; background: var(--nav); border-radius: 3px; padding: 5px; }
.tempo-navigation .tempo-nav-switch > button { flex-direction: row; justify-content: center; gap: 9px; color: var(--nav-ink); font-size: 12px; min-height: 47px; border-radius: 1px; }
.tempo-navigation .tempo-nav-switch > button[aria-current="page"] { background: var(--nav-ink); color: var(--nav); }
.tempo-nav-no { font-family: ui-monospace,monospace; font-size: 9px; opacity: .6; }
.tempo-navigation .tempo-buy { flex: 0 0 58px; min-height: 58px; border-radius: 3px; background: var(--accent); color: var(--accent-ink); gap: 0; font-size: 9px; font-weight: 700; }
.tempo-buy[aria-current="page"] { outline: 2px solid var(--text); outline-offset: 3px; }
.tempo-section-kicker { display: flex; align-items: center; gap: 10px; font-size: 10px; letter-spacing: 1.5px; color: var(--muted); padding: 12px 0 17px; border-top: 1px solid var(--line); }
.tempo-section-kicker span { color: var(--accent); font-family: ui-monospace, monospace; }
.tempo-destination .page-title { font-size: 35px; font-weight: 800; margin-bottom: 24px; }
.tempo-destination .wallet-card { background: var(--text); color: var(--bg); border-radius: 3px; padding: 24px; }
.tempo-destination .wallet-card .muted, .tempo-destination .wallet-card .wallet-label { color: inherit; opacity: .72; }
.tempo-destination .wallet-card .balance { font-family: Arial,sans-serif; font-weight: 400; letter-spacing: -1px; }
.tempo-destination .transaction-list { border: 0; border-radius: 0; background: transparent; }
.tempo-destination .transaction { border-bottom: 1px solid var(--line); padding: 20px 0; }
.tempo-destination .tx-icon { background: transparent; border: 1px solid var(--line); border-radius: 50%; }
.tempo-destination .category-card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 24px 0; }
.tempo-destination .category-icon { border-radius: 0; background: var(--surface-2); }
.btn, .field input, .field select, .field textarea, .notice, .search-box, .segmented, .plan-card, .wallet-tabs button, .sort-select { border-radius: 3px; }
.btn { font-size: 12px; }
dialog.sheet { border-radius: 10px 10px 0 0; background: var(--bg); }
.sheet-header { border-bottom: 1px solid var(--line); }
.sheet-header h2 { font-size: 23px; }
.sheet-actions { background: var(--bg); }
.sheet .panel { background: var(--surface); border-radius: 3px; }
.sheet .fact-list { border-radius: 0; }
.toast { border-radius: 3px; }
.empty { padding: 38px 10px; background: var(--bg); position: relative; }
.empty h2 { font-size: 24px; }
.skeleton { background: var(--surface-2); min-height: 120px; }
button { transition: opacity .16s ease, transform .16s ease, background-color .16s ease; }
button:active:not(:disabled) { transform: scale(.975); }
@keyframes tempo-load { 0%,100% { transform: scaleX(.15); } 50% { transform: scaleX(1); } }
@media (max-width: 370px) {
  .app-header { padding-inline: 18px; }
  .app-main { padding-inline: 18px; }
  .tempo-entry { grid-template-columns: 55px minmax(0,1fr); column-gap: 26px; }
  .tempo-axis { inset-inline-start: 67px; }
  .tempo-entry::before { inset-inline-start: 64px; }
  .tempo-date strong { font-size: 48px; }
  .tempo-date span { font-size: 7px; }
  .tempo-entry-actions { gap: 4px; }
  .tempo-main-action { padding-inline: 6px; gap: 5px; }
  .tempo-title-line h1 { font-size: 37px; }
  [dir="rtl"] .tempo-title-line h1 { font-size: 37px; }
  .app-nav.tempo-navigation { padding-inline: 18px; }
}
@media (min-width: 500px) { .app-main { padding-inline: 34px; } .app-header { padding-inline: 34px; } .tempo-title-line h1 { font-size: 54px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
