/*
  Design tokens
  Color: paper #EAE3D8, ink #2E2A3D (deep plum-black), line #C7BCA9,
         accent-a #B5563C (burnt rose, person 1 default), accent-b #3F6659
         (deep pine, person 2 default) — these two accents are per-user
         (set at setup), not fixed to a role.
  Type: Fraunces (serif, warm, some personality) for the wordmark and
        headings; Inter for everything else. Two families, clearly
        distinct roles.
  Layout: centered single card for auth screens (this is a private,
          two-person space, not a marketing funnel — no hero, no columns).
          Shared page: a simple top bar + content column, left-aligned.
*/

:root {
    --paper: #EAE3D8;
    --paper-raised: #F4EFE6;
    --ink: #2E2A3D;
    --ink-soft: #6B6478;
    --line: #C7BCA9;
    --accent-a: #B5563C;
    --accent-b: #3F6659;
    --error: #9A3B32;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

.wordmark {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 2.25rem;
    letter-spacing: -0.01em;
    margin: 0 0 0.25rem;
    color: var(--ink);
}

.wordmark--small { font-size: 1.4rem; }

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 360px;
}

.auth-card--wide { max-width: 640px; }

.auth-sub, .auth-note {
    color: var(--ink-soft);
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
}

.login-form, .setup-form { display: flex; flex-direction: column; gap: 0.35rem; }

label {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 0.75rem;
}

input[type="text"], input[type="password"], input[type="number"] {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    box-sizing: border-box;
}

input[type="color"] {
    width: 3rem;
    height: 2.2rem;
    padding: 0.15rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--ink);
}
.checkbox-row input { margin: 0; }

.btn-primary {
    margin-top: 1.5rem;
    background: var(--ink);
    color: var(--paper-raised);
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}
.btn-primary:hover { opacity: 0.9; }

.form-error {
    color: var(--error);
    font-size: 0.9rem;
    margin: -0.5rem 0 1rem;
}

.form-errors {
    color: var(--error);
    font-size: 0.9rem;
    margin: -0.5rem 0 1.25rem;
    padding-left: 1.1rem;
}

.setup-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 560px) {
    .setup-columns { grid-template-columns: 1fr; }
}

.person-fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}
.person-fieldset legend {
    font-family: 'Fraunces', serif;
    padding: 0 0.4rem;
    color: var(--ink-soft);
}

/* Shared page shell */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--line);
}
.topbar-nav { display: flex; align-items: center; gap: 1.25rem; font-size: 0.9rem; }
.whoami { color: var(--ink-soft); }
.link-quiet { color: var(--ink); }

.link-button {
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    cursor: pointer;
}

.shared-shell {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Settings "popup" — a real page, styled to sit like a modal over a
   dimmed scrim, so closing it is just a normal link back to index.php
   (no JS state to manage). */
/* Settings modal (see settings-modal.js). display:none by default and
   toggled via the .is-open class from JS — deliberately NOT relying on
   the `hidden` attribute, since any CSS rule that sets `display` on the
   same element silently overrides the browser's built-in
   `[hidden] { display: none }` default, which is a very easy way for a
   modal to end up "hidden" in name only. */
.modal-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(46, 42, 61, 0.55);
    z-index: 100;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1.5rem;
    overflow-y: auto;
}

.modal-scrim.is-open {
    display: flex;
}

body.modal-open {
    overflow: hidden;
}

