/* meAI tracker. The look follows meplatform.ai: Arial, near-black ink on a soft lavender paper, meAI purple
   for accents and labels, black rounded buttons, white rounded cards. Phone first: one column, 16px gutters,
   compact rows and number tiles, no wide tables, nothing that scrolls sideways. Logical properties throughout,
   so Arabic (dir="rtl") mirrors without a second stylesheet. */
@font-face { font-family: "Carlito"; src: url("/fonts/carlito-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Carlito"; src: url("/fonts/carlito-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("/fonts/plex-arabic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Plex Arabic"; src: url("/fonts/plex-arabic-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }

:root {
  --bg: #f7f5fb; --surface: #ffffff; --ink: #0f0f0f; --ink2: #16101f; --muted: #5b5368; --faint: #7a7383;
  --line: #ece6f2; --line2: #ddd4e8;
  --accent: #6310d1; --accent-soft: #f1e9fb; --lav: #c6a0f8;
  --warn: #8f5200; --warn-soft: #fcf1df; --ok: #1d7a4c; --ok-soft: #e3f4ea; --bad: #b3261e;
  --shadow: 0 10px 32px rgba(16, 10, 31, .06), 0 1px 2px rgba(16, 10, 31, .05);
  --font: "Plex Arabic", Aptos, Calibri, Carlito, Arial, "Helvetica Neue", Helvetica, sans-serif;
  --r: 18px;
  color-scheme: light;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); overflow-x: hidden; padding-block: env(safe-area-inset-top, 0) env(safe-area-inset-bottom, 0) }
html[lang="ar"] body { font-size: 15.5px; line-height: 1.65 }
.wrap { max-width: 1180px; margin-inline: auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)) }
h1, h2, h3 { font-weight: 700; margin: 0; color: var(--ink2); text-wrap: balance }
h1 { font-size: clamp(34px, 5vw, 48px); line-height: 1; letter-spacing: -.02em }
html[lang="ar"] h1, html[lang="ar"] h2 { letter-spacing: 0 }
h2 { font-size: clamp(21px, 2.4vw, 25px); letter-spacing: -.01em }
p { margin: 0 }
button { font: inherit; color: inherit }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px }
.sr { position: absolute; inset-inline-start: -9999px }
.label { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent) }
html[lang="ar"] .label { letter-spacing: 0; font-size: 12.5px }
.sub { color: var(--muted); font-size: 15px }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; unicode-bidi: isolate }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 14px }
.link.center { justify-self: center; margin-top: 4px }
.boot { min-height: 100vh }

/* brand */
.logos { display: flex; align-items: center; gap: 12px; min-width: 0 }
.logos .meai { height: 20px; width: auto }
.logos .sep { width: 1px; height: 24px; background: var(--line2) }
.logos .cl { display: flex; align-items: center; gap: 8px; min-width: 0 }
.logos .cl img { height: 30px; width: auto }
.logos .cl b { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }

/* sign in */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px }
.gate-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 26px; box-shadow: var(--shadow); padding: 26px 22px; display: grid; gap: 10px }
.gate-top { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.gate-card h1 { font-size: 28px; margin-top: 18px }
.gate-card .sub { margin-bottom: 8px }
#login-form, #link-panel { display: grid; gap: 8px }
#login-form label { font-size: 13px; color: var(--muted) }
.err { color: var(--bad); font-size: 13.5px }

/* buttons and inputs */
.btn { border: 0; background: var(--ink); color: var(--surface); border-radius: 14px; padding: 10px 16px; min-height: 40px; font-weight: 700; font-size: 14px; cursor: pointer }
.btn:hover { opacity: .88 }
.btn.wide { width: 100%; padding: 13px; font-size: 15px; margin-top: 6px }
.btn.small { padding: 6px 13px; min-height: 34px; font-size: 13px }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); border-radius: 999px }
.btn.ghost[aria-pressed="true"] { box-shadow: inset 0 0 0 2px currentColor }
.btn.ok { background: var(--accent); color: #fff }
.btn.ghost.ok { background: var(--surface); color: var(--ok) }
.btn.warnb { background: var(--surface); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); border-radius: 999px }
.btn.warnb[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--warn) }
.btn.danger { background: var(--surface); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); border-radius: 999px }
.btn:disabled { opacity: .5; cursor: default }
.btns { display: flex; gap: 8px; flex-wrap: wrap }
select, textarea, input[type=text], input[type=email], input[type=password], input[type=date], input[type=number] {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; padding: 9px 12px; max-width: 100%; min-width: 0 }
#login-form input { width: 100% }
textarea { width: 100%; resize: vertical }
.lang-btn { background: var(--surface); border: 0; box-shadow: inset 0 0 0 1px var(--line2); border-radius: 999px; padding: 6px 13px; min-height: 36px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: var(--font) }

