@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }

@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/source-serif-4-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1d2127;
  --muted: #5a616d;
  --line: #e3e6eb;
  --accent: #2f6feb;
  --accent-ink: #ffffff;
  --accent-soft: #eaf1ff;
  --danger: #c43d36;
  --radius: 10px;
  --page: 1120px;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --field: #ffffff;
  --field-border: #9aa1ad;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
    --bg: #131417;
    --surface: #1b1d21;
    --ink: #e7e9ec;
    --muted: #a8aeb8;
    --line: #2a2d33;
    --accent: #6c9eff;
    --accent-ink: #0f1114;
    --accent-soft: #1c2638;
    --danger: #ef6f68;
    --field: #22252b;
    --field-border: #5b616d;
  }

}
:root[data-theme="dark"]{
    --bg: #131417;
    --surface: #1b1d21;
    --ink: #e7e9ec;
    --muted: #a8aeb8;
    --line: #2a2d33;
    --accent: #6c9eff;
    --accent-ink: #0f1114;
    --accent-soft: #1c2638;
    --danger: #ef6f68;
    --field: #22252b;
    --field-border: #5b616d;
  }




* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.55 var(--sans); }

a { color: var(--accent); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }

h1 { font-size: 2rem; margin: 0.4em 0 0.5em; }

h2 { font-size: 1.35rem; margin: 1.6em 0 0.6em; }

code { background: var(--accent-soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

.muted { color: var(--muted); }

small { display: block; color: var(--muted); font-size: 0.85rem; }


/* Header */
.top { background: var(--bg); border-bottom: 1px solid var(--line); }

.bar { max-width: var(--page); margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }


.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }

.brand .family { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }

.brand .sub { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

nav { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }

nav a { text-decoration: none; color: var(--ink); }

nav a:hover { color: var(--accent); }


main { max-width: var(--page); margin: 0 auto; padding: 8px 16px 48px; }

footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 24px 16px 40px; }


/* Forms */
form.inline { display: inline; }

.stack { display: grid; gap: 14px; max-width: 420px; }

.stack label, .grid-form label { display: grid; gap: 4px; font-weight: 500; }

.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.row input { flex: 1 1 200px; }

.row.compact { flex-wrap: nowrap; }

.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }

.grid-form .check { display: flex; gap: 8px; align-items: center; font-weight: 400; }

.slug-input { display: flex; align-items: center; gap: 4px; }

.slug-input span { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

input, select, button, .button { font: inherit; border-radius: var(--radius); }

input, select { padding: 9px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-width: 0; }

input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .button { display: inline-block; padding: 9px 18px; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; font-weight: 600; }

button:hover, .button:hover { filter: brightness(1.06); }

button.secondary, .button.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

button.secondary:hover, .button.secondary:hover { box-shadow: inset 0 0 0 1px var(--accent); filter: none; }

button.danger { background: var(--danger); color: #fff; }

button.small { padding: 5px 10px; font-size: 0.85rem; }

button.link { background: none; color: var(--ink); padding: 0; font-weight: 400; }

button.link:hover { color: var(--accent); }

button[disabled] { opacity: 0.6; cursor: wait; }


.notice, .error, .callout { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; }

.notice { background: var(--accent-soft); border-left: 4px solid var(--accent); }

.error { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--ink); border-left: 4px solid var(--danger); }

.callout { background: var(--surface); border: 1px solid var(--line); }

.callout p { margin: 6px 0; }

.copy code { font-size: 0.95rem; }


/* Home */
.hero { padding: 48px 0 24px; }

.hero h1 { font-size: 2.4rem; }

.hero p { font-size: 1.1rem; max-width: 34em; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

.card h2 { margin: 0 0 4px; font-size: 1.2rem; }


/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }

th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }

th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

.badge { background: var(--accent-soft); border-radius: 20px; padding: 1px 8px; font-size: 0.75rem; }

@media (max-width: 640px) {
  table { display: block; overflow-x: auto; }
}


/* Gallery */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }

.month h2 { margin-top: 1.4em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }

.grid.small { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); margin-top: 8px; }

.tile { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 6px; background: var(--line); }

.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }

.tile:hover img { transform: scale(1.04); }

.tile.pending { display: grid; place-items: center; color: var(--muted); font-size: 1.5rem; }

.tile.big { aspect-ratio: 4 / 3; font-size: 1rem; }

.empty { text-align: center; padding: 48px 0; }

.pager { display: flex; justify-content: center; gap: 24px; margin-top: 24px; }

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
}


/* One photo */
.photo-view { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 24px; align-items: start; }

.photo-view figure { margin: 16px 0 0; }

.photo-view img { width: 100%; height: auto; border-radius: var(--radius); display: block; max-height: 82vh; object-fit: contain; background: #0002; }

.photo-view h1 { font-size: 1.5rem; margin-bottom: 0; }

dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }

dt { color: var(--muted); }

dd { margin: 0; overflow-wrap: anywhere; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tags a { background: var(--accent-soft); color: var(--ink); border-radius: 20px; padding: 2px 10px; text-decoration: none; font-size: 0.85rem; }

@media (max-width: 800px) {
  .photo-view { grid-template-columns: 1fr; }
}


/* Upload */
.upload { display: grid; gap: 14px; }

.drop { display: grid; gap: 6px; place-items: center; text-align: center; padding: 40px 16px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }

.drop.over { border-color: var(--accent); background: var(--accent-soft); }

.drop input { max-width: 100%; }

progress { width: 100%; height: 10px; accent-color: var(--accent); }


/* Search */
.search-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 16px; }

.search-form > input { flex: 1 1 240px; }

.search-form label { display: grid; gap: 2px; font-size: 0.85rem; color: var(--muted); }


/* Ask */
.chat { display: grid; gap: 12px; margin: 16px 0; }

.msg { padding: 12px 14px; border-radius: var(--radius); max-width: 92%; }

.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.msg.user { background: var(--accent-soft); justify-self: end; }

.msg.assistant { background: var(--surface); border: 1px solid var(--line); justify-self: start; width: 92%; }

.msg.thinking p { color: var(--muted); font-style: italic; }


/* Forms and chat stay readable inside the full-width page */
.upload, .callout, .hero { max-width: 760px; }

.msg.user { background: var(--accent); color: var(--accent-ink); }


/* Ask: chat list beside the conversation */
.ask-layout { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 16px; }

.sessions { position: sticky; top: 16px; min-width: 0; max-width: 100%; overflow: hidden; }

.sessions .new-chat { width: 100%; }

.sessions h3 { font-family: var(--sans); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 20px 0 6px; }

.sessions ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }

.sessions li { padding: 8px 10px; border-radius: 8px; min-width: 0; }

.sessions li.active { background: var(--accent-soft); }

.sessions li a { display: block; max-width: 100%; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sessions li:hover { background: var(--accent-soft); }

.sessions small { font-size: 0.75rem; }

.small-note { font-size: 0.8rem; margin-top: 16px; }

.ask-main { max-width: 760px; min-width: 0; }

.ask-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }

.ask-head h1 { margin: 0; font-size: 1.6rem; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .ask-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 8px; }
  .sessions { position: static; }
  /* On a phone the chat list is a compact, scrollable strip above the conversation. */
  .sessions h3 { margin-top: 12px; }
  .sessions ul { max-height: 132px; overflow-y: auto; }
  .small-note { display: none; }
  .ask-head h1 { font-size: 1.3rem; }
  .msg { max-width: 100%; }
  .msg.assistant { width: 100%; }
  #ask-form { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0 12px; }
  #ask-form input { flex: 1 1 0; min-width: 0; }
}


/* Videos */
.tile { position: relative; }

.tile .play { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 0.75rem; padding: 2px 7px; border-radius: 6px; }

.photo-view video { width: 100%; max-height: 82vh; border-radius: var(--radius); background: #000; display: block; }

.video-wait { position: relative; }

.video-wait p { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0; background: rgba(0, 0, 0, 0.62); color: #fff; padding: 8px 12px; border-radius: 8px; }


/* Filters: All / Photos / Videos */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }

.tab { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-size: 0.9rem; }

.tab:hover { box-shadow: inset 0 0 0 1px var(--accent); }

.tab.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

.tab .count { opacity: 0.7; font-size: 0.8rem; }

.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.crumbs { margin: 16px 0 -8px; font-size: 0.9rem; }

.crumbs a { color: var(--muted); }


/* Select mode */
body.selecting .grid[data-selectable="1"] .tile { cursor: pointer; }

body.selecting .grid[data-selectable="1"] .tile::after { z-index: 2; content: ''; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, 0.25); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3); }

body.selecting .grid[data-selectable="1"] .tile.picked { box-shadow: inset 0 0 0 4px var(--accent); }

body.selecting .grid[data-selectable="1"] .tile.picked::before { content: ''; position: absolute; inset: 0; border: 4px solid var(--accent); border-radius: 6px; z-index: 1; pointer-events: none; }

body.selecting .grid[data-selectable="1"] .tile.picked img { opacity: 0.75; transform: scale(0.94); }

body.selecting .grid[data-selectable="1"] .tile.picked::after { background: var(--accent); border-color: #fff; content: '✓'; color: #fff; font-size: 13px; font-weight: 700; line-height: 18px; text-align: center; z-index: 2; }

.select-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  width: min(760px, calc(100% - 24px)); padding: 10px 14px; border-radius: 14px; background: var(--surface); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), inset 0 0 0 1px var(--line); }

.select-bar[hidden] { display: none; }

.select-bar select, .select-bar input { flex: 1 1 160px; min-width: 0; }

.sel-count { font-weight: 600; white-space: nowrap; }

body.selecting main { padding-bottom: 120px; }


/* Albums */
.album-new { max-width: 560px; margin-bottom: 8px; }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 16px; }

.album-card { display: grid; gap: 4px; text-decoration: none; color: var(--ink); }

.album-cover { display: block; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--line); }

.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }

.album-card:hover img { transform: scale(1.03); }

.album-empty { display: grid; place-items: center; height: 100%; color: var(--muted); }

.album-name { font-weight: 600; overflow-wrap: anywhere; }

.album-meta { font-size: 0.85rem; }

.in-albums h3 { font-family: var(--sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 18px 0 6px; }

.add-album { flex-wrap: wrap; margin-top: 8px; }

.add-album select, .add-album input { flex: 1 1 140px; min-width: 0; }

details.menu { position: relative; }

details.menu summary { list-style: none; cursor: pointer; }

details.menu summary::-webkit-details-marker { display: none; }

.menu-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: min(320px, 90vw); padding: 14px; display: grid; gap: 12px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), inset 0 0 0 1px var(--line); }

@media (max-width: 480px) {
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .select-bar { bottom: 8px; }
}



/* ===== Design review round 2 ===================================================== */
body { font-size: 16px; }

footer { font-size: 0.875rem; }

footer p { margin: 4px 0; }

footer a { display: inline-block; padding: 10px 4px; }


/* Buttons and controls: comfortable to tap */
button, .button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

button.small, .button.small { min-height: 34px; }

input, select { min-height: 44px; }

button.link { min-height: 0; }

.wide-button { width: 100%; min-height: 48px; font-size: 1rem; }


/* Header navigation (desktop) */
.top-nav a { padding: 8px 2px; border-bottom: 2px solid transparent; }

.top-nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }

.top-nav .quiet { color: var(--muted); }


/* Phone tab bar */
.tabbar { display: none; }

@media (max-width: 760px) {
  body.has-tabbar .top-nav { display: none; }
  body.has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .bar { padding: 10px 16px; }
  .brand .family { font-size: 1.15rem; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tab-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 56px; color: var(--muted); text-decoration: none; font-size: 0.72rem; font-weight: 600;
    list-style: none; cursor: pointer; border-radius: 10px;
  }
  .tab-item::-webkit-details-marker { display: none; }
  .tab-item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tab-item[aria-current="page"] { color: var(--accent); }
  .tab-item:active { background: var(--accent-soft); }
  .tab-more { position: relative; }
  .tab-more > summary { height: 100%; }
  .tab-more[open] > summary { color: var(--accent); }
  .tab-more .sheet {
    position: absolute; right: 4px; bottom: calc(100% + 8px); width: min(260px, 80vw);
    display: grid; padding: 6px; border-radius: 14px; background: var(--surface);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 0 0 1px var(--line);
  }
  .tab-more .sheet a, .tab-more .sheet button {
    display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 10px;
    color: var(--ink); text-decoration: none; font-weight: 500; font-size: 1rem; width: 100%; justify-content: flex-start;
  }
  .tab-more .sheet a:active, .tab-more .sheet button:active { background: var(--accent-soft); }
  body.selecting .tabbar { display: none; }
  button.small, .button.small { min-height: 44px; }
  button, .button { min-height: 44px; }
}


/* Page head + filters */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 8px; }

.page-head h1 { margin: 0.3em 0; }

.filter-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 4px; }

.filter-row .storage { font-size: 0.85rem; }

.tab { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; font-size: 0.95rem; }

@media (max-width: 760px) { .tab { min-height: 44px; } .filter-row .storage { width: 100%; } }


/* Gallery fills the width */
.grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }

.tile { border-radius: 8px; }

.month h2 { font-size: 1.15rem; margin: 1.6em 0 0.6em; }

@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .tile { border-radius: 4px; }
}


/* Select mode */
body.selecting .grid[data-selectable="1"] .tile::after { width: 26px; height: 26px; border: 2px solid #fff; background: rgba(0, 0, 0, 0.35); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 1px 4px rgba(0, 0, 0, 0.4); }

body.selecting .grid[data-selectable="1"] .tile.picked::after { line-height: 22px; font-size: 14px; }

.select-bar {
  left: 0; right: 0; bottom: 0; transform: none; width: auto; border-radius: 0;
  flex-wrap: nowrap; justify-content: flex-start; gap: 8px;
  padding: 10px max(16px, calc((100% - 1088px) / 2)) calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18), inset 0 1px 0 var(--line);
}

.select-bar select { flex: 1 1 auto; max-width: 320px; }

.select-bar input[name=new_name] { flex: 1 1 auto; max-width: 260px; }

.select-bar button { flex: 0 0 auto; min-height: 44px; }

body.selecting main { padding-bottom: 110px; }