.modal-card {
    background: var(--paper-raised);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.modal-card--wide {
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}
.section-modal-card {
    padding-top: 1.6rem;
}
.section-modal-title {
    margin: 0 0 1rem;
    padding-right: 2rem;
}
.section-modal-subtitle {
    margin: 0 0 0.6rem;
    font-size: 1rem;
}
.help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    border: 1px solid var(--ink-soft);
    background: none;
    color: var(--ink-soft);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: help;
    margin-left: 0.4rem;
    vertical-align: middle;
    padding: 0;
    line-height: 1;
}
.help-tip:hover {
    border-color: var(--ink);
    color: var(--ink);
}
.help-tip-bubble {
    position: fixed;
    max-width: 260px;
    background: var(--ink);
    color: var(--paper-raised);
    font-size: 0.78rem;
    line-height: 1.4;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    z-index: 250;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.panel-section {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.9rem;
    background: var(--paper);
}
.panel-header-toggle {
    display: inline-block;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    margin: 0 0 0.6rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}
.panel-header-toggle:hover {
    border-color: var(--ink-soft);
    color: var(--accent-a);
}
.panel-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}
.collapsible-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    list-style: none;
    cursor: pointer;
}
.collapsible-section > summary::-webkit-details-marker { display: none; }
.collapsible-section > summary::after {
    content: '▾';
    color: var(--ink-soft);
    font-size: 0.8rem;
    transition: transform 0.15s ease;
}
.collapsible-section:not([open]) > summary::after {
    transform: rotate(-90deg);
}
.collapsible-body {
    margin-top: 0.6rem;
}
.panel-header-row .section-modal-subtitle {
    margin: 0;
}
.section-add-toggle {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    flex-shrink: 0;
}
.section-add-toggle:hover {
    border-color: var(--ink-soft);
}
.decay-field-label {
    font-size: 0.78rem;
    color: var(--ink-soft);
    white-space: nowrap;
}
.decay-input {
    width: 4.5rem;
}
.bar-admin-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}
.bar-admin-controls form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.bar-admin-remove-btn {
    background: none;
    border: none;
    color: #E53935;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}
.bar-admin-remove-btn:hover {
    opacity: 0.7;
}
.bar-admin-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.bar-admin-row-top form {
    margin: 0;
}
.need-tags-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.3rem 0;
}
.list-item-add-tag[hidden] { display: none; }
.panel-section-title {
    margin: 0 0 0.65rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
    font-weight: 700;
}

.idea-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.idea-card {
    position: relative;
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent, var(--accent-a));
    border-radius: 10px;
    padding: 0.75rem 0.8rem;
    background: var(--paper-raised);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 88px;
}
.idea-card:hover, .idea-card:focus-visible {
    border-color: var(--ink-soft);
    border-top-color: var(--accent, var(--accent-a));
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    outline: none;
}
.idea-card-suggested-by {
    margin: 0;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ink-soft);
}
.idea-card-title {
    font-size: 0.92rem;
    padding-right: 1.2rem;
    line-height: 1.3;
}
.idea-card-snippet {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin: 0;
    flex: 1;
    line-height: 1.4;
}
.idea-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: auto;
}
.idea-card-status {
    font-size: 0.66rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    white-space: nowrap;
}
.idea-card-status--1 { background: #E53935; border-color: #E53935; color: #fff; }
.idea-card-status--2 { background: #EF8354; border-color: #EF8354; color: #2E2A3D; }
.idea-card-status--3 { background: #1E88E5; border-color: #1E88E5; color: #fff; }
.idea-card-status--4 { background: #2ECC71; border-color: #2ECC71; color: #2E2A3D; }
.idea-card-status--pending { color: var(--ink-soft); }
.idea-card-more {
    position: absolute;
    bottom: 0.5rem;
    right: 0.7rem;
    font-size: 0.68rem;
    color: var(--ink-soft);
}
.idea-card-delete-form {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    margin: 0;
}
.idea-card-delete-btn {
    background: none;
    border: none;
    color: var(--ink-soft);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
}
.idea-card-delete-btn:hover {
    color: #E53935;
}

.section-nav {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin: 0.75rem 0 1.25rem;
}
.section-nav-btn {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.6rem 1.3rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.section-nav-btn:hover {
    border-color: var(--ink-soft);
}

.modal-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}
.modal-close {
    font-size: 1.5rem;
    line-height: 1;
    color: var(--ink-soft);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
}
.modal-close:hover { color: var(--ink); }

.settings-section {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}
.settings-section h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.settings-form { display: flex; flex-direction: column; gap: 0.35rem; }

.btn-secondary-size {
    margin-top: 1.25rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    align-self: flex-start;
}

.form-success {
    color: var(--accent-b);
    font-size: 0.9rem;
    margin: -0.5rem 0 1.25rem;
}

.admin-hint {
    color: var(--ink-soft);
    font-size: 0.85rem;
    margin: 0.4rem 0 0;
}

/* Game view — was ~672px content width; roughly doubled per request.
   The side panels get a fixed width and the center canvas column takes
   the rest, so it scales down gracefully on narrower screens too. */
.shared-shell--game {
    max-width: 1760px;
}

.game-layout {
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    gap: 1.5rem;
    align-items: start;
}

.side-panel {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.25rem;
    background: var(--paper-raised);
    border-top: 3px solid var(--accent, var(--accent-a));
}
.side-panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.side-panel-title {
    font-family: 'Fraunces', serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--ink);
}
.side-panel-hint {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin: 0;
}

.mood-inline-bar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 108px;
    height: 20px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
    flex-shrink: 0;
}
.mood-inline-fill {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    transition: width 0.4s ease;
}
.mood-inline-text {
    position: relative;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.55);
    white-space: nowrap;
    padding: 0 0.3rem;
}

.bar-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.bar-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    cursor: pointer;
}
.bar-row-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.bar-row-header-left {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
}
.bar-row-label {
    font-size: 0.78rem;
    color: var(--ink-soft);
}
.bar-row-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.55);
    pointer-events: none;
}
.bar-row-days {
    font-size: 0.72rem;
    color: var(--ink-soft);
    white-space: nowrap;
}
.bar-track {
    position: relative;
    display: block;
    height: 20px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}
