/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/instrument-sans-latin-ext-a083bc1c.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/instrument-sans-latin-570a9648.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/newsreader-latin-ext-53136885.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/newsreader-latin-4b499f36.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Shared foundations. Postcard paper and stamp inks stay local to the card. */
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-editorial: "Newsreader", Georgia, "Times New Roman", serif;
  --text-caption: 0.75rem;
  --text-small: 0.875rem;
  --text-body: 1rem;
  --text-section: 1.5rem;
  --text-title: clamp(1.875rem, 4vw, 2.5rem);
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.25rem;
  --space-6: 3.5rem;
  --radius: 0.4rem;
  --control-height: 2.75rem;
  --page-width: 60rem;
  --focus-color: var(--button-focus-color, var(--deep-blue));
  --action-background: var(--ink);
  --action-color: var(--background);
  --action-hover: color-mix(in srgb, var(--ink) 90%, var(--background));
  --background: #e8e1d2;
  --ink: #1d3344;
  --muted: #506571;
  --line: #b8aa90;
  --paper: #fbf7ed;
  --navy: #17344a;
  --deep-blue: #1f5a7a;
  --pale-blue: #d8ebec;
  --main-background: transparent;
  --main-padding: 0;
  --button-background: var(--paper);
  --button-color: var(--navy);
  --button-border: var(--line);
  --button-hover-border: #aa9c83;
  --button-radius: var(--radius);
  --button-hover-background: #f3ede0;
  --button-hover-color: var(--navy);
  --account-trigger-background: var(--paper);
  --account-trigger-color: var(--navy);
  --account-trigger-radius: 0.75rem;
  --account-trigger-border: var(--line);
  --account-trigger-hover-border: var(--line);
  --account-trigger-hover: var(--pale-blue);
  --menu-border: #c9bda7;
  --menu-trigger-hover-border: var(--menu-border);
  --menu-trigger-hover: #fffdf7;
  --menu-item-border: #a7bdbe;
  --menu-divider-border: #c1b6a2;
  --menu-hover: #eae5d7;
  --menu-active: #e0d9c7;
  --menu-muted: #415d6d;
  --theme-switch-background: #f3ede0;
  --theme-switch-border: #c9bda7;
  --theme-switch-label: #415d6d;
  --theme-button-background: transparent;
  --theme-button-color: var(--navy);
  --theme-button-border: transparent;
  --theme-button-hover-background: var(--paper);
  --theme-button-hover-color: var(--navy);
  --theme-button-hover-border: #a7bdbe;
  --theme-button-selected-background: var(--paper);
  --theme-button-selected-color: var(--navy);
  --theme-button-selected-border: #a7bdbe;
  --section-trigger-radius: 0.75rem;
  --section-icon-filter: brightness(0) saturate(100%) invert(17%) sepia(16%) saturate(1213%) hue-rotate(169deg) brightness(92%) contrast(91%);
  --section-chevron-color: #59717e;
  --footer-legal-color: var(--muted);
  --inline-surface: rgba(0, 55, 115, 0.16);
  --roll-card-background: var(--paper);
  --roll-card-color: var(--navy);
  --roll-card-border: var(--deep-blue);
  --roll-card-blue: #d8ebec;
  --roll-card-lavender: #e5e0f7;
  --error-background: #f7d8c8;
  --error-color: #4e1813;
  --danger: #9d302e;
  --field-border: var(--muted);
  --status-stable: light-dark(#31674f, #a9d8bd);
  --status-beta: light-dark(#885b13, #edc778);
  --status-admin: light-dark(#71518d, #d5b8ed);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #10191d;
  --ink: #e7e5dc;
  --muted: #b4c1c0;
  --line: #4a5b5d;
  --paper: #1d292c;
  --navy: #e7e5dc;
  --deep-blue: #5b7478;
  --pale-blue: #283b3f;
  --main-background: transparent;
  --main-padding: 0;
  --button-background: #1d292c;
  --button-color: #e7e5dc;
  --button-border: #405154;
  --button-hover-border: #7ab6b9;
  --button-radius: var(--radius);
  --button-hover-background: #27383b;
  --button-hover-color: #e7e5dc;
  --button-icon-color: #8dced0;
  --button-focus-color: #8dced0;
  --account-trigger-background: #1d292c;
  --account-trigger-color: #8dced0;
  --account-trigger-radius: 0.75rem;
  --account-trigger-border: #405154;
  --account-trigger-hover-border: #7ab6b9;
  --account-trigger-hover: #27383b;
  --menu-border: #405154;
  --menu-trigger-hover-border: #7ab6b9;
  --menu-trigger-hover: #27383b;
  --menu-item-border: #5b7478;
  --menu-divider-border: #4a5b5d;
  --menu-hover: #27383b;
  --menu-active: #32474a;
  --menu-muted: #b4c1c0;
  --theme-switch-background: #16262a;
  --theme-switch-border: #4a5b5d;
  --theme-switch-label: #b4c1c0;
  --theme-button-background: transparent;
  --theme-button-color: #b4c1c0;
  --theme-button-border: transparent;
  --theme-button-hover-background: #27383b;
  --theme-button-hover-color: #e7e5dc;
  --theme-button-hover-border: #6d898c;
  --theme-button-selected-background: #1d292c;
  --theme-button-selected-color: #e7e5dc;
  --theme-button-selected-border: #8dced0;
  --section-trigger-radius: 0.75rem;
  --section-icon-filter: brightness(0) invert(1) opacity(0.78);
  --section-chevron-color: #b4c1c0;
  --footer-legal-color: #e7e5dc;
  --inline-surface: #1d292c;
  --roll-card-background: #faf6e9;
  --roll-card-color: #17304a;
  --roll-card-border: #174f7c;
  --error-background: #3a2927;
  --error-color: #ffd9d2;
  --danger: #ff9b8f;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --background: #10191d;
    --ink: #e7e5dc;
    --muted: #b4c1c0;
    --line: #4a5b5d;
    --paper: #1d292c;
    --navy: #e7e5dc;
    --deep-blue: #5b7478;
    --pale-blue: #283b3f;
    --main-background: transparent;
    --main-padding: 0;
    --button-background: #1d292c;
    --button-color: #e7e5dc;
    --button-border: #405154;
    --button-hover-border: #7ab6b9;
    --button-radius: var(--radius);
    --button-hover-background: #27383b;
    --button-hover-color: #e7e5dc;
    --button-icon-color: #8dced0;
    --button-focus-color: #8dced0;
    --account-trigger-background: #1d292c;
    --account-trigger-color: #8dced0;
    --account-trigger-radius: 0.75rem;
    --account-trigger-border: #405154;
    --account-trigger-hover-border: #7ab6b9;
    --account-trigger-hover: #27383b;
    --menu-border: #405154;
    --menu-trigger-hover-border: #7ab6b9;
    --menu-trigger-hover: #27383b;
    --menu-item-border: #5b7478;
    --menu-divider-border: #4a5b5d;
    --menu-hover: #27383b;
    --menu-active: #32474a;
    --menu-muted: #b4c1c0;
    --theme-switch-background: #16262a;
    --theme-switch-border: #4a5b5d;
    --theme-switch-label: #b4c1c0;
    --theme-button-background: transparent;
    --theme-button-color: #b4c1c0;
    --theme-button-border: transparent;
    --theme-button-hover-background: #27383b;
    --theme-button-hover-color: #e7e5dc;
    --theme-button-hover-border: #6d898c;
    --theme-button-selected-background: #1d292c;
    --theme-button-selected-color: #e7e5dc;
    --theme-button-selected-border: #8dced0;
    --section-trigger-radius: 0.75rem;
    --section-icon-filter: brightness(0) invert(1) opacity(0.78);
    --section-chevron-color: #b4c1c0;
    --footer-legal-color: #e7e5dc;
    --inline-surface: #1d292c;
    --roll-card-background: #faf6e9;
    --roll-card-color: #17304a;
    --roll-card-border: #174f7c;
    --error-background: #3a2927;
    --error-color: #ffd9d2;
    --danger: #ff9b8f;
  }
}

html {
  overflow-y: scroll;
}

body {
  box-sizing: border-box;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2rem);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--background);
}