/* header */
.top { background: var(--surface); border-block-end: 1px solid var(--line) }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 18px 0 }
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0 }
.top-title { padding-block: 20px 24px; display: grid; gap: 8px }
.menu { position: relative }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-weight: 700; cursor: pointer }
.menu-pop { position: absolute; inset-inline-end: 0; top: 44px; z-index: 15; background: var(--surface); border-radius: 16px; box-shadow: 0 16px 40px rgba(15, 8, 32, .18); padding: 8px; min-width: 220px; display: grid }
.menu-who { padding: 8px 10px 10px; display: grid; gap: 4px; border-block-end: 1px solid var(--line); margin-block-end: 4px }
.menu-pop button { text-align: start; background: none; border: 0; padding: 10px; border-radius: 10px; cursor: pointer; font-size: 14.5px }
.menu-pop button:hover { background: var(--bg) }
.role { justify-self: start; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-radius: 999px; padding: 2px 9px }
.role.meai { background: var(--accent-soft); color: var(--accent) }
.role.client { background: var(--bg); color: var(--ink2); box-shadow: inset 0 0 0 1px var(--line2) }

/* header key figures */
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 12px 0 0 }
.fig { background: var(--bg); border-radius: 16px; padding: 14px 16px; min-width: 0; display: grid; gap: 2px; align-content: start }
.fig dt { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent) }
html[lang="ar"] .fig dt { letter-spacing: 0; font-size: 13px }
.fig dd { margin: 0; display: grid; gap: 2px }
.fig b { font-size: 21px; line-height: 1.2; color: var(--ink2); letter-spacing: -.01em }
.fig.n b { font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums }
.fig dd span { font-size: 14px; color: var(--muted) }

/* page grid: one column on phones; from 960px the plan sits beside a side column, under a full-width timeline */
.grid { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 28px; padding-block: 24px 48px;
  grid-template-areas: "turn" "fresh" "dates" "plan" "side" }
.turn { grid-area: turn } .fresh { grid-area: fresh } .plan { grid-area: plan; min-width: 0 } .side { grid-area: side; min-width: 0; display: grid; gap: 28px }
.dates-panel { grid-area: dates }
.turn, .fresh, .dates-panel, .plan { margin-block-end: 26px }
@media (min-width: 960px) {
  .grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start;
    grid-template-areas: "turn turn" "fresh fresh" "dates dates" "plan side" }
  .plan { margin-block-end: 0 }
}
.panel { display: grid; gap: 10px; min-width: 0 }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px }
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow) }
.empty { background: var(--surface); border: 1px dashed var(--line2); border-radius: var(--r); padding: 18px; color: var(--muted); margin: 0 }

