/* Mahina Club — admin console */

body.admin-mode { background: var(--paper); }
.admin { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--line); padding: 20px 14px; background: #fff; }
.side .wordmark { font-size: 18px; padding: 4px 10px 22px; }
.side nav { display: grid; gap: 2px; }
.side nav a {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; text-decoration: none;
  font-weight: 600; font-size: 15px; color: var(--text);
}
.side nav a:hover { background: var(--mist); color: var(--ink); }
.side nav a[aria-current="page"] { background: var(--night); color: #fff; }
.side nav a .icon { color: currentColor; opacity: .8; }
.side nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-foot a, .side-foot button { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); border: 0; background: none; cursor: pointer; text-align: left; }
.side-foot a:hover, .side-foot button:hover { background: var(--mist); color: var(--ink); }
.side-who { padding: 6px 12px 10px; font-size: 13px; color: var(--muted); }
.side-who b { display: block; color: var(--ink); font-size: 14px; }
.admin-top { display: none; }

.admin-main { padding: 36px clamp(20px, 3.5vw, 56px) 96px; max-width: 1180px; width: 100%; }
.a-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.a-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; }
.a-head .back { margin: 0 0 8px; }
.a-sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.a-section { margin-top: 44px; }
.a-section > h2 { font-size: 20px; font-weight: 750; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

@media (max-width: 900px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .side.open { display: flex; position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; }
  .admin-top { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 10; }
  .admin-top .wordmark { font-size: 17px; }
  .admin-main { padding-top: 24px; }
}

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.stat { padding: 20px 20px 22px 0; text-decoration: none; display: block; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat b { display: block; font-size: 44px; font-weight: 850; letter-spacing: -0.04em; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 14px; color: var(--muted); font-weight: 600; }
a.stat:hover b { color: var(--accent); }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr 1fr; } .stat:nth-child(3) { padding-left: 0; border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

.todo { display: grid; gap: 10px; margin-bottom: 36px; }
.todo a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--moon); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 650; }
.todo a:hover { background: var(--moon-2); }
.todo a .icon { color: var(--accent); }
.todo a span.go { margin-left: auto; font-size: 14px; color: var(--muted); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-size: 13px; font-weight: 700; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--wash); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .strong { font-weight: 700; color: var(--ink); }
.tbl .sub { font-size: 13px; color: var(--muted); }
.tbl .date { white-space: nowrap; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; position: relative; } /* keeps hidden labels inside the scroll area */
.tbl .actions { text-align: right; white-space: nowrap; }

.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #fff; background: var(--muted); white-space: nowrap; }
.pill.published, .pill.open, .pill.sent, .pill.approved, .pill.yes { background: var(--good); }
.pill.draft, .pill.held, .pill.queued, .pill.pending { background: var(--plumeria); }
.pill.cancelled, .pill.failed, .pill.closed, .pill.hidden { background: var(--faint); }
.pill.failed { background: var(--accent); }

