/* Account, login, setup and admin pages: cards, forms, people list, dialogs and toasts. */
:root {
  --ok: #1d6b3a; --ok-soft: #e3f2e8; --warn: #8a5300; --warn-soft: #fbf0dc; --bad: #b3261e; --bad-soft: #fbe9e7;
  --chip-member: #3b4a5c; --chip-member-bg: #e6ebf1; --chip-writer: #7a4b00; --chip-writer-bg: #f8ecd4; --chip-contrib: #1f5f5b; --chip-contrib-bg: #ddf0ee; --chip-photo: #4a3a7a; --chip-photo-bg: #ebe6f7; --chip-editor: #1d4f7a; --chip-editor-bg: #e2eef8;
  --chip-client: #5a4a1a; --chip-client-bg: #f1ecdc; --chip-wire: #155e2e; --chip-wire-bg: #dff1e4;
  --chip-admin: #500000; --chip-admin-bg: #f3e6e6; --ring: rgba(80,0,0,.18); --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ok: #7fd19b; --ok-soft: #14301f; --warn: #f0c070; --warn-soft: #33260f; --bad: #f2a29b; --bad-soft: #3a1714;
    --chip-member: #b9c7d8; --chip-member-bg: #1f2833; --chip-writer: #f0c070; --chip-writer-bg: #33260f; --chip-contrib: #8fd6cf; --chip-contrib-bg: #12302e; --chip-photo: #c4b5f0; --chip-photo-bg: #241d3a; --chip-editor: #9cc8ee; --chip-editor-bg: #152a3d;
    --chip-client: #e0cf9a; --chip-client-bg: #2e2812; --chip-wire: #8fd9a8; --chip-wire-bg: #12301c;
    --chip-admin: #f0b0b0; --chip-admin-bg: #3a1a1a; --ring: rgba(224,154,154,.25); --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  }
}

.wrap.acct { max-width: 520px; gap: 18px; }
.wrap.acct.wide { max-width: 980px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.panel h1 { margin: 0; font-size: 30px; letter-spacing: .02em; color: var(--ink); }
.panel h2, .head h2 { margin: 0; font-size: 18px; letter-spacing: 0; text-transform: none; color: var(--ink); }
.panel p { margin: 0; }
.muted { color: var(--muted); font-size: 14px; }

/* Forms */
.form { display: grid; gap: 14px; }
.form label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.form label small { font-weight: 400; color: var(--muted); }
.form input, .form select, .search input { font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; width: 100%; transition: border-color .15s, box-shadow .15s, background .15s; }
.form input:focus, .form select:focus, .search input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 4px var(--ring); background: var(--panel); }
.form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.pw { position: relative; display: block; }
.pw input { padding-right: 64px; }
.pw .peek { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; color: var(--muted); border: 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 6px 8px; border-radius: 6px; }
.pw .peek:hover { color: var(--ink); background: var(--line); }