/* your turn */
.turn { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px }
.turn-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap }
.turn-head h2 { font-size: 20px }
.turn-none { color: var(--muted) }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
.tile { border: 0; background: var(--bg); border-radius: 14px; padding: 10px 12px; text-align: start; display: grid; gap: 2px; align-content: start; cursor: pointer; min-height: 72px }
.tile b { font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--faint) }
.tile span { font-size: 13px; line-height: 1.3; color: var(--muted) }
.tile.has b { color: var(--accent) }
.tile.has span { color: var(--ink2) }
.tile.on { background: var(--ink); } .tile.on b, .tile.on span { color: #fff }
.tile:disabled { cursor: default }
.turn-list { list-style: none; margin: 0; padding: 0; border-block-start: 1px solid var(--line) }
.turn-list li { border-block-end: 1px solid var(--line) }
.turn-list li:last-child { border-block-end: 0 }
.turn-list button { width: 100%; background: none; border: 0; text-align: start; display: grid; grid-template-columns: minmax(0, 1fr) 16px; gap: 2px 10px; padding: 12px 2px; cursor: pointer; min-height: 48px }
.tl-t { font-size: 15px; line-height: 1.3; grid-column: 1 }
.tl-s { font-size: 13px; color: var(--muted); grid-column: 1 }
.chev { grid-column: 2; grid-row: 1 / 3; align-self: center; width: 8px; height: 8px; border-block-start: 2px solid var(--faint); border-inline-end: 2px solid var(--faint); transform: rotate(45deg) }
[dir="rtl"] .chev { transform: rotate(-45deg) }
@media (min-width: 760px) {
  .turn { grid-template-columns: 220px minmax(0, 1fr); align-items: center; padding: 12px 14px 12px 22px; gap: 10px 20px }
  [dir="rtl"] .turn { padding: 12px 22px 12px 14px }
  .turn-head { display: grid; gap: 0 }
  .turn-head .sub { font-size: 14px }
  .tile { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 16px }
  .tile span { font-size: 15px }
  .turn-list, .turn-none { grid-column: 1 / -1 }
  .turn-none { grid-column: 2 }
}

/* new since last visit */
.fresh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--accent-soft); color: var(--ink2); border-radius: 14px; padding: 10px 14px; font-size: 14px }
.fresh .link { margin-inline-start: auto }
.fresh-hello { color: var(--muted) }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; display: inline-block }
.new { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; white-space: nowrap }

/* tabs */
.seg { display: flex; gap: 8px; flex-wrap: wrap; margin-block-end: 12px }
.seg-b { border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line2); border-radius: 999px; padding: 9px 18px; min-height: 42px; cursor: pointer; font-size: 15.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap }
.seg-b[aria-selected="true"] { background: var(--ink); color: #fff; box-shadow: none }
.seg-b small { font-weight: 400; opacity: .65; font-size: 13.5px }
.tab-note { color: var(--muted); font-size: 14.5px; margin-block-end: 14px }

/* milestones */
.ms-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px }
.ms { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden }
.ms.attn { box-shadow: var(--shadow), inset 0 0 0 2px var(--lav) }
.ms-head { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px 14px; background: none; border: 0; text-align: start; cursor: pointer }
.ms-num { font-size: 21px; font-weight: 800; color: var(--lav); line-height: 1.3; font-variant-numeric: tabular-nums }
.ms-main { display: grid; gap: 3px; min-width: 0 }
.ms-title { font-weight: 700; font-size: 18px; line-height: 1.2 }
.ms-meta { color: var(--muted); font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden }
.ms.open .ms-meta { -webkit-line-clamp: unset }
.ms-tags { display: flex; gap: 6px; flex-wrap: wrap }
.ms-side { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap }
.count { font-size: 14px; font-weight: 700; color: var(--muted) }
.bar { width: 74px; height: 6px; border-radius: 3px; background: var(--accent-soft); overflow: hidden }
.bar i { display: block; height: 100%; background: var(--accent) }
.ms-body { border-block-start: 1px solid var(--line); padding: 14px; display: grid; gap: 12px }
.ms-summary { max-width: 68ch; color: var(--ink2) }
.gate-line, .pay-line { display: grid; gap: 2px; font-size: 14px; background: var(--bg); border-radius: 12px; padding: 10px 12px }
.pay-line { grid-template-columns: minmax(0, 1fr) auto; align-items: center }
.pay-line .label { grid-column: 1 / -1 }
.prod { font-size: 11px; font-weight: 700; color: var(--muted); border: 1px dashed var(--line2); border-radius: 999px; padding: 1px 8px; white-space: nowrap }
.prod-note { font-size: 13px; color: var(--muted); border-inline-start: 2px dashed var(--line2); padding-inline-start: 12px }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap }
@media (min-width: 600px) { .ms-head { padding: 18px 20px; grid-template-columns: 40px minmax(0, 1fr) auto } .ms-body { padding: 16px 18px 18px; padding-inline-start: 68px } }
@media (max-width: 560px) { .ms-head { grid-template-columns: 28px minmax(0, 1fr) } .ms-side { grid-column: 2; justify-content: flex-start } }