h1 {
  margin: 0 0 var(--space-4);
  font: 500 var(--text-title)/1.15 var(--font-editorial);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: var(--control-height);
  margin-bottom: var(--space-5);
}

.global-search {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  width: min(20rem, calc(50% - 6rem));
  min-height: var(--control-height);
  margin: 0;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
}

.global-search:focus-within { border-color: var(--focus-color); outline: 2px solid var(--focus-color); }
.global-search input[type="search"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.6rem 0.5rem 0;
  border: 0;
  border-radius: 0 999px 999px 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}
.global-search input::placeholder { color: var(--ink); opacity: 1; }
.global-search__submit {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  min-height: var(--control-height);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: transparent;
  box-shadow: none;
}
.global-search__submit:hover { background: var(--line); }

.account-menu {
  position: absolute;
  top: 0.2rem;
  right: 0;
  font-family: var(--font-body);
}

.account-menu__trigger {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  box-sizing: border-box;
  border: 1px solid var(--account-trigger-border);
  border-radius: var(--account-trigger-radius);
  color: var(--account-trigger-color);
  background: var(--account-trigger-background);
  cursor: pointer;
  list-style: none;
}

.account-menu__trigger::-webkit-details-marker { display: none; }
.account-menu__trigger::marker { content: ""; }
.account-menu__trigger:hover {
  border-color: var(--account-trigger-hover-border);
  background: var(--account-trigger-hover);
}
.account-menu[open] .account-menu__trigger {
  border-color: var(--menu-item-border);
  background: var(--account-trigger-hover);
}
.account-menu__trigger:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 3px; }
.account-menu__trigger svg { width: 1.5rem; height: 1.5rem; }

.account-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--menu-divider-border);
  border-radius: 999px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.account-badge--stable { --badge-color: var(--status-stable); }
.account-badge--beta { --badge-color: var(--status-beta); }
.account-badge--admin { --badge-color: var(--status-admin); }
.account-badge:is(.account-badge--stable, .account-badge--beta, .account-badge--admin) {
  color: var(--badge-color);
  border-color: color-mix(in srgb, var(--badge-color) 40%, var(--paper));
  background: color-mix(in srgb, var(--badge-color) 10%, var(--paper));
}

.account-menu__channel {
  position: absolute;
  right: calc(100% + 0.65rem);
}

.entry-details.admin-accounts { grid-template-columns: 1fr; }

.admin-account {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-account > span:first-child { overflow-wrap: anywhere; }

.channel-editor > summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  cursor: pointer;
  list-style: none;
}
.channel-editor > summary::-webkit-details-marker { display: none; }
.channel-editor > summary::marker { content: ""; }
.channel-editor > summary > span:first-child { min-width: 0; }
.channel-editor > summary:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 3px; }
.channel-editor__toggle {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--button-border);
  border-radius: var(--radius);
  color: var(--button-color);
  background: var(--button-background);
  font-size: var(--text-small);
}
.channel-editor > summary:hover .channel-editor__toggle { background: var(--button-hover-background); }
.channel-editor .stacked-form { margin-top: var(--space-4); }
.channel-editor .form-actions input[type="submit"] { margin: 0; }
.channel-editor .channel-editor__options { margin: 0; padding: 0; border: 0; }
.channel-editor__options legend { margin-bottom: var(--space-1); }
.channel-editor .channel-editor__choice { display: inline-flex; align-items: center; gap: 0.5rem; margin-right: var(--space-4); }
.channel-editor__choice input[type="radio"] { width: 1.1rem; height: 1.1rem; margin: 0; }
.channel-editor__choice--stable { accent-color: var(--status-stable); }
.channel-editor__choice--beta { accent-color: var(--status-beta); }