@media (max-width: 560px) {
  .select-bar { flex-wrap: wrap; }
  .select-bar .sel-count { flex: 1 1 auto; }
  .select-bar select, .select-bar input[name=new_name] { order: 3; flex: 1 1 100%; max-width: none; }
  .select-bar button[value=add] { order: 4; flex: 1 1 auto; }
  .select-bar button[value=remove] { order: 5; flex: 1 1 auto; }
}


/* Sign-in pages */
.auth-card { max-width: 420px; margin: 48px auto; padding: 32px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

.auth-card h1 { margin-top: 0; }

.auth-card .stack { max-width: none; margin-top: 20px; }

.small-print { font-size: 0.9rem; margin: 14px 0 0; }

@media (max-width: 480px) { .auth-card { margin: 16px auto; padding: 24px 20px; } }


/* My families */
.cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.family-card { width: 100%; justify-content: flex-start; gap: 14px; padding: 16px; min-height: 76px; text-align: left; font-weight: 400;
  background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }

.family-card:hover { box-shadow: inset 0 0 0 1px var(--accent); filter: none; }

.family-card .avatar { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1.2rem; }

.fc-text { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }

.fc-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }

.fc-go { font-size: 1.6rem; color: var(--muted); }

.join-row { max-width: 460px; }


/* One photo / video */
.photo-top { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }

.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }

.stepper { display: inline-flex; gap: 8px; }

.step { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; line-height: 1;
  text-decoration: none; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

.step:hover { box-shadow: inset 0 0 0 1px var(--accent); }

.step.off { opacity: 0.3; }

.photo-view { margin-top: 8px; }

.photo-view figure.media { margin: 0; }

.details h1 { margin-top: 0; font-size: 1.5rem; }

.caption { font-size: 1.05rem; }

.tags a { min-height: 32px; display: inline-flex; align-items: center; padding: 0 12px; }

.facts { grid-template-columns: 92px minmax(0, 1fr); row-gap: 10px; margin: 18px 0; }

.add-album select { flex: 1 1 180px; }

.add-album button { min-height: 44px; }

.more-info { margin-top: 18px; color: var(--muted); }

.more-info summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }

.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

button.danger-quiet { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }

button.danger-quiet:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); filter: none; }

@media (max-width: 800px) { .photo-view { gap: 12px; } }

@media (max-width: 760px) { .photo-view img, .photo-view video { border-radius: 0; margin: 0 -16px; width: calc(100% + 32px); max-width: none; } }


/* Ask: keep the question box above the phone tab bar */
@media (max-width: 760px) { body.has-tabbar #ask-form { bottom: calc(68px + env(safe-area-inset-bottom)); } }



/* ===== Design review round 3 ===================================================== */
h1, h2, h3 { letter-spacing: -0.01em; }

input, select { background: var(--field); border: 1px solid var(--field-border); border-radius: 10px; }

input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.js .no-js { display: none; }

.lead { margin-top: -4px; }

.count-note { font-family: var(--sans); font-size: 0.9rem; font-weight: 400; }

.phone-only { display: none; }

.icon-only { width: 44px; padding: 0; }

.icon-only svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@media (max-width: 760px) { .phone-only { display: inline-flex; } }

@media not ((hover: hover) and (pointer: fine)) { .pointer-only { display: none; } }


/* Main-site header links are proper tap targets on phones */
@media (max-width: 760px) { .top-nav.always a, .top-nav.always button { min-height: 44px; display: inline-flex; align-items: center; padding: 0 6px; } }


/* Gallery: bigger tiles on wide screens; storage line under the filters */
.grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.filter-row { flex-direction: column; align-items: flex-start; gap: 6px; }

@media (max-width: 760px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }


/* Upload */
.drop { position: relative; padding: 36px 16px; gap: 10px; }

.drop .file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.drop-icon { width: 40px; height: 40px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.drop-button { min-height: 48px; padding: 0 22px; pointer-events: none; }

.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.drop-picked { font-weight: 600; min-height: 1.4em; }

#upload-button:disabled { opacity: 0.45; cursor: not-allowed; }


/* Albums */
.album-new { display: flex; flex-wrap: wrap; gap: 8px; max-width: 560px; margin-bottom: 8px; }

.album-new input { flex: 1 1 240px; }

@media (max-width: 560px) { .album-new input, .album-new button { flex: 1 1 100%; } }

.album-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.album-chips a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; text-decoration: none; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-size: 0.9rem; }


/* Photo page */
.more-info summary { list-style: none; justify-content: space-between; font-weight: 600; color: var(--ink); }

.more-info summary::-webkit-details-marker { display: none; }

.more-info summary::after { content: '›'; font-size: 1.4rem; transition: transform 0.2s; color: var(--muted); }

.more-info[open] summary::after { transform: rotate(90deg); }


/* Family members as cards (fits any screen) */
.member-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

.member { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

.member .avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.member .who { display: grid; flex: 1 1 200px; min-width: 0; }

.member .name { font-weight: 600; }

.member .email { font-size: 0.9rem; overflow-wrap: anywhere; }

.member-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.role-form { display: flex; gap: 8px; }

.role-badge { font-size: 0.85rem; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); }

@media (max-width: 560px) {
  .member-actions { flex: 1 1 100%; }
  .role-form { flex: 1 1 auto; }
  .role-form select { flex: 1 1 auto; }
}

.invite-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; max-width: 760px; }

.invite-form label { display: grid; gap: 4px; font-weight: 500; }

.invite-form button { min-height: 44px; }

@media (max-width: 560px) { .invite-form { grid-template-columns: 1fr; } .invite-form button { width: 100%; min-height: 48px; } }

.invite-list { list-style: none; padding: 0; display: grid; gap: 8px; }

.invite-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }


/* Ask: chat list as a dropdown on phones */
.chat-picker > summary { display: none; }

@media (max-width: 760px) {
  .chat-picker > summary { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 14px; margin-top: 8px;
    border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; font-weight: 600; list-style: none; }
  .chat-picker > summary::-webkit-details-marker { display: none; }
  .chat-picker > summary::after { content: '▾'; color: var(--muted); }
  .chat-picker[open] > summary::after { content: '▴'; }
  .sessions .new-chat { min-height: 44px; }
  #ask-form { position: fixed; left: 0; right: 0; z-index: 30; padding: 10px 16px; border-top: 1px solid var(--line); }
  body.has-tabbar #ask-form { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .ask-main .chat { padding-bottom: 84px; }
}


/* Search form */
.search-form > input[type=search] { min-height: 48px; font-size: 1rem; }

@media (max-width: 560px) { .search-form { display: grid; grid-template-columns: 1fr 1fr; } .search-form > input, .search-form > button { grid-column: 1 / -1; } .search-form label:last-of-type { grid-column: 1 / -1; } }


/* ---- Design round 4 ---- */
/* One disabled look for every main button, in both themes. */
button:disabled, button[disabled], .button[aria-disabled="true"], #upload-button:disabled {
  background: var(--surface-2, var(--surface)); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line); border-color: var(--line);
  opacity: 1; cursor: not-allowed;
}

.sel-hint { font-size: 0.85rem; }

.sel-hint[hidden] { display: none; }


/* Touch screens: no drag-and-drop hint (narrow screens included, whatever the pointer says). */
@media (max-width: 760px) { .pointer-only { display: none; } }


/* Video: a still with a big play button until tapped. */
.video-start { position: relative; display: block; border-radius: 12px; overflow: hidden; background: #000; }

.video-start img { display: block; width: 100%; height: auto; }

.video-start .play-big { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0,0,0,0.55); color: #fff; padding-left: 4px; }

.video-start:hover .play-big, .video-start:focus-visible .play-big { background: var(--accent); }

.video-len { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,0.6); color: #fff;
  font-size: 0.85rem; padding: 2px 8px; border-radius: 6px; }

.media video { width: 100%; border-radius: 12px; background: #000; }


/* Tags are plain hashtag links; album chips are the outlined ones. */
.tags { gap: 4px 14px; }

.tags a { background: none; padding: 0; min-height: 32px; color: var(--muted); font-size: 0.9rem; border-radius: 0; }

.tags a:hover { color: var(--accent); text-decoration: underline; }

.album-chips a { min-height: 44px; padding: 0 16px; }

.place { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }

.map-link { display: inline-flex; align-items: center; padding: 0 12px;
  border-radius: 8px; text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); min-height: 36px; margin: -4px 0; }

@media (max-width: 760px) { .map-link { min-height: 44px; margin: -6px 0; } }


/* Albums: a quiet "+ New album" button that opens a small form. */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.new-album { position: relative; }

.new-album > summary { list-style: none; cursor: pointer; }

.new-album > summary::-webkit-details-marker { display: none; }

.new-album[open] > summary { box-shadow: inset 0 0 0 2px var(--accent); }

.new-album .album-new { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(340px, calc(100vw - 32px));
  display: grid; gap: 10px; padding: 16px; border-radius: 12px; background: var(--surface);
  box-shadow: 0 8px 28px rgba(0,0,0,0.18), inset 0 0 0 1px var(--line); margin: 0; }

.new-album .album-new label { display: grid; gap: 6px; }

.new-album .album-new input, .new-album .album-new button { flex: none; width: 100%; }


/* Ask: chat count as a badge; Delete set apart. */
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--accent-soft); color: var(--ink); font-size: 0.8rem; font-weight: 600; }

.chat-picker > summary { display: flex; align-items: center; gap: 8px; }

.chat-picker > summary > span:first-child { flex: 0 0 auto; }

.ask-head .row.compact { gap: 12px; }


/* Search: every control has a label on the same row. */
.search-form { align-items: end; }

.search-form label { display: grid; gap: 6px; }

.search-form input, .search-form select, .search-form button { height: 44px; box-sizing: border-box; }


/* Invite form: room for the role names. */
@media (min-width: 761px) {
  .invite-form { grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 1fr) minmax(150px, 1fr) auto; align-items: end; }
}

.invite-form select { min-width: 0; width: 100%; }


/* Log in: the invite path is a real button. */
.auth-alt { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }

.auth-alt .button { display: flex; justify-content: center; align-items: center; min-height: 44px; text-decoration: none; }


/* Main site: centered column; on phones the links live in an account menu. */
main.narrow > * { max-width: 640px; }

.phone-only { display: none; }

@media (max-width: 760px) {
  .desktop-only { display: none !important; }
  .phone-only { display: block; }
}

.account-menu { position: relative; margin-left: auto; }

.account-menu > summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; }

.account-menu > summary::-webkit-details-marker { display: none; }

.account-menu .avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.account-sheet { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 8px;
  border-radius: 12px; background: var(--surface); box-shadow: 0 8px 28px rgba(0,0,0,0.18), inset 0 0 0 1px var(--line); display: grid; }

.account-sheet p { margin: 6px 10px 8px; overflow-wrap: anywhere; }

.account-sheet a, .account-sheet button { display: flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 8px;
  text-decoration: none; color: var(--ink); width: 100%; text-align: left; font: inherit; }

.account-sheet a:hover, .account-sheet button:hover { background: var(--accent-soft); }

.photo-view .video-start img { margin: 0; width: 100%; max-height: 82vh; border-radius: 0; background: none; }

@media (max-width: 760px) { .photo-view .video-start { border-radius: 0; margin: 0 -16px; } }


/* ---- Design round 5 ---- */
.brand .sub { text-transform: none; letter-spacing: 0.02em; font-size: 0.8rem; }

.icon-only { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; padding: 0; }

.head-actions { gap: 8px; flex-wrap: nowrap; }

.head-actions > * { min-height: 44px; }

.filter-row { margin-top: 4px; margin-bottom: 16px; }

.grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

@media (max-width: 760px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tab { min-width: 44px; padding-inline: 14px; } }

.storage-note { margin-top: 28px; font-size: 0.85rem; text-align: center; }


/* Selected tiles: full-strength photo, ring plus a light accent tint. */
body.selecting .grid[data-selectable="1"] .tile.picked img { opacity: 1; }

body.selecting .grid[data-selectable="1"] .tile.picked::before { background: color-mix(in srgb, var(--accent) 15%, transparent); }

@media (max-width: 760px) {
  .select-bar { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .select-bar .sel-count { grid-column: 1; }
  .select-bar [data-select-cancel] { grid-column: 2; grid-row: 1; min-height: 44px; }
  .select-bar select { grid-column: 1; }
  .select-bar button[name=do][value=add] { grid-column: 2; min-height: 44px; width: auto; }
  .select-bar .sel-hint { grid-column: 1 / -1; order: 9; }
  .select-bar input[name=new_name] { grid-column: 1 / -1; }
  .select-bar button[value=remove] { grid-column: 1 / -1; }
}


/* Search on phones: words, then the date range together, then type and Search. */
@media (max-width: 560px) {
  .search-form { display: grid; grid-template-columns: 1fr 1fr; }
  .search-form .q-field, .search-form label:last-of-type, .search-form > button { grid-column: 1 / -1; }
}


/* Main site: header lines up with the centered column. */
/* Main site keeps the standard header; its content is a 640px column on the same left edge. */

/* Upload uses the full content column. */
form.upload { max-width: none; }


/* Ask */
.sessions .chat-picker { margin-top: 20px; }

.ask-head h1 { flex: 1 1 100%; margin-bottom: 4px; }

.ask-head .row.compact { gap: 0; }

.ask-head .row.compact > form + form { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); }

.ask-head button { min-height: 44px; padding-inline: 14px; }

.save-toggle[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

.msg.user { justify-self: end; margin-left: auto; max-width: 85%; border-radius: 16px 16px 4px 16px; }

@media (max-width: 760px) { .msg.user { max-width: 85%; } }


/* Albums and album pages: actions apart from filters; 44px create button. */
.new-album > summary { min-height: 44px; display: inline-flex; align-items: center; }

.page-head + .filter-row, .album-head + .filter-row { margin-top: 12px; }

.photo-top .icon-only, .stepper a, .stepper span { min-width: 44px; min-height: 44px; }


/* Empty states */
.empty-note { padding: 16px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }

body.has-tabbar main { padding-bottom: 96px; }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .page-head.tight { flex-wrap: nowrap; }
  .page-head.tight h1 { font-size: 1.6rem; margin: 0; min-width: 0; }
  .album-page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .album-page-head .head-actions { justify-content: flex-start; }
  .head-actions .button, .head-actions button, .head-actions summary { white-space: nowrap; }
}

@media (max-width: 760px) { .album-page-head { margin-bottom: 16px; } }