.signoff { border-radius: 14px; padding: 12px 14px; background: var(--accent-soft); display: grid; gap: 10px; font-size: 14px }
.signoff.done { background: var(--ok-soft) }
@media (min-width: 600px) { .signoff { grid-template-columns: minmax(0, 1fr) auto; align-items: center } }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0 }
.st-planned, .st-open, .st-waiting, .st-paynone { background: var(--bg); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line2) }
.st-ready, .st-payinvoiced { background: var(--accent-soft); color: var(--accent) }
.st-in_review, .st-in_progress { background: var(--warn-soft); color: var(--warn) }
.st-signed_off, .st-confirmed, .st-received, .st-paypaid { background: var(--ok-soft); color: var(--ok) }
.st-live { background: var(--ink); color: #fff }
.chip { font-size: 11.5px; font-weight: 700; color: var(--muted); border-radius: 999px; padding: 1px 8px; box-shadow: inset 0 0 0 1px var(--line2); white-space: nowrap }
.chip.ok { color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok) }
.chip.chg { color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn) }

/* points */
.items { list-style: none; margin: 0; padding: 0; border-block-start: 1px solid var(--line) }
.item { border-block-end: 1px solid var(--line) }
.item:last-child { border-block-end: 0 }
.item-head { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 12px 0; background: none; border: 0; text-align: start; cursor: pointer; min-height: 48px }
.item-n { font-size: 12.5px; font-weight: 700; color: var(--faint); padding-top: 2px; font-variant-numeric: tabular-nums }
.item-main { display: grid; gap: 4px; min-width: 0 }
.item-t { font-size: 15px; line-height: 1.3 }
.item-tags { display: flex; gap: 6px; flex-wrap: wrap }
.item-tags:empty { display: none }
.item-body { padding: 0 0 14px; display: grid; gap: 10px }
@media (max-width: 420px) { .item-head { grid-template-columns: 30px minmax(0, 1fr) } .item-head .pill { grid-column: 2; justify-self: start } }
.side-by { display: grid; gap: 10px }
@media (min-width: 700px) { .side-by { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) } }
.say { border-radius: 14px; padding: 10px 12px; font-size: 14px; min-width: 0 }
.say p { margin-top: 4px; white-space: pre-line }
.say.client { background: var(--bg) } .say.client .label { color: var(--muted) }
.say.meai { background: var(--accent-soft) }
.review { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); padding: 10px 12px }
.review .lbl { font-weight: 700 }
.review .state { color: var(--muted); flex: 1 1 160px }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted) }
.notes { display: grid; gap: 10px; margin-top: 6px }
.note { font-size: 14px; border-inline-start: 2px solid var(--line2); padding-inline-start: 12px }
.note-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap }
.note p { margin-top: 2px; white-space: pre-line; overflow-wrap: anywhere }
.who { font-weight: 700; font-size: 13px }
.who.client { color: var(--ink2) } .who.meai { color: var(--accent) } .who.both { color: var(--muted) }
.at { color: var(--faint); font-size: 12.5px }
.msg { font-size: 13.5px; color: var(--muted); margin-top: 4px }
.cform { display: grid; gap: 8px }

.dates { list-style: none; margin: 0; padding: 4px 16px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow) }
.dates li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 0; position: relative }
.dates li + li { border-block-start: 1px solid var(--line) }
.dates .mark { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line2); background: var(--surface); margin-top: 4px }
.dates li.done .mark { background: var(--accent); border-color: var(--accent) }
.dates li.next .mark { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft) }
.d-main { display: grid; gap: 1px; min-width: 0 }
.d-what { font-size: 15.5px; line-height: 1.3 }
.dates li.done .d-what { color: var(--muted) }
.d-when { font-size: 14px; font-weight: 700; color: var(--faint) }
.dates li.next .d-when { color: var(--accent) }
.dates li.done .d-when { color: var(--accent) }
.d-when.agree { font-weight: 400; font-style: italic }