.bar-fill {
    display: block;
    height: 100%;
    background: var(--accent, var(--accent-a));
    border-radius: 999px;
    transition: width 0.4s ease;
}

.bar-color-swatch {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 0.15rem;
    border: 1px solid rgba(0,0,0,0.15);
}
.side-panel-needs {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
}
.side-panel-subheading {
    font-family: 'Fraunces', serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin: 0 0 0.6rem;
}
.need-mini-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.6rem;
}
.need-mini-row:last-child { margin-bottom: 0; }
.need-mini-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}
.need-mini-label {
    font-size: 0.78rem;
    color: var(--ink-soft);
}
.need-mini-days {
    font-size: 0.72rem;
    color: var(--ink-soft);
    white-space: nowrap;
}
.need-progress-track {
    height: 8px;
}

.checkin-link {
    display: block;
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    text-decoration: none;
}
.checkin-link:first-of-type {
    margin-top: 1.25rem;
}

.bar-suggestions-icon {
    position: relative;
    display: none; /* shown only via .bar-row--low below */
    font-size: 0.85rem;
    line-height: 1;
}
.bar-row--low .bar-suggestions-icon {
    display: inline-block;
}
.bar-row--very-low .bar-suggestions-icon {
    animation: bar-suggestions-pulse 1.1s ease-in-out infinite;
}
.bar-row--very-low .bar-suggestions-icon::after {
    content: '!';
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--error);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    width: 11px;
    height: 11px;
    line-height: 11px;
    border-radius: 50%;
    text-align: center;
}
@keyframes bar-suggestions-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.65; }
}
.bar-suggestions-panel {
    position: fixed;
    z-index: 150;
    width: 240px;
    max-width: calc(100vw - 16px);
    padding: 0.6rem 0.7rem;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    font-size: 0.78rem;
    cursor: default; /* the panel's own content (links) isn't part of the row's toggle-click affordance */
    --arrow-y: 16px;
}
.bar-suggestions-panel[hidden] { display: none; }
.bar-suggestions-panel::before {
    content: '';
    position: absolute;
    top: var(--arrow-y);
    width: 12px;
    height: 12px;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    transform: translateY(-50%) rotate(45deg);
}
.bar-suggestions-panel--arrow-left::before {
    left: -6.5px;
    border-right: none;
    border-bottom: none;
}
.bar-suggestions-panel--arrow-right::before {
    right: -6.5px;
    border-left: none;
    border-top: none;
}
.bar-suggestions-heading {
    margin: 0 0 0.3rem;
    font-weight: 600;
    font-size: 0.75rem;
}
.bar-suggestions-panel ul {
    margin: 0;
    padding-left: 1.1rem;
}
.bar-suggestions-panel li {
    margin-bottom: 0.5rem;
}
.bar-suggestions-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.2rem;
}
.bar-suggestions-tags .list-item-tag {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
}
.bar-suggestions-panel a {
    color: var(--ink);
}

@media (max-width: 980px) {
    .game-layout {
        grid-template-columns: 1fr;
    }
    .game-view-wrap { order: 1; }
    .side-panel--me { order: 2; }
    .side-panel--partner { order: 3; }
}

.game-view-wrap {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--paper-raised);
}

.game-canvas {
    display: block;
    width: 100%;
    cursor: default;
}

.lists-panel {
    margin-top: 1rem;
}
.lists-panel summary {
    cursor: pointer;
    width: fit-content;
}
.equipment-panel {
    margin-top: 1rem;
    font-size: 0.85rem;
}
.equipment-panel summary {
    cursor: pointer;
    width: fit-content;
}
.equipment-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    margin: 0.6rem 0;
}
.equipment-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    text-align: center;
}
.equipment-name {
    font-size: 0.82rem;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.equipment-worn-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: var(--ink-soft);
}
.equipment-card-actions {
    display: flex;
    gap: 0.5rem;
    font-size: 0.78rem;
}

