:root {
  --bg: #f2f6f5;
  --surface: #ffffff;
  --surface-2: #eaf1ee;
  --text: #163e3b;
  --muted: #677b77;
  --line: #dce6e2;
  --accent: #11665d;
  --accent-ink: #ffffff;
  --good: #16765e;
  --warning: #936124;
  --danger: #a9473e;
  --radius: 20px;
  --font: 'Vazirmatn', system-ui, sans-serif;
  --tide-feature: #124b45;
  --tide-feature-ink: #f0fff8;
  --tide-feature-muted: #b5d2c9;
  --tide-mint: #b7edd0;
  --tide-nav: rgba(255, 255, 255, .94);
  --tide-shadow: 0 9px 35px rgba(30, 71, 60, .09);
}

:root[data-theme='dark'] {
  --bg: #0e1d1b;
  --surface: #162925;
  --surface-2: #203732;
  --text: #e4f1e9;
  --muted: #a0b8b0;
  --line: #29423a;
  --accent: #b7edd0;
  --accent-ink: #133d31;
  --good: #9cd6b8;
  --warning: #e4b973;
  --danger: #f49f92;
  --tide-feature: #194e43;
  --tide-nav: rgba(22, 41, 37, .96);
  --tide-shadow: 0 9px 35px rgba(0, 0, 0, .22);
}

