/* Mzya on a computer. Colours and fonts are the app's tokens
   (lib/core/design/tokens.dart). Open plane: the sidebar sits on the paper
   ground, the work on flat ivory cards edged by one hairline. Colour goes
   on replies and money, not on chrome. */

@font-face { font-family: Plex; src: url(/fonts/IBMPlexSansArabic-Regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Plex; src: url(/fonts/IBMPlexSansArabic-Medium.ttf) format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: Plex; src: url(/fonts/IBMPlexSansArabic-SemiBold.ttf) format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: Fraunces; src: url(/fonts/Fraunces-Variable.ttf) format('truetype'); font-weight: 300 900; font-display: swap; }

:root {
  --paper: #FAF8F2; --card: #FFFEFA; --ink: #26291F; --ink-soft: #55584C; --muted: #6F7266;
  --hairline: #E4E1D5; --sage: #8FA083; --sage-deep: #4E5E44; --sage-mist: #E6ECDD; --sage-wash: #F1F4EB;
  --mauve: #8A7577; --mauve-mist: #F1E8E8;
  --yes: #557A46; --yes-mist: #E7F0E0; --no: #B0573F; --no-mist: #F7E6E0; --wait: #8F6A22; --wait-mist: #F8F0DC;
  --groom: #5B7489; --groom-mist: #E6EDF2; --shared: #6A675A; --shared-mist: #EFEDE6;
  --r: 12px; --side: 248px; --gut: 32px;
  --text: Plex, system-ui, sans-serif; --display: Fraunces, Plex, Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--text);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sage-deep); }