.character-sets-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    margin: 0.6rem 0;
}
.character-set-target-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}
.character-set-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.6rem;
    margin: 0.75rem 0;
}
.character-set-slot {
    position: relative;
    aspect-ratio: 3 / 4;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 10px 10px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.character-set-slot img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.character-set-slot--empty {
    border-style: dashed;
    background: var(--paper);
}
.character-set-slot-label {
    position: relative;
    z-index: 1;
    font-size: 0.68rem;
    text-transform: capitalize;
    color: var(--ink-soft);
    background: rgba(255,255,255,0.85);
    width: 100%;
    text-align: center;
    padding: 0.1rem 0;
}
.character-set-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.2rem;
    margin: 0.75rem 0 0.5rem;
    padding: 1.2rem 1rem;
    border: 2px dashed var(--line);
    border-radius: 10px;
    background: var(--paper);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.character-set-dropzone.is-dragover {
    border-color: var(--accent, var(--accent-a));
    background: var(--paper-raised);
}
.character-set-dropzone-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
}
.character-set-dropzone-label strong {
    font-size: 0.9rem;
}
.character-set-dropzone-label span {
    font-size: 0.75rem;
    color: var(--ink-soft);
}

.character-set-or-divider {
    text-align: center;
    font-size: 0.75rem;
    color: var(--ink-soft);
    margin: 0.75rem 0;
}
.character-set-slicer {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.character-set-slicer-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
}
.character-set-slicer-controls input[type="number"] {
    width: 4rem;
}
.character-set-slicer-canvas-wrap {
    position: relative;
    display: block;
    max-width: 100%;
    margin: 0 auto 0.75rem;
}
.character-set-slicer-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
}
.character-set-slicer-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    margin-left: -1.5px;
    background: var(--accent, var(--accent-a));
    cursor: ew-resize;
    touch-action: none;
}
.character-set-slicer-divider::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -8px;
    right: -8px;
}
.character-set-slicer-guide {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    margin-top: -1.5px;
    background: #E53935;
    cursor: ns-resize;
    touch-action: none;
}
.character-set-slicer-guide::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -8px;
    bottom: -8px;
}
.character-set-slicer-guide::after {
    position: absolute;
    right: 2px;
    font-size: 0.62rem;
    font-weight: 700;
    color: #E53935;
    background: var(--paper-raised);
    padding: 0 0.2rem;
    border-radius: 3px;
    line-height: 1.3;
}
.character-set-slicer-guide--top::after {
    content: 'top';
    top: 2px;
}
.character-set-slicer-guide--bottom::after {
    content: 'bottom (feet)';
    bottom: 2px;
}
.character-set-slicer-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.character-set-slice-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.character-set-slice-preview canvas {
    max-height: 90px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 8px 8px;
}
.character-set-slice-preview select {
    font-size: 0.72rem;
    max-width: 90px;
}
.character-set-slicer-actions {
    display: flex;
    gap: 0.6rem;
}
.character-set-staging {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.character-set-staging-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.character-set-staging-row img {
    width: 42px;
    height: 56px;
    object-fit: contain;
    border-radius: 4px;
    background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 8px 8px;
    flex-shrink: 0;
}
.character-set-staging-row select {
    flex: 1;
}

.debug-equip-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.4rem;
}
.debug-equip-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--ink-soft);
}

.equipment-editor-card { max-width: 980px; width: 94vw; }
.equipment-editor-body {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}
.equipment-editor-canvas-col {
    flex: 1 1 460px;
    min-width: 280px;
}
.equipment-editor-controls-col {
    flex: 1 1 300px;
    min-width: 260px;
}
.equipment-name-input {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-bottom: 1px solid var(--line);
    background: transparent;
    padding: 0.2rem 0;
    margin-right: 0.5rem;
}
.equipment-thumb {
    position: relative;
    width: 100%;
    height: 160px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 10px 10px;
    flex-shrink: 0;
    overflow: hidden;
}
.equipment-thumb-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.equipment-thumb--empty {
    background: var(--paper);
}

.equipment-layer-toggle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.equipment-layer-btn {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    color: var(--ink-soft);
    cursor: pointer;
}
.equipment-layer-btn.is-active {
    background: var(--accent-a);
    border-color: var(--accent-a);
    color: #fff;
}
.equipment-layer-note {
    flex-basis: 100%;
    font-size: 0.72rem;
}

