  :root {
    /* Weber County EM portal palette — navy / gold / cream.
       Matches webercountyem.gov: navy #1A365D, navy-dark #0F2440,
       gold #C99C3E, gold-dark #8F6F22, cream #F7F4ED, border #D6D3CD. */
    --bg:            #f7f4ed;
    --bg-tint:       #efeadd;
    --surface:       #ffffff;
    --ink:           #1f2937;
    --ink-soft:      #4b5563;
    --ink-faint:     #6b7280;
    --rule:          #d6d3cd;
    --rule-strong:   #c2bdb2;

    /* Single confident accent — portal navy */
    --accent:        #1a365d;
    --accent-deep:   #0f2440;
    --accent-tint:   #e8eef5;

    /* Semantic. Warnings/errors stay distinct from the navy/gold brand;
       the "best time" highlight uses the portal gold (#C99C3E). */
    --warn:          #92400e;
    --warn-bg:       #fef3c7;
    --error:         #991b1b;
    --error-bg:      #fee2e2;
    --best:          #f3e2b3;
    --best-strong:   #c99c3e;

    --shadow-sm: 0 1px 2px rgba(15,36,64,0.05);
    --shadow:    0 2px 8px rgba(15,36,64,0.07), 0 1px 2px rgba(15,36,64,0.05);

    --serif: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
    --sans:  'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  }

  * { box-sizing: border-box; }

  html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
  }

  /* Subtle paper-grain texture on the background */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
      radial-gradient(circle at 20% 30%, rgba(26,54,93,0.025) 0, transparent 40%),
      radial-gradient(circle at 80% 70%, rgba(201,156,62,0.03) 0, transparent 45%);
  }

  .container {
    max-width: 880px;
    margin: 0 auto;
    padding: 56px 28px 80px;
    position: relative;
    z-index: 1;
  }

  /* Masthead — small, editorial */
  .masthead {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding-bottom: 20px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--rule);
  }
  .masthead .mark {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.01em;
    color: var(--accent);
  }
  .masthead .mark::before {
    content: '§';
    color: var(--accent);
    margin-right: 6px;
    font-style: italic;
  }
  .masthead .tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-faint);
  }

  /* ===== Portal chrome (matches webercountyem.gov) ===== */
  /* Signature navy→gold strip across the very top of every page. */
  .accent-strip {
    height: 3px;
    background: linear-gradient(to right,
      var(--accent) 0%, var(--accent) 60%,
      #c99c3e 60%, #c99c3e 100%);
    position: relative;
    z-index: 1;
  }
  /* "← Portal Home" back link, same treatment as the SHSP app pages. */
  .nav-back {
    position: relative;
    z-index: 1;
    margin-bottom: 22px;
  }
  .nav-back a {
    color: var(--ink-faint);
    font-size: 0.85rem;
    text-decoration: none;
  }
  .nav-back a:hover { color: var(--accent); text-decoration: underline; }
  /* Quiet footer to match the portal's footer voice. */
  .site-footer {
    position: relative;
    z-index: 1;
    margin-top: 56px;
    padding-top: 22px;
    border-top: 1px solid var(--rule);
    color: var(--ink-faint);
    font-size: 12px;
    line-height: 1.6;
  }
  .site-footer a { color: var(--ink-faint); text-decoration: none; }
  .site-footer a:hover { color: var(--accent); text-decoration: underline; }

  /* Cards */
  .card {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 40px 44px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
  }
  @media (max-width: 640px) {
    .card { padding: 28px 22px; }
    .container { padding: 32px 16px 56px; }
  }

  /* Typography */
  h1 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 38px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 6px 0;
    color: var(--ink);
  }
  h1 em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
  }
  h2 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 22px;
    letter-spacing: -0.01em;
    margin: 32px 0 12px;
  }
  .eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    margin-bottom: 8px;
  }
  .subtitle {
    color: var(--ink-soft);
    margin: 0 0 24px;
    font-size: 16px;
  }
  .meta-line {
    color: var(--ink-soft);
    font-size: 14px;
    margin: 0 0 4px;
  }
  .meta-line strong {
    color: var(--ink);
    font-weight: 600;
  }

  /* Form fields */
  .field { margin-bottom: 18px; }
  .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  @media (max-width: 560px) {
    .field-row { grid-template-columns: 1fr; }
  }
  label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--ink);
    letter-spacing: 0.01em;
  }
  input[type="text"],
  input[type="email"],
  input[type="datetime-local"],
  input[type="number"],
  textarea,
  select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--rule-strong);
    border-radius: 3px;
    font-size: 15px;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
    transition: border-color .12s, box-shadow .12s;
  }
  input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-tint);
  }
  /* Invalid field highlight — used for malformed email entry */
  input.input-error,
  input.input-error:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 3px var(--error-bg);
  }
  textarea { resize: vertical; min-height: 72px; }

  /* Buttons */
  button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    padding: 11px 22px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background .12s, border-color .12s, transform .04s;
  }
  button:hover:not(:disabled), .btn:hover:not(:disabled) {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
  }
  button:active:not(:disabled) { transform: translateY(1px); }
  button:disabled { opacity: .55; cursor: not-allowed; }

  .btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--rule-strong);
  }
  .btn-ghost:hover:not(:disabled) {
    background: var(--bg-tint);
    border-color: var(--ink-faint);
    color: var(--ink);
  }

  .btn-small {
    padding: 6px 12px;
    font-size: 12px;
  }

  /* Slot list (organizer) */
  .slot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0 12px;
  }
  .slot-row {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .slot-row input { flex: 1; }
  .slot-remove {
    background: transparent;
    color: var(--ink-faint);
    border: 1px solid var(--rule);
    padding: 9px 13px;
    border-radius: 3px;
    font-size: 13px;
  }
  .slot-remove:hover { background: var(--bg-tint); color: var(--error); border-color: var(--error); }

  /* Up/down reorder controls for slot rows (create page and edit modal) */
  .slot-reorder {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
  }
  .slot-move {
    background: transparent;
    color: var(--ink-faint);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0;
    width: 28px;
    height: 18px;
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .12s, border-color .12s, background .12s;
  }
  .slot-move:hover:not(:disabled) {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-tint);
  }
  .slot-move:disabled {
    opacity: 0.3;
    cursor: default;
  }

  /* Vote checkboxes */
  .vote-list { margin: 8px 0; }
  .vote-row {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border: 1px solid var(--rule);
    border-radius: 3px;
    margin-bottom: 8px;
    cursor: pointer;
    background: var(--surface);
    transition: background .1s, border-color .1s;
    user-select: none;
  }
  .vote-row:hover { background: var(--bg-tint); }
  .vote-row.checked {
    background: var(--accent-tint);
    border-color: var(--accent);
  }
  .vote-row input[type="checkbox"] {
    margin: 0 14px 0 0;
    width: 18px; height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
  }
  .vote-row .slot-label { flex: 1; font-size: 15px; }
  .vote-row .slot-label .day {
    font-family: var(--serif);
    font-weight: 500;
    margin-right: 8px;
  }
  .vote-row .slot-label .time { color: var(--ink-soft); }

  /* Participant-proposed slot — small pill that sits next to the time */
  .added-tag {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 9px;
    background: var(--accent-tint);
    color: var(--accent-deep);
    border-radius: 99px;
    font-size: 10.5px;
    font-family: var(--sans);
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.5;
    white-space: nowrap;
    vertical-align: 2px;
  }
  .vote-row.added {
    border-left: 3px solid var(--accent);
    padding-left: 13px;
  }
  /* Inside the results matrix header */
  th.added .added-tag {
    display: block;
    margin: 4px 0 0 0;
    text-align: center;
  }

  /* Propose-another-time panel on the voting page */
  .propose-wrap {
    margin: 18px 0 6px;
    padding-top: 14px;
    border-top: 1px dashed var(--rule);
  }
  .propose-panel {
    margin-top: 14px;
    padding: 16px;
    background: var(--bg-tint);
    border: 1px solid var(--rule);
    border-radius: 4px;
    animation: editPanelFadeIn .18s ease-out;
  }

  /* List of datetime pickers inside the propose panel */
  .propose-slot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
  }
  .propose-row {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .propose-row-input {
    flex: 1;
    min-width: 0;
  }
  .propose-row-remove {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 13px;
    background: transparent;
    color: var(--ink-faint);
    border: 1px solid var(--rule);
    border-radius: 3px;
    cursor: pointer;
    transition: color .12s, border-color .12s, background .12s;
    font-family: var(--sans);
  }
  .propose-row-remove:hover {
    color: var(--error);
    border-color: var(--error);
    background: var(--error-bg);
  }

  /* Invite toggle on the finalize panel */
  .invite-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin: 6px 0 16px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--bg-tint);
    cursor: pointer;
    transition: background .12s, border-color .12s;
  }
  .invite-toggle:hover { border-color: var(--rule-strong); }
  .invite-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
  }
  .invite-toggle.off { background: transparent; }
  .invite-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.4;
  }
  .invite-toggle-title {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ink);
    font-family: var(--sans);
  }
  .invite-toggle-sub {
    font-size: 12.5px;
    color: var(--ink-soft);
    font-family: var(--sans);
  }
  .invite-toggle.off .invite-toggle-title { color: var(--ink-soft); }

  /* Edit (reschedule) panel — appears inside the scheduled card */
  .edit-panel {
    margin-top: 4px;
    padding-top: 4px;
    animation: editPanelFadeIn .18s ease-out;
  }
  .edit-panel .rule { margin: 22px 0 18px; }
  @keyframes editPanelFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Share box */
  .share-box {
    background: var(--bg-tint);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 18px;
    margin: 14px 0;
  }
  .share-box .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-faint);
    margin-bottom: 8px;
  }
  .share-box code {
    display: block;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    word-break: break-all;
    margin-bottom: 10px;
    color: var(--ink);
  }

  /* Results matrix */
  .results-scroll {
    overflow-x: auto;
    margin: 8px -4px;
    padding: 4px;
  }
  table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 500px;
    font-size: 14px;
  }
  thead th {
    background: var(--bg-tint);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-soft);
    padding: 12px 10px;
    border-bottom: 2px solid var(--rule-strong);
    text-align: center;
    white-space: nowrap;
    line-height: 1.3;
  }
  thead th:first-child { text-align: left; }
  thead th .day {
    display: block;
    font-family: var(--serif);
    font-size: 13px;
    text-transform: none;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 2px;
    font-weight: 500;
  }
  thead th .time {
    display: block;
    font-size: 11px;
    color: var(--ink-faint);
    text-transform: none;
    letter-spacing: 0;
  }
  tbody td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid var(--rule);
  }
  tbody td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--ink);
  }
  tbody tr:last-child td { border-bottom: none; }

  td.cell-yes {
    background: var(--accent-tint);
    color: var(--accent-deep);
    font-weight: 600;
  }
  td.cell-no { color: var(--rule-strong); }

  th.best, td.best { background: var(--best); }
  td.cell-yes.best { background: #fcd34d; }
  tr.tally-row td {
    background: var(--bg-tint);
    font-weight: 700;
    color: var(--ink);
    border-top: 2px solid var(--rule-strong);
  }
  tr.tally-row td.best { background: var(--best-strong); color: #fff; }

  th .conflict-flag {
    display: inline-block;
    margin-top: 4px;
    font-size: 10px;
    color: var(--warn);
    background: var(--warn-bg);
    padding: 2px 6px;
    border-radius: 2px;
    font-weight: 600;
    letter-spacing: 0.04em;
  }

  /* Banners */
  .banner {
    padding: 14px 18px;
    border-radius: 3px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
  }
  .banner.error  { background: var(--error-bg); color: var(--error); border: 1px solid #fca5a5; }
  .banner.success { background: var(--accent-tint); color: var(--accent-deep); border: 1px solid #86b29a; }
  .banner.info   { background: var(--bg-tint); color: var(--ink-soft); border: 1px solid var(--rule); }

  /* Spinner */
  .spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
  }

  hr.rule {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 28px 0;
  }

  /* Empty / loading states */
  .empty {
    text-align: center;
    padding: 36px 20px;
    color: var(--ink-faint);
    font-style: italic;
    font-family: var(--serif);
  }

  /* ============================================================
     Meeting log — editorial ledger style
     Open registry feel: hairline rules, numbered entries, refined
     typographic hierarchy. No boxed-table chrome.
     ============================================================ */

  /* Header strip above the ledger */
  .history-summary {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 2px 0 18px;
  }
  .history-summary .lede {
    color: var(--ink-soft);
    font-size: 15px;
    margin: 0;
    flex: 1;
    font-family: var(--serif);
    font-style: italic;
    line-height: 1.45;
    max-width: 56ch;
  }
  .history-count {
    font-family: var(--sans);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--ink-faint);
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
    line-height: 1.4;
  }
  .history-count strong {
    display: block;
    font-family: var(--serif);
    font-style: normal;
    font-weight: 500;
    font-size: 30px;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
  }

  /* The ledger — two heavy rules top & bottom, no side borders */
  .history-table {
    border-top: 2px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    background: transparent;
  }

  .history-scroll {
    max-height: 460px;
    overflow-y: auto;
    /* Hint at scrollability without a hard shadow */
    background:
      linear-gradient(var(--surface) 30%, rgba(255,255,255,0)) center top,
      linear-gradient(rgba(255,255,255,0), var(--surface) 70%) center bottom,
      radial-gradient(farthest-side at 50% 0, rgba(26,25,22,0.08), rgba(0,0,0,0)) center top,
      radial-gradient(farthest-side at 50% 100%, rgba(26,25,22,0.08), rgba(0,0,0,0)) center bottom;
    background-repeat: no-repeat;
    background-size: 100% 24px, 100% 24px, 100% 10px, 100% 10px;
    background-attachment: local, local, scroll, scroll;
  }
  .history-scroll::-webkit-scrollbar { width: 8px; }
  .history-scroll::-webkit-scrollbar-track { background: transparent; }
  .history-scroll::-webkit-scrollbar-thumb {
    background: var(--rule-strong);
    border-radius: 4px;
  }
  .history-scroll::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

  /* Shared grid — fixed-width entry number, flexible meeting/when, fixed status/votes */
  .history-thead,
  .history-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1.9fr) minmax(0, 1.15fr) 104px 96px;
    gap: 22px;
    align-items: baseline;
  }

  .history-thead {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 13px 6px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--ink);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--ink-faint);
    font-weight: 600;
    font-family: var(--sans);
  }
  .history-thead .col-status,
  .history-thead .col-votes { text-align: right; }
  .history-thead .col-num   { text-align: left; }

  .history-item {
    /* The history row is a <button> for accessibility (modal opener) — reset
       all the browser defaults so it looks identical to the prior anchor row. */
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--rule);
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
    padding: 22px 6px;
    text-decoration: none;
    color: inherit;
    transition: background .14s ease;
    position: relative;
  }
  .history-item:last-child { border-bottom: none; }
  .history-item:hover { background: var(--bg-tint); }
  .history-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    background: var(--bg-tint);
  }

  /* Subtle left accent rail on hover — editorial touch, not a full marker */
  .history-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18%;
    bottom: 18%;
    width: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity .14s ease;
  }
  .history-item:hover::before,
  .history-item:focus-visible::before { opacity: 1; }

  /* Entry number — italic serif registry mark */
  .history-num {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: 14px;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    line-height: 1;
    align-self: center;
  }

  /* Meeting cell */
  .history-title-cell { min-width: 0; }
  .history-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 19px;
    color: var(--ink);
    margin: 0 0 5px 0;
    line-height: 1.2;
    letter-spacing: -0.012em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .history-organizer {
    font-family: var(--serif);
    font-style: italic;
    color: var(--ink-soft);
    font-size: 13.5px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .history-organizer .by {
    font-family: var(--sans);
    font-style: normal;
    font-size: 9.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-faint);
    font-weight: 600;
    margin-right: 7px;
    vertical-align: 1px;
  }

  /* When */
  .history-date-cell { min-width: 0; align-self: center; }
  .history-date {
    font-family: var(--serif);
    font-size: 16px;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    margin: 0 0 4px 0;
    line-height: 1.2;
    font-weight: 400;
    letter-spacing: -0.005em;
  }
  .history-date-sub {
    font-size: 10px;
    color: var(--ink-faint);
    font-family: var(--sans);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1.2;
  }

  /* Status — refined text marker, no pill */
  .history-status-cell {
    text-align: right;
    align-self: center;
  }
  .history-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 600;
    font-family: var(--sans);
    line-height: 1;
  }
  .history-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
  }
  .history-status.open    { color: var(--accent); }
  .history-status.closed  { color: var(--ink-faint); }
  .history-status.closed::before { background: var(--rule-strong); }
  .history-status.cancelled { color: var(--error); }
  .history-status.cancelled::before { background: var(--error); }

  /* Cancelled rows — quieter than active ones, with strike on the title */
  .history-item.cancelled .history-title {
    text-decoration: line-through;
    color: var(--ink-faint);
  }
  .history-item.cancelled .history-organizer,
  .history-item.cancelled .history-date,
  .history-item.cancelled .history-date-sub,
  .history-item.cancelled .history-votes-num {
    color: var(--ink-faint);
  }

  /* Responses — large serif numeral with refined caption */
  .history-votes-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
    align-self: center;
  }
  .history-votes-num {
    font-family: var(--serif);
    font-size: 30px;
    font-weight: 400;
    color: var(--ink);
    line-height: 1;
    display: block;
    margin-bottom: 5px;
    letter-spacing: -0.02em;
  }
  .history-votes-num.zero {
    color: var(--rule-strong);
    font-style: italic;
  }
  .history-votes-label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ink-faint);
    font-weight: 600;
    font-family: var(--sans);
  }

  /* Empty state — refined, no boxed card */
  .history-empty {
    padding: 64px 24px;
    text-align: center;
    background: transparent;
    border-top: 2px solid var(--ink);
    border-bottom: 1px solid var(--ink);
  }
  .history-empty .glyph {
    font-family: var(--serif);
    font-style: italic;
    font-size: 64px;
    color: var(--accent);
    opacity: .28;
    line-height: 1;
    margin-bottom: 14px;
    font-weight: 500;
  }
  .history-empty .msg {
    font-family: var(--serif);
    font-size: 20px;
    font-style: italic;
    font-weight: 400;
    color: var(--ink-soft);
    margin: 0 0 6px 0;
    letter-spacing: -0.005em;
  }
  .history-empty .sub {
    font-size: 13px;
    color: var(--ink-faint);
    margin: 0;
    max-width: 36ch;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
  }

  /* Loading placeholder */
  .history-loading {
    padding: 56px 24px;
    text-align: center;
    color: var(--ink-faint);
    font-family: var(--serif);
    font-style: italic;
    font-size: 15px;
    border-top: 2px solid var(--ink);
    border-bottom: 1px solid var(--ink);
  }

  /* ============================================================
     Share-link modal — opens from a clicked meeting log row
     ============================================================ */

  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 25, 22, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: modalBackdropFade .14s ease-out;
  }
  @keyframes modalBackdropFade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  .modal-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 32px 32px 24px;
    max-width: 560px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow:
      0 1px 2px rgba(0,0,0,0.04),
      0 12px 32px rgba(0,0,0,0.18);
    animation: modalCardIn .18s ease-out;
  }
  @keyframes modalCardIn {
    from { opacity: 0; transform: translateY(8px) scale(0.99); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  .modal-card h2 {
    font-size: 24px;
    margin: 6px 0 4px;
    font-family: var(--serif);
    line-height: 1.2;
    letter-spacing: -0.01em;
  }

  .modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--ink-faint);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    border-radius: 3px;
    font-family: var(--sans);
    transition: color .12s, background .12s;
  }
  .modal-close:hover {
    color: var(--ink);
    background: var(--bg-tint);
  }

  /* Modal-flavored copy button state */
  .btn-ghost.copied {
    color: var(--accent);
    border-color: var(--accent);
  }

  /* Row of secondary actions in the modal (Edit / Cancel meeting) */
  .modal-actions-row {
    display: flex;
    gap: 10px;
    margin: 18px 0 8px;
    padding: 14px 0;
    border-top: 1px dashed var(--rule);
    border-bottom: 1px dashed var(--rule);
  }
  .modal-actions-row .btn-ghost {
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  /* Delete link — a quiet, full-width text button below the action row.
     Deliberately understated so it doesn't compete with Edit/Cancel, but
     turns clearly destructive (red) on hover. */
  .modal-delete-row {
    text-align: center;
    margin: 0 0 8px;
  }
  .modal-delete-link {
    background: transparent;
    border: none;
    color: var(--ink-faint);
    font-size: 12.5px;
    font-family: var(--sans);
    cursor: pointer;
    padding: 6px 10px;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .12s;
  }
  .modal-delete-link:hover {
    color: var(--error);
  }

  /* Edit-times list inside the modal */
  .edit-times-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
  }
  .edit-time-row {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .edit-time-input {
    flex: 1;
    min-width: 0;
  }
  .edit-time-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
    flex-shrink: 0;
    min-width: 96px;
    line-height: 1.25;
  }
  .edit-time-votes {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-soft);
    font-weight: 600;
    font-family: var(--sans);
  }
  .edit-time-proposer {
    font-size: 10px;
    font-family: var(--sans);
    color: var(--accent);
    background: var(--accent-tint);
    padding: 2px 7px;
    border-radius: 99px;
    letter-spacing: 0.02em;
    font-weight: 600;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .edit-time-remove {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 12.5px;
    background: transparent;
    color: var(--ink-faint);
    border: 1px solid var(--rule);
    border-radius: 3px;
    cursor: pointer;
    transition: color .12s, border-color .12s, background .12s;
    font-family: var(--sans);
  }
  .edit-time-remove:hover {
    color: var(--error);
    border-color: var(--error);
    background: var(--error-bg);
  }

  @media (max-width: 560px) {
    .edit-time-row {
      flex-wrap: wrap;
      gap: 6px 10px;
    }
    .edit-time-input {
      flex-basis: 100%;
    }
    .edit-time-meta {
      flex-direction: row;
      align-items: center;
      min-width: 0;
    }
  }

  /* Danger button — for destructive actions like cancelling a meeting */
  .btn-danger {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
  }
  .btn-danger:hover:not(:disabled) {
    background: #a72525;
    border-color: #a72525;
  }
  .btn-ghost.btn-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
  }
  .btn-ghost.btn-danger:hover:not(:disabled) {
    background: var(--error-bg);
    color: var(--error);
  }

  @media (max-width: 560px) {
    .modal-card {
      padding: 26px 20px 18px;
    }
    .modal-card h2 { font-size: 20px; }
  }

  /* Mobile — collapse to a stacked layout */
  @media (max-width: 640px) {
    .history-summary {
      flex-direction: column;
      align-items: flex-start;
      gap: 14px;
    }
    .history-count { text-align: left; }
    .history-count strong { font-size: 26px; display: inline; margin-right: 8px; }

    .history-thead { display: none; }
    .history-item {
      grid-template-columns: 36px minmax(0, 1fr) auto;
      grid-template-areas:
        "num   title  status"
        ".     date   votes";
      gap: 6px 14px;
      padding: 18px 6px;
      align-items: baseline;
    }
    .history-num         { grid-area: num; align-self: start; padding-top: 4px; font-size: 12px; }
    .history-title-cell  { grid-area: title; }
    .history-status-cell { grid-area: status; align-self: start; padding-top: 6px; }
    .history-date-cell   { grid-area: date; }
    .history-votes-cell  { grid-area: votes; align-self: end; }
    .history-title       { font-size: 16px; margin-bottom: 4px; }
    .history-date        { font-size: 14px; margin-bottom: 2px; }
    .history-date-sub    { font-size: 9.5px; }
    .history-votes-num   { font-size: 18px; display: inline; margin: 0; }
    .history-votes-label { display: inline; font-size: 9.5px; margin-left: 5px; letter-spacing: 0.14em; }
    .history-status      { font-size: 9.5px; letter-spacing: 0.14em; gap: 6px; }
  }
