:root {
    --bg: #f7f2ec;
    --surface: #fffcf8;
    --text: #2a2420;
    --muted: #6b5f56;
    --border: rgba(42, 36, 32, 0.12);
    --accent: #b8864a;
    --accent-hover: #9a7040;
    --danger: #8b3a3a;
    --success-bg: #e8f0e8;
    --warning-bg: #f4f0e8;
    --error-bg: #f0e8e8;
    --radius: 6px;
    --font: system-ui, -apple-system, sans-serif;
    --serif: Georgia, "Times New Roman", serif;
    --max-width: 42rem;
    --filmstrip-bg: #221f1c;
    --filmstrip-line: #342f2b;
    --filmstrip-muted: #8a8179;
    --filmstrip-text: #c9c0b8;
    --filmstrip-accent: #c9956a;
    --filmstrip-pick: #d04a4a;
    --filmstrip-width: 56rem;
    --film-edge: #2a2623;
    --film-well: #1a1816;
    --film-edge-print: #e8954a;
    --film-stripe-line: rgba(126, 186, 122, 0.55);
    --film-number: #e8954a;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
  }
  a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(184, 134, 74, 0.35);
  }
  a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent);
  }
  /* ——— layout ——— */
  .site-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }
  .site-header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
  .site-header__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem 1.25rem;
  }
  .site-primary-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem 1rem;
    margin-right: 0.25rem;
  }
  .site-primary-nav__link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
    border-bottom: none;
    text-decoration: none;
    padding: 0.2rem 0;
  }
  .site-primary-nav__link:hover {
    color: var(--accent);
  }
  .site-primary-nav__link.is-active {
    color: var(--text);
    border-bottom: 2px solid var(--accent);
  }
  .site-auth {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
  }
  .site-account {
    position: relative;
  }
  .site-account__trigger {
    list-style: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
  }
  .site-account__trigger::after {
    content: "▾";
    margin-left: 0.2rem;
    font-size: 0.7em;
    opacity: 0.55;
  }
  .site-account[open] .site-account__trigger::after {
    content: "▴";
  }
  .site-account__trigger::-webkit-details-marker {
    display: none;
  }
  .site-account__trigger::marker {
    content: "";
  }
  .site-account[open] .site-account__trigger {
    color: var(--text);
  }
  .site-account__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    min-width: 11rem;
    margin: 0;
    padding: 0.25rem 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(42, 36, 32, 0.1);
    z-index: 50;
  }
  .site-account__menu form {
    margin: 0;
  }
  .site-account__menu button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.5rem 0.85rem;
    border: none;
    border-radius: 0;
    background: transparent;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 400;
    text-align: left;
    color: var(--text);
    cursor: pointer;
  }
  .site-account__menu button:hover {
    background: var(--bg);
  }
  .site-account__link {
    display: block;
    padding: 0.45rem 0.85rem;
    font-size: 0.9rem;
    color: var(--text);
    border-bottom: none;
  }
  .site-account__link:hover {
    background: var(--bg);
    color: var(--accent);
  }
  .site-account__danger {
    display: block;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    color: var(--danger);
    border-bottom: none;
    border-top: 1px solid var(--border);
  }
  .site-account__danger:hover {
    background: var(--error-bg);
    color: var(--danger);
  }
  .site-auth a {
    font-size: 0.9rem;
    color: var(--muted);
    border-bottom: none;
  }
  .site-auth a:hover {
    color: var(--accent);
  }
  .site-brand {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    border-bottom: none;
  }
  .site-brand:hover { color: var(--accent); }
  .site-primary-nav + .site-auth {
    padding-left: 1.25rem;
    margin-left: 0.15rem;
    border-left: 1px solid var(--border);
  }
  .page-context {
    margin: 0 0 0.35rem;
  }
  .page-context a {
    border-bottom: none;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .page-context a:hover {
    color: var(--accent);
  }
  main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
  }
  /* ——— type ——— */
  h1 {
    margin: 0 0 0.5rem;
    font-family: var(--serif);
    font-size: 1.75rem;
    font-weight: 400;
  }
  h2 {
    margin: 2rem 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  h2:first-child { margin-top: 0; }
  .lead {
    margin: 0 0 1.5rem;
    color: var(--muted);
  }
  /* ——— messages ——— */
  .messages {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
  }
  .messages li {
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
  }
  .messages .success { background: var(--success-bg); }
  .messages .warning { background: var(--warning-bg); }
  .messages .error   { background: var(--error-bg); }
  /* ——— forms ——— */
  form p { margin: 0 0 1rem; }
  label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
  }
  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="file"],
  select,
  textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.65rem;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  textarea { min-height: 4rem; resize: vertical; }
  button,
  .btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font: inherit;
    font-size: 0.9rem;
    color: var(--surface);
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
  }
  button:hover,
  .btn:hover {
    background: var(--accent-hover);
  }
  .btn--ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
  }
  .btn--danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(139, 58, 58, 0.35);
  }
  .btn--danger:hover {
    background: var(--error-bg);
  }
  /* ——— lists ——— */
  .card-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .card-list li {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .card-list li p {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
  }
  .card-list a {
    font-weight: 500;
    border-bottom: none;
  }
  .card-list a:hover { color: var(--accent-hover); }
  /* ——— sections ——— */
  .section {
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
  }
  .section:first-of-type { border-top: none; }
  .section--danger {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
  }
  /* ——— page header + create panel ——— */
  .page-header {
    margin-bottom: 0.75rem;
  }
  .page-header:has(+ .messages) {
    margin-bottom: 0.5rem;
  }
  .page-header h1 {
    margin: 0 0 0.35rem;
  }
  .page-header .lead {
    margin: 0;
  }
  .page-header--split {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
  }
  .page-header__intro {
    flex: 1 1 12rem;
    min-width: 0;
  }
  .page-header__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.75rem 1.25rem;
    flex: 0 1 auto;
  }
  .page-header--split .create-panel:not([open]) {
    margin-bottom: 0;
  }
  .page-header--split > .create-panel[open] {
    flex: 1 1 100%;
    width: 100%;
  }
  .page-header__tools:has(.create-panel[open]) {
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-start;
  }
  .page-header__tools .create-panel[open] {
    flex: 1 1 100%;
    width: 100%;
  }
  .create-panel {
    margin: 0 0 1rem;
  }
  .create-panel__trigger {
    list-style: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
    border-bottom: 1px solid rgba(184, 134, 74, 0.35);
  }
  .create-panel__trigger:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent);
  }
  .create-panel__trigger::-webkit-details-marker {
    display: none;
  }
  .create-panel[open] .create-panel__trigger {
    margin-bottom: 0.75rem;
  }
  .create-panel__body {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .create-panel__body .lead {
    margin-top: 0;
  }
  .page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
  }
  .create-panel--inline {
    margin-bottom: 0;
  }
  .create-panel--inline:not([open]) {
    flex: 0 0 auto;
  }
  .create-panel--inline[open] {
    flex: 1 1 100%;
    width: 100%;
  }
  .create-panel--inline[open] .create-panel__trigger {
    margin-bottom: 0.75rem;
  }
  .section--align-end {
    text-align: right;
  }
  .section--frames {
    padding-top: 0;
    border-top: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    max-width: 100vw;
  }
  .section--frames-notes {
    margin-top: 0.25rem;
    margin-left: 0;
    margin-right: 0;
    width: auto;
    max-width: none;
  }
  .filmstrip {
    --filmstrip-pad-x: max(1.5rem, calc((100vw - var(--filmstrip-width)) / 2));
    background: var(--filmstrip-bg);
    padding: 0.85rem var(--filmstrip-pad-x) 1rem;
    border-top: 1px solid var(--filmstrip-line);
    border-bottom: 1px solid var(--filmstrip-line);
  }
  .filmstrip__label {
    max-width: var(--filmstrip-width);
    margin: 0 auto 0.45rem;
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--film-edge-print);
    opacity: 0.85;
  }
  .frame-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: 0.35rem;
    row-gap: 0.65rem;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: var(--filmstrip-width);
    background: transparent;
  }
  @media (max-width: 640px) {
    .frame-grid {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }
  @media (max-width: 420px) {
    .frame-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
  .frame-grid__cell {
    background: transparent;
    overflow: visible;
    min-width: 0;
  }
  .frame-grid__body {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--film-edge);
    overflow: hidden;
  }
  .frame-grid__cell:hover .frame-grid__body {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  }
  .frame-grid__cell.is-active .frame-grid__body {
    box-shadow: 0 0 0 2px #f5f0ea;
  }
  .frame-grid__cell.is-favorite .frame-grid__image {
    box-shadow: none;
  }
  .frame-grid__cell.is-favorite .frame-grid__image::before,
  .frame-grid__cell.is-favorite .frame-grid__image::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 2;
    border: none;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center;
  }
  .frame-grid__cell.is-favorite .frame-grid__image::before {
    inset: 0.12rem 0.08rem 0.16rem 0.1rem;
    transform: rotate(2deg);
    opacity: 0.42;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 132'%3E%3Cpath d='M22 30 C10 52 14 96 42 112 C82 126 138 118 172 94 C194 68 186 26 148 12 C98 2 48 12 22 30 Z' fill='none' stroke='%23c93030' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
  .frame-grid__cell.is-favorite .frame-grid__image::after {
    inset: 0.18rem 0.12rem 0.22rem 0.14rem;
    transform: rotate(-3deg);
    opacity: 0.9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 132'%3E%3Cpath d='M16 26 C6 48 9 98 36 114 C76 128 142 116 178 90 C198 62 190 18 144 6 C94 -2 38 8 16 26 Z' fill='none' stroke='%23d04040' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
  .frame-grid__edge {
    position: relative;
    height: 0.42rem;
    flex-shrink: 0;
    background: var(--film-edge);
    overflow: hidden;
  }
  .frame-grid__edge::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      90deg,
      var(--filmstrip-bg) 0,
      var(--filmstrip-bg) 0.24rem,
      transparent 0.24rem,
      transparent 0.38rem
    );
  }
  .frame-grid__edge--top {
    height: 10px;
  }
  .frame-grid__edge--top::before {
    z-index: 0;
    background: repeating-linear-gradient(
      90deg,
      var(--filmstrip-bg) 0,
      var(--filmstrip-bg) 5px,
      transparent 5px,
      transparent 8px
    );
  }
  .frame-grid__edge--top::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    height: auto;
    background: linear-gradient(
      to bottom,
      transparent 1px,
      var(--film-stripe-line) 1px 2px,
      transparent 2px 4px,
      var(--film-stripe-line) 4px 5px,
      transparent 5px 7px,
      var(--film-stripe-line) 7px 8px,
      transparent 8px 100%
    );
    opacity: 1;
    -webkit-mask: none;
    mask: none;
  }
  .frame-grid__edge--bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 0.58rem;
    padding: 0.12rem 0.15rem 0.32rem;
    background: var(--filmstrip-bg);
    border-top: 1px solid var(--filmstrip-line);
  }
  .frame-grid__edge--bottom::before {
    top: auto;
    bottom: 0;
    height: 0.28rem;
  }
  .frame-grid__edge--bottom::after {
    content: none;
  }
  .frame-grid__image {
    position: relative;
    flex: 1;
    background: var(--film-well);
  }
  .frame-grid__zoom {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
  }
  .frame-grid__caption {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin: 0;
    padding: 0;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.62rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    color: var(--film-number);
    background: none;
    border: none;
    line-height: 1;
    text-shadow: 0 0 8px rgba(232, 149, 74, 0.35);
    cursor: pointer;
  }
  .frame-grid__caption:hover {
    color: #f5b066;
  }
  .frame-grid__cell.is-active .frame-grid__caption {
    color: #f5b066;
  }
  .frame-grid__cell.is-favorite .frame-grid__caption {
    color: #f08080;
    text-shadow: none;
  }
  .frame-grid__img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    background: var(--film-well);
    pointer-events: none;
    transition: filter 0.12s ease;
  }
  .frame-grid__cell:hover .frame-grid__img {
    filter: brightness(1.04);
  }
  .frame-grid__cell.is-favorite .frame-grid__img {
    filter: brightness(1.02);
  }
  .frame-grid__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 3 / 2;
    font-size: 0.55rem;
    color: var(--filmstrip-muted);
    background: var(--film-well);
  }
  .frame-grid__note {
    margin: 0.15rem 0 0;
    padding: 0 0.1rem;
    font-size: 0.5rem;
    line-height: 1.2;
    text-align: center;
    color: var(--filmstrip-muted);
  }
  .frame-grid__favorite {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    z-index: 3;
    margin: 0;
    opacity: 0;
    transition: opacity 0.12s ease;
  }
  .frame-grid__cell:not(.is-favorite):hover .frame-grid__favorite,
  .frame-grid__cell:not(.is-favorite):focus-within .frame-grid__favorite {
    opacity: 1;
  }
  .frame-grid__cell.is-favorite .frame-grid__favorite {
    opacity: 0;
    pointer-events: none;
  }
  .frame-grid .btn-favorite {
    width: 1.4rem;
    height: 1.4rem;
    font-size: 0.72rem;
    border-radius: 2px;
    color: var(--filmstrip-text);
    background: rgba(34, 31, 28, 0.88);
    border: 1px solid var(--filmstrip-line);
    box-shadow: none;
  }
  .frame-grid .btn-favorite:hover {
    color: #fff;
    border-color: rgba(201, 149, 106, 0.45);
    background: rgba(42, 38, 35, 0.95);
  }
  .roll-tools {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
  }
  .shoot-log-cta {
    margin-bottom: 1.5rem;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .shoot-log-cta .lead {
    margin: 0 0 0.75rem;
  }
  .shoot-log-cta__link {
    font-weight: 500;
  }
  .roll-list__intro {
    margin: 0 0 1.25rem;
  }
  .roll-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border);
  }
  .roll-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
  }
  .roll-list__main {
    flex: 1;
    min-width: 0;
  }
  .roll-list__title {
    display: block;
    font-weight: 500;
    border-bottom: none;
    margin-bottom: 0.2rem;
  }
  .roll-list__meta {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
  }
  .roll-list__strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    flex-shrink: 0;
    overflow-x: auto;
    max-width: min(100%, 22rem);
    -webkit-overflow-scrolling: touch;
  }
  .roll-list__thumb {
    display: block;
    width: 4rem;
    height: 2.65rem;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid var(--border);
    background: var(--bg);
  }
  .roll-page-actions {
    margin: 0.5rem 0 0;
  }
  .roll-page-actions a {
    border-bottom: none;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .frame-log-list__hint {
    margin: 0 0 0.5rem;
  }
  .frame-roll-view {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .frame-icon-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.6rem;
    width: 100%;
    margin: 0;
    padding: 0.85rem 1rem;
    list-style: none;
    overflow-x: auto;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
  }
  .frame-icon-strip__item {
    flex: 0 0 auto;
  }
  .frame-icon-strip__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.75rem;
    height: 3.75rem;
    margin: 0;
    padding: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
  }
  .frame-icon-strip__btn:hover {
    border-color: var(--accent);
  }
  .frame-icon-strip__item.is-active .frame-icon-strip__btn {
    border: 2px solid var(--accent);
    box-shadow: inset 0 0 0 1px var(--surface);
  }
  .frame-icon-strip__item.is-favorite .frame-icon-strip__btn {
    border-color: rgba(208, 74, 74, 0.45);
    color: var(--danger);
  }
  .frame-icon-strip__label {
    line-height: 1;
  }
  .frame-log-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
  .frame-log-list__row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    border-bottom: 1px solid var(--border);
  }
  .frame-log-list__row:last-child {
    border-bottom: none;
  }
  .frame-log-list__row.is-active {
    background: var(--bg);
  }
  .frame-log-list__main {
    flex: 1;
    display: block;
    margin: 0;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
  }
  .frame-log-list__main:hover {
    background: var(--bg);
  }
  .frame-log-list__text {
    font-size: 1rem;
    line-height: 1.45;
    color: var(--text);
  }
  .frame-log-list__text em {
    color: var(--muted);
    font-style: italic;
  }
  .frame-log-list__row .frame-grid__favorite {
    position: static;
    flex-shrink: 0;
    margin: 0 0.65rem 0 0;
    opacity: 1;
    width: 1.75rem;
    height: 1.75rem;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
  }
  .frame-log-list__row.is-favorite .frame-grid__favorite {
    opacity: 1;
    pointer-events: auto;
    color: var(--filmstrip-pick);
    border-color: rgba(208, 74, 74, 0.35);
  }
  .log-frame-optional-scan {
    margin: 0 0 1rem;
    font-size: 0.9rem;
  }
  .log-frame-optional-scan summary {
    cursor: pointer;
    color: var(--muted);
    margin-bottom: 0.5rem;
  }
  .log-frame-optional-scan[open] summary {
    margin-bottom: 0.75rem;
  }
  .roll-panel--log {
    order: -1;
  }
  .roll-tools {
    display: flex;
    flex-direction: column;
  }
  .roll-panel {
    margin-bottom: 0;
  }
  .roll-panel .create-panel__trigger {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: none;
  }
  .roll-panel .create-panel__trigger:hover {
    color: var(--accent);
  }
  .roll-panel[open] .create-panel__trigger {
    color: var(--text);
    margin-bottom: 0.75rem;
  }
  .roll-panel .create-panel__body {
    margin-bottom: 0.5rem;
  }
  .roll-tools--notes {
    margin-top: 1.25rem;
    gap: 0.35rem;
  }
  .roll-tools--notes .roll-panel .create-panel__trigger {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--accent);
    border-bottom: 1px solid rgba(184, 134, 74, 0.35);
  }
  .roll-tools--notes .roll-panel[open] .create-panel__trigger {
    color: var(--text);
    border-bottom-color: transparent;
  }
  .roll-tools--notes .roll-panel .create-panel__body {
    margin-bottom: 0;
  }
  .section--frames-notes ~ .roll-tools--notes {
    margin-top: 1rem;
  }
  /* ——— roll page ——— */
  main.main--wide {
    max-width: var(--filmstrip-width);
  }
  .meta {
    font-size: 0.85rem;
    color: var(--muted);
  }
  .btn-favorite {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    border-radius: 50%;
    color: var(--muted);
    background: rgba(255, 252, 248, 0.9);
    border: 1px solid var(--border);
    cursor: pointer;
  }
  .btn-favorite:hover {
    color: var(--accent);
    background: var(--surface);
  }
  .btn-favorite.is-on {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--surface);
  }
  .frame-lightbox:not([open]) {
    display: none;
  }
  .frame-lightbox[open] {
    display: flex;
    flex-direction: column;
    width: min(96vw, 58rem);
    max-height: 94vh;
    margin: auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 16px 48px rgba(42, 36, 32, 0.18);
    overflow-x: hidden;
    overflow-y: auto;
  }
  .frame-lightbox::backdrop {
    background: rgba(42, 36, 32, 0.35);
  }
  .frame-lightbox__close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 5;
    width: 2rem;
    height: 2rem;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: var(--radius);
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
  }
  .frame-lightbox__close:hover {
    color: var(--text);
    border-color: var(--accent);
    background: var(--bg);
  }
  .frame-lightbox__stage {
    position: relative;
    flex: 0 1 auto;
    min-height: 0;
    max-height: min(62vh, calc(94vh - 14rem));
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    overflow: hidden;
  }
  .frame-lightbox__frame-label {
    position: absolute;
    bottom: 0.55rem;
    left: 0.75rem;
    z-index: 2;
    margin: 0;
    padding: 0.2rem 0.5rem;
    font-family: var(--font);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    background: rgba(255, 252, 248, 0.9);
    border: 1px solid var(--border);
    border-radius: 3px;
    pointer-events: none;
  }
  .frame-lightbox__media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 8rem;
    max-height: 100%;
    margin: 0 2.75rem;
  }
  .frame-lightbox__favorite {
    position: static;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.2rem;
  }
  .frame-lightbox__favorite:disabled {
    opacity: 0.5;
    cursor: wait;
  }
  .frame-lightbox__nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    width: 2rem;
    height: 2.25rem;
    padding: 0;
    font-size: 1.35rem;
    line-height: 1;
    border-radius: var(--radius);
    color: var(--text);
    background: rgba(255, 252, 248, 0.92);
    border: 1px solid var(--border);
    cursor: pointer;
  }
  .frame-lightbox__nav:hover:not(:disabled) {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--surface);
  }
  .frame-lightbox__nav:disabled {
    opacity: 0.3;
    cursor: default;
  }
  .frame-lightbox__nav--prev { left: 0.5rem; }
  .frame-lightbox__nav--next { right: 0.5rem; }
  .frame-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: var(--bg);
  }
  .frame-lightbox__img[hidden] {
    display: none !important;
  }
  .frame-lightbox__placeholder {
    margin: 0;
    padding: 2rem 1.5rem;
    font-size: 0.95rem;
    color: var(--muted);
    text-align: center;
  }
  .frame-lightbox__placeholder[hidden] {
    display: none !important;
  }
  .frame-lightbox__caption {
    flex: 0 0 auto;
    flex-shrink: 0;
    padding: 0.75rem 1rem 1rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
  }
  .frame-lightbox__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .frame-lightbox__meta {
    min-width: 0;
  }
  .frame-lightbox__counter {
    margin: 0;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.72rem;
    color: var(--muted);
  }
  .frame-lightbox__caption .meta {
    color: var(--muted);
    font-size: inherit;
  }
  .frame-lightbox__scan {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: var(--muted);
    word-break: break-all;
  }
  .frame-lightbox__note-label {
    display: block;
    margin: 0.5rem 0 0.25rem;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .frame-lightbox__note-input {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.5rem 0.55rem;
    font-family: var(--font);
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    min-height: 2.75rem;
    max-height: 6rem;
    box-sizing: border-box;
  }
  .frame-lightbox__note-input:focus {
    outline: none;
    border-color: var(--accent);
  }
  .frame-lightbox__note-input::placeholder {
    color: var(--muted);
  }
  .frame-lightbox__edit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.55rem;
  }
  .frame-lightbox__save {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--surface);
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
  }
  .frame-lightbox__save:hover:not(:disabled) {
    background: var(--accent-hover);
  }
  .frame-lightbox__save:disabled {
    opacity: 0.6;
    cursor: wait;
  }
  .frame-lightbox__save-status {
    font-size: 0.75rem;
    color: var(--muted);
  }
  .frame-lightbox__save-status.is-error {
    color: var(--danger);
  }
  .frame-lightbox__full-edit {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--muted);
    border-bottom: none;
  }
  .frame-lightbox__full-edit:hover {
    color: var(--accent);
  }
  .form-hint {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--muted);
  }
  .form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }
  .input--narrow {
    width: 3.5rem !important;
  }
  #folder-preview {
    font-size: 0.85rem;
    max-height: 14rem;
    overflow-y: auto;
    margin: 0.5rem 0 1rem;
    padding: 0;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }
  #folder-preview li {
    padding: 0.35rem 0.65rem;
    border-bottom: 1px solid var(--border);
  }
  #folder-preview li.is-frame-1 {
    background: var(--success-bg);
    font-weight: 600;
  }
  .roll-panel--frame-one select {
    display: block;
    width: 100%;
    max-width: 28rem;
    margin-top: 0.35rem;
  }
  .frame-lightbox__set-frame-one {
    display: block;
    margin-top: 0.5rem;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-size: 0.9rem;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
  }
  .frame-lightbox__set-frame-one:hover {
    color: var(--text);
  }
  #folder-preview li.is-leader {
    background: var(--warning-bg);
  }