.equipment-frame-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.6rem 0;
}
.equipment-frame-tab {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    color: var(--ink-soft);
    cursor: pointer;
    position: relative;
}
.equipment-frame-tab.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper-raised);
}
.equipment-frame-tab.has-content::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-b);
    border: 1px solid var(--paper-raised);
}

.equipment-canvas-viewport {
    width: min(440px, 100%);
    aspect-ratio: 320 / 420;
    max-height: 65vh;
    margin: 0 auto 0.5rem;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.equipment-canvas-stack {
    position: relative;
    width: 320px;
    aspect-ratio: 320 / 420;
    background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
.equipment-canvas-stack canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
}
#equipment-ref-canvas { z-index: 1; pointer-events: none; }
#equipment-base-canvas { z-index: 2; cursor: crosshair; }
#equipment-overlay-canvas { z-index: 3; pointer-events: none; }

.equipment-zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.equipment-zoom-level {
    font-size: 0.78rem;
    color: var(--ink-soft);
    min-width: 3em;
    text-align: center;
}

.equipment-editor-hint {
    min-height: 1.2em;
    margin: 0.4rem 0;
}

.debug-panel {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--ink-soft);
}
.debug-panel summary {
    cursor: pointer;
    width: fit-content;
}
.debug-panel select {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    padding: 0.25rem 0.4rem;
}
.debug-view-as-row {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.debug-mood-motion {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
    max-width: 360px;
}
.debug-subheading {
    font-family: 'Fraunces', serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 0.35rem;
}
.debug-mood-force-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0;
}
.debug-mood-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0;
}
.debug-mood-sliders {
    margin: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.debug-mood-slider-row label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--ink-soft);
    margin-bottom: 0.15rem;
}
.debug-mood-slider-value {
    font-weight: 600;
    color: var(--ink);
}
.debug-mood-slider-row input[type="range"] {
    width: 100%;
}
.debug-mood-json {
    width: 100%;
    font-family: monospace;
    font-size: 0.68rem;
    padding: 0.4rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    color: var(--ink);
    resize: vertical;
    margin-bottom: 0.4rem;
}

.activity-log-panel {
    margin-top: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    background: var(--paper-raised);
}
.activity-log-panel summary {
    cursor: pointer;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.05rem;
}
.activity-log-panel .auth-sub {
    margin: 0.5rem 0 0;
}
.activity-log-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    max-height: 260px;
    overflow-y: auto;
}
.activity-log-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.85rem;
}
.activity-log-list li:last-child { border-bottom: none; }
.activity-log-time {
    color: var(--ink-soft);
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.78rem;
    padding-top: 0.1rem;
}
.activity-log-summary {
    color: var(--ink);
}
.activity-log-summary--clickable {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 2px;
    transition: text-decoration-color 0.15s ease;
}
.activity-log-summary--clickable:hover,
.activity-log-summary--clickable:focus-visible {
    text-decoration-color: currentColor;
}
.activity-log-detail-toggle {
    /* Stays inline on the same line as the time/summary while collapsed —
       only takes its own full line once expanded (see [open] below),
       since a paragraph or image needs the room but the toggle itself
       shouldn't force a line break just sitting there closed. */
}
.activity-log-detail-toggle[open] {
    flex-basis: 100%;
    margin-top: 0.15rem;
}
.activity-log-detail-toggle summary {
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--ink-soft);
    list-style: none;
}
.activity-log-detail-toggle summary::-webkit-details-marker { display: none; }
.activity-log-detail-toggle summary::before {
    content: '▸ ';
    font-size: 0.7em;
}
.activity-log-detail-toggle[open] summary::before {
    content: '▾ ';
}
.activity-log-detail-text {
    margin: 0.4rem 0 0;
    padding: 0.5rem 0.65rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--ink);
    white-space: pre-wrap;
}
.activity-log-detail-image {
    margin-top: 0.4rem;
    max-width: 220px;
    max-height: 160px;
    border-radius: 8px;
    border: 1px solid var(--line);
    display: block;
    cursor: pointer;
}
.activity-log-empty {
    color: var(--ink-soft);
    font-size: 0.85rem;
}
.activity-log-list li.activity-log-empty {
    border-bottom: none;
    padding: 0.25rem 0 0;
}