/* plan and actual: a list on phones, a timeline across the page from 760px */
.dates-panel .panel-head { justify-content: flex-start; gap: 12px }
@media (min-width: 760px) {
  .dates { display: flex; padding: 6px 0 0; background: none; box-shadow: none; border-radius: 0 }
  .dates li { flex: 1 1 0; min-width: 0; display: block; padding: 22px 16px 0 0; border: 0 }
  [dir="rtl"] .dates li { padding: 22px 0 0 16px }
  .dates li + li { border: 0 }
  .dates li::before { content: ""; position: absolute; top: 7px; inset-inline: 0; height: 2px; background: var(--line2) }
  .dates li.done::before { background: var(--accent) }
  .dates .mark { position: absolute; top: 1px; inset-inline-start: 0; margin: 0; z-index: 1 }
  .dates .d-main { display: grid; gap: 2px }
  .dates .d-when { order: -1; font-size: 13.5px; font-weight: 700; line-height: 1.3 }
  .dates .d-what { font-size: 15px; line-height: 1.3 }
  .dates li.done .d-what { color: var(--ink2) }
  .dates .link { margin-top: 6px }
}

/* compact rows (waiting on, payments) */
.rows { list-style: none; margin: 0; padding: 0 16px }
.rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px 0; align-items: start }
.rows li + li { border-block-start: 1px solid var(--line) }
.r-main { display: grid; gap: 2px; min-width: 0 }
.r-t { font-size: 15.5px; line-height: 1.35 }
.r-s { font-size: 14px; color: var(--muted) }
.r-s.late { color: var(--bad); font-weight: 700 }
.r-n { font-size: 14px; color: var(--muted) }
.r-side { display: grid; gap: 6px; justify-items: end; align-content: start }
.rows li.received .r-t { color: var(--muted) }
.rows li.total { border-block-start: 2px solid var(--ink2); align-items: center }
.rows li.total b { font-size: 15.5px }
.pay .num { font-size: 14.5px }
.grp { margin-top: 4px }
.more { justify-self: start }

/* updates */
.addform { display: grid; gap: 8px; padding: 14px }
.addform .controls select { flex: 1 1 140px }
.log { list-style: none; margin: 4px 0 0; padding: 0 }
.log li { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-block-end: 1px solid var(--line); font-size: 14.5px; line-height: 1.4 }
.log .d { font-size: 12.5px; font-weight: 700; color: var(--faint); padding-top: 2px }
.log-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap }
.log .who { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase }
html[lang="ar"] .log .who { letter-spacing: 0; font-size: 12.5px }
.log .ms-ref { color: var(--muted); font-size: 12.5px }
.log p { margin-top: 2px; white-space: pre-line; overflow-wrap: anywhere }
.log .empty-li { display: block; color: var(--muted) }

.foot { color: var(--faint); font-size: 13px; padding-block: 0 32px }

/* modal and toast */
.modal { position: fixed; inset: 0; background: rgba(15, 8, 32, .5); display: grid; place-items: center; padding: 12px; z-index: 20 }
.modal-card { width: 100%; max-width: 600px; max-height: calc(100vh - 24px); overflow: auto; background: var(--surface); border-radius: 24px; box-shadow: 0 24px 60px rgba(15, 8, 32, .34); padding: 20px; display: grid; gap: 12px }
.modal-card h2 { font-size: 22px }
#modal-form { display: grid; gap: 10px }
#modal-form .f { display: grid; gap: 4px; min-width: 0 }
#modal-form .f > span { font-size: 13px; font-weight: 700; color: var(--muted) }
#modal-form .f.check { grid-template-columns: auto 1fr; align-items: center; gap: 8px }
#modal-form .bi-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; align-items: start }
#modal-form .bi-row small { font-size: 11px; font-weight: 700; color: var(--faint); padding-top: 11px }
#modal-form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px }
#modal-form input, #modal-form select { width: 100% }
#modal-form input[type=checkbox] { width: auto }
#modal-form .f-group { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; margin-top: 6px }
#modal-form .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px }
#modal-form .actions .danger { margin-inline-end: auto }
.toast { position: fixed; inset-inline: 16px; margin-inline: auto; width: fit-content; bottom: max(20px, env(safe-area-inset-bottom, 0px)); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 14px; font-size: 14px; z-index: 30; max-width: calc(100vw - 32px) }
.flash { animation: flash 1.6s ease-out }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px var(--lav) } 100% { box-shadow: none } }
@media (prefers-reduced-motion: no-preference) { .ms-body, .item-body, .turn-list { animation: in .18s ease-out } @keyframes in { from { opacity: .4; transform: translateY(-3px) } } }
@media (max-width: 599px) { .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px } .fig { padding: 10px 12px } .fig b { font-size: 15px } .fig.n b { font-size: 22px } .fig dd span { font-size: 12.5px } }