.drop small { text-wrap: balance; }


/* ---- Design round 7 ---- */
.account-menu > summary { width: auto; height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px 0 4px;
  border-radius: 22px; box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; color: var(--ink); }

.account-menu .chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .15s; }

.account-menu[open] .chev { transform: rotate(180deg); }

.select-bar button:disabled { opacity: 0.55; }

@media (min-width: 761px) {
  .select-bar [data-select-cancel] { margin-left: auto; }
  .select-bar select { flex: 0 1 280px; }
}

.sel-hint { font-size: 0.875rem; color: var(--muted); }

.sessions small { font-size: 0.8rem; }

.small-note { font-size: 0.875rem; }

.drop small { font-size: 0.875rem; }

.ask-main { max-width: none; }

.msg { max-width: min(72ch, 92%); }

form.add-album button:disabled, form.add-album button.secondary:disabled { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); opacity: 0.55; cursor: not-allowed; }

.back { min-height: 44px; padding-right: 12px; margin-left: -2px; gap: 6px; }


/* Gallery months: on wide screens, months with 1–3 items share a row. */
@media (min-width: 761px) {
  .months { display: flex; flex-wrap: wrap; column-gap: 28px; --tile: 172px; }
  .months .month { flex: 1 1 100%; min-width: 0; }
  .months .month.short { flex: 0 0 auto; }
  .months .month.short .grid { grid-template-columns: repeat(var(--cols), var(--tile)); }
  .months .month.n1 { --cols: 1; } .months .month.n2 { --cols: 2; } .months .month.n3 { --cols: 3; }
  .months .month:not(.short) .grid { grid-template-columns: repeat(auto-fill, var(--tile)); }
}


.add-hint { font-size: 0.875rem; color: var(--muted); margin: 6px 0 0; }

.add-hint[hidden] { display: none !important; }

.pw-wrap { position: relative; display: block; }

.pw-wrap input { padding-right: 72px; width: 100%; box-sizing: border-box; }

.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 40px; padding: 0 12px;
  background: none; color: var(--accent); box-shadow: none; font-weight: 600; font-size: 0.9rem; }

.pw-toggle:hover { background: var(--accent-soft); }

.join-row { display: flex; gap: 8px; }
 .join-row input { flex: 1 1 auto; min-width: 0; max-width: none; }


/* ---- Final polish ---- */
body { min-height: 100vh; display: flex; flex-direction: column; }

body > main { flex: 1 0 auto; width: 100%; box-sizing: border-box; }

main.narrow .cards { grid-template-columns: 1fr; }

main.narrow .family-card { width: 100%; }

.stepper a, .stepper span, .photo-top .stepper > * { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }

@media (min-width: 761px) { main .grid:not(.small) { grid-template-columns: repeat(auto-fill, 172px); } }

/* Disabled Add: still reads as a button (solid border, readable label), just inactive. */
.select-bar button:disabled, form.add-album button:disabled, form.add-album button.secondary:disabled {
  opacity: 1; background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--field-border, var(--line)); }

.pw-toggle { min-height: 44px; }



/* ===== Navigation & settings (premium pass) ===== */
:root { --shadow-pop: 0 1px 2px rgba(16,24,40,.06), 0 12px 32px -8px rgba(16,24,40,.22); --ease: cubic-bezier(.2,.8,.2,1); }
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){ --shadow-pop: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -8px rgba(0,0,0,.65); }
 }
:root[data-theme="dark"]{ --shadow-pop: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -8px rgba(0,0,0,.65); }
 


/* Header: frosted, sticky, one row: brand · links · account */
header.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }

.bar { flex-wrap: nowrap; gap: 20px; min-height: 64px; padding-block: 8px; }

.brand .family { font-size: 1.2rem; letter-spacing: -0.01em; }

.top-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.top-nav a { padding: 8px 12px; border-radius: 999px; border-bottom: 0; color: var(--muted); font-weight: 500; transition: background .15s var(--ease), color .15s var(--ease); }

.top-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }

.top-nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(16,24,40,.06); font-weight: 600; }

.top-nav .button.small { color: var(--accent-ink); background: var(--accent); }


/* Account menu */
.account-menu { margin-left: 4px; flex: 0 0 auto; }

.account-menu > summary { width: auto; height: 44px; gap: 8px; padding: 0 10px 0 4px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line);
  background: var(--surface); transition: box-shadow .15s var(--ease); }

.account-menu > summary:hover, .account-menu[open] > summary { box-shadow: inset 0 0 0 1px var(--field-border); }

.account-menu .account-name { font-weight: 600; font-size: 0.95rem; }

.avatar { border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; flex: 0 0 auto;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent)); color: var(--accent-ink); }

.account-menu .avatar { width: 34px; height: 34px; font-size: 0.95rem; }

.avatar.sm { width: 26px; height: 26px; font-size: 0.8rem; }

.avatar.lg { width: 42px; height: 42px; font-size: 1.1rem; }

.avatar.xl { width: 72px; height: 72px; font-size: 1.9rem; }

.account-sheet { width: 300px; min-width: 0; padding: 6px; border-radius: 16px; top: calc(100% + 10px); background: var(--surface);
  box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line); transform-origin: top right; animation: pop .16s var(--ease); }

.account-sheet a, .account-sheet button { gap: 12px; padding: 0 12px; border-radius: 10px; font-weight: 500; }

.account-sheet svg, .sheet svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); flex: 0 0 auto; }

.account-sheet a:hover svg { color: var(--ink); }

.account-who { display: flex; gap: 12px; align-items: center; padding: 12px 12px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }

.account-who > span:last-child { display: grid; min-width: 0; }

.account-who .muted { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu-label { margin: 10px 12px 4px; font-size: 0.75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.family-item[aria-current="true"] { background: var(--accent-soft); font-weight: 600; }

.family-item .check { margin-left: auto; color: var(--accent); stroke-width: 2.4; }

.account-sheet form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }

.menu-logout { color: var(--danger) !important; background: none; box-shadow: none; }

.menu-logout svg { color: var(--danger) !important; }

@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { .account-sheet, .tab-more .sheet { animation: none; } }

@media (max-width: 760px) {
  .account-menu > summary { padding: 0 4px; box-shadow: none; background: none; }
  .account-menu .account-name, .account-menu .chev { display: none; }
  .account-menu .avatar { width: 36px; height: 36px; }
  .account-sheet { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
  .phone-only.account-menu, .account-menu { display: block; }
}


/* Phone tab bar: frosted, crisp active state, a real bottom sheet for More */
@media (max-width: 760px) {
  .tabbar { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); }
  .tab-item { position: relative; font-weight: 500; }
  .tab-item[aria-current="page"] { font-weight: 600; }
  .tab-item[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .tab-more .sheet { position: fixed; left: 8px; right: 8px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 8px; border-radius: 20px;
    box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line); animation: sheet .2s var(--ease); }
  .tab-more .sheet a, .tab-more .sheet button { gap: 14px; min-height: 52px; }
  .tab-more .sheet form { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
  .sheet-grab { justify-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 2px 0 6px; }
}

@keyframes sheet { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }


/* Settings */
.settings { max-width: 720px; }

.settings-hero { display: flex; gap: 20px; align-items: center; margin: 24px 0 20px; }

.settings-hero h1 { margin: 0 0 4px; }

.settings-hero p { margin: 0; }

.settings-hero .role-badge { white-space: nowrap; }

.settings-jump { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 20px; position: sticky; top: 72px; z-index: 5; padding: 6px 0;
  background: var(--bg); }

.settings-jump a { padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }

.settings-jump a:hover { color: var(--ink); }

.settings-card { background: var(--surface); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(16,24,40,.04);
  padding: 24px; margin: 0 0 16px; scroll-margin-top: 130px; }

.settings-card-head { margin-bottom: 16px; }

.settings-card-head h2 { margin: 0 0 4px; font-size: 1.3rem; }

.settings-card-head p { margin: 0; }

.settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; max-width: none; }

.settings-form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; }

.settings-form .hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }

.settings-form .form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; padding-top: 4px; }

#password .settings-form label:first-child { grid-column: 1 / -1; }

.settings-form.inline-form { grid-template-columns: 1fr auto; align-items: end; margin-top: 18px; }

.settings-form.inline-form .form-actions { grid-column: auto; padding: 0; }

.settings-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 16px 0 0; }

.settings-card .settings-row + .settings-row, .settings-form + .settings-row { margin-top: 16px; border-top: 1px solid var(--line); }

.settings-row p { margin: 2px 0 0; }

.settings-row .button, .settings-row button { white-space: nowrap; }

.storage-meter p { margin: 8px 0 0; }

.storage-bar { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; }

.storage-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #8b5cf6)); min-width: 6px; }

.settings-logout { margin: 24px 0 8px; }

@media (max-width: 600px) {
  .settings-hero { gap: 14px; margin-top: 12px; }
  .avatar.xl { width: 56px; height: 56px; font-size: 1.5rem; }
  .settings-card { padding: 18px; border-radius: 14px; }
  .settings-form, .settings-form.inline-form { grid-template-columns: 1fr; }
  .settings-form .form-actions { justify-content: stretch; } .settings-form .form-actions button { width: 100%; }
  .settings-row { flex-direction: column; align-items: stretch; }
  .settings-row .button, .settings-row form button { width: 100%; justify-content: center; }
  .settings-jump { top: 60px; overflow-x: auto; flex-wrap: nowrap; }
}

.storage-fill.pct-0 { width: 0%; }

.storage-fill.pct-5 { width: 5%; }

.storage-fill.pct-10 { width: 10%; }

.storage-fill.pct-15 { width: 15%; }

.storage-fill.pct-20 { width: 20%; }

.storage-fill.pct-25 { width: 25%; }

.storage-fill.pct-30 { width: 30%; }

.storage-fill.pct-35 { width: 35%; }

.storage-fill.pct-40 { width: 40%; }

.storage-fill.pct-45 { width: 45%; }

.storage-fill.pct-50 { width: 50%; }

.storage-fill.pct-55 { width: 55%; }

.storage-fill.pct-60 { width: 60%; }

.storage-fill.pct-65 { width: 65%; }

.storage-fill.pct-70 { width: 70%; }

.storage-fill.pct-75 { width: 75%; }

.storage-fill.pct-80 { width: 80%; }

.storage-fill.pct-85 { width: 85%; }

.storage-fill.pct-90 { width: 90%; }

.storage-fill.pct-95 { width: 95%; }

.storage-fill.pct-100 { width: 100%; }

.hero-email { overflow-wrap: anywhere; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px !important; font-size: 0.9rem; }

.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }

.pill.accent { background: var(--accent-soft); color: var(--accent); }

.device-list { list-style: none; margin: 0; padding: 0; display: grid; }

.device-list li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }

.device-list li:first-child { border-top: 0; padding-top: 0; }

.device-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto;
  background: color-mix(in srgb, var(--ink) 6%, transparent); }

.device-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; color: var(--muted); }

.device-text { display: grid; gap: 2px; min-width: 0; }

.device-text .muted { font-size: 0.88rem; }

.settings-row > p { margin: 0; }

.account-sheet .menu-logout { justify-content: flex-start; }

/* Dim the page behind open menus and the More sheet. */
body.menu-open::after { content: ''; position: fixed; inset: 0; z-index: 35; background: rgba(10, 12, 16, .32); animation: fade .16s var(--ease); }

@media (min-width: 761px) { body.menu-open::after { background: rgba(10, 12, 16, .06); } }

.account-sheet { z-index: 45; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 600px) {
  .settings-hero { align-items: flex-start; }
  .settings-hero h1 { font-size: 1.6rem; }
}

.device-name { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }


/* ===== Navigation & settings, round 2 ===== */
:root { --surface-2: #ffffff; --active-tint: color-mix(in srgb, var(--accent) 11%, transparent); }
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){ --surface-2: #23262c; --active-tint: color-mix(in srgb, var(--accent) 20%, transparent); }
 }
:root[data-theme="dark"]{ --surface-2: #23262c; --active-tint: color-mix(in srgb, var(--accent) 20%, transparent); }
 


/* Desktop header: active link is a tinted accent pill. */
.top-nav a[aria-current="page"] { background: var(--active-tint); color: var(--accent); box-shadow: none; }


/* Menus: shared row styles, current item tinted. */
.account-sheet, .tab-more .sheet { background: var(--surface-2); }

.account-sheet a[aria-current="true"], .tab-more .sheet a[aria-current="true"] { background: var(--active-tint); color: var(--ink); font-weight: 600; }

.account-sheet a[aria-current="true"] svg:not(.check), .tab-more .sheet a[aria-current="true"] svg:not(.check) { color: var(--accent); }

.family-item .check { margin-left: auto; width: 18px; height: 18px; color: var(--accent); stroke-width: 2.4; }

.family-item > svg:first-child { width: 26px; }

.account-sheet hr, .tab-more .sheet hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.two-line { display: grid; line-height: 1.2; }

.two-line small { color: var(--muted); font-weight: 400; font-size: 0.8rem; }

.account-sheet .sheet-grab { display: none; }


/* Phone: the account menu is a bottom sheet, like More. */
@media (max-width: 760px) {
  .account-sheet { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto;
    padding: 8px 8px 10px; border-radius: 20px; max-height: 80vh; overflow-y: auto; animation: sheet .2s var(--ease);
    box-shadow: 0 -8px 32px rgba(0,0,0,.35), inset 0 0 0 1px var(--line); }
  body.has-tabbar .account-sheet { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .account-sheet .sheet-grab { display: block; justify-self: center; margin: 0 auto 6px; width: 36px; height: 4px; border-radius: 2px; background: var(--line); }
  .account-sheet a, .account-sheet button { min-height: 50px; font-size: 1rem; }
  .account-menu[open] > summary .avatar { box-shadow: 0 0 0 3px var(--active-tint); }
  /* More sheet sits right on the tab bar. */
  .tab-more .sheet { bottom: calc(68px + env(safe-area-inset-bottom)); max-height: 78vh; overflow-y: auto; }
  /* While a sheet is open, only More (or nothing) reads as active. */
  .tabbar:has(.tab-more[open]) > a.tab-item[aria-current="page"] { color: var(--muted); font-weight: 500; }
  .tabbar:has(.tab-more[open]) > a.tab-item[aria-current="page"]::before { display: none; }
  .tab-more[open] > summary { color: var(--accent); }
  .tab-more[open] > summary::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
}


/* Settings: title, then a section list beside one content column. */
.settings-page { max-width: 920px; margin: 0 auto; }

.settings-top { margin: 16px 0 20px; }

.settings-top h1 { margin: 4px 0 0; }

.settings-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; align-items: start; }

.settings { max-width: none; }

.settings-nav { position: sticky; top: 88px; display: grid; gap: 2px; }

.settings-nav a { display: flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; }

.settings-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }

.settings-nav a[aria-current="true"] { color: var(--accent); background: var(--active-tint); font-weight: 600; }

.settings-card { scroll-margin-top: 88px; }

.settings-card h2 { font-size: 1.3rem; }

.identity { display: flex; gap: 18px; align-items: center; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }

.identity h2 { margin: 0 0 2px; font-size: 1.5rem; }

.identity p { margin: 0; }

.settings-form label.full { grid-column: 1 / -1; }

html.js .email-confirm { display: none; }

html.js .email-confirm.show { display: grid; animation: fade .2s var(--ease); }

.settings-form button:disabled { opacity: .45; }

.text-button { background: none; box-shadow: none; color: var(--accent); font-weight: 600; min-height: 44px; padding: 0 8px; margin-left: auto; }

.text-button:hover { background: var(--active-tint); }

.device-list li { gap: 14px; }

.device-list li > form { margin-left: auto; }

.storage-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }

.storage-bar { height: 8px; }

.storage-fill { min-width: 8px; }

.settings-link { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }

.settings-link a { font-weight: 600; text-decoration: none; }

.settings-link a:hover { text-decoration: underline; }

.row-list { list-style: none; margin: 0; padding: 0; }

.row-list a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 8px; margin: 0 -8px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 500; }

.row-list a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }

.row-list li + li a { box-shadow: 0 -1px 0 var(--line); }

.row-go { margin-left: auto; color: var(--muted); font-size: 1.3rem; }

.settings-logout { margin: 32px 0 8px; }

.settings-logout button { display: inline-flex; align-items: center; gap: 8px; }

.btn-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 760px) {
  .settings-layout { grid-template-columns: 1fr; gap: 0; }
  .settings-nav { display: none; }
  .settings-top { margin-top: 8px; }
  .identity { gap: 14px; }
  .identity h2 { font-size: 1.3rem; }
  .settings-logout button { width: 100%; justify-content: center; min-height: 48px; }
}

@media (max-width: 760px) {
  /* A blurred header would trap the fixed bottom sheet inside it; phones get a solid header. */
  header.top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
}

.text-button { white-space: nowrap; }


/* ===== Navigation & settings, round 3 ===== */
/* Menu rows: one leading slot so every label lines up. */
.menu-row { display: grid !important; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px !important; align-items: center; text-align: left; }

.menu-row .slot { display: grid; place-items: center; width: 28px; height: 28px; }

.menu-row .slot svg { width: 20px; height: 20px; }

.menu-row .slot .avatar.sm { width: 26px; height: 26px; }

@media (max-width: 760px) { .menu-row { grid-template-columns: 32px minmax(0, 1fr) auto; } .menu-row .slot { width: 32px; } .menu-row .slot .avatar.sm { width: 30px; height: 30px; font-size: .85rem; } }

.account-who { padding: 10px 8px 14px 12px; }

/* Log out is ordinary, not alarming. */
.menu-logout, .account-sheet .menu-logout, .tab-more .sheet .menu-logout { color: var(--ink) !important; }

.menu-logout svg, .menu-logout .slot svg { color: var(--muted) !important; }

/* Stronger dim; the open menu's bar rises above it. */
body.menu-open::after { z-index: 45; background: rgba(15, 18, 22, .4); }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) body.menu-open::after{ background: rgba(0, 0, 0, .55); }
 }
:where(:root[data-theme="dark"]) body.menu-open::after{ background: rgba(0, 0, 0, .55); }
 

@media (min-width: 761px) { body.menu-open::after { background: rgba(15, 18, 22, .12); } }

header.top:has(.account-menu[open]), .tabbar:has(.tab-more[open]) { z-index: 60; }

/* Header account button: 44px target, active on Settings. */
.account-menu > summary { min-width: 44px; min-height: 44px; justify-content: center; }

.account-menu.is-here > summary { background: var(--active-tint); box-shadow: none; color: var(--accent); }

/* Phone sheets sit flush on the tab bar with square bottom corners. */
@media (max-width: 760px) {
  .tabbar { --tabbar-h: 68px; }
  .tab-more .sheet { bottom: 100%; left: 0; right: 0; border-radius: 20px 20px 0 0; padding-bottom: 8px; box-shadow: 0 -12px 40px rgba(0,0,0,.4), inset 0 1px 0 var(--line); }
  body.has-tabbar .account-sheet { bottom: calc(68px + env(safe-area-inset-bottom)); left: 0; right: 0; border-radius: 20px 20px 0 0; }
  body:not(.has-tabbar) .account-sheet { bottom: 0; left: 0; right: 0; border-radius: 20px 20px 0 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .sheet-grab { width: 40px !important; height: 5px !important; background: color-mix(in srgb, var(--ink) 30%, transparent) !important; }
  .tab-more .sheet hr { margin: 6px 4px; }
}

/* Settings aligns with every other page's left edge. */
.settings-page { max-width: none; margin: 0; }

.settings-layout { grid-template-columns: 200px minmax(0, 700px); column-gap: 40px; }

.settings-nav { top: 96px; }

.settings-nav a { min-height: 40px; }

.settings-nav a[aria-current="true"] { box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 10px 10px 0; }

.back { min-height: 44px; }

/* Devices: text never orphans a date; Sign out stacks under on narrow phones. */
.nowrap { white-space: nowrap; }

.device-list li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 56px; }

.device-list li > form { margin: 0; }

@media (max-width: 480px) {
  .device-list li { grid-template-columns: 40px minmax(0, 1fr); }
  .device-list li > form { grid-column: 2; justify-self: start; margin-top: -6px; }
  .device-list .text-button { padding: 0; }
}

/* Password feedback */
.pw-status { margin: -4px 0 0; min-height: 1.2em; font-size: .88rem; color: var(--muted); }