.activity-log-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}
.activity-log-filter {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    color: var(--ink-soft);
    cursor: pointer;
}
.activity-log-filter.is-active {
    background: var(--accent-a);
    border-color: var(--accent-a);
    color: #fff;
}

.bars-panel {
    margin-top: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    background: var(--paper-raised);
}
.bars-panel summary {
    cursor: pointer;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.05rem;
}
.bars-panel .auth-sub {
    margin: 0.5rem 0 1rem;
}
.bars-add-form {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}
.bars-add-form input[type="text"] {
    flex: 1;
    min-width: 180px;
}
.bars-add-form input[type="number"] {
    width: 90px;
}
.bars-manage-list {
    margin-top: 0.75rem;
}

/* Admin panel */
.shared-shell--wide {
    max-width: 900px;
}

.admin-tag {
    font-size: 0.9rem;
    color: var(--ink-soft);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.admin-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}
.admin-section:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.admin-section h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
}
.admin-subheading {
    font-family: 'Fraunces', serif;
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: var(--ink-soft);
}
.admin-subheading:first-of-type { margin-top: 0.75rem; }

.admin-tag-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

select {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    box-sizing: border-box;
}

.background-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.background-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.background-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}
.background-edit-form {
    padding: 0.65rem 0.7rem 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.background-edit-form input[type="text"] {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
}
.background-edit-form input[type="file"] {
    font-size: 0.75rem;
}
.admin-tag-row--tight {
    gap: 0.5rem;
    margin-top: 0;
}
.admin-tag-row--tight select,
.admin-tag-row--tight input[type="number"] {
    font-size: 0.8rem;
    padding: 0.35rem 0.4rem;
    width: 100%;
}
.background-card-actions {
    display: flex;
    justify-content: flex-end;
}
.btn-tiny {
    margin-top: 0;
    padding: 0.58rem 0.9rem;
    font-size: 0.8rem;
}
.background-remove-form { padding: 0 0.7rem 0.65rem; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.link-danger {
    color: var(--error);
    font-size: 0.82rem;
}

.bar-admin-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper-raised);
    margin-bottom: 0.6rem;
}
.bars-manage-list .bar-admin-row:last-child { margin-bottom: 0; }
.bar-admin-label {
    min-width: 140px;
    display: flex;
    flex-direction: column;
}
.bar-admin-label .auth-sub { margin: 0; font-size: 0.75rem; }
.bar-admin-decay-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.bar-admin-decay-form input[type="number"] {
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    width: 80px;
}
.bars-panel-subheading {
    font-family: 'Fraunces', serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin: 1.25rem 0 0.25rem;
}
.bar-admin-row--readonly {
    opacity: 0.85;
}
.need-row {
    flex-direction: column;
    align-items: stretch;
}
.need-row .bar-admin-label {
    gap: 0.15rem;
    display: flex;
    flex-direction: column;
}
.need-overdue {
    color: var(--error);
    font-weight: 600;
}
.need-reaction-form {
    max-width: 260px;
}
.decay-preview {
    font-size: 0.75rem;
    color: var(--ink-soft);
    white-space: nowrap;
}

/* Check-in page */
.checkin-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.checkin-form.step-hidden {
    display: none;
}
.checkin-need-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}
#checkin-needs-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 1rem;
}
.checkin-bar {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}
.checkin-bar legend {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    padding: 0 0.4rem;
}
.checkin-bar-visual {
    position: relative;
    height: 26px;
    margin-top: 1.7rem; /* room for the floating bubble above */
}
.checkin-visual-track {
    position: absolute;
    inset: 0;
    display: block;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}
.checkin-visual-base {
    position: absolute;
    inset: 0;
    width: 0;
    background: #1E88E5;
    /* No border-radius here — .checkin-visual-track's own rounded
       corners + overflow:hidden already round the overall bar shape.
       Rounding this fill segment too made a short fill look like a
       floating capsule instead of a bar filled from the left edge. */
}
.checkin-visual-delta {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
}
.checkin-visual-delta[hidden] { display: none; }
.checkin-visual-delta--up { background: #2ECC71; }
.checkin-visual-delta--down { background: #E53935; }

.checkin-slider-bubble {
    position: absolute;
    top: -1.6rem;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--paper-raised);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
}
.checkin-slider-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--ink);
}