html { background: var(--bg); color-scheme: light; }
html[data-theme='dark'] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
button:active { transform: scale(.985); }
.app-shell { max-width: 540px; min-height: 100dvh; margin-inline: auto; background: var(--bg); }
.app-header { height: auto; min-height: 75px; padding: calc(13px + max(env(safe-area-inset-top), var(--host-safe-top, 0px))) 23px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: transparent; border: 0; position: relative; }
.tide-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tide-brand strong { font-size: 13px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 225px; }
.tide-brand-symbol { width: 30px; height: 34px; flex: none; color: var(--accent); }
.tide-brand-symbol svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.tide-header-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.tide-settings, .tide-language { color: var(--text); background: transparent; border: 0; width: 44px; min-width: 44px; height: 44px; display: grid; place-items: center; padding: 0; cursor: pointer; }
.tide-language { font: 650 11px system-ui, sans-serif; letter-spacing: .03em; }
.tide-settings { border-inline-start: 1px solid var(--line); padding-inline-start: 7px; width: 39px; }
.app-main { padding: 6px 22px calc(110px + env(safe-area-inset-bottom)); }
.tide-page-intro { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 7px 0 23px; }
.tide-eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .035em; }
.tide-page-intro h1 { margin: 0; font-size: 30px; line-height: 1.45; letter-spacing: -.045em; font-weight: 780; text-wrap: balance; }
.tide-subtitle { font-size: 11px; color: var(--muted); margin: 4px 0 0; }
.tide-add { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 16px; color: var(--accent-ink); background: var(--accent); border: 0; margin-block-start: 9px; box-shadow: 0 4px 9px rgba(17, 102, 93, .08); cursor: pointer; }
.tide-control-area { margin-bottom: 12px; }
.tide-control-area .list-controls { gap: 10px; margin-bottom: 0; }
.tide-control-area .search-box { min-height: 48px; border-radius: 15px; background: var(--surface); border: 1px solid var(--line); padding: 0 14px; gap: 9px; box-shadow: none; }
.tide-control-area .search-box input { font-size: 11px; min-height: 46px; background: transparent; }
.tide-control-area .search-box .icon { width: 17px; color: var(--muted); }
.tide-control-area .segmented { background: transparent; border: 0; padding: 0; gap: 5px; margin-block: 0; display: flex; width: fit-content; }
.tide-control-area .segmented button { min-height: 40px; padding: 6px 14px; border-radius: 10px; border: 0; color: var(--muted); font-size: 11px; font-weight: 550; background: transparent; position: relative; }
.tide-control-area .segmented button.active, .tide-control-area .segmented button[aria-pressed='true'], .tide-control-area .segmented button[aria-selected='true'] { color: var(--text); background: var(--surface-2); box-shadow: none; font-weight: 750; }
.tide-control-area select { font-size: 11px; border: 0; background: transparent; color: var(--muted); min-height: 35px; padding-inline: 6px; width: auto; }
.tide-control-area .field { margin: 0; }
.tide-control-area > .row, .tide-control-area .controls-row { gap: 5px; }
.tide-control-area .filter-sort { margin-top: 8px; }
.tide-list-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 17px 2px 11px; }
.tide-list-meta > span { color: var(--muted); font-size: 10px; font-weight: 650; }
.tide-list-meta > button { display: flex; gap: 5px; align-items: center; min-height: 32px; background: transparent; border: 0; padding: 0 1px; font-size: 10px; color: var(--muted); cursor: pointer; }
.tide-list-meta > button, .tide-auto, .tide-details-link { position: relative; }
.tide-list-meta > button::before, .tide-auto::before, .tide-details-link::before, .tide-control-area .segmented button::before { content: ''; position: absolute; inset: 50% 0 auto; min-height: 44px; transform: translateY(-50%); }
.tide-subscription-list { display: grid; gap: 13px; }
.tide-active { border: 0; border-radius: 25px; background: var(--tide-feature); color: var(--tide-feature-ink); padding: 20px 19px 16px; box-shadow: 0 8px 20px rgba(27, 72, 54, .06); overflow: hidden; }
.tide-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tide-name { min-width: 0; }
.tide-name h2 { margin: 0; font-size: 15px; font-weight: 720; line-height: 1.45; overflow-wrap: anywhere; }
.tide-username { font-family: var(--font); font-size: 10px; color: var(--tide-feature-muted); display: block; text-align: start; margin-top: 2px; }
.tide-status { display: inline-flex; align-items: center; gap: 5px; background: rgba(189, 232, 210, .12); color: #c8f4d9; border-radius: 7px; font-size: 10px; font-weight: 500; padding: 3px 7px; flex: none; white-space: nowrap; }
.tide-status i { width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
.tide-category { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--tide-feature-muted); font-size: 10px; margin-top: 7px; }
.tide-category i { font-style: normal; opacity: .65; padding-inline: 1px; }
.tide-data-area { display: grid; grid-template-columns: minmax(0, 1fr) 123px; align-items: center; gap: 5px; margin: 19px 0 16px; }
.tide-data-copy > p { color: var(--tide-feature-muted); font-size: 11px; margin: 0 0 4px; }
.tide-quantity { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 5px; row-gap: 0; }
.tide-quantity strong { font-family: var(--font); font-weight: 500; font-size: 46px; letter-spacing: -.055em; line-height: 1.24; }
.tide-quantity span { font-size: 11px; color: var(--tide-feature-muted); }
.tide-quantity.is-pending { flex-direction: column; }
.tide-quantity.is-pending span { font-size: 10px; }
.tide-allowance { font-size: 10px; color: var(--tide-feature-muted); }
.tide-dial { width: 123px; height: 117px; position: relative; direction: ltr; }
.tide-dial svg { width: 100%; height: 100%; stroke-width: 3.8; stroke-linecap: round; transform: rotate(0); }
.dial-live { stroke: var(--tide-mint); }
.dial-idle { stroke: rgba(194, 232, 214, .14); }
.dial-label { position: absolute; top: 39px; left: 7px; right: 7px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.dial-label strong { font-size: 18px; font-weight: 500; line-height: 1.1; letter-spacing: -.04em; color: var(--tide-mint); }
.dial-label > span { margin-top: 6px; color: var(--tide-feature-muted); font-size: 9px; }
.tone-warning .dial-live { stroke: #ebc383; }
.tone-warning .dial-label strong { color: #f5d8ab; }
.tone-critical .dial-live { stroke: #ffa49a; }
.tone-critical .dial-label strong { color: #ffc8bd; }
.tide-facts { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid rgba(204, 243, 223, .13); padding-top: 10px; margin-top: 4px; }
.tide-facts > span, .tide-auto { display: flex; align-items: center; gap: 5px; color: var(--tide-feature-muted); font-size: 10px; }
.tide-auto { border: 0; background: none; padding: 0; min-height: 27px; cursor: pointer; }
.tide-auto-value { color: #e6f5ed; font-size: 9px; }
.tide-auto-value.enabled { color: var(--tide-mint); }
.tide-card-actions { display: flex; gap: 7px; margin-top: 13px; }
.tide-copy, .tide-manage { display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; min-height: 44px; border: 0; font-size: 12px; font-weight: 700; cursor: pointer; }
.tide-copy { flex: 1; background: #e1f4e8; color: #174c3b; padding: 10px 12px; }
.tide-manage { width: 46px; color: #dcf2e6; background: rgba(223, 255, 237, .09); padding: 10px; }
.tide-manage span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.tide-inactive { padding: 18px 18px 11px; background: var(--surface); border-radius: 20px; border: 1px solid var(--line); }
.tide-inactive .tide-name h2 { font-size: 13px; }
.tide-inactive .tide-username { color: var(--muted); }
.tide-small-status { font-size: 9px; line-height: 1.75; color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); border-radius: 7px; padding: 2px 6px; max-width: 130px; }
.is-expired .tide-small-status { color: var(--warning); background: color-mix(in srgb, var(--warning) 9%, transparent); }
.tide-inactive-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.tide-inactive-meta { min-width: 0; }
.tide-inactive-meta > span { font-size: 10px; color: var(--muted); }
.tide-inactive-meta p { display: flex; align-items: flex-start; gap: 5px; font-size: 10px; color: var(--warning); margin: 4px 0; }
.tide-inactive-meta .icon { flex: none; margin-top: 1px; }
.needs-help .tide-inactive-meta p { color: var(--muted); }
.tide-context-action { display: flex; align-items: center; justify-content: center; gap: 5px; flex: none; min-height: 44px; padding: 6px 11px; background: var(--surface-2); border: 0; color: var(--text); font-size: 10px; font-weight: 650; border-radius: 11px; cursor: pointer; }
.tide-context-action .icon { width: 15px; height: 15px; }
.tide-details-link { border: 0; background: none; display: flex; align-items: center; justify-content: flex-end; gap: 3px; width: 100%; color: var(--muted); font-size: 9px; padding: 0; margin-top: 6px; min-height: 30px; cursor: pointer; }
[dir='rtl'] .tide-details-link .icon { transform: rotate(180deg); }
.app-nav { position: fixed; inset-inline: auto; bottom: calc(13px + max(env(safe-area-inset-bottom), var(--host-safe-bottom, 0px))); left: 50%; right: auto; margin: 0; transform: translateX(-50%); width: calc(100% - 36px); max-width: 500px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px 7px; gap: 5px; min-height: 71px; border: 1px solid color-mix(in srgb, var(--line) 75%, transparent); border-radius: 22px; background: var(--tide-nav); backdrop-filter: blur(18px); box-shadow: var(--tide-shadow); z-index: 20; }
.app-nav > button { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; min-height: 52px; padding: 3px; color: var(--muted); background: transparent; border: 0; border-radius: 16px; font-size: 10px; font-weight: 550; cursor: pointer; }
.app-nav > button[aria-current='page'] { background: var(--surface-2); color: var(--accent); font-weight: 750; }
.tide-nav-icon { display: flex; height: 24px; align-items: center; }
.tide-nav-dot { position: absolute; width: 4px; height: 4px; top: 8px; inset-inline-end: 23px; background: currentColor; border-radius: 50%; }
.tide-secondary-page .page-title { font-size: 28px; font-weight: 750; letter-spacing: -.04em; margin-block: 14px 18px; }
.tide-secondary-page .page-title p { font-weight: 450; letter-spacing: 0; }
.tide-secondary-page .section-title { font-size: 14px; letter-spacing: -.015em; }
.wallet-card { border: 0; border-radius: 24px; padding: 24px; background: var(--tide-feature); color: var(--tide-feature-ink); box-shadow: none; }
.wallet-card .muted, .wallet-card p { color: var(--tide-feature-muted); }
.wallet-card strong, .wallet-card .balance { font-size: 38px; line-height: 1.3; font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.wallet-card .btn { background: #e1f4e8; color: #174c3b; }
.wallet-tabs { background: var(--surface-2); border-radius: 13px; padding: 4px; gap: 4px; }
.wallet-tabs button { border: 0; border-radius: 10px; font-size: 12px; min-height: 42px; }
.wallet-tabs button.active, .wallet-tabs button[aria-pressed='true'] { background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .035); color: var(--text); }
.transaction-list { border-radius: 20px; background: var(--surface); border: 1px solid var(--line); padding: 2px 15px; }
.transaction { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 0; }
.transaction:last-child { border-bottom: 0; }
.transaction .tx-icon { background: var(--surface-2); color: var(--text); border-radius: 13px; }
.tx-amount { font-weight: 650; font-variant-numeric: tabular-nums; }
.category-list, .plan-list { gap: 13px; }
.category-card, .plan-card { border: 1px solid var(--line); background: var(--surface); border-radius: 21px; padding: 20px; box-shadow: none; }
.category-card .icon { color: var(--accent); }
.category-card h3, .plan-card h3 { font-weight: 700; }
.plan-card .price { color: var(--accent); font-weight: 650; font-size: 24px; letter-spacing: -.035em; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: none; }
.btn { border-radius: 13px; min-height: 45px; font-size: 12px; font-weight: 650; gap: 7px; }
.btn.primary, button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.secondary, button.secondary { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn.danger, button.danger { background: color-mix(in srgb, var(--danger) 11%, var(--surface)); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--line)); }
.field input, .field select, .field textarea { border-radius: 13px; min-height: 47px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 11px 13px; }
.field label, .field > span { font-size: 12px; }
.field:focus-within { border-color: var(--accent); }
.sheet-backdrop { background: rgba(10, 36, 30, .33); backdrop-filter: blur(5px); }
dialog.sheet { border: 0; border-radius: 29px 29px 0 0; color: var(--text); background: var(--bg); padding: 0; box-shadow: 0 -10px 80px rgba(10, 36, 30, .17); max-width: 540px; }
.sheet::before { content: ''; display: block; width: 33px; height: 4px; background: var(--line); border-radius: 10px; margin: 11px auto 2px; }
.sheet-header { padding: 12px 22px 17px; border-bottom: 1px solid var(--line); }
.sheet-header h2 { font-size: 20px; letter-spacing: -.035em; }
.sheet-body { padding: 21px 22px; }
.sheet-actions { padding: 14px 22px calc(17px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.fact-list { font-size: 12px; }
.fact-list > div { border-bottom: 1px solid var(--line); padding-block: 11px; }
.progress { height: 6px; border-radius: 5px; background: var(--surface-2); }
.progress > span, .progress > div { background: var(--accent); border-radius: inherit; }
.badge { border-radius: 7px; font-size: 10px; padding: 3px 7px; }
.notice { border-radius: 14px; font-size: 12px; background: var(--surface-2); padding: 14px; }
.empty { margin-top: 15px; background: var(--surface); border: 1px dashed var(--line); border-radius: 22px; padding: 28px 20px; }
.empty h2, .empty h3 { font-size: 18px; }
.toast { border-radius: 15px; background: var(--text); color: var(--bg); font-size: 12px; box-shadow: var(--tide-shadow); }
.search-box:focus-within { border-color: var(--accent); }
:root[dir='ltr'] .tide-page-intro h1 { font-size: 29px; letter-spacing: -.05em; }
:root[dir='ltr'] .tide-eyebrow { font-size: 9px; letter-spacing: .12em; }
:root[dir='ltr'] .tide-quantity strong { font-size: 44px; }
@media (min-width: 620px) { .app-shell { border-inline: 1px solid var(--line); } .app-main { padding-inline: 28px; } .app-header { padding-inline: 29px; } .tide-data-area { grid-template-columns: minmax(0, 1fr) 150px; } .tide-dial { width: 145px; height: 138px; } .dial-label { top: 46px; } .dial-label strong { font-size: 23px; } }
@media (max-width: 370px) { .app-header { padding-inline: 18px; } .app-main { padding-inline: 16px; } .tide-page-intro h1 { font-size: 28px; } .tide-brand strong { max-width: 180px; font-size: 12px; } .tide-active { padding-inline: 17px; } .tide-data-area { grid-template-columns: minmax(0, 1fr) 112px; } .tide-dial { width: 112px; height: 107px; } .dial-label { top: 36px; } .tide-quantity strong { font-size: 42px; } .tide-facts { gap: 5px; } .tide-facts > span, .tide-auto { font-size: 8px; } .tide-control-area .segmented button { padding-inline: 11px; } }
@media (prefers-reduced-motion: no-preference) { .tide-active, .tide-inactive { animation: tide-appear 260ms ease-out both; } .tide-inactive { animation-delay: 35ms; } button { transition: transform 130ms ease, background-color 130ms ease; } @keyframes tide-appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