/* tabs */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 30px; overflow-x: auto; }
.tabs a, .tabs button { border: 0; background: none; padding: 12px 0; font-weight: 650; font-size: 15px; color: var(--muted); text-decoration: none; cursor: pointer; box-shadow: inset 0 -3px 0 transparent; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs [aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.tabs .n { color: var(--faint); font-weight: 600; margin-left: 4px; }

/* editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.editor form, .stack { display: grid; gap: 18px; }
.panel { display: grid; gap: 22px; }
.panel-block { display: grid; gap: 10px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.panel-block:last-child { border-bottom: 0; }
.panel-block > .field-label { margin-bottom: 2px; }
.cover-pick { aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; background: var(--mist); display: grid; place-items: center; color: var(--muted); }
.cover-pick img { width: 100%; height: 100%; object-fit: cover; }
.savebar { grid-column: 1 / -1; position: sticky; bottom: 0; z-index: 5; display: flex; gap: 12px; justify-content: flex-end; padding: 14px 0; background: var(--paper); border-top: 1px solid var(--line); }
@media (max-width: 1100px) { .editor { grid-template-columns: 1fr; gap: 36px; } .editor .panel { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 36px; align-items: start; } .editor .panel-block { border-bottom: 0; border-top: 1px solid var(--line); padding: 22px 0 0; } }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--night); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 3px solid var(--lagoon); outline-offset: 2px; }

.chips-edit { display: flex; flex-wrap: wrap; gap: 8px; }
.editor form.add-tag, .add-tag { display: flex; gap: 6px; align-items: center; }
.add-tag input { height: 32px; border-radius: 999px; font-size: 14px; width: 130px; padding: 0 12px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c); box-shadow: 0 0 0 2px #fff, 0 0 0 3px transparent; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }

/* slot / question editors */
.rows-edit { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.row-edit { display: grid; grid-template-columns: 28px minmax(140px, 1.4fr) 80px minmax(110px, .8fr) minmax(110px, .8fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row-edit input { height: 40px; font-size: 15px; }
.row-edit .check { font-size: 13px; white-space: nowrap; }
.row-edit .mv { display: grid; }
.row-edit .mv button { height: 18px; width: 26px; border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.row-edit .mv button:hover { color: var(--ink); }
.row-head { display: grid; grid-template-columns: 28px minmax(140px, 1.4fr) 80px minmax(110px, .8fr) minmax(110px, .8fr) auto auto; gap: 10px; font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 0 8px; }

.sheet-card { padding: 26px 0; border-top: 2px solid var(--ink); }
.sheet-card + .sheet-card { margin-top: 30px; }
.sheet-card-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 14px; }
.sheet-card-head h3 { font-size: 20px; }
.roster { margin-top: 10px; }
.roster .slot-name { font-weight: 750; color: var(--ink); padding: 14px 0 4px; display: flex; justify-content: space-between; }
.roster .who { display: grid; grid-template-columns: 1.1fr 1.4fr 1fr auto; gap: 12px; align-items: center; font-size: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.roster .who .muted { font-size: 13px; }
.templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.templates button { text-align: left; border: 1.5px solid var(--line-2); background: #fff; border-radius: 12px; padding: 18px; cursor: pointer; }
.templates button:hover { border-color: var(--ink); }
.templates b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.templates span { color: var(--muted); font-size: 14px; }

.qcard { padding: 22px 0; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.qcard:first-child { border-top: 2px solid var(--ink); }
.qcard-top { display: grid; grid-template-columns: 30px minmax(0, 1fr) 190px auto; gap: 10px; align-items: center; }
.qcard-top .n { font-weight: 800; color: var(--faint); font-variant-numeric: tabular-nums; }
.opt-edit { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.opt-edit .mk { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-2); justify-self: center; }
.opt-edit .mk.sq { border-radius: 4px; }
.opt-edit input { height: 40px; font-size: 15px; }
.qcard-foot { display: flex; justify-content: space-between; align-items: center; padding-left: 40px; gap: 12px; flex-wrap: wrap; }
.qcard-foot .switch { font-size: 14px; }
.add-q { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 700px) { .qcard-top { grid-template-columns: 24px 1fr; } .qcard-top select, .qcard-top .row { grid-column: 2; } }

/* gallery admin */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pthumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--mist); cursor: pointer; border: 0; padding: 0; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.pthumb .sel { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: inset 0 0 0 2px var(--line-2); display: grid; place-items: center; }
.pthumb .sel .icon { width: 16px; height: 16px; stroke-width: 2.6; color: #fff; opacity: 0; }
.pthumb.on { box-shadow: 0 0 0 3px var(--night); }
.pthumb.on .sel { background: var(--night); box-shadow: none; }
.pthumb.on .sel .icon { opacity: 1; }
.pthumb .pill { position: absolute; bottom: 8px; left: 8px; }
.pthumb.hidden img { opacity: .45; }
.bulk { position: sticky; top: 0; z-index: 6; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--night); color: #fff; padding: 10px 12px 10px 18px; border-radius: 14px; margin-bottom: 14px; }
.bulk b { margin-right: 6px; }
.bulk .btn.ghost { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.bulk select { width: auto; height: 36px; border-radius: 999px; font-size: 14px; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 36px; }
@media (max-width: 800px) { .upload-row { grid-template-columns: 1fr; } }

/* inbox */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); border-top: 2px solid var(--ink); min-height: 520px; }
.inbox-list { border-right: 1px solid var(--line); max-height: 72vh; overflow-y: auto; }
.inbox-item { display: block; width: 100%; text-align: left; border: 0; background: none; border-bottom: 1px solid var(--line); padding: 14px 16px 14px 0; cursor: pointer; }
.inbox-item:hover { background: var(--wash); }
.inbox-item[aria-selected="true"] { background: var(--night); color: #fff; padding-left: 14px; }
.inbox-item[aria-selected="true"] * { color: #fff !important; }
.inbox-item b { display: flex; justify-content: space-between; gap: 10px; color: var(--ink); font-size: 15px; }
.inbox-item b time { font-weight: 500; font-size: 13px; color: var(--muted); }
.inbox-item .s { font-size: 14px; color: var(--ink); margin-top: 2px; }
.inbox-item .p { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item.unread b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin: 6px 0 0 -14px; position: absolute; }
.inbox-item { position: relative; padding-left: 14px; }
.inbox-read { padding: 6px 0 0 32px; }
.inbox-read h2 { font-size: 26px; margin-bottom: 6px; }
.inbox-read .from { color: var(--muted); font-size: 15px; margin-bottom: 26px; }
.inbox-read .body { white-space: pre-wrap; font-size: 17px; max-width: 40em; margin-bottom: 28px; }
@media (max-width: 800px) { .inbox { grid-template-columns: 1fr; } .inbox-read { padding: 24px 0; border-top: 1px solid var(--line); } }

.callout { display: flex; gap: 12px; align-items: flex-start; background: var(--moon); color: var(--ink); padding: 14px 16px; border-radius: 12px; font-size: 15px; margin-bottom: 18px; }
.callout .icon { color: var(--accent); margin-top: 2px; }
.callout a { font-weight: 700; }

.settings-sec { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 36px; padding: 34px 0; border-top: 1px solid var(--line); }
.settings-sec:first-of-type { border-top: 2px solid var(--ink); }
.settings-sec h2 { font-size: 19px; }
.settings-sec form, .settings-sec > .stack { display: grid; gap: 16px; max-width: 620px; }
@media (max-width: 800px) { .settings-sec { grid-template-columns: 1fr; gap: 16px; } }
.list-edit { display: grid; gap: 8px; }
.list-edit .li { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.list-edit .li.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; }
.list-edit .li > * { min-width: 0; }
@media (max-width: 600px) { .list-edit .li.three { grid-template-columns: minmax(0, 1fr) auto; } .list-edit .li.three > input { grid-column: 1; } .list-edit .li.three > button { grid-column: 2; grid-row: 1; } }

.auth { min-height: 100vh; display: grid; place-items: center; background: var(--night); padding: 24px; }
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 20px; padding: 36px; }
.auth-card .wordmark { margin-bottom: 26px; }
.auth-card h1 { font-size: 28px; margin-bottom: 22px; }
.auth-card form { display: grid; gap: 14px; }

.activity { display: grid; }
.activity div { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.activity b { color: var(--ink); }
.activity time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.search { max-width: 320px; height: 40px !important; border-radius: 999px !important; font-size: 15px !important; }
.preview-frame { width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: 10px; }

form.stack > .btn, .stack > div > .btn { justify-self: start; }
.admin > div { min-width: 0; }

.editor > *, .two > * { min-width: 0; }
.editor input, .editor select, .editor textarea { min-width: 0; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.pw-toggle:hover { color: var(--ink); background: var(--mist); }
.auth-or { text-align: center; color: var(--muted); font-size: 14px; margin: 14px 0; }
.auth-card > .btn.block { width: 100%; }
.sections-edit .li { align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); }
.palettes { display: flex; gap: 10px; flex-wrap: wrap; }
.palette { display: inline-flex; align-items: center; gap: 12px; height: 52px; padding: 0 18px 0 8px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--mist); color: var(--ink); font: inherit; font-weight: 700; font-size: 15px; }
.palette:hover { background: var(--mist-2); }
.palette[aria-pressed="true"] { background: var(--night); color: #fff; }
.palette-chip { position: relative; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: inline-block; flex: none; }
.palette-chip i { position: absolute; width: 14px; height: 14px; border-radius: 50%; }
.palette-chip i:first-child { top: 6px; left: 6px; }
.palette-chip i:last-child { bottom: 6px; right: 6px; }
.swatch.theme-default { background: conic-gradient(var(--c) 0 50%, var(--night) 50% 100%); }

/* ---------- accounts ---------- */
.side-foot a.side-who { display: block; height: auto; padding: 8px 12px 10px; font-weight: 500; font-size: 13px; line-height: 1.4; }
.side-foot a.side-who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot a.side-who .role { margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.side-foot a.side-who[aria-current="page"] { background: var(--mist); }
.stats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
@media (max-width: 700px) { .stats { grid-auto-flow: row; grid-template-columns: 1fr 1fr; } }
.perm-list { display: grid; gap: 2px; border-top: 1px solid var(--line); }
.perm { display: grid; grid-template-columns: 20px 1fr; gap: 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.perm input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--night); }
.perm b { display: block; color: var(--ink); font-size: 15px; }
.perm[hidden], .perm-list[hidden] { display: none; }
.seg button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- planning ---------- */
.plan-summary { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.plan-summary > div { padding: 16px 16px 18px 0; }
.plan-summary > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.plan-summary b { display: block; font-size: 30px; font-weight: 850; letter-spacing: -0.03em; color: var(--ink); line-height: 1.05; font-variant-numeric: tabular-nums; }
.plan-summary span { font-size: 13px; color: var(--muted); font-weight: 650; }
@media (max-width: 700px) { .plan-summary { grid-auto-flow: row; grid-template-columns: 1fr 1fr; } .plan-summary > div:nth-child(odd) { padding-left: 0; border-left: 0; } }

.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
@media (max-width: 1100px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-sec + .plan-sec { margin-top: 44px; }
.plan-sec h3, .plan-notes h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 750; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.plan-sec h3 .muted { margin-left: auto; font-size: 13px; font-weight: 650; letter-spacing: 0; }
.plan-list { display: grid; }
.plan-empty { padding: 14px 0; margin: 0; }
.plan-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.plan-row:not(.buy) { grid-template-columns: 28px minmax(0, 1fr) auto; }
.plan-row.done .plan-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.plan-main { min-width: 0; }
.plan-title { font-weight: 650; color: var(--ink); font-size: 15px; line-height: 1.35; display: inline-flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
button.linkish { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
button.linkish:hover { text-decoration: underline; text-underline-offset: 3px; }
.plan-title .kind { color: var(--muted); align-self: center; }
.plan-row .sub { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 4px; font-size: 13px; color: var(--muted); }
.plan-row .sub a { color: var(--muted); }
.plan-row .late { color: var(--accent); font-weight: 700; }
.plan-details { flex-basis: 100%; white-space: pre-line; }
.who-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--mist); color: var(--ink); font-weight: 700; font-size: 12px; }
.who-chip.me { background: var(--night); color: #fff; }
.plan-check { position: relative; width: 24px; height: 24px; margin-top: -1px; cursor: pointer; }
.plan-check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.plan-check span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); color: transparent; transition: background .15s, border-color .15s; }
.plan-check input:checked + span { background: var(--good); border-color: var(--good); color: #fff; }
.plan-check:hover span { border-color: var(--ink); }
.plan-check input:focus-visible + span { outline: 3px solid var(--lagoon); outline-offset: 2px; }
.plan-money { display: grid; justify-items: end; gap: 4px; }
input.money { width: 92px; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; background: #fff; }
.plan-add { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; padding: 12px 0; }
.plan-sec[data-kind="buy"] .plan-add { grid-template-columns: minmax(0, 1fr) 64px auto auto auto; }
.plan-add input, .plan-add select, .assignee select, .assignee input { height: 38px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; min-width: 0; color: var(--text); }
.plan-add input.money { width: 84px; text-align: left; }
.plan-add input.qty { width: 64px; }
.assignee { display: flex; gap: 6px; min-width: 0; }
.assignee input[hidden] { display: none; }
.assignee input { width: 120px; }
.field .assignee select, .field .assignee input { height: 46px; flex: 1; width: auto; }
@media (max-width: 760px) {
  .plan-add, .plan-sec[data-kind="buy"] .plan-add { grid-template-columns: 1fr 1fr; }
  .plan-add > input[name="title"] { grid-column: 1 / -1; }
  .plan-add .assignee { grid-column: 1 / -1; }
  .plan-row, .plan-row:not(.buy) { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .plan-row .plan-money { grid-column: 2; justify-items: start; grid-auto-flow: column; align-items: center; }
}
.plan-notes { position: sticky; top: 24px; }
.plan-note-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; font-size: 15px; resize: vertical; margin-top: 12px; }
.plan-note-form .row { margin: 8px 0 12px; }
.plan-note { padding: 12px 0; border-top: 1px solid var(--line); }
.plan-note-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.plan-note-head b { color: var(--ink); }
.plan-note-head time { color: var(--muted); }
.plan-note-head .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.plan-note p { margin: 4px 0 0; font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }

.plan-cards { display: grid; border-top: 1px solid var(--line); }
.plan-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.plan-card .when .d { display: block; font-size: 36px; font-weight: 850; letter-spacing: -0.04em; color: var(--ink); line-height: 1; }
.plan-card .when .m { font-size: 13px; color: var(--muted); font-weight: 700; }
.plan-card h3 { font-size: 19px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.plan-card:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.plan-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 8px; font-size: 14px; color: var(--text); font-weight: 600; }
.plan-stats > span { display: inline-flex; align-items: center; gap: 7px; }
.plan-stats .icon { color: var(--muted); }
.meter { display: inline-block; width: 52px; height: 6px; border-radius: 3px; background: var(--mist-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--good); border-radius: 3px; }
@media (max-width: 600px) { .plan-card { grid-template-columns: 56px minmax(0, 1fr); gap: 14px; } .plan-card .when .d { font-size: 28px; } }

/* ---------- invites ---------- */
.join-from { color: var(--muted); margin: -6px 0 22px; font-size: 15px; }
.auth input.readonly { background: var(--mist); color: var(--muted); border-color: transparent; }
.invite-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; }
.invite-link input { height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; font-size: 14px; background: var(--wash); min-width: 0; }
form .seg { align-self: start; justify-self: start; align-items: center; }
form .seg .hint { margin: 0 8px 0 6px; }

/* ---------- sign-up slot editor: pictures and servings ---------- */
.row-head > span { display: inline-flex; align-items: center; gap: 2px; }
.row-edit .check.center, .row-head > span:nth-child(7), .row-head > span:nth-child(8) { justify-content: center; }
.slot-pic { width: 44px; height: 44px; border-radius: var(--radius-img); border: 1px dashed var(--line-2); background: var(--wash); display: grid; place-items: center; color: var(--muted); cursor: pointer; padding: 0; overflow: hidden; }
.slot-pic:hover { border-color: var(--ink); color: var(--ink); }
.slot-pic img { width: 100%; height: 100%; object-fit: cover; }
.slot-pic:has(img) { border-style: solid; border-color: transparent; }
.slot-thumb { display: inline-block; width: 28px; height: 28px; border-radius: 4px; object-fit: cover; vertical-align: middle; margin-right: 10px; }

/* slot items */
.row-head > span:nth-child(9) { justify-content: center; }
.items-btn { padding: 0 10px; gap: 4px; height: 32px; font-size: 13px; }
.choice-edit { display: grid; gap: 8px; min-width: min(460px, 80vw); }
.choice-edit-head, .choice-edit-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 36px; gap: 8px; align-items: center; }
.choice-edit-head { font-size: 12px; font-weight: 700; color: var(--muted); }
.choice-edit-row input { height: 42px; }
.choice-edit > .btn { justify-self: start; margin-top: 4px; }
.roster .who { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.2fr) 52px 56px 36px; }
.roster .who.none { grid-template-columns: 1fr; }
.roster .who-head { font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--ink); padding: 0 0 6px; }
.roster .who .num { text-align: right; font-variant-numeric: tabular-nums; }
.roster .who .qty { font-weight: 800; color: var(--ink); }
.roster .who > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .roster .who { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px 36px; } .roster .who > :nth-child(2), .roster .who > :nth-child(5) { display: none; } }

/* event starters and snippets */
.starters { display: grid; gap: 8px; margin-bottom: 4px; }
.starter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.starter-row button { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-weight: 650; font-size: 14px; color: var(--text); cursor: pointer; }
.starter-row button:hover { border-color: var(--ink); color: var(--ink); }
.starter-row button[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: #fff; }
.field-label .snippet { margin-left: auto; height: 30px; padding: 0 28px 0 10px; font-size: 13px; font-weight: 650; border: 1px solid var(--line-2); border-radius: 8px; background-color: #fff; color: var(--ink); cursor: pointer; width: auto; }
.field-label:has(.snippet) { display: flex; align-items: center; gap: 4px; }

/* ---------- sign-up editor: room for every column on a desktop, stacked rows on smaller screens ---------- */
.admin > div { min-width: 0; }
.modal.xwide { width: min(1120px, calc(100vw - 32px)); }
.row-edit, .row-head { grid-template-columns: 26px 44px minmax(150px, 1.5fr) 80px minmax(104px, .7fr) minmax(104px, .7fr) 70px 70px 76px 36px; gap: 8px; }
.row-head > span { white-space: nowrap; }
@media (max-width: 980px) {
  .row-head { display: none; }
  .row-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0; }
  .row-edit .mv { display: none; }
  .row-edit > .slot-pic { flex: none; }
  .row-edit > input[aria-label="Slot name"] { flex: 1 1 0; min-width: 0; }
  .row-edit > .icon-btn { flex: none; order: 1; }
  .row-edit > input[aria-label="How many"] { order: 3; flex: 0 0 72px; }
  .row-edit > input[type="time"] { order: 3; flex: 1 1 0; min-width: 0; }
  .row-edit > .check { order: 5; flex: none; gap: 6px; align-items: center; }
  /* Three lines: picture, name, delete / how many and times / options */
  .row-edit::before, .row-edit::after { content: ""; flex-basis: 100%; height: 0; }
  .row-edit::before { order: 2; }
  .row-edit::after { order: 4; }
  .row-edit > .check::after { content: attr(data-label); font-size: 13px; color: var(--muted); }
  .row-edit > .items-btn { order: 5; margin-left: auto; }
}
.items-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--night); color: #fff; font-size: 11px; font-weight: 800; }
@media (max-width: 980px) { .row-edit > .check + .check { margin-left: 8px; } }

/* link picker */
.link-picker { display: grid; gap: 8px; }
.link-picker input[hidden] { display: none; }

/* ---------- shop ---------- */
.a-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 16px; }
.units { margin-top: 16px; font-size: 15px; }
.units summary { cursor: pointer; font-weight: 650; color: var(--ink); }
.units ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 0 28px; }
.units li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tbl .sub.warn { color: var(--accent); font-weight: 600; }
.orders-tbl td:nth-child(3) { min-width: 180px; }
.prod-cell { display: flex; align-items: center; gap: 12px; }
.slot-thumb.blank { display: inline-grid; place-items: center; background: var(--mist); color: var(--faint); }

.pos { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.pos-tile { display: grid; gap: 4px; padding: 10px 10px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; text-align: left; min-width: 0; }
.pos-tile:hover:not(:disabled) { border-color: var(--ink); }
.pos-tile:active:not(:disabled) { transform: scale(.98); }
.pos-tile:disabled { opacity: .5; cursor: not-allowed; }
.pos-img { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--mist); display: grid; place-items: center; color: var(--faint); margin-bottom: 6px; }
.pos-img img { width: 100%; height: 100%; object-fit: cover; }
.pos-name { font-weight: 700; color: var(--ink); font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.pos-price { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pos-cart { position: sticky; top: 24px; border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 14px; background: #fff; }
.pos-cart h2 { font-size: 19px; }
.pos-cart .muted { margin: 0; font-size: 15px; }
.pos-lines { display: grid; }
.pos-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.pos-line .num { text-align: right; }
.pos-total, .pos-change, .pos-amount { display: flex; justify-content: space-between; align-items: baseline; }
.pos-total b { font-size: 26px; font-weight: 850; color: var(--ink); letter-spacing: -0.02em; }
.pos-pay { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pos-pay .btn { height: 56px; font-size: 17px; }
.pos-cart .text-link { justify-self: center; background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pos-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 18px; }
.pos-sizes button { display: grid; gap: 2px; justify-items: center; padding: 16px 8px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; cursor: pointer; }
.pos-sizes button:hover:not(:disabled) { background: var(--night); border-color: var(--night); color: #fff; }
.pos-sizes button:hover:not(:disabled) b { color: #fff; }
.pos-sizes button:disabled { opacity: .45; cursor: not-allowed; }
.pos-sizes b { font-size: 20px; color: var(--ink); }
.pos-sizes span { font-size: 12px; color: var(--muted); }
.pos-sizes button:hover:not(:disabled) span { color: rgba(255,255,255,.7); }
.pos-amount { margin-bottom: 18px; }
.pos-amount span { font-weight: 650; color: var(--muted); }
.pos-amount b { font-size: 40px; font-weight: 850; color: var(--ink); letter-spacing: -0.03em; }
.pos-change { min-height: 28px; margin: 4px 0 8px; color: var(--muted); }
.pos-change b { font-size: 22px; color: var(--good); }
.pos-venmo { display: grid; gap: 16px; }
.pos-venmo .pos-amount { margin: 0; padding-right: 36px; }
.pos-qr { justify-self: center; width: min(280px, 100%); padding: 20px; background: var(--moon); border-radius: 16px; }
.pos-qr img { width: 100%; height: auto; display: block; }
.pos-code { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; color: var(--muted); }
.pos-code b { font-size: 22px; color: var(--ink); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.pos-wait { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 650; color: var(--muted); font-size: 15px; }
.pos-wait .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--plumeria); animation: pos-pulse 1.4s ease-in-out infinite; }
@keyframes pos-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .pos-wait .dot { animation: none; } }
.pos-paid { display: grid; justify-items: center; gap: 6px; padding: 24px 0 8px; color: var(--good); }
.pos-paid b { font-size: 32px; color: var(--ink); }
.pos-paid span { color: var(--muted); }
@media (max-width: 1100px) { .pos { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; } }
@media (max-width: 860px) {
  .pos { grid-template-columns: 1fr; }
  .pos-cart { position: sticky; bottom: 12px; top: auto; box-shadow: 0 12px 32px rgba(10,26,49,.16); }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
}

.prod-form { display: grid; gap: 18px; }
.prod-top { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 20px; align-items: start; }
.prod-fields { display: grid; gap: 16px; }
.prod-photo-btn { width: 148px; aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line-2); background: var(--wash); cursor: pointer; padding: 0; overflow: hidden; display: grid; place-items: center; color: var(--muted); }
.prod-photo-btn:hover { border-color: var(--ink); }
.prod-photo-btn img { width: 100%; height: 100%; object-fit: cover; }
.prod-photo-btn span { display: grid; justify-items: center; gap: 6px; font-weight: 650; font-size: 14px; }
.money-input { display: flex; align-items: center; gap: 0; }
.money-input span { height: 46px; display: grid; place-items: center; padding: 0 12px; border: 1.5px solid var(--line-2); border-right: 0; border-radius: var(--radius-field) 0 0 var(--radius-field); background: var(--wash); font-weight: 700; color: var(--muted); }
.money-input input { border-radius: 0 var(--radius-field) var(--radius-field) 0; min-width: 0; flex: 1; }
.size-edit input { height: 34px; width: 110px; border-radius: 999px; font-size: 14px; padding: 0 12px; }
.chip-x { display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--night); color: #fff; font-weight: 700; font-size: 14px; }
.chip-x button { border: 0; background: none; color: inherit; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.chip-x button:hover { background: var(--night-2); }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; margin-top: 12px; }
.stock-cell { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.stock-cell input { height: 40px; }
.imap-status { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 0; font-weight: 600; }
.imap-status:empty { display: none; }
.imap-status.ok { color: var(--good); }
.imap-status.bad { color: var(--accent); }
@media (max-width: 560px) { .prod-top { grid-template-columns: 1fr; } .prod-photo-btn { width: 120px; } }
.prod-cell .slot-thumb { margin-right: 0; width: 40px; height: 40px; border-radius: 6px; }
.shop-stats .stat b { font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.03em; }
.shop-stats .stat span { display: block; line-height: 1.35; margin-top: 6px; }
.send-to { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 8px 16px; padding: 4px 0; }
.orders-tbl tr.focus td { background: var(--wash); box-shadow: inset 0 2px 0 var(--night), inset 0 -2px 0 var(--night); }
select.poll-add { width: auto; max-width: 280px; height: 44px; }
/* planning: steps inside tasks, send the list */
.plan-top { display: grid; }
.plan-top > .btn { justify-self: end; order: -1; margin-bottom: 12px; }
.plan-task { border-bottom: 1px solid var(--line); }
.plan-task > .plan-row { border-bottom: 0; }
.plan-steps { margin-left: 40px; border-left: 2px solid var(--line); padding-left: 14px; }
.plan-row.step { padding: 8px 0; border-bottom: 0; }
.plan-row.step .plan-title { font-size: 15px; }
.step-toggle { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px 40px; padding: 2px 0; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 650; cursor: pointer; }
.step-toggle:hover { color: var(--ink); }
.plan-add.step-add { margin: 4px 0 12px 40px; }
@media (max-width: 640px) { .plan-steps, .plan-add.step-add, .step-toggle { margin-left: 16px; } }