/* The native range input sits directly on top of the visual track,
   stretched to fill it exactly — its own track/fill is made fully
   transparent (cross-browser, including Firefox's separate
   ::-moz-range-progress fill pseudo-element, easy to miss) so only the
   visual track underneath shows, and only a thin, light-colored thumb
   is visible for dragging — sized to blend with the bar rather than
   read as its own big separate control. */
.checkin-slider {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}
.checkin-slider::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    background: transparent;
    height: 100%;
}
.checkin-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 6px;
    height: 20px;
    margin-top: 3px;
    border-radius: 3px;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.25);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    cursor: grab;
}
.checkin-slider::-moz-range-track {
    background: transparent;
    height: 100%;
    border: none;
}
.checkin-slider::-moz-range-progress {
    background: transparent; /* Firefox's own "filled" portion — separate from the track, easy to miss, and what was actually showing through as an unwanted default-colored fill */
}
.checkin-slider::-moz-range-thumb {
    width: 6px;
    height: 20px;
    border-radius: 3px;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.25);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    cursor: grab;
}
.checkin-slider::-moz-focus-outer {
    border: 0;
}

.checkin-slider-row {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
}
.checkin-slider-row .checkin-bar-visual {
    flex: 1;
}
.checkin-step-btn {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.checkin-notes-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0.5rem 0 0.4rem;
}
.checkin-notes-field {
    margin-bottom: 1rem;
}

/* Notes: compose modal + note-view modal */
textarea {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
}

.emoji-pick-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.emoji-pick {
    flex: 1;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.5rem 0;
    cursor: pointer;
    font-size: 1.2rem;
}
.emoji-pick input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.emoji-pick:has(input:checked) {
    background: var(--paper);
    border-color: var(--ink);
}

.note-mode-tabs {
    display: flex;
    gap: 0.4rem;
    margin: 0.75rem 0;
}
.note-mode-tab {
    flex: 1;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.45rem 0;
    font-size: 0.85rem;
    color: var(--ink-soft);
    cursor: pointer;
}
.note-mode-tab.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper-raised);
}

.draw-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.draw-swatch {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    padding: 0;
    cursor: pointer;
}
.draw-swatch.is-active {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.draw-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.draw-tool {
    display: inline-flex;
}
.draw-tool input[type="color"] {
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: none;
    cursor: pointer;
}
.draw-tool--size input[type="range"] {
    width: 6rem;
}
.draw-tool-btn.is-active {
    background: var(--ink);
    color: var(--paper-raised);
    border-color: var(--ink);
}
.draw-tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
#note-draw-canvas {
    display: block;
    width: 100%;
    max-width: 480px;
    height: auto;
    aspect-ratio: 480 / 300;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
    margin-bottom: 0.5rem;
}
.note-draw-hint {
    margin: 0 0 0.75rem;
}

.note-view-drawing-img {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--line);
    margin: 0 0 1rem;
    background: #fff;
}
.note-view-drawing-img[hidden] { display: none; }

