:root {
  --ink: #172b3a;
  --muted: #687987;
  --brand: #0f766e;
  --pale: #eaf8f5;
  --line: #e6edf0;
  --bg: #f4f8f8;
  --danger: #c24141;
  --ok: #1f8a4c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Vazirmatn, Tahoma, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}
a { color: var(--brand); text-decoration: none; }
button, input, select { font: inherit; }
.wrap { width: min(880px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 48px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.top h1 { margin: 0; font-size: 1.45rem; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.tool-logo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: #fff; }
.pwa-install { position: fixed; z-index: 30; left: 16px; right: 16px; bottom: 16px; display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: 0 12px 30px #143e3a18; }
.pwa-install.d-none { display: none; }
.pwa-install img { width: 42px; height: 42px; border-radius: 50%; }
.pwa-install-copy { flex: 1; }
.pwa-install-copy strong { display: block; }
.pwa-install-copy small { color: var(--muted); }
.pwa-x { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; }
.lines { display: flex; flex-direction: column; gap: 8px; }
.line { display: grid; grid-template-columns: 1fr 72px 120px 36px; gap: 8px; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); font-size: .9rem; }
.sheet { display: none; }
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { height: 72px; border-radius: 12px; border: 1px solid var(--line); background: var(--pale); font-size: 1.4rem; cursor: pointer; }
.tile.open { background: #fff; }
.xo { display: grid; grid-template-columns: repeat(3, 72px); gap: 8px; }
.xo button { height: 72px; font-size: 1.5rem; font-weight: 800; }
.card-face { min-height: 140px; border: 1px solid var(--line); border-radius: 16px; display: grid; place-items: center; padding: 18px; background: #fff; font-size: 1.15rem; text-align: center; cursor: pointer; }
.habit-days { display: flex; gap: 6px; }
.habit-days button.on { background: var(--pale); border-color: var(--brand); color: var(--brand); }
@media print {
  .top, .card, .pwa-install { display: none !important; }
  .sheet { display: block; }
  body { background: #fff; }
}
.home { font-weight: 700; font-size: .92rem; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.composer { display: grid; gap: 10px; margin-bottom: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.field, .select, .btn {
  border-radius: 12px;
  border: 1px solid #d5e2e4;
  background: #fff;
  padding: 10px 12px;
}
.field { flex: 1; min-width: 180px; }
.field.num { direction: ltr; text-align: right; }
.chart-card { margin-bottom: 16px; }
.chart-card h2 { margin: 0 0 4px; font-size: 1.12rem; }
.chart-card h3 { margin: 0 0 10px; font-size: .92rem; }
.chart-lead { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }
.chart-grid { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 18px; align-items: start; }
.donut-wrap { display: flex; gap: 12px; align-items: center; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: .86rem; }
.donut-legend strong { display: block; }
.day-block { margin-bottom: 12px; }
.day-name { font-weight: 800; font-size: .86rem; margin-bottom: 4px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 6px; }
@media (max-width: 720px) { .chart-grid { grid-template-columns: 1fr; } }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 8px; align-items: center; font-size: .86rem; }
.bar-track { height: 8px; background: #eef3f3; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 99px; }
.field:focus, .select:focus { outline: 2px solid #b7e4dc; border-color: var(--brand); }
.btn { font-weight: 700; cursor: pointer; }
.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover { background: #0b625c; }
.choice { cursor: pointer; color: #526471; }
.choice.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.stat small { color: var(--muted); display: block; }
.stat strong { font-size: 1.25rem; }
.stat.income strong { color: var(--ok); }
.stat.expense strong { color: var(--danger); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}
.item.done .title { text-decoration: line-through; color: var(--muted); }
.title { flex: 1; font-weight: 650; }
.meta { color: var(--muted); font-size: .82rem; }
.badge { border-radius: 999px; padding: 2px 8px; font-size: .75rem; background: var(--pale); color: var(--brand); white-space: nowrap; }
.badge.high { background: #fde8e8; color: var(--danger); }
.badge.low { background: #eef2f4; color: #5d707a; }
.icon-btn { border: 0; background: transparent; color: #8aa; cursor: pointer; font-size: 1.1rem; }
.check { width: 22px; height: 22px; accent-color: var(--brand); }
.empty { text-align: center; color: var(--muted); padding: 28px 8px; }
.month-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.amount.plus { color: var(--ok); font-weight: 800; }
.amount.minus { color: var(--danger); font-weight: 800; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 14px; }
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .field { min-width: 100%; }
}
.wrap.wide { width: min(1040px, calc(100% - 28px)); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); cursor: pointer; }
.btn { cursor: pointer; }
.drop { border: 1.5px dashed #b7d5d0; background: #fff; border-radius: 18px; padding: 22px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--brand); background: var(--pale); }
.drop input { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid #d5e2e4; background: #fff; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.hub-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; color: var(--ink); min-height: 132px; }
.hub-card:hover { border-color: #9fd8cf; }
.hub-card strong { display: block; margin: 8px 0 4px; }
.hub-card span { color: var(--muted); font-size: .88rem; }
.file-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.file-row img, .thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: #eef4f3; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb-card { width: 120px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; cursor: grab; }
.thumb-card.on { outline: 2px solid var(--brand); }
.thumb-card canvas, .thumb-card img { width: 100%; height: 90px; object-fit: contain; background: #f7fbfa; border-radius: 8px; }
.stage { position: relative; max-width: 100%; overflow: auto; background: #122532; border-radius: 16px; }
.stage canvas { max-width: 100%; height: auto; display: block; }
.note { background: #fff8e8; border: 1px solid #f3e2b5; border-radius: 12px; padding: 10px 12px; color: #7a5b16; }
.diff-add { background: #e7f7ee; }
.diff-del { background: #fdecec; }
.progress { height: 8px; background: #e7efee; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); width: 0; }
