/* Web panel: the app's locked colours and font (rasana/ui/web/app.css), made for a phone held in one hand. */
@font-face { font-family: "Vazirmatn"; font-weight: 400; font-display: swap; src: url("font.woff2") format("woff2"); }
@font-face { font-family: "Vazirmatn"; font-weight: 700; font-display: swap; src: url("font-bold.woff2") format("woff2"); }

:root {
  --accent: #5B3FC4; --accent-strong: #4A2FB0; --accent-soft: #EFECF9; --on-accent: #FFFFFF;
  --bar: #141B3C; --bar-text: #E9EAF6; --page: #F3F4FA; --card: #FFFFFF; --card-2: #F7F7FC; --border: #E6E7F2;
  --text: #1B1F3B; --muted: #5F6480; --ok: #1E9E5A; --ok-soft: #E5F6EC; --warn: #B26A00; --warn-soft: #FFF3DF;
  --bad: #D6336C; --bad-soft: #FDE7EF; --radius: 16px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20,27,60,.04), 0 4px 16px rgba(20,27,60,.06);
  --nav-h: 64px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --accent: #8B74F0; --accent-strong: #7A61EA; --accent-soft: #2A2550; --page: #0F1328; --card: #1A1F3A;
    --card-2: #20264A; --border: #2C3358; --text: #ECEDF7; --muted: #A3A8C8; --ok: #4CC789; --ok-soft: #173B2B;
    --warn: #F0B14A; --warn-soft: #3B2E14; --bad: #F06A98; --bad-soft: #43182A; --shadow: none; color-scheme: dark; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: "Vazirmatn", Tahoma, sans-serif; background: var(--page); color: var(--text); font-size: 16px;
  line-height: 1.7; -webkit-font-smoothing: antialiased; overscroll-behavior-y: contain;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); }
input, select, textarea, button { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px;
  padding-top: calc(8px + env(safe-area-inset-top)); background: var(--bar); color: var(--bar-text); }
.top .mark { width: 32px; height: 32px; border-radius: 9px; }
.top .who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; margin-inline-end: auto; }
.top .who span { font-size: 12px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--bar-text); }
.icon:active { background: rgba(255,255,255,.12); }
.icon.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(-360deg); } }

main { max-width: 640px; margin: 0 auto; padding: 12px 16px; }
.boot { text-align: center; color: var(--muted); margin-top: 48px; }

/* cards and forms */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.card.narrow { max-width: 420px; margin: 24px auto; }
.big-mark { display: block; width: 64px; height: 64px; border-radius: 18px; margin: 4px auto 8px; }
h1 { font-size: 20px; margin: 0 0 16px; text-align: center; }
h2 { font-size: 17px; margin: 0 0 12px; }
label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--card-2); color: var(--text); font-size: 16px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.primary { width: 100%; min-height: 50px; border: 0; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px; }
.primary:active { background: var(--accent-strong); }
.primary:disabled { opacity: .55; }
.ghost { width: 100%; min-height: 48px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.hint.center { text-align: center; }
.err { color: var(--bad); background: var(--bad-soft); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; margin: 0 0 12px; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; margin: 0 0 12px; }
.seg { display: flex; gap: 6px; margin-bottom: 14px; background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 9px 4px; border-radius: 9px; color: var(--muted); font-size: 15px; }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

/* brand filter */
.brands { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 2px 16px; scrollbar-width: none; }
.brands::-webkit-scrollbar { display: none; }
.brands button { flex: none; min-height: 38px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 4px 14px; font-size: 14px; color: var(--muted); }
.brands button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }

/* home */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 0; min-height: 76px; justify-content: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat b { font-size: 24px; line-height: 1.3; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.hot b { color: var(--bad); }
.sec { font-size: 15px; color: var(--muted); margin: 18px 4px 8px; }

/* lists */
.day { font-weight: 700; font-size: 14px; color: var(--muted); margin: 16px 4px 8px; }
.row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; min-height: 56px; }
.row .time { flex: none; font-weight: 700; min-width: 48px; text-align: center; font-size: 15px; }
.row .body { flex: 1; min-width: 0; }
.row .title { overflow-wrap: anywhere; line-height: 1.5; }
.row .meta { font-size: 12px; color: var(--muted); }
.chip { flex: none; font-size: 12px; border-radius: 999px; padding: 3px 10px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.go { background: var(--accent-soft); color: var(--accent); }
.empty { color: var(--muted); text-align: center; padding: 28px 8px; background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); }

.item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; }
.item .head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.item .head .brand-name { font-size: 13px; color: var(--muted); margin-inline-end: auto; }
.item .title { font-weight: 700; font-size: 16px; margin-bottom: 12px; overflow-wrap: anywhere; line-height: 1.6; }
.acts { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 8px; }
.acts button { min-height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card-2); font-size: 15px; }
.acts .ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 700; }
.acts .no { color: var(--bad); }
.done { color: var(--ok); font-size: 14px; margin: 0; }

/* bottom navigation: within reach of the thumb */
.bottom { position: fixed; inset-inline: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(20,27,60,.06); }
.bottom button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; background: none; color: var(--muted); font-size: 12px; }
.bottom button[aria-current="page"] { color: var(--accent); font-weight: 700; }
.bottom button b:empty { display: none; }
.bottom button b { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; line-height: 20px; }
@media (min-width: 700px) { .bottom { max-width: 640px; margin: 0 auto; border: 1px solid var(--border); border-bottom: 0; border-radius: 16px 16px 0 0; } }

/* bottom sheet */
.sheet-bg { position: fixed; inset: 0; z-index: 10; background: rgba(10,12,30,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; background: var(--card); border-radius: 20px 20px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  animation: up .18s ease-out; max-height: 90vh; overflow-y: auto; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.grip { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 4px auto 12px; }
.sheet h2 { margin-bottom: 4px; }
.sheet .sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; overflow-wrap: anywhere; }
.lbl { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.days { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
.days button { flex: none; min-width: 72px; min-height: 56px; border: 1px solid var(--border); background: var(--card-2); border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.3; font-size: 14px; }
.days button small { font-size: 12px; color: var(--muted); }
.days button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.days button[aria-pressed="true"] small { color: var(--on-accent); opacity: .85; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.quick button { min-height: 44px; border: 1px solid var(--border); background: var(--card-2); border-radius: var(--radius-sm); font-size: 15px; }
.quick button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.clock { display: flex; align-items: flex-end; gap: 8px; direction: ltr; }
.clock label { flex: 1; text-align: center; margin-bottom: 14px; }
.clock select { text-align: center; text-align-last: center; font-size: 20px; font-weight: 700; }
.colon { font-size: 22px; font-weight: 700; padding-bottom: 22px; }
.sheet-acts { display: grid; gap: 8px; margin-top: 4px; }
.sheet .primary.danger { background: var(--bad); }

.toast { position: fixed; inset-inline: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); z-index: 20; max-width: 608px; margin: 0 auto;
  background: var(--bar); color: var(--bar-text); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow); }