.note-view-message {
    font-size: 1.05rem;
    line-height: 1.5;
    background: var(--paper);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    margin: 0 0 1rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Positions this specific modal lower on the screen, roughly level with
   the game view behind it, instead of pinned near the top like the
   settings/check-in modals. */
.modal-scrim--lower {
    align-items: center;
}
.note-view-card {
    max-width: 380px;
}
.image-lightbox-card {
    max-width: 90vw;
    text-align: center;
}
.image-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    border: 1px solid var(--line);
    margin: 0 auto 1rem;
    background: #fff;
}
.note-view-topline {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.note-view-from {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.1rem;
}
.note-view-time {
    font-size: 0.78rem;
    color: var(--ink-soft);
    white-space: nowrap;
}
.note-view-dismiss {
    width: 100%;
    text-align: center;
    margin-top: 0;
}
.pending-response-card {
    max-width: 520px;
    position: relative;
    background: linear-gradient(180deg, #FFF9F4 0%, var(--paper-raised) 90px);
}
.pending-response-close {
    position: absolute;
    top: 0.6rem;
    right: 0.7rem;
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}
.pending-response-close:hover {
    color: var(--ink);
}
.pending-response-header {
    padding-right: 1.8rem;
    margin-bottom: 0.5rem;
}
.pending-response-header h3 {
    margin: 0.1rem 0 0;
    font-size: 1.1rem;
    font-family: var(--font-display, inherit);
}
.pending-response-category {
    display: inline-block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-a);
    font-weight: 700;
}

/* Chat-style thread: the original idea as the first message, then each
   response in the order they happened. Whoever's viewing sees their
   own messages on the right, the other person's on the left — same
   convention as any ordinary messaging app, and it updates naturally
   depending on who's logged in without needing separate markup. */
.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.4rem 0.2rem;
}
.chat-message {
    max-width: 82%;
    padding: 0.45rem 0.65rem;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.4;
}
.chat-message--theirs {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-message--mine {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-message-speaker {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}
.chat-message-level {
    font-weight: 700;
}
.chat-message-time {
    display: block;
    font-size: 0.65rem;
    color: var(--ink-soft);
    margin-top: 0.2rem;
}

/* A soft torn-ticket edge between the conversation and the response
   controls — the whole popup is basically a little date-night coupon:
   the idea's the offer, the rating's the redemption. */
.pending-response-divider {
    height: 1px;
    margin: 0.6rem 0;
    background-image: repeating-linear-gradient(to right, var(--line) 0, var(--line) 6px, transparent 6px, transparent 12px);
}

.pending-response-status {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 4px solid var(--ink-soft);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    margin: 0 0 0.6rem;
}
.pending-response-react-form {
    margin-bottom: 0.6rem;
}
.pending-response-submit {
    width: 100%;
    margin-top: 0.6rem;
}
.pending-response-note-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.6rem;
}
.pending-response-note-form[hidden] { display: none; }
.pending-response-note-form input[type="text"] {
    flex: 1;
    height: 2.1rem;
    padding: 0 0.6rem;
    margin: 0;
    font-size: 0.85rem;
}
.pending-response-note-form button {
    height: 2.1rem;
    margin: 0;
    flex-shrink: 0;
}

.pending-response-tags-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0.5rem 0;
}
.tag-add-chip {
    display: inline-flex;
    align-items: center;
    height: 1.9rem;
    padding: 0 0.6rem;
    border-radius: 999px;
    border: 1px dashed var(--line);
    background: none;
    color: var(--ink-soft);
    font-size: 0.78rem;
    cursor: pointer;
}
.tag-add-chip:hover {
    color: var(--ink);
    border-color: var(--ink-soft);
}
/* All three controls share the same height so the row reads as one
   unit instead of three mismatched pieces. */
.pending-response-tag-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.4rem 0 0.6rem;
}
.pending-response-tag-form[hidden] { display: none; }
.pending-response-tag-form select,
.pending-response-tag-form input[type="number"],
.pending-response-tag-form button {
    height: 2.1rem;
    margin: 0;
    font-size: 0.82rem;
    box-sizing: border-box;
}
.pending-response-tag-form select {
    flex: 1;
    min-width: 8rem;
    padding: 0 0.5rem;
}
.pending-response-tag-form input[type="number"] {
    width: 4.5rem;
    padding: 0 0.5rem;
}
.pending-response-tag-form button {
    padding: 0 0.8rem;
    flex-shrink: 0;
}

/* Lists page (Activities/Likes/Fantasies/Gift Ideas) */
.list-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.list-tab {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.9rem;
}
.list-tab--active {
    background: var(--ink);
    color: var(--paper-raised);
    border-color: var(--ink);
}

.list-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}
.list-item-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    background: var(--paper-raised);
}
.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
.list-item-header .auth-sub {
    margin: 0.15rem 0 0;
}
.list-item-description {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--ink);
}
.list-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}
.list-item-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    color: var(--ink);
}
.tag-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    flex-shrink: 0;
}
.list-item-tag-remove { display: inline; }
.list-item-tag-remove button {
    background: none;
    border: none;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    line-height: 1;
}
.list-item-add-tag {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}
.list-item-add-tag select,
.list-item-add-tag input {
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 6px;
}
.list-item-reactions {
    margin-top: 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}
.list-item-reaction {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}
.reaction-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.reaction-levels {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.reaction-levels--centered {
    justify-content: center;
    gap: 0.6rem;
}
.reaction-levels--centered .reaction-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 4.4rem;
    padding: 0.8rem 0.7rem 0.6rem;
    font-size: 0.78rem;
}
.reaction-level-symbol {
    font-size: 1.7rem;
    line-height: 1;
    color: var(--ink-soft);
}
.reaction-level-text {
    display: block;
}
.reaction-level {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--ink-soft);
}
.reaction-level input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.reaction-level:has(input:checked) {
    background: var(--ink);
    color: var(--paper-raised);
    border-color: var(--ink);
}
.reaction-form input[type="text"] {
    font-size: 0.85rem;
    padding: 0.45rem 0.6rem;
}