/* Buttons */
button, .btn { font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .02em; background: var(--accent); color: #fff; border: 1px solid transparent; border-radius: 10px; padding: 11px 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; transition: background .15s, border-color .15s, transform .05s; }
button:hover, .btn:hover { background: #6d1010; }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
button.alt, .btn.alt { background: var(--panel); color: var(--ink); border-color: var(--line); }
button.alt:hover, .btn.alt:hover { border-color: var(--accent-text); background: var(--panel); }
button.ghost { background: none; color: var(--muted); border-color: transparent; padding: 8px 10px; }
button.ghost:hover { background: var(--bg); color: var(--ink); }
button.danger { background: var(--bad); color: #fff; }
button.danger:hover { background: #8f1d17; }
button.ghost.danger-text:hover { color: var(--bad); background: var(--bad-soft); }
button:disabled { opacity: .5; cursor: default; }
.form > button, .panel > button, .panel > .btn, .ask > .btn { justify-self: start; align-self: flex-start; }
.form > button[type=submit].full { justify-self: stretch; }

/* Messages */
.msg { color: var(--bad); font-size: 14px; margin: 0; }
.msg.ok { color: var(--ok); }
.msg:empty { display: none; }
.note { background: var(--accent-soft); color: var(--accent-text); border-radius: 10px; padding: 11px 14px; font-size: 14px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }

/* Login */
.login { overflow: hidden; padding-top: 0; }
.login-photo { display: block; width: calc(100% + 48px); margin: 0 -24px 6px; aspect-ratio: 16 / 7; object-fit: cover; background: #222; }
.ask { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }

/* Avatars and chips */
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: .02em; color: var(--chip-member); background: var(--chip-member-bg); }
.avatar.big { width: 64px; height: 64px; font-size: 22px; }
.avatar.photographer { color: var(--chip-photo); background: var(--chip-photo-bg); }
.avatar.contributor { color: var(--chip-contrib); background: var(--chip-contrib-bg); }
.avatar.writer { color: var(--chip-writer); background: var(--chip-writer-bg); }
.avatar.admin { color: var(--chip-admin); background: var(--chip-admin-bg); }
.avatar.editor { color: var(--chip-editor); background: var(--chip-editor-bg); }
.avatar.client { color: var(--chip-client); background: var(--chip-client-bg); }
.avatar.wire { color: var(--chip-wire); background: var(--chip-wire-bg); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; color: var(--chip-member); background: var(--chip-member-bg); }
.chip.photographer { color: var(--chip-photo); background: var(--chip-photo-bg); }
.chip.contributor { color: var(--chip-contrib); background: var(--chip-contrib-bg); }
.chip.writer { color: var(--chip-writer); background: var(--chip-writer-bg); }
.chip.admin { color: var(--chip-admin); background: var(--chip-admin-bg); }
.chip.editor { color: var(--chip-editor); background: var(--chip-editor-bg); }
.chip.client { color: var(--chip-client); background: var(--chip-client-bg); }
.chip.wire { color: var(--chip-wire); background: var(--chip-wire-bg); }
.chip.wirecontrib, .chip.wireself { color: var(--chip-wire); background: var(--chip-wire-bg); }
.role-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip.owner { color: var(--panel); background: var(--ink); }
.chip.wait { color: var(--warn); background: var(--warn-soft); }

/* Signed-in profile */
.profile { display: flex; align-items: center; gap: 16px; }
.profile h1 { font-size: 26px; text-transform: none; }
.profile .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.shortcut { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; background: var(--bg); transition: border-color .15s, transform .15s; }
.shortcut:hover { border-color: var(--accent-text); transform: translateY(-1px); }
.shortcut b { font-size: 15px; }
.shortcut b::after { content: " \2192"; color: var(--accent-text); }
.shortcut span { color: var(--muted); font-size: 13px; }
.sync { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.sync::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); flex: none; }
details.panel > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 16px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--muted); }
details.panel[open] > summary::after { content: "\2212"; }
.foot-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Admin page */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head h1 { font-size: 32px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 118px), 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-align: left; color: var(--ink); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-weight: 400; letter-spacing: 0; }
.stat:hover { background: var(--panel); border-color: var(--accent-text); }
.stat[aria-pressed=true] { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--ring); }
.stat b { font-size: 26px; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; display: block; }
.toolbar .search { flex: 1 1 240px; }
.search input { padding-left: 38px; background: var(--panel); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.people { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); animation: rise .25s ease both; }
.person:first-child { border-top: 0; }
.person .who { min-width: 0; }
.person .who b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.person .who .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.person .when { font-size: 12px; color: var(--muted); }
.person .acts { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.person select { font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.person select:focus { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.person button { font-size: 13px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
@media (max-width: 640px) {
  .person { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .person .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .person select { flex: 1; min-width: 0; }
  .person button.ghost { padding: 8px; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 10px 12px; border-radius: 12px; }
  .stat b { font-size: 20px; }
  .stat span { font-size: 12px; line-height: 1.25; }
  .head .btn, .head button { width: 100%; }
}

/* Dialogs */
dialog { border: 0; padding: 0; border-radius: 18px; background: var(--panel); color: var(--ink); width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-shadow: 0 24px 64px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(0,0,0,.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg { padding: 24px; display: grid; gap: 16px; }
.dlg header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dlg h2 { margin: 0; font-size: 20px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.dlg .x { background: none; color: var(--muted); border: 0; font-size: 22px; line-height: 1; padding: 4px 8px; }
.dlg .x:hover { background: var(--bg); color: var(--ink); }
.dlg .btns { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.roles { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; }
.roles legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.role-opt { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 400; transition: border-color .15s, background .15s; }
.role-opt input { grid-row: span 2; width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.role-opt b { font-size: 14px; }
.role-opt span { font-size: 13px; color: var(--muted); }
.role-opt:has(input:checked) { border-color: var(--accent-text); background: var(--accent-soft); }
.form .role-opt { display: grid; }
.roles legend small { font-weight: 400; color: var(--muted); }
.role-opt:has(input:disabled) { opacity: .55; cursor: default; }
.client-pick[hidden] { display: none; }
.roles + .roles { margin-top: 10px; }
.client-pick { margin: 0 0 4px 30px; }
.invite { display: grid; gap: 12px; }
.invite .pass { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px; }
.invite code { font: 700 clamp(17px, 5vw, 22px)/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; white-space: nowrap; }
.done-mark { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-size: 22px; font-weight: 700; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #161616; color: #fff; border-radius: 12px; padding: 12px 14px 12px 16px; font-size: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.3); animation: pop .2s ease; }
.toast.bad { background: var(--bad); }
.toast button { background: none; border: 0; color: #f0b0b0; padding: 4px 6px; font-size: 13px; }
.toast button:hover { background: rgba(255,255,255,.1); }
@media (prefers-reduced-motion: reduce) { .person, dialog[open], .toast { animation: none; } .shortcut:hover { transform: none; } }

/* Page headers on the admin and client pages use the same maroon banner as the tool and blog pages. */
.head { background: #500000; color: #fff; border-bottom: 4px solid #111; border-radius: 12px; padding: 22px 24px; align-items: center; }
.head h1 { color: #fff; font-size: clamp(24px, 4vw, 32px); text-transform: uppercase; letter-spacing: .02em; }
.head .kicker { color: #e6c2c2; }
.head .muted { color: #ececec; }
.head .muted a { color: #fff; font-weight: 700; }
.head button, .head .btn { background: #fff; color: #500000; }
.head button:hover, .head .btn:hover { background: #f3e6e6; }
.head button.alt, .head .btn.alt { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.head button.ghost { color: #fff; } .head button.ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Sign-up: a field only bots fill in */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pending-box { display: grid; gap: 10px; margin-bottom: 18px; }
.pending-box h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.pending-box p { margin: 0; }
.person .who .muted + .muted { font-size: 12px; }