.account-menu__panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  box-sizing: border-box;
  width: 16rem;
  max-width: calc(100vw - 2rem);
  padding: 0.375rem;
  border: 1px solid var(--menu-border);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 3px 4px 0 color-mix(in srgb, var(--deep-blue) 35%, var(--background));
}

.account-menu__panel form { margin: 0; }

.account-menu__theme {
  margin-bottom: 0.375rem;
  padding: 0.5rem 0.5rem 0.75rem;
  border-bottom: 1px solid var(--menu-divider-border);
}

.account-menu__theme-label {
  margin: 0 0 0.5rem;
  color: var(--theme-switch-label);
  font-size: var(--text-caption);
  font-weight: 600;
}

.account-menu__theme-options {
  display: flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--theme-switch-border);
  border-radius: var(--radius);
  background: var(--theme-switch-background);
}

.account-menu__theme-options button {
  flex: 1;
  min-height: 2rem;
  padding: 0.4rem 0.25rem;
  border: 1px solid var(--theme-button-border);
  border-radius: 0.2rem;
  color: var(--theme-button-color);
  background: var(--theme-button-background);
  box-shadow: none;
  font: 500 var(--text-caption)/1.2 var(--font-body);
}

.account-menu__theme-options button:hover {
  border-color: var(--theme-button-hover-border);
  color: var(--theme-button-hover-color);
  background: var(--theme-button-hover-background);
  transform: none;
  box-shadow: none;
}

.account-menu__theme-options button[aria-pressed="true"] {
  border-color: var(--theme-button-selected-border);
  color: var(--theme-button-selected-color);
  background: var(--theme-button-selected-background);
  transform: none;
  box-shadow: none;
}

.account-menu__theme-options button:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 1px;
}

.account-menu__link,
.account-menu__logout {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.625rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.2rem;
  color: var(--button-color);
  background: transparent;
  font: 500 var(--text-small)/1.3 var(--font-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu__footer {
  margin-top: 0.375rem;
  padding-top: 0.375rem;
  border-top: 1px solid var(--menu-divider-border);
}

.account-menu__link:hover,
.account-menu__link:focus-visible,
.account-menu__logout:hover,
.account-menu__logout:focus-visible {
  border-color: transparent;
  background: var(--menu-hover);
}

.account-menu__link:focus-visible,
.account-menu__logout:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: -2px;
}

@media (max-width: 36rem) {
  .global-search { width: min(18rem, calc(100% - 4rem)); }

  .site-header {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .account-menu {
    position: static;
    align-self: flex-end;
    order: -1;
  }
}

.section-menu {
  position: relative;
  width: fit-content;
  font-family: var(--font-body);
}

.section-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  box-sizing: border-box;
  min-height: var(--control-height);
  padding: 0.25rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--navy);
  background: transparent;
  cursor: pointer;
  list-style: none;
  transition: opacity 150ms ease;
}

.section-menu__trigger::-webkit-details-marker { display: none; }
.section-menu__trigger::marker { content: ""; }
.section-menu__trigger:hover {
  border-color: transparent;
  background: transparent;
}
.section-menu[open] .section-menu__trigger {
  border-color: transparent;
  background: transparent;
}
.section-menu__trigger:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 3px; }

.section-menu__brand {
  cursor: default;
}

.section-menu__brand:hover {
  border-color: transparent;
  background: transparent;
}

.section-menu__trigger .rollbook-logo {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}

.section-menu__wordmark {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.section-menu__chevron {
  margin-left: 0.15rem;
  width: 1rem;
  height: 1rem;
  color: var(--section-chevron-color);
  transition: transform 150ms ease;
}

.section-menu__chevron path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.section-menu[open] .section-menu__chevron { transform: rotate(180deg); }

.section-menu__panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 50%;
  box-sizing: border-box;
  width: min(30rem, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid var(--menu-border);
  border-radius: var(--radius);
  color: var(--navy);
  background: var(--paper);
  box-shadow: 3px 4px 0 color-mix(in srgb, var(--deep-blue) 35%, var(--background));
  animation: menu-arrive 120ms ease-out;
  translate: -50% 0;
}

.section-menu__intro {
  margin: 0.25rem 0 1rem;
  color: var(--menu-muted);
  font-size: var(--text-caption);
  text-align: center;
}

.section-menu__links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
}

.section-menu__links a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  box-sizing: border-box;
  min-height: 7rem;
  padding: 1.75rem 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--navy);
  background: color-mix(in srgb, var(--menu-hover) 55%, var(--paper));
  font-size: var(--text-small);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
}

.section-menu__links a:hover {
  background: var(--menu-hover);
}

.section-menu__links a.active {
  background: var(--menu-active);
  font-weight: 600;
}

.section-menu__links a:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: -2px;
}

.section-menu__icon {
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 auto;
  filter: var(--section-icon-filter);
}