:focus-visible { outline: 2px solid var(--sage-deep); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dash { color: var(--muted); }
.sub { display: block; color: var(--muted); font-size: 13px; }
.bad { color: var(--no); }
.num { text-align: end; white-space: nowrap; }
.loading { display: grid; place-items: center; height: 100vh; }
.loading .mark { width: 56px; height: 48px; opacity: .6; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 500 22px/1 var(--display); }
.mark { width: 28px; height: 24px; flex: none; }

.quiet {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 999px; padding: 7px 16px;
  color: var(--ink); transition: background .15s, border-color .15s;
}
.quiet:hover { border-color: var(--sage); background: var(--sage-wash); }
.primary {
  background: var(--sage-deep); color: var(--paper); border: 0; border-radius: 999px; padding: 9px 20px; font-weight: 500;
}
.primary:hover { background: #3F4D37; }
select, input[type=search], input[type=number] {
  background: var(--card); border: 1px solid #D9D5C6; border-radius: 10px; padding: 7px 12px; min-height: 38px;
}
input[type=search] { min-width: 240px; }

/* ------------------------------------------------------------ linking */

.link {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px;
  align-items: center; max-width: 1120px; margin: 0 auto; padding: 48px var(--gut);
}
.link h1 { font: 500 40px/1.1 var(--display); letter-spacing: -.02em; margin: 40px 0 16px; max-width: 14ch; }
.link .lead { font-size: 18px; color: var(--ink-soft); max-width: 44ch; margin: 0 0 32px; }
.steps { margin: 0 0 24px; padding-inline-start: 22px; font-size: 17px; }
.steps li { margin-bottom: 10px; padding-inline-start: 4px; }
.steps li::marker { color: var(--sage-deep); font-weight: 600; }
.safety { color: var(--muted); font-size: 14px; max-width: 44ch; margin: 0 0 24px; }
.notice { background: var(--wait-mist); color: #5E4614; border-radius: var(--r); padding: 12px 16px; margin: 0 0 24px; max-width: 44ch; }
.link-code {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 20px; padding: 40px;
  display: grid; justify-items: center; text-align: center;
}
.qr { width: min(340px, 100%); aspect-ratio: 1; display: grid; place-items: center; transition: opacity .2s; }
.qr svg { width: 100%; height: 100%; }
.qr.waiting { opacity: .25; }
.qr-error { color: var(--no); }
.code-label { color: var(--muted); font-size: 14px; margin: 20px 0 4px; }
.code { font: 500 30px/1.2 var(--display); letter-spacing: .08em; margin: 0 0 16px; direction: ltr; unicode-bidi: isolate; }

/* -------------------------------------------------------------- shell */

.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100vh; }
.side {
  display: flex; flex-direction: column; gap: 24px; padding: 24px 16px 20px; border-inline-end: 1px solid var(--hairline);
  overflow-y: auto;
}
.side .brand { padding: 0 8px; }
.wedding { padding: 0 8px; }
.wedding select { width: 100%; font: 500 17px/1.3 var(--display); }
.wedding-names { font: 500 19px/1.25 var(--display); margin: 0 0 4px; }
.wedding-date { margin: 0; color: var(--ink-soft); font-size: 14px; }
.wedding-count { margin: 2px 0 0; color: var(--sage-deep); font-size: 14px; font-weight: 500; }
nav { display: grid; gap: 2px; }
.nav {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; border-radius: 8px;
  background: none; color: var(--ink-soft); text-align: start; font-size: 15px;
}
.nav:hover { background: #F1EFE7; color: var(--ink); }
.nav.on { background: #ECE9DF; color: var(--ink); font-weight: 500; }
.nav span:first-of-type { flex: 1; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.count { font-size: 12px; min-width: 22px; height: 20px; border-radius: 999px; display: grid; place-items: center; padding: 0 6px; background: var(--wait-mist); color: #5E4614; }
.count.late { background: var(--no-mist); color: #7C3A28; }
.side-foot { margin-top: auto; display: grid; gap: 12px; padding: 0 8px; }
.side-foot select { width: 100%; }
.computer { margin: 0; font-size: 13px; color: var(--muted); }
.computer span { color: var(--ink-soft); }
.side-foot .quiet { justify-self: start; }

.canvas { overflow-y: auto; padding: 28px var(--gut) 56px; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.title-row h1 { font: 500 28px/1.15 var(--display); letter-spacing: -.01em; margin: 0 0 4px; }
.finding { margin: 0; color: var(--ink-soft); font-size: 15px; }
.finding strong { color: var(--ink); font-weight: 600; }
.finding strong.bad { color: var(--no); }
.title-side { margin: 0; color: var(--muted); font-size: 14px; }

.panel { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r); padding: 20px; margin-bottom: 16px; }
.panel h2 { font: 500 18px/1.2 var(--display); margin: 0 0 14px; }
.panel h2 .n { font: 400 14px var(--text); color: var(--muted); margin-inline-start: 6px; }
.empty { color: var(--muted); margin: 8px 0; }
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.split .panel { margin-bottom: 16px; }

/* ------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { font-weight: 500; font-size: 12.5px; color: var(--muted); text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
th.num { text-align: end; }
th.focus { color: var(--sage-deep); }
td { padding: 10px 12px; border-bottom: 1px solid #EEEBE1; vertical-align: middle; }
th:first-child, td:first-child { padding-inline-start: 20px; }
th:last-child, td:last-child { padding-inline-end: 20px; }
tbody tr:hover { background: var(--sage-wash); }
tfoot td { border-bottom: 0; font-weight: 600; }
.fam { font-weight: 500; }
td .sub { font-size: 12.5px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone a { text-decoration: none; color: var(--ink-soft); white-space: nowrap; }

.side-tag, .pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; white-space: nowrap; }
.side-tag.groom { background: var(--groom-mist); color: #3C5366; }
.side-tag.bride { background: var(--mauve-mist); color: #6A5557; }
.side-tag.shared { background: var(--shared-mist); color: var(--shared); }
.pill { border: 1px solid transparent; }
.pill.coming { background: var(--yes-mist); color: #3D5C31; }
.pill.notComing { background: var(--no-mist); color: #7C3A28; }
.pill.maybe { background: var(--wait-mist); color: #5E4614; }
.pill.pending { background: none; border: 1px dashed #CFCBBB; color: var(--muted); }
.pill:hover { border-color: var(--sage-deep); }
.by-guest { color: var(--sage-deep); font-size: 15px; line-height: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar-count { margin-inline-start: auto; color: var(--muted); font-size: 14px; }

/* The evening ledger: one column per event, confirmed over invited. */
.ledger {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r); overflow: hidden;
}
.ledger-col {
  display: grid; gap: 2px; text-align: start; padding: 16px 18px; border: 0; background: none;
  border-inline-start: 1px solid var(--hairline); transition: background .15s;
}
.ledger-col:first-child { border-inline-start: 0; }
.ledger-col:hover { background: var(--sage-wash); }
.ledger-col.on { background: var(--sage-wash); box-shadow: inset 0 -3px 0 var(--sage-deep); }
.ledger-name { font-weight: 500; font-size: 14px; }
.ledger-date { color: var(--muted); font-size: 13px; }
.ledger-fig { margin-top: 8px; }
.ledger-fig b { font: 500 30px/1 var(--display); }
.ledger-fig span { color: var(--muted); font-size: 15px; }
.ledger-bar { display: flex; height: 6px; border-radius: 3px; background: var(--shared-mist); overflow: hidden; margin: 8px 0 4px; }
.ledger-bar i { display: block; height: 100%; }
.ledger-bar .yes { background: var(--yes); }
.ledger-bar .wait { background: #E3CF9E; }
.ledger-bar .no { background: #D9A796; }
.ledger-meta { color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------- budget */

.figures { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 0; }
.fig { padding: 18px 20px; border-inline-start: 1px solid var(--hairline); display: grid; gap: 4px; }
.fig:first-child { border-inline-start: 0; }
.fig .label { color: var(--muted); font-size: 13px; }
.fig .value { font: 500 24px/1.1 var(--display); white-space: nowrap; }
.fig.main .value { font-size: 30px; color: var(--sage-deep); }
.plan-bar { grid-column: 1 / -1; position: relative; display: flex; height: 10px; margin: 4px 20px 0; border-radius: 5px; background: var(--shared-mist); }
.plan-bar i { display: block; height: 100%; }
.plan-bar i:first-child { border-start-start-radius: 5px; border-end-start-radius: 5px; }
.plan-bar .paid { background: var(--sage-deep); }
.plan-bar .owed { background: var(--sage); }
.plan-bar .free { background: var(--sage-mist); }
.plan-bar .limit { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--no); }
.plan-key { grid-column: 1 / -1; margin: 8px 20px 16px; color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.plan-key .k { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-inline-start: 10px; }
.plan-key .k:first-child { margin-inline-start: 0; }
.k.paid { background: var(--sage-deep); } .k.owed { background: var(--sage); } .k.free { background: var(--sage-mist); }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 170px minmax(0, 1fr) 110px; gap: 12px; align-items: center; font-size: 14px; }
.bar-track { position: relative; height: 10px; background: var(--paper); border-radius: 5px; }
.bar-track i { display: block; height: 100%; border-radius: 5px; background: var(--sage); }
.bar-track i.over { background: var(--no); }
.bar-track .cap { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-soft); }
.bar-value { text-align: end; white-space: nowrap; }
.due { list-style: none; margin: 0; padding: 0; }
.due li { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid #EEEBE1; font-size: 14px; }
.due li:last-child { border-bottom: 0; }
.due-date { color: var(--ink-soft); }
.due li.late .due-date { color: var(--no); font-weight: 500; }
.due .sub { display: inline; }

/* -------------------------------------------------------------- tasks */

.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #EEEBE1; }
.task:last-child { border-bottom: 0; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--sage); background: var(--card); display: grid; place-items: center; padding: 0; transition: background .15s; }
.check svg { width: 15px; height: 15px; fill: none; stroke: var(--paper); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.check:hover { background: var(--sage-mist); }
.check[aria-pressed=true] { background: var(--sage-deep); border-color: var(--sage-deep); }
.check[aria-pressed=true] svg { opacity: 1; }
.task-title { font-weight: 500; }
.is-done .task-title { color: var(--muted); text-decoration: line-through; }
.task-when { color: var(--ink-soft); font-size: 14px; white-space: nowrap; }
.tasks-group.late h2 { color: var(--no); }
.tasks-group > .quiet { margin: 0 0 4px; }

/* ----------------------------------------------------------- calendar */

.month-nav { display: flex; gap: 6px; }
.cal { padding: 0; overflow: hidden; }
.cal-key { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--hairline); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wd { padding: 8px 10px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--hairline); }
.day { min-height: 112px; padding: 6px 6px 8px; border-bottom: 1px solid #EEEBE1; border-inline-start: 1px solid #EEEBE1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.day:nth-child(7n + 1) { border-inline-start: 0; }
.day.weekend { background: #FBFAF5; }
.day.other { background: var(--paper); }
.day.other .day-n { color: #B7B8AE; }
.day-n { font-size: 13px; color: var(--ink-soft); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.day.today .day-n { background: var(--sage-deep); color: var(--paper); font-weight: 600; }
.item { display: block; font-size: 12px; line-height: 1.35; padding: 2px 6px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item b { font-weight: 600; }
.item.event { background: var(--sage-deep); color: var(--paper); }
.item.appointment { border: 1px solid var(--sage); color: var(--sage-deep); background: var(--card); }
.item.task { background: var(--sage-wash); color: var(--ink-soft); }
.item.task.done { text-decoration: line-through; color: var(--muted); }
.item.payment { background: var(--wait-mist); color: #5E4614; }
.item.key { display: inline-block; }
.more { font-size: 12px; color: var(--muted); padding: 0 6px; }

/* ------------------------------------------------------------ dialogs */

dialog { border: 0; border-radius: 16px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(38, 41, 31, .2); }
dialog::backdrop { background: rgba(38, 41, 31, .35); }
.reply-form { padding: 24px; display: grid; gap: 14px; }
.reply-form h2 { font: 500 22px/1.2 var(--display); margin: 0; }
.reply-form .sub { margin-top: -10px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--sage-deep); background: var(--sage-wash); }
.choice input { accent-color: var(--sage-deep); margin: 0; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--ink-soft); }
.field[hidden] { display: none; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.toast { position: fixed; inset-inline-start: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 10px; font-size: 14px; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
[dir=rtl] .toast { transform: translate(50%, 20px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
[dir=rtl] .toast.on { transform: translate(50%, 0); }
.noscript { padding: 24px; }

[dir=rtl] .title-row h1, [dir=rtl] .link h1, [dir=rtl] .panel h2, [dir=rtl] .ledger-fig b, [dir=rtl] .fig .value { font-family: Fraunces, Plex, serif; letter-spacing: 0; }

/* ------------------------------------------------------------- narrow */

@media (max-width: 960px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fig:nth-child(odd) { border-inline-start: 0; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  :root { --gut: 16px; }
  .link { grid-template-columns: 1fr; gap: 32px; padding-top: 24px; }
  .link h1 { font-size: 30px; margin-top: 24px; }
  .link-code { padding: 24px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border-inline-end: 0; border-bottom: 1px solid var(--hairline); overflow: visible; }
  .side .wedding { flex: 1; min-width: 0; }
  .wedding-date, .side-foot .computer { display: none; }
  nav { grid-auto-flow: column; width: 100%; overflow-x: auto; }
  .nav { height: 34px; }
  .side-foot { margin: 0; grid-auto-flow: column; width: 100%; align-items: center; }
  .title-row { flex-direction: column; align-items: flex-start; }
  .bars li { grid-template-columns: 110px minmax(0, 1fr) 90px; }
  input[type=search] { min-width: 0; flex: 1 1 100%; }
  .day { min-height: 64px; }
  .item { font-size: 10.5px; padding: 1px 3px; }
  .item b { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* The page a phone's camera opens from the QR code (l.html). */
.phone-help { max-width: 560px; margin: 0 auto; padding: 32px 16px 48px; }
.phone-help h1 { font: 500 30px/1.15 var(--display); letter-spacing: -.01em; margin: 32px 0 16px; }
.phone-help h2 { font: 500 22px/1.2 var(--display); margin: 40px 0 12px; }
.phone-help .steps { font-size: 17px; }

/* The wedding's plan, from the admin console's settings and its Pro date. */
.wedding-plan { margin-top: 6px; font-size: 13px; color: var(--muted, #6E7064); }
.wedding-plan.pro { color: var(--sage-deep, #4E5E44); }
.locked { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; line-height: 20px; background: #FBEFE9; color: #8A7577; font-weight: 500; }