.pw-status.good { color: #1f8a4c; }

.pw-status.bad { color: var(--danger); }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .pw-status.good{ color: #5bd08a; }
 }
:where(:root[data-theme="dark"]) .pw-status.good{ color: #5bd08a; }
 

.avatar.md { width: 36px; height: 36px; font-size: 1rem; }

@media (max-width: 760px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
}

.pw-status:empty { display: none; }


/* ===== Navigation & settings, round 4 ===== */
/* Phone sheets cover the tab bar under one full-screen dim. */
@media (max-width: 760px) {
  .tabbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  .tab-more .sheet, .account-sheet, body.has-tabbar .account-sheet, body:not(.has-tabbar) .account-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 85vh; overflow-y: auto;
    border-radius: 22px 22px 0 0; padding: 8px 10px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -16px 48px rgba(0,0,0,.45), inset 0 1px 0 var(--line); z-index: 70; }
  body.menu-open::after { z-index: 55; }
  header.top:has(.account-menu[open]), .tabbar:has(.tab-more[open]) { z-index: 65; }
  /* What's under the sheet is dimmed too, and can't be tapped. */
  header.top:has(.account-menu[open]) .brand, header.top:has(.account-menu[open]) .account-menu > summary { opacity: .45; }
  .tabbar:has(.tab-more[open]) > a, .tabbar:has(.tab-more[open]) > details > summary { pointer-events: none; }
  .sheet-grab, .account-sheet .sheet-grab { display: block; margin: 2px auto 8px !important; width: 40px !important; height: 5px !important; border-radius: 3px;
    background: rgba(0,0,0,.28) !important; }
}
@media (max-width: 760px) and (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .sheet-grab, :where(:root:not([data-theme="light"])) .account-sheet .sheet-grab{ background: rgba(255,255,255,.45) !important; }
 }
@media (max-width: 760px){:where(:root[data-theme="dark"]) .sheet-grab, :where(:root[data-theme="dark"]) .account-sheet .sheet-grab{ background: rgba(255,255,255,.45) !important; }
 }

/* One leading column for icons, avatars and the identity row. */
.menu-row { grid-template-columns: 36px minmax(0, 1fr) auto !important; }

.menu-row .slot { width: 36px !important; }

.account-who { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 10px 12px 14px; }

.account-who .avatar.lg { width: 36px; height: 36px; font-size: 1rem; }

.menu-row .slot .avatar.sm { width: 28px !important; height: 28px !important; font-size: .82rem !important; }

/* Disabled buttons stay readable (>= 3:1) and look like buttons. */
button:disabled, .settings-form button:disabled, form.add-album button:disabled, .select-bar button:disabled {
  opacity: 1 !important; background: #eceef2 !important; color: #5a616d !important; box-shadow: inset 0 0 0 1px #d5d9e0 !important; cursor: not-allowed; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) button:disabled, :where(:root:not([data-theme="light"])) .settings-form button:disabled, :where(:root:not([data-theme="light"])) form.add-album button:disabled, :where(:root:not([data-theme="light"])) .select-bar button:disabled{
    background: #2a2e36 !important; color: #b4bac4 !important; box-shadow: inset 0 0 0 1px #3a3f48 !important; }

}
:where(:root[data-theme="dark"]) button:disabled, :where(:root[data-theme="dark"]) .settings-form button:disabled, :where(:root[data-theme="dark"]) form.add-album button:disabled, :where(:root[data-theme="dark"]) .select-bar button:disabled{
    background: #2a2e36 !important; color: #b4bac4 !important; box-shadow: inset 0 0 0 1px #3a3f48 !important; }



.pw-status { min-height: 20px; margin-top: 2px; }

.pw-status:empty { display: block; }

/* Settings: wider content; on phones a sticky section switcher under the title. */
.settings-layout { grid-template-columns: 200px minmax(0, 760px); }

@media (max-width: 760px) {
  .settings-nav { display: flex; position: sticky; top: 64px; z-index: 20; gap: 8px; overflow-x: auto; margin: 0 -16px 16px; padding: 8px 16px;
    background: var(--bg); scrollbar-width: none; box-shadow: 0 1px 0 var(--line); }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav a { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
  .settings-nav a[aria-current="true"] { box-shadow: inset 0 0 0 1px var(--accent); border-radius: 999px; }
  .settings-card { scroll-margin-top: 140px; }
}

/* Families rows match device rows. */
.row-list a { min-height: 60px; font-size: 1rem; font-weight: 600; }

.row-list .two-line small { font-size: .86rem; margin-top: 2px; }

.row-list li + li a { box-shadow: none; border-top: 1px solid var(--line); border-radius: 0; }

/* Storage meter reads as a meter. */
.storage-bar { height: 8px; background: color-mix(in srgb, var(--ink) 13%, transparent); }

.storage-head { font-variant-numeric: tabular-nums; }

/* Password Show: a full 44px target. */
.pw-toggle { min-width: 56px; min-height: 44px; right: 0; }

.settings-row form button { display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 480px) { .device-list .text-button { min-height: 44px; padding: 0 12px; margin-left: -12px; } }

@media (max-width: 760px) {
  .settings-page .settings-layout { display: block; }
  .settings-page .settings-nav { flex-wrap: nowrap; }
}

@media (max-width: 760px) {
  .settings-page .settings-nav { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 40px; }
  .settings-page .settings-nav a { padding: 0 14px; }
}


/* ===== Navigation & settings, round 5 ===== */
/* Family colours (white letter, >= 4.5:1). */
.avatar.tone-0 { background: #3b6fd8; color: #fff; }
 .avatar.tone-1 { background: #0f7a6a; color: #fff; }

.avatar.tone-2 { background: #b5532a; color: #fff; }
 .avatar.tone-3 { background: #7a4fc4; color: #fff; }

.avatar.tone-4 { background: #a63a6a; color: #fff; }
 .avatar.tone-5 { background: #4f6b2a; color: #fff; }

.family-card .avatar[class*="tone-"] { color: #fff; }

/* Desktop dropdowns float over an undimmed page; phones keep the full dim. */
@media (min-width: 761px) { body.menu-open::after { background: transparent; } }

/* Sheet: identity header first. */
.tab-more .sheet .account-who { border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* Settings bits */
.family-head { display: flex; gap: 14px; align-items: center; }

.family-head h2 { margin: 0 0 2px; }

.storage-meter .small-print { margin: 10px 0 0; }

.storage-bar { height: 8px; }

.logout-here { margin: 16px 0 0; }

.logout-here button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; width: 100%; }

.settings-row.first { padding-top: 0; }

.quiet-card { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }

.quiet-card p { margin: 0; }

.danger-text { background: none; box-shadow: none; color: var(--danger); font-weight: 600; min-height: 44px; padding: 0 8px; white-space: nowrap; }

.danger-text:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }

@media (max-width: 760px) {
  .settings-page .settings-nav a { padding: 0 12px; font-size: .95rem; }
}


/* ===== Navigation & settings, round 6 ===== */
.place-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }

.place-chips .pill { font-weight: 500; }

.device-name { gap: 8px; }

.device-name .muted { font-size: .88rem; }

.small-btn { min-height: 40px; padding: 0 14px; }

@media (max-width: 480px) { .device-list li > form { margin-top: 2px; } .small-btn { min-height: 44px; } }

.logout-here .small-print { text-align: center; margin: 8px 0 0; }

.storage-bar { background: #e4e4e7; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .storage-bar{ background: #3a3a3f; }
 }
:where(:root[data-theme="dark"]) .storage-bar{ background: #3a3a3f; }
 

.settings-link.plain { border: 0; padding: 0; margin-top: 10px; }

/* Phone section chips: four always fit, each a full 44px. */
@media (max-width: 760px) {
  .settings-page .settings-nav { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 6px; overflow: visible;
    -webkit-mask-image: none; mask-image: none; padding-right: 16px; }
  .settings-page .settings-nav a { min-height: 44px; padding: 0 12px; font-size: .92rem; justify-content: center; }
  .account-menu .avatar { width: 40px; height: 40px; }
}

.back { padding: 0 4px; margin-left: -4px; display: inline-flex; align-items: center; }

/* Menus on a light page: crisp edge. */
.account-sheet { box-shadow: 0 12px 32px rgba(16,24,40,.14), 0 2px 6px rgba(16,24,40,.06), inset 0 0 0 1px var(--line); }

@media (max-width: 760px) { .account-sheet { box-shadow: 0 -16px 48px rgba(0,0,0,.45), inset 0 1px 0 var(--line); } }

.menu-label { font-size: .75rem; letter-spacing: .06em; padding: 8px 12px 6px; margin: 4px 0 0; color: color-mix(in srgb, var(--ink) 62%, transparent); }


/* ===== Navigation & settings, round 7 ===== */
.sheet-hint { margin: 6px 14px 4px; font-size: .85rem; color: var(--muted); }

.site-context { margin-left: auto; color: var(--muted); font-size: .92rem; }

.site-context a { color: var(--muted); text-decoration: none; }
 .site-context a:hover { color: var(--ink); }

.top-nav a { font-size: .9rem; height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 10px; }

/* Section list: a location marker, not tabs. */
.settings-nav a[aria-current="true"] { background: none; color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); border-radius: 0; }

@media (max-width: 760px) {
  .settings-page .settings-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); justify-content: stretch; padding-inline: 16px; gap: 8px; }
  .settings-page .settings-nav a { padding: 0 6px; }
  .settings-page .settings-nav a[aria-current="true"] { background: var(--surface); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); border-radius: 999px; }
}

.facts-row { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 14px 0 0; font-size: .92rem; }

.facts-row dt { color: var(--muted); }

.facts-row dd { margin: 0; }

.selectable { user-select: all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }

.logout-here { display: grid; gap: 4px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }

.logout-here p { margin: 0; }

.logout-here .text-button { justify-self: start; margin-left: -8px; display: inline-flex; align-items: center; gap: 8px; }

#site .button { margin-top: 2px; }


/* ===== Navigation & settings, round 8 ===== */
/* Phone header: avatar + chevron so it reads as a menu button. */
@media (max-width: 760px) {
  .account-menu > summary { gap: 2px; padding: 0 2px 0 2px; }
  .account-menu .chev { display: block; width: 16px; height: 16px; color: var(--muted); }
  .account-menu .avatar { width: 34px; height: 34px; }
}

.menu-row.two-line, button.menu-row { width: 100%; background: none; box-shadow: none; color: var(--ink); font: inherit; font-weight: 500; }

button.menu-row .row-go { color: var(--muted); }

/* Desktop menu rows match the 36px nav rhythm. */
@media (min-width: 761px) { .account-sheet .menu-row { min-height: 38px; font-size: .92rem; } .account-who strong { font-size: .98rem; } }

/* Section chips use the same selected look as the photo filters. */
@media (max-width: 760px) {
  .settings-page .settings-nav a { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
  .settings-page .settings-nav a[aria-current="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
}

.storage-fill { min-width: 4px; }

.logout-here .text-button { justify-self: start; }

.logout-here .text-button { width: auto; justify-content: flex-start; margin-left: -8px !important; }


/* ===== Navigation & settings, round 9 ===== */
.header-spacer { margin-left: auto; }

.brand .family { font-weight: 650; }

/* Password eye: a full 44x44 button. */
.pw-wrap input { padding-right: 52px; }

.pw-toggle { width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; right: 2px; color: var(--muted); border-radius: 10px; }

.pw-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.pw-toggle[aria-pressed="true"] { color: var(--accent); }

/* More sheet rows: same 64px rhythm, icons in round wells. */
.menu-row.big { min-height: 64px !important; grid-template-columns: 40px minmax(0, 1fr) auto !important; }

.slot.well { width: 40px !important; height: 40px !important; border-radius: 50%; background: color-mix(in srgb, var(--ink) 8%, transparent); }

.slot.well .avatar.sm { width: 40px !important; height: 40px !important; font-size: 1rem !important; }

.tab-more .sheet .row-go { font-size: 1.3rem; }

/* You're in Settings: ring the avatar. */
.account-menu.is-here .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

/* Photo filters and header buttons: the same 44px as the settings chips. */
@media (max-width: 760px) {
  .type-tabs .tab, .filter-row .tab { height: 44px; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; }
  .head-actions .button, .head-actions button { height: 44px; min-height: 44px; }
}


/* ===== Navigation & settings, round 10 ===== */
/* Three button states that can't be confused: primary (accent fill), secondary (surface + border), disabled (no fill, dashed). */
button:disabled, .settings-form button:disabled, form.add-album button:disabled, .select-bar button:disabled, .join-row button:disabled {
  background: transparent !important; box-shadow: none !important; border: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent) !important;
  color: var(--muted) !important; opacity: 1 !important; cursor: not-allowed; }

.button.secondary, button.secondary { background: var(--surface); box-shadow: inset 0 0 0 1px var(--field-border); }

/* Sheet close button (phones only). */
.sheet-close { display: none; }

@media (max-width: 760px) {
  .account-sheet, .tab-more .sheet { position: fixed; }
  .sheet-close { display: grid; place-items: center; position: absolute; top: 6px; right: 8px; width: 44px; height: 44px; padding: 0; border-radius: 50%;
    background: color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: none; color: var(--ink); font-size: 1.5rem; line-height: 1; }
  .account-sheet .account-who { padding-right: 56px; }
  .tab-more .sheet .sheet-grab { margin-bottom: 44px !important; }
}

/* Desktop dropdown rows: roomier. */
@media (min-width: 761px) {
  .account-sheet .menu-row { min-height: 38px; padding: 0 12px; }
  .account-sheet .menu-row .slot .avatar.sm { width: 24px !important; height: 24px !important; font-size: .75rem !important; }
  .menu-label { margin: 10px 12px 4px; padding: 0; }
}

/* Phone: chips scroll when there are more than four. */
@media (max-width: 760px) {
  .settings-page .settings-nav { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 16px; padding-right: 40px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .settings-page .settings-nav a { flex: 0 0 auto; padding: 0 16px; scroll-snap-align: start; }
  .new-album > summary { min-height: 44px; }
}

.owner-btn { display: flex; justify-content: center; align-items: center; min-height: 44px; margin-top: 12px; font-weight: 600; text-decoration: none; }

.slot-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 6%, transparent); }

.slot-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; color: var(--muted); }

.join-hint { margin: -6px 0 10px; }

.storage-bar { height: 8px; border-radius: 999px; }

.account-sheet button.sheet-close, .tab-more .sheet button.sheet-close { display: none; }

@media (max-width: 760px) {
  .account-sheet button.sheet-close, .tab-more .sheet button.sheet-close {
    display: grid; place-items: center; position: absolute; top: 8px; right: 10px; width: 44px; height: 44px; min-height: 44px; padding: 0;
    border-radius: 50%; background: color-mix(in srgb, var(--ink) 10%, transparent); box-shadow: none; color: var(--ink); font-size: 1.5rem; line-height: 1; }
}

.sheet-title { display: none; }

@media (max-width: 760px) {
  .tab-more .sheet .sheet-grab { margin-bottom: 8px !important; }
  .sheet-title { display: block; margin: 0 0 6px; padding: 8px 12px; min-height: 28px; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
}


/* ===== Navigation & settings, round 11 ===== */
button.secondary:disabled, .button.secondary:disabled { background: transparent !important; box-shadow: none !important;
  border: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent) !important; color: var(--muted) !important; }

.nav-group { margin: 14px 14px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }

.nav-group:first-child { margin-top: 0; }

@media (max-width: 760px) { .settings-page .nav-group { display: none; } }

.back { gap: 4px; font-size: .95rem; }

.back-chev { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 761px) { .owner-btn { display: inline-flex; width: auto; margin-left: auto; padding: 0 18px; } #leave .owner-btn { float: right; } #leave::after { content: ''; display: block; clear: both; } }

.row-list a { margin: 0; padding: 0; }

/* One "you are here" cue on Settings: the tinted button, no ring. */
.account-menu.is-here .avatar { box-shadow: none; }

@media (max-width: 760px) { .account-menu.is-here > summary { background: var(--active-tint); border-radius: 999px; } }

/* Close button: visible on the sheet, clear of the content. */
@media (max-width: 760px) {
  .account-sheet button.sheet-close, .tab-more .sheet button.sheet-close { top: 12px; right: 12px; background: color-mix(in srgb, var(--ink) 14%, transparent); color: var(--muted); }
  .account-sheet .account-who { padding-right: 64px; }
}

/* "Account & families" well matches the other rows. */
.slot.well.initial { font-weight: 700; color: var(--ink); font-size: 1rem; }


/* ===== Navigation & settings, round 12 ===== */
/* Disabled: solid, quiet, clearly inactive. */
button:disabled, button.secondary:disabled, .settings-form button:disabled, form.add-album button:disabled, .select-bar button:disabled, .join-row button:disabled {
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent) !important; background: color-mix(in srgb, var(--ink) 4%, transparent) !important;
  color: color-mix(in srgb, var(--ink) 55%, transparent) !important; box-shadow: none !important; }

/* Sheet header: title and close on one line, glyph centered. */
@media (max-width: 760px) {
  .account-sheet button.sheet-close, .tab-more .sheet button.sheet-close { justify-content: center; align-content: center; text-align: center; top: 14px; }
  .sheet-title { padding: 6px 12px; line-height: 44px; min-height: 44px; margin: 0 0 4px; }
  .tab-more .sheet .sheet-grab { margin-bottom: 0 !important; }
  .settings-page .settings-nav { padding-right: 32px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .settings-page .settings-nav a { padding: 0 14px; }
  .account-menu.is-here > summary { box-shadow: 0 0 0 2px var(--accent); }
  /* Family name is the switcher on phones. */
  .brand.switchable .family { display: inline-flex; align-items: center; gap: 4px; font-size: 1.1rem; }
  .brand.switchable { min-height: 44px; justify-content: center; }
  .brand.switchable .sub { display: none; }
  .logout-here .text-button { width: 100%; min-height: 44px; }
}

.brand-chev { display: none; }

@media (max-width: 760px) { .brand-chev { display: inline-block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; color: var(--muted); } }

/* Desktop: content runs to the header's right edge. */
@media (min-width: 761px) { .settings-layout { grid-template-columns: 200px minmax(0, 1fr); } }

.storage-fill { min-width: 2%; }

.menu-label, .account-who .muted { color: var(--muted); }

.row-list a { min-height: 56px; }

.row-list .two-line small { font-size: .82rem; color: var(--muted); }


/* ===== Navigation & settings, round 13 ===== */
/* Title tap: a families-only sheet. Avatar: the full account sheet. */
.switch-title { display: none !important; }

.account-menu.families-only .switch-title { display: block !important; }

.account-menu.families-only .account-who, .account-menu.families-only .account-sheet > a[href="/settings"],
.account-menu.families-only .account-sheet > form, .account-menu.families-only .menu-label { display: none !important; }

/* Phone Settings sections: wrap onto two rows, so every section is always visible. */
@media (max-width: 760px) {
  .settings-page .settings-nav { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; padding-right: 16px; gap: 8px; }
  .settings-page .settings-nav a { padding: 0 16px; }
}

/* Desktop: logging out of this computer is a quiet button, not a link. */
@media (min-width: 761px) {
  .logout-here .text-button { color: var(--ink); box-shadow: inset 0 0 0 1px var(--field-border); background: var(--surface); padding: 0 14px !important; margin-left: 0 !important; min-height: 36px; border-radius: 10px; }
}


/* ===== Navigation & settings, round 14 ===== */
/* Desktop: the family name is a switcher too, opening a families-only menu under it. */
@media (min-width: 761px) {
  .brand.switchable { flex-direction: column; padding: 4px 8px; margin-left: -8px; border-radius: 10px; }
  .brand.switchable:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
  .brand.switchable .family { display: inline-flex; align-items: center; gap: 4px; }
  .brand-chev { display: inline-block; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; color: var(--muted); }
  .account-menu.families-only .account-sheet { position: fixed; top: 60px; right: auto; left: max(16px, calc((100vw - 1120px) / 2 + 8px)); width: 280px; transform-origin: top left; }
}

/* All families sits apart from the family rows. */
.family-item.all-families { margin-top: 6px; position: relative; }

.family-item.all-families::before { content: ''; position: absolute; left: 8px; right: 8px; top: -4px; border-top: 1px solid var(--line); }

/* Readable small print. */
footer, footer p { color: var(--muted); font-size: .85rem; }

.form-hint { grid-column: 1 / -1; }

html.js .settings-form .form-hint { display: block; }

small.warn { color: #b45309 !important; font-weight: 500; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) small.warn{ color: #fbbf24 !important; }
 }
:where(:root[data-theme="dark"]) small.warn{ color: #fbbf24 !important; }
 
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) button:disabled, :where(:root:not([data-theme="light"])) button.secondary:disabled, :where(:root:not([data-theme="light"])) .settings-form button:disabled{ color: #8b93a1 !important; border-color: rgba(255,255,255,.14) !important; }

}
:where(:root[data-theme="dark"]) button:disabled, :where(:root[data-theme="dark"]) button.secondary:disabled, :where(:root[data-theme="dark"]) .settings-form button:disabled{ color: #8b93a1 !important; border-color: rgba(255,255,255,.14) !important; }



.storage-fill.tiny { min-width: 4px; width: 4px; opacity: .7; }

@media (max-width: 760px) { .account-menu.is-here > summary { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent); } }

/* Phone header buttons and avatar: full 44px. */
@media (max-width: 760px) {
  .head-actions .icon-only, .head-actions [data-select-start], .new-album > summary { min-height: 44px; height: 44px; min-width: 44px; }
}

.account-menu.families-only[open] .chev { transform: none; }

.account-menu.families-only[open] > summary { box-shadow: inset 0 0 0 1px var(--line); }

header.top:has(.account-menu.families-only[open]) .brand.switchable { background: var(--active-tint); }

header.top:has(.account-menu.families-only[open]) .brand-chev { transform: rotate(180deg); }

@media (max-width: 760px) { header.top:has(.account-menu.families-only[open]) .brand, header.top:has(.account-menu.families-only[open]) .account-menu > summary { opacity: 1; } header.top:has(.account-menu.families-only[open]) .account-menu > summary { opacity: .45; } }


/* ===== Appearance (Settings → Appearance) ===== */
/* Accent colours. Each has a light and a dark version with readable text on it. */
:root[data-accent="green"]  { --accent: #12805c; --accent-soft: #e3f4ec; }

:root[data-accent="purple"] { --accent: #6d4bd1; --accent-soft: #efeafc; }

:root[data-accent="rose"]   { --accent: #c0335f; --accent-soft: #fbe7ee; }

:root[data-accent="amber"]  { --accent: #a85a06; --accent-soft: #fbefdf; }

:root[data-accent="teal"]   { --accent: #0e7383; --accent-soft: #e0f3f5; }
@media (prefers-color-scheme: dark){:root:not([data-theme="light"])[data-accent="green"]{ --accent: #4cc38a; --accent-soft: #15302a; }
:root:not([data-theme="light"])[data-accent="purple"]{ --accent: #a78bfa; --accent-soft: #261f3d; }
:root:not([data-theme="light"])[data-accent="rose"]{ --accent: #f17ca0; --accent-soft: #3a1d29; }
:root:not([data-theme="light"])[data-accent="amber"]{ --accent: #f0a03c; --accent-soft: #3a2a14; }
:root:not([data-theme="light"])[data-accent="teal"]{ --accent: #3cc6d6; --accent-soft: #12303a; }

}
:root[data-theme="dark"][data-accent="green"]{ --accent: #4cc38a; --accent-soft: #15302a; }
:root[data-theme="dark"][data-accent="purple"]{ --accent: #a78bfa; --accent-soft: #261f3d; }
:root[data-theme="dark"][data-accent="rose"]{ --accent: #f17ca0; --accent-soft: #3a1d29; }
:root[data-theme="dark"][data-accent="amber"]{ --accent: #f0a03c; --accent-soft: #3a2a14; }
:root[data-theme="dark"][data-accent="teal"]{ --accent: #3cc6d6; --accent-soft: #12303a; }



/* Text size: everything is sized in rem, so this scales the whole interface. */
html[data-text="large"] { font-size: 112.5%; }

html[data-text="larger"] { font-size: 125%; }

/* Photo size in grids. */
@media (min-width: 761px) {
  html[data-photos="small"] main .grid:not(.small) { grid-template-columns: repeat(auto-fill, 132px); }
  html[data-photos="small"] .months { --tile: 132px; }
  html[data-photos="large"] main .grid:not(.small) { grid-template-columns: repeat(auto-fill, 232px); }
  html[data-photos="large"] .months { --tile: 232px; }
}

@media (max-width: 760px) {
  html[data-photos="small"] .grid:not(.small) { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  html[data-photos="large"] .grid:not(.small) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}


/* Appearance controls */
.appearance { display: grid; gap: 22px; }

.appearance fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.appearance legend { font-weight: 600; font-size: .92rem; margin-bottom: 10px; padding: 0; }

.choice-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.choice { position: relative; display: grid; gap: 8px; cursor: pointer; border-radius: 12px; padding: 10px; box-shadow: inset 0 0 0 1px var(--line);
  background: var(--surface); font-weight: 600; font-size: .92rem; text-align: center; min-height: 44px; }

.choice:hover { box-shadow: inset 0 0 0 1px var(--field-border); }

.choice input { position: absolute; opacity: 0; pointer-events: none; }

.choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); background: var(--active-tint); }

.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.theme-preview { height: 64px; border-radius: 8px; overflow: hidden; display: grid; grid-template-rows: 14px 1fr; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }

.theme-preview i { display: block; }

.tp-light { background: #f6f7f9; }
 .tp-light i:first-child { background: #fff; }
 .tp-light i:last-child { margin: 8px; border-radius: 4px; background: #fff; box-shadow: 0 0 0 1px #e3e6eb; }

.tp-dark { background: #131417; }
 .tp-dark i:first-child { background: #1b1d21; }
 .tp-dark i:last-child { margin: 8px; border-radius: 4px; background: #1b1d21; box-shadow: 0 0 0 1px #2a2d33; }

.tp-system { background: linear-gradient(90deg, #f6f7f9 50%, #131417 50%); }

.tp-system i:first-child { background: linear-gradient(90deg, #fff 50%, #1b1d21 50%); }

.tp-system i:last-child { margin: 8px; border-radius: 4px; background: linear-gradient(90deg, #fff 50%, #1b1d21 50%); }

.swatches { display: flex; flex-wrap: wrap; gap: 12px; }

.swatch { position: relative; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }

.swatch input { position: absolute; opacity: 0; pointer-events: none; }

.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }

.swatch:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 4px; }

.swatch svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 3; opacity: 0; }

.swatch:has(input:checked) svg { opacity: 1; }

.sw-blue { background: #2f6feb; }
 .sw-green { background: #12805c; }
 .sw-purple { background: #6d4bd1; }

.sw-rose { background: #c0335f; }
 .sw-amber { background: #a85a06; }
 .sw-teal { background: #0e7383; }

.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 6%, transparent); width: 100%; max-width: 420px; }

.segmented label { position: relative; display: grid; place-items: center; min-height: 40px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--muted); }

.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); }

.seg-a { font-size: .85rem; }
 .seg-a.l { font-size: 1rem; }
 .seg-a.xl { font-size: 1.15rem; }

.save-state { min-height: 20px; font-size: .88rem; color: var(--muted); margin: 0; }

html.js .appearance .no-js-save { display: none; }

@media (max-width: 480px) { .choice-row { gap: 8px; } .theme-preview { height: 52px; } }


/* ===== Ask side panel ===== */
.ask-toggle { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; margin-left: 8px; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: .92rem; color: var(--accent); background: var(--active-tint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: background .15s var(--ease), color .15s var(--ease); }

.ask-toggle:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }

.ask-toggle.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

.spark { width: 18px; height: 18px; fill: currentColor; }

@media (max-width: 760px) { header .ask-toggle { display: none; } }


.ask-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; z-index: 50; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 32px -16px rgba(16,24,40,.18); animation: panel-in .2s var(--ease); }

.ask-panel[hidden] { display: none; }

@keyframes panel-in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) { .ask-panel { animation: none; } }

/* Wide screens: the page makes room. Narrower: the panel floats over it. */
@media (min-width: 1180px) { body.ask-open { padding-right: 400px; } body.ask-open .select-bar { left: calc(50% - 200px); } }

@media (min-width: 761px) and (max-width: 1179px) { .ask-panel { box-shadow: -16px 0 48px rgba(16,24,40,.22); } }

@media (max-width: 760px) {
  .ask-panel { width: auto; left: 0; z-index: 90; border-left: 0; padding-top: env(safe-area-inset-top); animation: sheet .22s var(--ease); }
  body.ask-open { overflow: hidden; }
}


.ap-head { display: flex; align-items: center; gap: 6px; min-height: 64px; padding: 0 10px 0 18px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }

.ap-title { display: inline-flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 650; font-size: 1.2rem; color: var(--ink); }

.ap-title .spark { color: var(--accent); width: 20px; height: 20px; }

.ap-chat-title { flex: 1 1 auto; min-width: 0; color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; }

.ap-icon { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: none; box-shadow: none; color: var(--muted); padding: 0; }

.ap-icon:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }

.ap-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@media (max-width: 760px) { .ap-icon { width: 44px; height: 44px; } }


.ap-context { padding: 10px 18px 0; flex: 0 0 auto; }

.ap-ctx-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  color: var(--accent); background: var(--active-tint); }

.ap-messages { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }

.ap-welcome { margin: auto 0 0; }

.ap-hello { font-family: var(--serif); font-size: 1.25rem; line-height: 1.3; margin: 0 0 14px; }

.ap-suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

.ap-chip { text-align: left; min-height: 40px; padding: 8px 14px; border-radius: 12px; font-weight: 500; font-size: .92rem; color: var(--ink);
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }

.ap-chip:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }

.ap-msg { max-width: 92%; }

.ap-msg p { margin: 0; white-space: pre-wrap; }

.ap-msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 16px 16px 4px 16px; }

.ap-msg.assistant { align-self: flex-start; display: grid; gap: 10px; }

.ap-msg.assistant > p { background: var(--bg); padding: 10px 14px; border-radius: 16px 16px 16px 4px; box-shadow: inset 0 0 0 1px var(--line); }

.ap-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }

.ap-tile { position: relative; display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--line); }

.ap-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ap-tile .play { position: absolute; left: 4px; bottom: 4px; font-size: .68rem; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; }

.ap-action { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 10px 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, #1f8a4c 9%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, #1f8a4c 30%, transparent); font-size: .9rem; }

.ap-action-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #1f8a4c; color: #fff; font-weight: 700; font-size: .85rem; }

.ap-action.undone { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }

.ap-action.undone .ap-action-icon { background: var(--muted); }

.ap-action-tools { display: inline-flex; gap: 4px; }

.ap-link, .ap-undo { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border-radius: 8px; font-weight: 600; font-size: .85rem;
  text-decoration: none; background: none; box-shadow: none; color: var(--accent); }

.ap-link:hover, .ap-undo:hover { background: var(--active-tint); }

.ap-refresh { align-self: center; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

.ap-msg.typing { display: inline-flex; gap: 5px; padding: 14px 16px; border-radius: 16px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }

.ap-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite ease-in-out; }

.ap-msg.typing span:nth-child(2) { animation-delay: .15s; }
 .ap-msg.typing span:nth-child(3) { animation-delay: .3s; }

@keyframes dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ap-compose { flex: 0 0 auto; display: flex; gap: 8px; align-items: flex-end; margin: 0 14px; padding: 8px 8px 8px 14px; border-radius: 16px;
  background: var(--field); box-shadow: inset 0 0 0 1px var(--field-border); }

.ap-compose:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }

.ap-compose textarea { flex: 1 1 auto; border: 0; background: none; resize: none; padding: 8px 0; min-height: 24px; max-height: 160px; font: inherit; color: var(--ink); outline: none; box-shadow: none; }

.ap-send { flex: 0 0 auto; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 12px; display: grid; place-items: center; }

.ap-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.ap-foot { margin: 8px 18px calc(12px + env(safe-area-inset-bottom)); font-size: .78rem; color: var(--muted); text-align: center; }

.ask-panel:not(:has(.ap-foot)) .ap-compose { margin-bottom: calc(14px + env(safe-area-inset-bottom)); }


/* On the Ask page the same helper fills the column. */
.ask-panel.inline { position: static; width: auto; height: min(72vh, 760px); border: 0; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); animation: none; z-index: auto; }

.ask-panel.inline .ap-head { min-height: 52px; }

@media (max-width: 760px) { .ask-panel.inline { height: calc(100vh - 260px); padding-top: 0; } }


/* First album: an inviting empty state with the form built in. */
.empty-start { max-width: 520px; margin: 40px auto; text-align: center; padding: 32px 24px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

.empty-start h2 { margin: 12px 0 6px; }

.empty-start p { margin: 0 0 18px; }

.empty-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--active-tint); color: var(--accent); }

.empty-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.album-start { display: flex; gap: 8px; margin: 0 0 14px; }

.album-start input { flex: 1 1 auto; min-width: 0; min-height: 44px; }

.album-start button { min-height: 44px; white-space: nowrap; }

@media (max-width: 480px) { .album-start { flex-direction: column; } }


/* Panel sits under the header; the page column makes room beside it. */
@media (min-width: 761px) {
  .ask-panel:not(.inline) { top: 65px; }
  body.ask-open { padding-right: 0 !important; }
}

@media (min-width: 1180px) {
  body.ask-open > main, body.ask-open > footer { padding-right: 416px; max-width: calc(var(--page) + 400px); }
  body.ask-open .select-bar { left: calc(50% - 200px); width: min(700px, calc(100% - 440px)); }
}

.ap-welcome { margin: auto 0; }

@media (max-width: 760px) { .settings-card { scroll-margin-top: 200px; } }

.ap-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 8px; flex: 0 0 auto; }

.ap-chip.small { min-height: 34px; padding: 4px 12px; font-size: .85rem; border-radius: 999px; }

@media (max-width: 760px) { .ap-chip.small { min-height: 44px; } }

@media (min-width: 1180px) {
  body.ask-open .select-bar { left: 24px; right: 424px; width: auto; max-width: 760px; margin: 0 auto; transform: none; }
}


/* ===== Ask panel, round 2 ===== */
.ap-spacer { flex: 1 1 auto; }

.ap-icon { width: 40px; height: 40px; }

@media (max-width: 760px) { .ap-icon { width: 44px; height: 44px; } .ap-head { padding-left: 16px; } }

.ap-send { width: 44px; height: 44px; min-height: 44px; }

.ap-msg.assistant > p { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .ap-msg.assistant > p{ background: #23262c; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
:where(:root:not([data-theme="light"])) .ask-panel{ background: #17191d; }
 }
:where(:root[data-theme="dark"]) .ap-msg.assistant > p{ background: #23262c; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
:where(:root[data-theme="dark"]) .ask-panel{ background: #17191d; }
 

/* "Looking at" sits right above the message box. */
.ap-context { padding: 0 14px 8px; }

.ap-ctx-chip { gap: 6px; }

.ap-ctx-chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

.ap-quick { padding-bottom: 8px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }

.ap-quick::-webkit-scrollbar { display: none; }

.ap-quick .ap-chip { flex: 0 0 auto; }

/* Change cards: text, then a row of real buttons. */
.ap-action { grid-template-columns: 28px minmax(0, 1fr); row-gap: 10px; padding: 12px; }

.ap-action-text { font-weight: 600; }

.ap-action-tools { grid-column: 2; display: flex; gap: 8px; }

.ap-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: .9rem;
  text-decoration: none; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--field-border); }

.ap-btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

.ap-btn:hover { filter: brightness(1.05); }

@media (max-width: 760px) { .ap-btn { min-height: 44px; flex: 1 1 0; } }

.ap-action.info { background: var(--active-tint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }

.ap-action.info .ap-action-icon { background: var(--accent); color: var(--accent-ink); font-style: italic; font-family: var(--serif); }

.ap-foot { font-size: .8rem; color: var(--muted); }

/* With the panel open, the page's selection bar shrinks to a count and Cancel: the panel does the rest. */
body.ask-open .select-bar select, body.ask-open .select-bar input[name=new_name], body.ask-open .select-bar button[name=do], body.ask-open .select-bar .sel-hint { display: none !important; }

body.ask-open .select-bar { width: auto !important; max-width: none; padding: 8px 8px 8px 18px; border-radius: 999px; gap: 14px; }

@media (min-width: 1180px) { body.ask-open .select-bar { left: calc((100% - 400px) / 2); right: auto; transform: translateX(-50%); margin: 0; } }

body.selecting main .grid { padding-bottom: 8px; }

/* Tiles have a resting colour while loading. */
.tile { background: color-mix(in srgb, var(--ink) 8%, transparent); }

footer p { font-size: .88rem; }


/* Appearance, round 2 */
.swatches { display: grid; grid-template-columns: repeat(6, 44px); justify-content: start; gap: 14px; }

@media (max-width: 480px) { .swatches { justify-content: space-between; gap: 0; } }

.accent-name { font-weight: 500; margin-left: 6px; }

.theme-preview { height: auto; aspect-ratio: 16 / 10; display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 18% 1fr 14%; gap: 4px; padding: 0 0 6px; }

.theme-preview i { margin: 0 !important; border-radius: 3px !important; box-shadow: none !important; }

.theme-preview .h { grid-column: 1 / -1; border-radius: 0 !important; }

.theme-preview .t { margin: 0 !important; }

.theme-preview .t:nth-of-type(2) { margin-left: 6px !important; }

.theme-preview .t:nth-of-type(4) { margin-right: 6px !important; }

.theme-preview .a { grid-column: 1 / 2; margin-left: 6px !important; border-radius: 999px !important; background: var(--accent) !important; }

.tp-light .h { background: #fff !important; }
 .tp-light .t { background: #dfe3ea !important; }

.tp-dark .h { background: #1b1d21 !important; }
 .tp-dark .t { background: #32363d !important; }

.tp-system .h { background: linear-gradient(90deg, #fff 50%, #1b1d21 50%) !important; }
 .tp-system .t { background: #a9afb8 !important; }

.tp-dark, .tp-system { box-shadow: inset 0 0 0 1px rgba(255,255,255,.12) !important; }

.segmented label:has(input:checked) { font-weight: 700; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .segmented label:has(input:checked){ background: #343943; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
 }
:where(:root[data-theme="dark"]) .segmented label:has(input:checked){ background: #343943; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
 

.settings-card + .settings-card { margin-top: 20px; }


/* First album: visible label, quiet Ask option */
.album-start { display: grid; gap: 6px; text-align: left; }

.album-start label { font-weight: 600; font-size: .92rem; }

.album-start-row { display: flex; gap: 8px; }

.album-start-row input { flex: 1 1 auto; min-width: 0; min-height: 44px; }

@media (max-width: 480px) { .album-start-row { flex-direction: column; } }

.or-ask { margin: 4px 0 0 !important; color: var(--muted); }

.link-btn { background: none; box-shadow: none; padding: 0 6px; min-height: 44px; color: var(--accent); font-weight: 600; }

.link-btn:hover { text-decoration: underline; }

.empty-start { box-shadow: inset 0 0 0 1px var(--line), 0 8px 24px rgba(16,24,40,.06); margin-top: 8vh; }

.theme-preview { aspect-ratio: auto; height: 76px; }

.choice-row { max-width: 560px; }

@media (max-width: 480px) { .theme-preview { height: 56px; } .choice { font-size: .85rem; padding: 8px; } .choice span:last-child { white-space: nowrap; } }


/* ===== Ask panel, round 3 ===== */
@media (min-width: 1180px) { body.ask-open > main { padding-left: 48px; } }

.ap-quick { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 32px; }

.ap-grid.in-card { grid-column: 1 / -1; }

.ap-action.info .ap-action-tools { flex-wrap: wrap; }

.ap-action-text { text-wrap: pretty; }

@media (max-width: 760px) { .ap-action-tools { flex-direction: column; } .ap-action-tools .ap-btn { width: 100%; } }

/* Select mode: every tile shows an empty circle you can tap. */
body.selecting .grid[data-selectable="1"] .tile::after { background: rgba(255,255,255,.28); box-shadow: 0 1px 3px rgba(0,0,0,.45); width: 24px; height: 24px; }

/* Resting tiles are visible slots in both themes. */
.tile { background: #e4e7ec; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .tile{ background: #2c3138; box-shadow: inset 0 0 0 1px #3d4450; }
 }
:where(:root[data-theme="dark"]) .tile{ background: #2c3138; box-shadow: inset 0 0 0 1px #3d4450; }
 

.storage-note { font-size: .88rem; color: var(--muted); margin-top: 24px; }

/* Empty albums: a real Ask button and a findable disabled Create. */
.or-ask { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 14px !important; }

.ask-cta { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600;
  color: var(--accent); background: var(--active-tint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }

.ask-cta .spark { width: 16px; height: 16px; }

@media (max-width: 480px) { .ask-cta { width: 100%; justify-content: center; } }

.album-start-row button:disabled { background: #f3f4f6 !important; color: #6b7280 !important; border: 1px solid #e5e7eb !important; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .album-start-row button:disabled{ background: #2a2e34 !important; color: #a0a6af !important; border-color: #3a4048 !important; }
 }
:where(:root[data-theme="dark"]) .album-start-row button:disabled{ background: #2a2e34 !important; color: #a0a6af !important; border-color: #3a4048 !important; }
 

.album-start .small-print { margin-top: 2px; }

/* Appearance: sizes preview themselves. */
.segmented .seg-a.l { font-size: 1.06rem; }
 .segmented .seg-a.xl { font-size: 1.25rem; }

.size-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.size-row .segmented { flex: 1 1 260px; }

.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 64px; height: 64px; overflow: hidden; border-radius: 8px; padding: 4px; background: color-mix(in srgb, var(--ink) 6%, transparent); flex: 0 0 auto; }

.mini-grid i { display: block; aspect-ratio: 1; border-radius: 2px; background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }

.appearance:has(input[name=photos][value=small]:checked) .mini-grid { grid-template-columns: repeat(4, 1fr); }

.appearance:has(input[name=photos][value=large]:checked) .mini-grid { grid-template-columns: repeat(2, 1fr); }

.ap-action.info .ap-action-tools { grid-column: 1 / -1; }


/* ===== Ask panel, round 4 ===== */
/* Every change card: icon + title on one row, then full-width buttons sharing the card's left edge. */
.ap-action { grid-template-columns: 28px minmax(0, 1fr); padding: 14px; }

.ap-action .ap-grid.in-card, .ap-action .ap-action-tools { grid-column: 1 / -1; }

.ap-action-tools { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; flex-direction: initial !important; }

.ap-action-tools > :only-child { grid-column: 1 / -1; }

.ap-btn { width: 100%; min-height: 44px; border-radius: 12px; }

@container (max-width: 320px) { .ap-action-tools { grid-template-columns: 1fr; } }

.ap-msg.assistant { container-type: inline-size; width: 100%; }

/* Conversation fades under the header so a cut line never looks broken. */
.ap-messages { -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18px); mask-image: linear-gradient(180deg, transparent 0, #000 18px); scroll-padding-top: 12px; }

.ap-quick { padding-right: 40px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }

.ap-compose { box-shadow: inset 0 0 0 1px var(--field-border); }

.ap-foot { font-size: .82rem; color: var(--muted); }

/* Selection pill: a full 44px Cancel. */
body.ask-open .select-bar [data-select-cancel] { min-height: 44px; padding: 0 18px; border-radius: 999px; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .album-start-row button:disabled{ background: #2c313a !important; color: #c5cad3 !important; border-color: #4a5260 !important; }
 }
:where(:root[data-theme="dark"]) .album-start-row button:disabled{ background: #2c313a !important; color: #c5cad3 !important; border-color: #4a5260 !important; }
 


/* ===== Ask panel, round 5 ===== */
.ask-panel:not(.inline) { width: 384px; }

@media (min-width: 1180px) { body.ask-open > main, body.ask-open > footer { padding-right: 400px; } }

.ap-messages { -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 40px); mask-image: linear-gradient(180deg, transparent 0, #000 40px); }

.ap-ctx-chip { min-height: 32px; padding: 0 12px 0 4px; }

.ap-ctx-thumbs { display: inline-flex; }

.ap-ctx-thumbs img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; box-shadow: 0 0 0 2px var(--surface); }

.ap-ctx-thumbs img + img { margin-left: -8px; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .ap-ctx-thumbs img{ box-shadow: 0 0 0 2px #17191d; }
 }
:where(:root[data-theme="dark"]) .ap-ctx-thumbs img{ box-shadow: 0 0 0 2px #17191d; }
 

.ap-foot { color: var(--muted); }

/* Loading tiles shimmer; images fade in. Dark photos keep an edge on a dark page. */
.tile { background: linear-gradient(90deg, #e4e7ec 0%, #eef0f3 50%, #e4e7ec 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .tile{ background: linear-gradient(90deg, #2a2f37 0%, #343a44 50%, #2a2f37 100%); background-size: 200% 100%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
 }
:where(:root[data-theme="dark"]) .tile{ background: linear-gradient(90deg, #2a2f37 0%, #343a44 50%, #2a2f37 100%); background-size: 200% 100%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
 

@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (prefers-reduced-motion: reduce) { .tile { animation: none; } }

/* Appearance: readable options and a live text sample. */
.segmented label { color: color-mix(in srgb, var(--ink) 75%, transparent); }

.text-sample { margin: 0 0 10px; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }

/* First album: one hierarchy everywhere. Create is the main action; Ask is an outline. */
.ask-cta { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }

.album-start-row button:disabled { background: transparent !important; color: #6b7280 !important; border: 1px dashed #c4c9d1 !important; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .album-start-row button:disabled{ background: transparent !important; color: #8e96a3 !important; border: 1px dashed #4a5260 !important; }
 }
:where(:root[data-theme="dark"]) .album-start-row button:disabled{ background: transparent !important; color: #8e96a3 !important; border: 1px dashed #4a5260 !important; }
 

.ap-msg.assistant { max-width: 100%; }

.ap-action-tools { grid-template-columns: 1fr 1fr !important; }

.ap-btn { padding: 0 10px; white-space: nowrap; }

@container (max-width: 230px) { .ap-action-tools { grid-template-columns: 1fr !important; } }


/* ===== Ask panel, round 6 ===== */
/* Panel open on wide screens: the page keeps the header's left edge and stops 32px short of the panel. */
@media (min-width: 1180px) {
  body.ask-open > main, body.ask-open > footer {
    max-width: none; margin: 0;
    padding-left: max(16px, calc((100vw - var(--page)) / 2 + 16px));
    padding-right: calc(384px + 32px);
  }
  body.ask-open .select-bar { left: calc((100% - 384px) / 2); }
}

.ask-panel:not(.inline) { box-shadow: -12px 0 32px rgba(15,17,20,.06); }

/* Suggestions wrap: nothing is ever cut off. */
.ap-quick { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; padding-right: 14px; }

/* Header buttons: 44px everywhere. */
.ap-icon { width: 44px; height: 44px; }

.ap-head { gap: 2px; }

/* What's selected: recognisable thumbnails. */
.ap-ctx-chip { min-height: 40px; padding: 0 14px 0 6px; gap: 10px; }

.ap-ctx-thumbs img { width: 30px; height: 30px; border-radius: 7px; }

.ap-ctx-thumbs img + img { margin-left: -10px; }

/* Conversation: never opens on a sliced bubble. */
.ap-messages { padding-top: 20px; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 56px); mask-image: linear-gradient(180deg, transparent 0, #000 56px); }

/* Empty Albums: Create is always the accent button (faded until a name is typed); Ask is a text button. */
.album-start-row button:disabled, .album-start-row button { background: var(--accent) !important; color: var(--accent-ink) !important; border: 0 !important; }

.album-start-row button:disabled { opacity: .45 !important; cursor: not-allowed; }

.ask-cta.text { background: none; box-shadow: none; padding: 0 10px; }

.ask-cta.text:hover { background: var(--active-tint); }

/* Appearance: a sans preview that follows the chosen size. */
.text-sample { display: grid; gap: 2px; margin: 0 0 12px; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 5%, transparent); font-family: var(--sans); }

.ts-label { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }

.ts-title { font-weight: 700; font-size: 1.1rem; }

.ts-body { color: var(--muted); }

/* Phone Settings sections: one scrolling row with a fade, active chip kept in view. */
@media (max-width: 760px) {
  .settings-page .settings-nav { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important; scroll-snap-type: x proximity; padding-right: 32px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent) !important; mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent) !important;
    background: var(--bg); box-shadow: 0 1px 0 var(--line); }
  .settings-page .settings-nav a { flex: 0 0 auto; scroll-snap-align: start; }
  .settings-card { scroll-margin-top: 140px; }
}
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .tile{ box-shadow: inset 0 0 0 1px rgba(255,255,255,.10); }
 }
:where(:root[data-theme="dark"]) .tile{ box-shadow: inset 0 0 0 1px rgba(255,255,255,.10); }
 
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .grid .tile{ outline: 1px solid rgba(255,255,255,.10); outline-offset: -1px; }
 }
:where(:root[data-theme="dark"]) .grid .tile{ outline: 1px solid rgba(255,255,255,.10); outline-offset: -1px; }
 


/* ===== Round 7 ===== */
/* Every month gets its own full-width row; tiles fill it. */
@media (min-width: 761px) {
  .months { display: block; }
  .months .month, .months .month.short { width: 100%; }
  .months .month .grid, .months .month.short .grid { grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)) !important; }
}

/* Selection keeps its direct actions with the panel open (compact). */
body.ask-open .select-bar select, body.ask-open .select-bar button[name=do] { display: inline-flex !important; }

body.ask-open .select-bar select { display: block !important; max-width: 200px; }

body.ask-open .select-bar .sel-hint, body.ask-open .select-bar input[name=new_name]:not(:focus) { display: none !important; }

body.ask-open .select-bar { border-radius: 16px; padding: 8px 10px 8px 16px; }

/* Send waits for something to send. */
.ap-send:disabled { opacity: .45 !important; background: var(--accent) !important; color: var(--accent-ink) !important; border: 0 !important; cursor: default; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .segmented label:has(input:checked){ background: color-mix(in srgb, var(--accent) 24%, #2a2d33); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); color: #fff; }

}
:where(:root[data-theme="dark"]) .segmented label:has(input:checked){ background: color-mix(in srgb, var(--accent) 24%, #2a2d33); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); color: #fff; }



/* "or" as a divider */
.or-line { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--muted); }

.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.or-ask { gap: 14px; }

/* Phone Settings chips: a stronger edge fade. */
@media (max-width: 760px) { .settings-page .settings-nav { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent) !important; mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent) !important; padding-right: 48px; } }


/* ===== Round 8 ===== */
.appearance .segmented { width: 420px; max-width: 100%; flex: 0 0 auto; }

.size-row { gap: 16px; }

.size-row .segmented { flex: 0 1 420px; }

/* "Looking at" is a label, not a button. */
.ap-ctx-chip { background: none; color: var(--muted); padding-left: 0; min-height: 32px; font-weight: 600; }

.ap-ctx-chip svg { color: var(--muted); }

/* Suggestions: 44px on phones. */
@media (max-width: 760px) { .ap-chip { min-height: 44px; } }

.ap-send:disabled { opacity: .4 !important; }

/* Settings leave room above the phone tab bar. */
@media (max-width: 760px) { .settings-page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* Disabled Create album: the same faded accent in both themes. */
.album-start-row button:disabled { opacity: .4 !important; box-shadow: none !important; }

[data-select-start][aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }


/* ===== Round 9 ===== */
.ap-action.past .ap-btn.primary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--field-border); }

.ap-action.past { opacity: .92; }

/* Phone Settings sections: an even grid, every section visible. */
@media (max-width: 760px) {
  .settings-page .settings-nav { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; overflow: visible !important;
    -webkit-mask-image: none !important; mask-image: none !important; padding: 8px 16px 10px !important; }
  .settings-page .settings-nav a { justify-content: center; padding: 0 6px; font-size: .9rem; min-height: 44px; }
  .account-menu.is-here > summary { box-shadow: none; background: none; }
}
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .album-start-row button:disabled, :where(:root:not([data-theme="light"])) .ap-send:disabled{ color: color-mix(in srgb, #fff 80%, transparent) !important; }

}
:where(:root[data-theme="dark"]) .album-start-row button:disabled, :where(:root[data-theme="dark"]) .ap-send:disabled{ color: color-mix(in srgb, #fff 80%, transparent) !important; }



.storage-note { margin-bottom: 0; }

body:has(.storage-note) footer { margin-top: 8px; }

@media (max-width: 760px) { .settings-page .settings-card { scroll-margin-top: 200px; } }


/* ===== Round 10 ===== */
.ap-msg.folded { display: none; }

.ap-earlier { align-self: center; min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: .88rem; font-weight: 600; color: var(--muted);
  background: none; box-shadow: inset 0 0 0 1px var(--line); }

.ap-earlier:hover { color: var(--ink); }

@media (max-width: 760px) { .ap-earlier { min-height: 44px; } .ap-chip, .ap-chip.small { min-height: 46px; } }

.ap-messages { -webkit-mask-image: none; mask-image: none; }

/* Create album before a name is typed: a neutral, clearly inactive button. */
.album-start-row button:disabled { background: color-mix(in srgb, var(--ink) 6%, transparent) !important; color: var(--muted) !important;
  border: 1px solid var(--line) !important; opacity: 1 !important; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .album-start-row button:disabled{ color: #a8aeb8 !important; }
 }
:where(:root[data-theme="dark"]) .album-start-row button:disabled{ color: #a8aeb8 !important; }
 

.ask-toggle { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }


/* ===== Round 11 ===== */
/* Phone Settings sections: one scrolling row (44px chips), active chip kept in view. */
@media (max-width: 760px) {
  .settings-page .settings-nav { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important; gap: 8px; scroll-snap-type: x proximity;
    padding: 8px 48px 10px 16px !important; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent) !important; mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent) !important; }
  .settings-page .settings-nav::-webkit-scrollbar { display: none; }
  .settings-page .settings-nav a { flex: 0 0 auto; padding: 0 16px; scroll-snap-align: start; }
  .settings-page .settings-card { scroll-margin-top: 140px; }
  .settings-page { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
}

/* New messages settle just above the message box. */
.ap-messages > .ap-earlier:first-child, .ap-messages > .ap-msg:first-of-type { margin-top: auto; }

.ap-messages > .ap-welcome + .ap-earlier, .ap-messages > .ap-welcome[hidden] + .ap-earlier { margin-top: auto; }

.ap-earlier { min-height: 44px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 16%, transparent); }

/* Suggestions: one row that scrolls, faded at the edge. */
.ap-quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-right: 40px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }

.ap-quick::-webkit-scrollbar { display: none; }

/* Appearance: every control shares one column width. */
.appearance { max-width: 460px; }

.appearance .segmented, .size-row .segmented { width: 100%; flex: 1 1 auto; }

.choice-row { max-width: none; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .grid .tile{ outline-color: rgba(255,255,255,.06); }
 }
:where(:root[data-theme="dark"]) .grid .tile{ outline-color: rgba(255,255,255,.06); }
 

/* First album: inactive Create is an outline; icon at full accent. */
.album-start-row button:disabled { background: transparent !important; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .album-start-row button:disabled{ border-color: rgba(255,255,255,.22) !important; }
 }
:where(:root[data-theme="dark"]) .album-start-row button:disabled{ border-color: rgba(255,255,255,.22) !important; }
 

.empty-icon { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }

.or-ask { margin-top: 4px !important; }


/* ===== Round 12 ===== */
/* Scrolling chip rows: a wide, obvious fade so a half-shown chip reads as "more this way". */
@media (max-width: 760px) {
  .settings-page .settings-nav { padding-right: 72px !important;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 72px), transparent 100%) !important; mask-image: linear-gradient(90deg, #000 calc(100% - 72px), transparent 100%) !important; }
}

.ap-quick { padding-right: 64px; scroll-padding-inline: 14px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent); }

.ap-quick > * { scroll-snap-align: start; }


/* Appearance: controls on the left, a live preview on the right (desktop). */
.appearance-layout { display: grid; gap: 28px; }

.look-preview { display: none; }

@media (min-width: 1000px) {
  .appearance-layout { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); align-items: start; }
  .look-preview { display: grid; gap: 10px; position: static; }
}

.lp-label { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.lp-page { display: grid; gap: 4px; padding: 0 0 16px; border-radius: 14px; overflow: hidden; background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line), 0 12px 32px -12px rgba(16,24,40,.18); }

.lp-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; margin-bottom: 8px;
  background: var(--surface); box-shadow: inset 0 -1px 0 var(--line); }

.lp-brand { font-family: var(--serif); font-weight: 700; font-size: .9rem; color: var(--ink); }

.lp-pill { font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; color: var(--accent); background: var(--active-tint); }

.lp-month { padding: 0 14px; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--ink); }

.lp-cap { padding: 0 14px 6px; font-size: .9rem; color: var(--muted); }

.lp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 14px; }

.lp-button { justify-self: start; margin: 12px 14px 0; padding: 7px 14px; border-radius: 10px; font-size: .82rem; font-weight: 600; background: var(--accent); color: var(--accent-ink); }

.lp-note { margin: 0; font-size: .82rem; color: var(--muted); }


/* Photo size: a real strip of tiles that changes with the choice. */
.ps-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 12px; padding: 10px; border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 5%, transparent); }

.ps-preview i, .lp-grid i { display: block; aspect-ratio: 1; border-radius: 4px; transition: transform .2s var(--ease); }

.ps-preview i:nth-child(3n+1), .lp-grid i:nth-child(3n+1) { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }

.ps-preview i:nth-child(3n+2), .lp-grid i:nth-child(3n+2) { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); }

.ps-preview i:nth-child(3n), .lp-grid i:nth-child(3n) { background: color-mix(in srgb, var(--ink) 14%, var(--surface)); }

.ps-preview i:nth-child(n+9), .lp-grid i:nth-child(n+9) { display: none; }

.appearance-layout:has(input[name=photos][value=small]:checked) :is(.ps-preview, .lp-grid) { grid-template-columns: repeat(6, 1fr); }

.appearance-layout:has(input[name=photos][value=small]:checked) :is(.ps-preview, .lp-grid) i:nth-child(n+9) { display: block; }

.appearance-layout:has(input[name=photos][value=large]:checked) :is(.ps-preview, .lp-grid) { grid-template-columns: repeat(3, 1fr); }

.appearance-layout:has(input[name=photos][value=large]:checked) :is(.ps-preview, .lp-grid) i:nth-child(n+7) { display: none; }

@media (min-width: 1000px) { .ps-preview { display: none; } }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .segmented label:has(input:checked){ background: color-mix(in srgb, var(--accent) 34%, #2a2d33) !important; color: #fff !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent) !important; }

}
:where(:root[data-theme="dark"]) .segmented label:has(input:checked){ background: color-mix(in srgb, var(--accent) 34%, #2a2d33) !important; color: #fff !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent) !important; }




/* First album: an active button; an empty name gets a clear message instead. */
.album-start-row button { background: var(--accent) !important; color: var(--accent-ink) !important; border: 0 !important; }

.field-error { margin: 8px 0 0; font-size: .88rem; font-weight: 600; color: #b42318; }
@media (prefers-color-scheme: dark){:where(:root:not([data-theme="light"])) .field-error{ color: #ffb4ab; }
 }
:where(:root[data-theme="dark"]) .field-error{ color: #ffb4ab; }
 

input[aria-invalid="true"] { border-color: #b42318 !important; box-shadow: 0 0 0 3px rgba(180,35,24,.15) !important; }


/* Ask panel: a clear layer edge on desktop, readable promise and context line. */
@media (min-width: 1180px) { .ask-panel { box-shadow: -1px 0 0 var(--line), -12px 0 32px rgba(16,24,40,.06); } }

.ap-foot { font-size: .8rem; line-height: 1.4; color: var(--muted); }

.ap-context { font-weight: 600; color: var(--ink); }


/* ===== Round 13 ===== */
/* Ask header: words beside the icons on desktop, so New chat and History are obvious. */
.ap-hl { display: none; }

@media (min-width: 761px) {
  .ask-panel:not(.inline) .ap-icon:has(.ap-hl) { display: inline-flex; flex-direction: row; align-items: center; width: auto; height: 36px; gap: 6px; padding: 0 10px; border-radius: 10px; font-size: .82rem; font-weight: 600; color: var(--muted); text-decoration: none; }
  .ask-panel:not(.inline) .ap-icon:has(.ap-hl):hover { color: var(--ink); }
  .ask-panel:not(.inline) .ap-hl { display: inline; }
}

/* "Looking at": the prefix quiet, the thing itself strong. */
.ap-context, .ap-ctx-chip { font-weight: 500; color: var(--muted); }

.ap-ctx-what { font-weight: 650; color: var(--ink); margin-left: -2px; }

/* Desktop Appearance: the live preview already shows text size. */
@media (min-width: 1000px) { .appearance .text-sample { display: none; } }

/* First album on phones: centred in the space, not stuck to the top. */
@media (max-width: 760px) {
  main:has(.empty-start) { min-height: calc(100dvh - 64px - 80px - env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
  main:has(.empty-start) .empty-start { margin: auto 0 !important; width: 100%; }
}

.or-ask .ask-cta { min-height: 44px; }


/* ===== Round 14 ===== */
/* Ask suggestions: wrap onto a second line; nothing is ever cut off. */
.ap-quick { flex-wrap: wrap !important; overflow: visible !important; padding-right: 14px !important; -webkit-mask-image: none !important; mask-image: none !important; }

/* Phone Settings chips: an opaque fade drawn over the row (a mask let the card outline show through). */
@media (max-width: 760px) {
  .settings-page .settings-nav { -webkit-mask-image: none !important; mask-image: none !important; padding-right: 16px !important; }
  .settings-page .settings-nav::after { content: ""; position: sticky; right: -16px; flex: 0 0 64px; margin-left: -56px; margin-right: -16px; align-self: stretch;
    background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 85%); pointer-events: none; }
}

/* Send: plainly grey until there is something to send. */
.ap-send:disabled { opacity: 1 !important; background: color-mix(in srgb, var(--ink) 10%, var(--surface)) !important; color: color-mix(in srgb, var(--ink) 45%, transparent) !important; }
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){ --muted: #b6bcc6; }
:where(:root:not([data-theme="light"])) .tabs .tab.on, :where(:root:not([data-theme="light"])) .tabs .tab[aria-current="page"]{ color: var(--accent-ink) !important; }
:where(:root:not([data-theme="light"])) .tabs .tab.on .count{ color: inherit; opacity: .75; }

}
:root[data-theme="dark"]{ --muted: #b6bcc6; }
:where(:root[data-theme="dark"]) .tabs .tab.on, :where(:root[data-theme="dark"]) .tabs .tab[aria-current="page"]{ color: var(--accent-ink) !important; }
:where(:root[data-theme="dark"]) .tabs .tab.on .count{ color: inherit; opacity: .75; }




/* ===== Round 15 ===== */
/* Phone Ask header: small words under the icons, so New chat and History are clear. */
@media (max-width: 760px) {
  .ask-panel:not(.inline) .ap-icon:has(.ap-hl) { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: auto; min-width: 56px; height: 52px; padding: 0 6px; text-decoration: none; color: var(--muted); }
  .ask-panel:not(.inline) .ap-hl { display: block; font-size: .68rem; font-weight: 600; line-height: 1; }
  .ask-panel:not(.inline) .ap-icon:has(.ap-hl) svg { width: 22px; height: 22px; }
}

/* The context line belongs to the composer, not the conversation. */
.ap-context { border-top: 1px solid var(--line); padding-top: 10px !important; margin-top: 4px; }

/* Selecting photos: room under the grid so the bar never covers the last row. */
body:has(.select-bar:not([hidden])) main { padding-bottom: 120px; }

/* Accent fills always use the accent ink colour (dark text on bright dark-mode accents). */
.account-menu > summary .avatar, .avatar:not([class*="tone-"]) { color: var(--accent-ink); }

/* Dark theme sample: tiles lifted so the three choices compare at a glance. */
.tp-dark .t { background: #3a3d44 !important; }

.tp-dark .a, .tp-dark i:last-child { background: var(--accent) !important; }

/* Appearance on phones: clear gaps between the text sample and its control. */
@media (max-width: 999px) { .appearance .text-sample { margin-bottom: 14px; } .appearance { gap: 28px; } }

.or-ask .ask-cta { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; }


/* ===== Round 16 ===== */
.look-preview, .look-preview * { pointer-events: none; cursor: default; }

.lp-button { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

@media (min-width: 1180px) { .ask-panel:not(.inline) { border-left: 1px solid var(--line); } }