kbd {
  border: 1px solid;
  border-radius: 0.3em;
  box-shadow: 0 0.1em 0 currentColor;
  font-family: ui-monospace, SFMono-Regular, SF Pro Text, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8em;
  font-weight: 600;
  opacity: 0.7;
  padding: 0 0.4em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

.section-menu kbd {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.section-menu__links kbd {
  position: absolute;
  top: 0.5rem;
  right: 0.625rem;
  color: var(--menu-muted);
  font-size: var(--text-caption);
  opacity: 1;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: var(--control-height);
  margin-bottom: var(--space-1);
  color: var(--muted);
  font-size: var(--text-small);
  text-decoration: none;
}

.back-link__label {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.back-link:hover { color: var(--ink); }

.back-link:focus-visible {
  outline: 3px solid var(--focus-color);
  outline-offset: 2px;
}

@keyframes menu-arrive {
  from { opacity: 0; transform: translateY(-0.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-bar { display: none; }

@media (max-width: 36rem) {
  .section-menu { display: none; }
  kbd { display: none; }

  main { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
  .footer { margin-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
  .footer__links { display: none; }

  .tab-bar {
    position: fixed;
    inset: auto 0 0;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.2rem;
    padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
    border-top: 2px solid var(--deep-blue);
    background: var(--paper);
    font-family: var(--font-body);
  }

  .tab-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.4rem 0.15rem;
    border: 2px solid transparent;
    border-radius: 3px;
    color: var(--navy);
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
  }

  .tab-bar a:focus-visible {
    border-color: var(--menu-item-border);
    background: var(--menu-hover);
    outline: none;
  }

  .tab-bar a.active {
    border-color: var(--deep-blue);
    background: var(--menu-active);
  }

  .tab-bar__icon {
    width: 1.75rem;
    height: 1.75rem;
    filter: var(--section-icon-filter);
  }
}

a {
  color: inherit;
}

.button,
button,
input[type="submit"] {
  box-sizing: border-box;
  display: inline-block;
  min-height: var(--control-height);
  padding: 0.65rem 1rem;
  border: 1px solid var(--button-border);
  border-radius: var(--button-radius);
  padding-inline: 1.1rem;
  color: var(--button-color);
  background: var(--button-background);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
  border-color: var(--button-hover-border);
  color: var(--button-hover-color);
  background: var(--button-hover-background);
}

.button:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible {
  outline: 3px solid var(--button-focus-color, var(--line));
  outline-offset: 4px;
}

.button--load {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.button--load .icon--add {
  font: 700 1.25em/1 var(--font-body);
  color: var(--button-icon-color, currentColor);
}

.button--primary {
  --button-background: var(--action-background);
  --button-color: var(--action-color);
  --button-border: var(--action-background);
  --button-hover-background: var(--action-hover);
  --button-hover-color: var(--action-color);
  --button-hover-border: var(--action-hover);
  --button-icon-color: var(--action-color);
}

.button--quiet {
  --button-background: transparent;
  --button-border: transparent;
  --button-hover-background: transparent;
  --button-hover-border: transparent;
  padding-inline: var(--space-1);
  font-size: var(--text-small);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.button--danger {
  --button-color: var(--danger);
  --button-hover-color: var(--danger);
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-3);
}

.page-header__actions form { margin: 0; }

.page-header__danger-action {
  margin-left: var(--space-1);
  padding-left: var(--space-3);
  border-left: 1px solid var(--line);
}

.page-header__greeting {
  margin: 0 0 var(--space-1);
  font: 1.125rem/1.5 var(--font-editorial);
  overflow-wrap: anywhere;
}

.page-header__status {
  margin: 0 0 var(--space-1);
  color: var(--muted);
  font: 600 var(--text-caption)/1.3 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-header__meta {
  margin: 0;
  color: var(--muted);
  font: var(--text-small)/1.5 var(--font-body);
}

.page-intro { max-width: 38rem; margin: 0 0 var(--space-4); }

.pat-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pat-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--line);
}

.pat-list__details {
  min-width: 0;
}

.pat-list strong {
  font: 500 1.125rem/1.35 var(--font-editorial);
  overflow-wrap: anywhere;
}

.pat-list__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem var(--space-3);
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: var(--text-small);
}

.pat-list__delete-form,
.pat-list__delete-form > div {
  flex: none;
  margin: 0;
}

.pat-copy__controls {
  display: flex;
  align-items: stretch;
  gap: var(--space-1);
  max-width: 38rem;
  margin-top: 0.25rem;
}

.pat-copy__controls input {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.pat-copy__controls button {
  flex: none;
}

.pat-copy__status {
  min-height: 1.5em;
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  color: var(--muted);
  font-size: var(--text-small);
  text-decoration: none;
}

form > div {
  margin-bottom: 1rem;
}

label {
  font-weight: 600;
}

input,
select,
textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.6rem 0.7rem;
  font: inherit;
}

/* Search and filters */

.list-filters {
  position: relative;
  margin: 0 0 var(--space-5);
}

.list-filters__clear { flex: none; color: var(--muted); font-size: var(--text-small); }
.list-filters__hint { margin: var(--space-3) 0 0; color: var(--muted); font-size: var(--text-small); }
.list-filters__details summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  width: fit-content;
  height: var(--control-height);
  padding-inline: var(--space-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  color: var(--muted);
}

.list-filters__details summary::-webkit-details-marker { display: none; }
.list-filters__details summary:hover,
.list-filters__details[open] summary { color: var(--ink); background: var(--line); }
.list-filters__details summary:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 3px; }
.list-filters__applied {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

.list-filters__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: var(--space-3); padding-block: var(--space-3); }
.list-filters__fields > div { min-width: 0; }
.list-filters__date-hint { grid-column: 1 / -1; margin: 0; font-size: var(--text-small); }
.list-filters__details > input[type="submit"] { margin: 0 0 var(--space-2); }

.list-filters > .list-filters__clear { display: inline-block; margin-top: var(--space-2); }
.search-help { margin-bottom: var(--space-5); color: var(--muted); font-size: var(--text-small); }
.search-help summary { cursor: pointer; }
.search-help p { max-width: 65ch; }
.search-pagination { display: flex; justify-content: center; gap: var(--space-4); margin-top: var(--space-4); }

/* Record lists */

.item-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.item-list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: 1px solid var(--line);
}

.item-list form { flex: none; margin: 0; }

.item-row {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  min-height: var(--control-height);
  box-sizing: border-box;
  padding: 0.65rem var(--space-2);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 150ms ease;
}

.item-row:hover { background: var(--pale-blue); }
.item-row:focus-visible { outline: 3px solid var(--focus-color); outline-offset: -3px; }
.item-row__name { flex: 1; min-width: 0; font: 500 1.125rem/1.35 var(--font-editorial); overflow-wrap: anywhere; }
.item-row__meta { color: var(--muted); font: var(--text-small)/1.4 var(--font-body); white-space: nowrap; }
.item-row::after { flex: 0 0 auto; display: grid; width: 2rem; height: 2rem; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 1rem; content: "↗" / ""; transition: background-color 150ms ease, color 150ms ease, transform 150ms ease; }
.item-row:hover::after { color: var(--ink); background: var(--paper); transform: translate(2px, -2px); }

textarea {
  min-height: 8rem;
}

button,
input[type="submit"] {
  width: auto;
  cursor: pointer;
}

form input[type="submit"] + .button {
  margin-left: 0.75rem;
}

.form-actions--primary {
  margin: 1rem 0 1.5rem;
}

.form-actions--sticky {
  position: sticky;
  bottom: var(--space-3);
  z-index: 1;
  margin: var(--space-5) 0 0;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 0.45rem 1rem rgba(15, 30, 40, 0.15);
}

@media (max-width: 36rem) {
  .form-actions--sticky {
    bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }

  .form-actions.form-actions--create {
    gap: 0.25rem var(--space-2);
    padding: var(--space-1);
    font-size: var(--text-small);
  }

  .form-actions--create input[type="submit"] { margin: 0; }
}

.metadata-row span + span {
  margin-left: 1rem;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-1);
  margin-bottom: var(--space-2);
}
.section-heading h2 { font: 500 var(--text-section)/1.2 var(--font-editorial); margin: 0; }
.section-heading > span { font: var(--text-small)/1.4 var(--font-body); color: var(--muted); white-space: nowrap; }

/* Roll Grid */

.roll-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.roll-card {
  --card-paper: #ffe16a;
  --card-ink: #20213b;
  --card-accent: #e34e32;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-3);
  position: relative;
  isolation: isolate;
  border-radius: 0.55rem 0.2rem 0.55rem 0.2rem;
  font-family: var(--font-editorial);
  color: var(--card-ink);
  background:
    radial-gradient(circle at 94% 92%, color-mix(in srgb, var(--card-accent) 24%, transparent) 0 4.5rem, transparent 4.6rem),
    repeating-linear-gradient(0deg, rgba(60, 43, 35, 0.018) 0 1px, transparent 1px 4px),
    linear-gradient(145deg, color-mix(in srgb, var(--card-paper) 88%, white), var(--card-paper));
  border: 2px solid var(--card-ink);
  box-shadow:
    inset 0 0 0 0.35rem rgba(255, 255, 255, 0.48),
    3px 3px 0 var(--card-accent),
    5px 5px 0 var(--card-ink);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
  width: 100%;
  max-width: 30rem;
  justify-self: center;
}

.roll-card::before {
  position: absolute;
  z-index: -1;
  inset: 0.5rem;
  border: 1px dashed color-mix(in srgb, var(--card-ink) 55%, transparent);
  border-radius: 0.25rem;
  content: "";
  pointer-events: none;
}

.roll-card:nth-child(4n + 2) { --card-paper: #83ded0; --card-accent: #e95436; }
.roll-card:nth-child(4n + 3) { --card-paper: #ffad9b; --card-accent: #6942a3; }
.roll-card:nth-child(4n) { --card-paper: #c4b2fa; --card-accent: #e2a82d; }

.roll-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.roll-card__heading { min-width: 0; }
.roll-card__metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.65rem;
  margin: 0.35rem 0 0;
  font: var(--text-small)/1.4 var(--font-body);
  overflow-wrap: anywhere;
}

.roll-card__metadata span + span::before { content: "· "; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.roll-card__postage {
  position: relative;
  flex: 0 0 auto;
  z-index: 2;
  display: grid;
  grid-template-rows: 1fr auto auto;
  justify-items: center;
  align-items: center;
  width: 2.6rem;
  height: 3rem;
  padding: 0.18rem;
  border: 0.28rem dotted var(--card-paper);
  outline: 1px solid rgba(255, 255, 255, 0.42);
  outline-offset: 1px;
  color: var(--card-ink);
  background: var(--card-accent);
  box-shadow: 2px 3px 0 var(--card-ink), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  font-family: var(--font-body);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  transform: rotate(7deg);
  pointer-events: none;
}

.roll-card__postage::before,
.roll-card__postage::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.roll-card__postage::before {
  inset: 0.25rem;
  border: 1px solid color-mix(in srgb, var(--card-ink) 65%, transparent);
}

.roll-card__postage::after {
  inset: 0.42rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.roll-card__postage-art,
.roll-card__postage-country,
.roll-card__postage-rate {
  position: relative;
  z-index: 1;
}

.roll-card__postage-art {
  grid-row: 1;
  align-self: end;
  width: 1.4rem;
  height: 1.4rem;
  color: var(--card-ink);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0.5px 0.5px rgba(255, 255, 255, 0.6));
}

.roll-card__postage-country {
  grid-row: 2;
  max-width: 100%;
  color: var(--card-ink);
  font-size: 0.42rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
}

.roll-card__postage-country--long {
  font-size: 0.35rem;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.roll-card__postage-rate {
  grid-row: 3;
  max-width: 100%;
  margin-top: 0.08rem;
  color: var(--card-ink);
  font-size: 0.26rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.roll-card__passport-marks {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  align-self: end;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.45rem;
  max-width: 6rem;
}

.roll-card__passport-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.35rem;
  border: 3px double currentColor;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font: 700 var(--text-caption)/1.1 var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  pointer-events: none;
}

.roll-card__passport-mark::before {
  position: absolute;
  inset: 0.15rem;
  border: 1px solid currentColor;
  border-radius: inherit;
  content: "";
  opacity: 0.5;
  pointer-events: none;
}

.roll-card__passport-mark--finished {
  color: #9d302e;
  border-radius: 0.25rem;
  transform: rotate(-5deg);
}

.roll-card__passport-mark--expired {
  color: #a84e20;
  border-radius: 0.35rem;
  transform: rotate(3deg);
}

.roll-card h3 {
  margin: 0;
  color: var(--card-ink);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: left;
  text-wrap: pretty;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

.roll-card__bottom {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.7rem;
}

.roll-card__bottom p {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: var(--text-small)/1.4 var(--font-body);
  overflow-wrap: anywhere;
}

.roll-card__arrow {
  box-sizing: border-box;
  flex: 0 0 auto;
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border: 2px solid var(--card-ink);
  border-radius: 50%;
  color: var(--card-paper);
  background: var(--card-ink);
}

.roll-card__arrow svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.roll-card:nth-child(4n + 2) { transform: rotate(-0.45deg); }
.roll-card:nth-child(4n + 3) { transform: rotate(0.45deg); }
.roll-card:hover {
  transform: translateY(-2px) rotate(0);
  box-shadow:
    inset 0 0 0 0.35rem rgba(255, 255, 255, 0.48),
    4px 5px 0 var(--card-accent),
    6px 7px 0 var(--card-ink);
}
.roll-card:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 6px; }

/* Journal rows */

.roll-list {
  display: grid;
  gap: 0.6rem;
  --row-radius: 0.75rem;
  margin-bottom: var(--space-4);
}

.roll-row-group {
  min-width: 0;
  padding: var(--space-2);
  border-radius: var(--row-radius);
  background: color-mix(in srgb, var(--line) 25%, var(--background));
}

.roll-row-group__label {
  margin: 0 0 var(--space-2);
  padding: 0 0.25rem;
  color: var(--ink);
  font: 500 1.125rem/1.4 var(--font-editorial);
}

.roll-row-group__label a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.roll-row-group__label a:hover,
.roll-row-group__label a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

.roll-row-group__rows {
  display: grid;
  gap: 0.6rem;
}

.bulk-actions {
  display: none;
  position: sticky;
  top: var(--space-3);
  z-index: 5;
  margin-bottom: var(--space-5);
  padding: var(--space-3);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 0.45rem 1rem rgba(15, 30, 40, 0.15);
}

main:has(.roll-row-selection__checkbox:checked) .bulk-actions { display: block; }
.feedback { margin: 0 0 var(--space-3); }
.bulk-actions form > .bulk-actions__choices { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.bulk-actions__choices > strong { min-height: var(--control-height); display: inline-flex; align-items: center; margin-right: var(--space-2); }
.bulk-actions__action { min-width: 0; }
.bulk-actions__action[open] { flex-basis: 100%; }
.bulk-actions__action summary {
  box-sizing: border-box;
  display: block;
  min-height: var(--control-height);
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--button-border);
  border-radius: var(--button-radius);
  color: var(--button-color);
  background: var(--button-background);
  font-weight: 700;
  cursor: pointer;
}
.bulk-actions__action summary:hover,
.bulk-actions__action[open] summary { border-color: var(--button-hover-border); background: var(--button-hover-background); }
.bulk-actions__action summary:focus-visible { outline: 3px solid var(--button-focus-color, var(--line)); outline-offset: 3px; }
.bulk-actions__panel {
  position: static;
  box-sizing: border-box;
  width: min(30rem, 100%);
  margin-top: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 0.45rem 1rem rgba(15, 30, 40, 0.15);
}
.bulk-actions__controls { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-3); margin-top: var(--space-2); }
.bulk-actions__controls select { flex: 1 1 12rem; width: auto; min-width: 0; margin: 0; }
.bulk-actions__controls input[type="submit"] { width: auto; margin: 0; }
.bulk-actions__pin-controls { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.bulk-actions__duplicate-hint { color: var(--muted); font: var(--text-caption)/1.3 var(--font-body); }
.bulk-actions button:disabled { cursor: not-allowed; opacity: 0.55; }
.bulk-actions .inline-item { margin-top: var(--space-3); }

@media (max-width: 40rem) {
  .bulk-actions__panel { width: 100%; }
}

.roll-row-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--row-radius);
  background: var(--paper);
}

.roll-row-selection {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: stretch;
}

.roll-row-selection__checkbox {
  justify-self: center;
  align-self: center;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.roll-row-card:has(.roll-row-selection__checkbox:checked) { background: var(--pale-blue); border-color: var(--focus-color); }
.roll-row-selection__checkbox:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 3px; }

.roll-row {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(9rem, 0.8fr) 2rem;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: 0.6rem var(--space-2);
  border-radius: var(--row-radius);
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.roll-row:hover { background: var(--pale-blue); }
.roll-row:focus-visible { outline: 3px solid var(--focus-color); outline-offset: -3px; }
.roll-row__date { color: var(--muted); font: var(--text-small)/1.4 var(--font-body); font-variant-numeric: tabular-nums; }
.roll-row__entry, .roll-row__gear { display: grid; gap: 0.1rem; min-width: 0; }
.roll-row__metadata { display: flex; flex-wrap: wrap; gap: 0.15rem 0; }
.roll-row__location { display: inline-flex; align-items: center; }
.roll-row__location::before { width: 0.25rem; height: 0.25rem; margin: 0 0.45rem 0 0.65rem; border-radius: 50%; background: currentColor; content: ""; }
.roll-row__title-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.65rem; min-width: 0; }
.roll-row__title { font: 500 1.125rem/1.35 var(--font-editorial); overflow-wrap: anywhere; }
.roll-row__archive-reference { color: var(--muted); font: 600 var(--text-caption)/1.2 ui-monospace, monospace; }
.roll-row__expired, .roll-row__pin, .roll-row__finished { padding: 0.1rem 0.35rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font: var(--text-caption)/1.2 var(--font-body); }
.roll-row__expired { border-color: #a84e20; color: #a84e20; }
.roll-row__location { font: var(--text-small)/1.4 var(--font-body); overflow-wrap: anywhere; }
.roll-row__gear { color: var(--muted); font: var(--text-caption)/1.35 var(--font-body); overflow-wrap: anywhere; }
.roll-row__location, .roll-row__camera { color: var(--muted); }
.roll-row__stock { color: var(--muted); font-weight: 500; }
.roll-row__arrow { align-self: center; display: grid; width: 2rem; height: 2rem; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 1rem; transition: background-color 150ms ease, color 150ms ease, transform 150ms ease; }
.roll-row:hover .roll-row__arrow { color: var(--ink); background: var(--paper); }
.roll-row:hover .roll-row__arrow { transform: translate(2px, -2px); }

@media (max-width: 40rem) {
  .roll-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem var(--space-1); }
  .roll-row__entry, .roll-row__gear { grid-column: 1; }
  .roll-row__arrow { grid-column: 2; grid-row: 1; align-self: start; }
}

/* Site Footer */

.footer {
  margin-top: var(--space-6);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.footer a {
  text-decoration: none;
}

.footer__links {
  margin-bottom: var(--space-2);
}

.footer__links ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links a:hover,
.footer__links a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.footer__links a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

.footer__legal {
  color: var(--muted);
  font-size: var(--text-caption);
  font-family: var(--font-body);
}

.footer__legal p {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35em;
  margin: 0;
}

.inline-item-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 0;
  border: 0;
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font: 600 0.875rem/1.3 var(--font-body);
  text-align: left;
  text-decoration: none;
}

.inline-item-toggle:hover {
  transform: none;
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.inline-item-toggle:focus-visible {
  outline: 3px solid var(--line);
  outline-offset: 2px;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  line-height: 1;
}

.footer__brand strong {
  line-height: 1;
  text-decoration: none;
}

.footer__brand sup {
  display: inline-block;
  position: relative;
  top: 0;
  line-height: 0;
  text-decoration: none;
}

.footer__brand svg {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}

.footer__brand--capital-lambda svg {
  width: 1.55em;
  height: 1.55em;
}

.footer__brand:hover strong,
.footer__brand:focus-visible strong {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

/* Shared spacing rhythm */

main { padding: var(--main-padding); background: var(--main-background); }
h2 { line-height: 1.15; }
main > h1, main > header { margin-bottom: var(--space-5); }
main > header h1 { margin-bottom: var(--space-2); }

form > div { margin-bottom: var(--space-4); }
.pin-field { display: flex; align-items: center; gap: var(--space-2); }
.pin-field input[type="checkbox"] { width: auto; margin: 0; }
.pin-field input[type="hidden"] { display: none; }
.pin-field label { margin: 0; }
[data-lens-picker-target][hidden] { display: none; }
.lens-picker__selected { margin: var(--space-2) 0; padding: 0; list-style: none; }
.lens-picker__selected:empty { display: none; }
.lens-picker__selected li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); border-bottom: 1px solid var(--line); }
.lens-picker__selected span { min-width: 0; overflow-wrap: anywhere; }
.lens-picker__selected button { flex: none; padding-inline: var(--space-2); font-size: 1.25rem; text-decoration: none; }
form > p:first-child { margin: 0 0 var(--space-4); }
form > div:last-child { margin-top: var(--space-5); }
fieldset { min-width: 0; margin: var(--space-5) 0; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); }
legend { padding: 0 var(--space-1); font: 500 1.25rem/1.2 var(--font-editorial); }
legend span { margin-left: var(--space-1); color: var(--muted); font: 400 var(--text-caption)/1.2 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; }
.date-parts { margin: var(--space-4) 0; }
.date-parts__simple > select,
.date-parts__input { max-width: 15rem; }
.date-parts__copy { margin: calc(-1 * var(--space-2)) 0 var(--space-2); }
.date-parts__input { margin-top: var(--space-3); }
.date-parts__simple[hidden],
.date-parts__fallback[hidden],
.date-parts__input[hidden] { display: none; }
.date-parts .field-hint { margin: 0 0 var(--space-3); }
.date-parts__fields { display: grid; grid-template-columns: minmax(5rem, 1fr) minmax(8rem, 1.5fr) minmax(5rem, 1fr); gap: var(--space-3); }
.date-parts__fields > div { min-width: 0; }
form small, .field-hint { color: var(--muted); }
input, select, textarea { border: 1px solid var(--field-border); border-radius: var(--radius); color: var(--ink); background: var(--paper); }
input:not([type="checkbox"]):not([type="radio"]), select { min-height: var(--control-height); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 2px; }
textarea { min-height: 10rem; resize: vertical; }
form input[type="submit"] + .button { margin-left: var(--space-2); }
.stacked-form { max-width: 38rem; }
.stacked-form--narrow { max-width: 24rem; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.form-actions input[type="submit"] + .button { margin-left: 0; }

.sign-in-page {
  max-width: none;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.sign-in-page .site-header {
  justify-content: center;
  margin-bottom: 0;
}

.sign-in-page main {
  display: grid;
  place-items: center;
  padding-block: clamp(2rem, 8vh, 6rem);
}

.sign-in-panel {
  width: min(100%, 24rem);
  text-align: center;
}

.sign-in-panel .page-header { margin-bottom: var(--space-5); }
.sign-in-panel .page-header h1 { margin-bottom: 0; }
.sign-in-panel .stacked-form { margin-inline: auto; text-align: left; }
.sign-in-panel label { text-align: center; }
.sign-in-panel .form-actions { justify-content: center; }
.sign-in-page .footer { margin-top: 0; }
.sign-in-page .footer__legal p { justify-content: center; }
.text-link { display: inline-flex; align-items: center; min-height: var(--control-height); text-underline-offset: 0.2em; }
.journal-section + .journal-section { margin-top: var(--space-4); }
.journal-section > p { max-width: 38rem; margin: 0 0 var(--space-3); }
.quiet-note { color: var(--muted); }

.journal-empty {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.journal-empty main { flex: 1; }

.journal-empty-state {
  max-width: 32rem;
  padding: var(--space-4) 0 var(--space-5);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.journal-empty-state p { margin: 0; }

.entry-details { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); column-gap: var(--space-4); margin: 0 0 var(--space-5); border-top: 1px solid var(--line); }
.entry-details > div { min-width: 0; padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
.entry-details dt { color: var(--muted); font: 600 var(--text-caption)/1.4 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; }
.entry-details dd { margin: 0.15rem 0 0; overflow-wrap: anywhere; }
.entry-details a { text-underline-offset: 0.2em; }
.entry-notes { max-width: 40rem; margin: 0 0 var(--space-5); font: 1.125rem/1.75 var(--font-editorial); }
.entry-notes p { margin: 0 0 var(--space-3); }
.entry-notes p:last-child { margin-bottom: 0; }
.gear-history { margin-top: var(--space-4); }

.exposure-log { margin: var(--space-5) 0; border: 1px solid var(--line); border-radius: var(--button-radius); background: var(--paper); }
.exposure-log > summary { padding: var(--space-3); cursor: pointer; }
.exposure-log > summary:focus-visible { outline: 3px solid var(--line); outline-offset: 3px; }
.exposure-log__badge { margin-left: var(--space-1); color: var(--muted); font-size: 0.75rem; }
.exposure-log__count { float: right; color: var(--muted); font-size: 0.85rem; }
.exposure-log__body { padding: 0 var(--space-3) var(--space-3); }
.exposure-log__body > .field-hint { margin: 0 0 var(--space-4); }
.exposure-log [role="status"]:empty { display: none; }
.exposure-log [role="status"] { color: var(--muted); }
.exposure-form__settings { display: grid; grid-template-columns: minmax(10rem, 0.7fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); }
.exposure-form__settings > div { min-width: 0; }
.exposure-form label { font-size: 0.85rem; }
.exposure-form input { min-height: 2.75rem; }
.exposure-dial { display: flex; align-items: center; gap: 0.25rem; margin-top: 0.25rem; }
.exposure-dial input { min-width: 0; margin: 0; text-align: center; font: 600 1.15rem/1.5 ui-monospace, monospace; }
.exposure-dial button { flex: 0 0 2.75rem; min-height: 2.75rem; padding: 0; font-size: 1.25rem; }
.exposure-dial button[hidden] { display: none; }
.exposure-form__frame input { text-align: center; font: 600 1.15rem/1.5 ui-monospace, monospace; }
.exposure-form .exposure-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: var(--space-3) 0 var(--space-4); }
.exposure-form__actions input { margin: 0; }
.exposure-form .field-hint, .exposure-log__empty { font-size: 0.85rem; }
.exposure-log__empty { margin: 0; padding-top: var(--space-3); border-top: 1px solid var(--line); color: var(--muted); }
.exposure-list { list-style: none; padding: 0; margin: 0; }
.exposure-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) 0; border-top: 1px solid var(--line); }
.exposure-list__settings { display: block; color: var(--muted); font: 0.9rem/1.5 ui-monospace, monospace; }
.exposure-list__actions { display: flex; align-items: center; gap: var(--space-2); }
.exposure-list__actions a { padding: 0.65rem 0.25rem; }
.exposure-list__actions button { min-height: 2.75rem; }

@media (max-width: 48rem) {
  .exposure-form__settings { grid-template-columns: minmax(0, 1fr); }
  .exposure-log__badge { display: inline-block; }
}

.inline-item { margin-top: var(--space-2); padding: var(--space-3); border-left: 3px solid var(--line); background: var(--inline-surface); }
.inline-item h3 { margin: 0 0 var(--space-1); }
.inline-item .field-hint { margin: 0 0 var(--space-3); }
.inline-item .field { margin-bottom: var(--space-3); }
.inline-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.error-summary { margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); border: 2px solid #7a231b; color: var(--error-color); background: var(--error-background); }
.error-summary h2 { margin: 0 0 var(--space-2); font-size: 1.15rem; }
.error-summary ul { margin: 0; padding-left: 1.25rem; }

@media (max-width: 40rem) {
  fieldset { padding: var(--space-3); }
  .date-parts__fields { gap: var(--space-2); }
  .roll-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 30rem) {
  .date-parts__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 26rem) {
  .section-heading { align-items: flex-start; }
  .section-heading > span { padding-top: 0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .section-menu__panel,
  .section-menu__chevron,
  .section-menu__trigger,
  .section-menu__links a,
  .button,
  button,
  input[type="submit"],
  .roll-card,
  .roll-row,
  .roll-row__arrow,
  .item-row,
  .item-row::after { animation: none; transition: none; }

  .roll-card,
  .roll-card:hover,
  .roll-card:nth-child(4n + 2),
  .roll-card:nth-child(4n + 3),
  .roll-row:hover .roll-row__arrow,
  .item-row:hover::after { transform: none; }
}
