:root {
  color-scheme: light;
  --color-indigo: #6366f1;
  --color-mist: #f1f5f9;
  --color-cloud: #fff;
  --color-blossom: #ec4899;
  --color-mint: #10b981;
  --color-amber: #f59e0b;
  --text: #1f2937;
  --muted: #53647d;
  --shadow-card: 0 12px 32px rgba(148,163,184,.18);
  --shadow-hover: 0 24px 48px rgba(99,102,241,.20);
  --font-sans: Inter, Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--color-mist);
  font-size: 14px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 78% 0%, rgba(224,225,255,.40), transparent 42%), var(--color-mist); }
button, input, textarea, select { font: inherit; }
html { scroll-padding-top: 24px; }
[hidden] { display: none !important; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
a { color: #5356d4; text-decoration: none; }
a:hover { color: #4338ca; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 16px; min-height: 44px; padding: 11px 20px; background: #eef0fa; color: #5659bc; cursor: pointer; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; transition: transform .3s ease, background .3s ease, box-shadow .3s ease, color .3s ease; }
button:hover, .button:hover { background: #e5e7ff; color: #4338ca; box-shadow: 0 10px 24px rgba(99,102,241,.12); transform: translateY(-4px); }
button:active, .button:active { transform: scale(.96); box-shadow: inset 0 4px 10px rgba(67,56,202,.14); }
button.primary, .button.primary { background: var(--color-indigo); color: #fff; box-shadow: 0 10px 24px rgba(99,102,241,.25); padding: 12px 24px; font-size: 16px; }
button.primary:hover { background: #585be0; box-shadow: 0 18px 32px rgba(99,102,241,.35); }
button.primary:active { box-shadow: inset 0 4px 10px rgba(67,56,202,.28); }
button.danger { background: #fff0f3; color: #b94a68; }
button.danger:hover { background: #fbe3eb; box-shadow: 0 10px 24px rgba(195,91,124,.14); }
button:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
button[aria-busy=true] { cursor: progress; }
button[aria-busy=true]::after { content: ""; width: 12px; height: 12px; flex-shrink: 0; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: working .8s linear infinite; }
@keyframes working { to { transform: rotate(360deg); } }
:focus-visible { outline: 3px solid rgba(99,102,241,.65); outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 600; overflow-wrap: anywhere; }
h1[tabindex="-1"]:focus { outline: none; }
h1 { margin-bottom: 0; font-size: 28px; line-height: 1.3; letter-spacing: -.025em; }
h2 { font-size: 20px; line-height: 1.4; margin-bottom: 16px; letter-spacing: -.015em; }
p { margin-bottom: 16px; overflow-wrap: anywhere; }
small, time { color: var(--muted); font-size: 12px; }
.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.icon-chip, .brand-icon, .upload-icon, .empty-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--color-indigo); background: #eeedff; flex-shrink: 0; }
.icon-chip { width: 56px; height: 56px; border-radius: 50%; }
.icon-chip .icon { width: 27px; height: 27px; }
.brand-icon { width: 48px; height: 48px; border-radius: 16px; background: var(--color-indigo); color: #fff; box-shadow: 0 10px 24px rgba(99,102,241,.24); }
.brand-icon .icon { width: 26px; height: 26px; }
.brand { font-size: 24px; line-height: 1.15; font-weight: 600; letter-spacing: .08em; }
.brand small { display: block; font-size: 11px; line-height: 1.7; letter-spacing: .08em; font-weight: 400; margin-top: 5px; }
.eyebrow { display: block; color: #7c7fa7; font-size: 12px; letter-spacing: .10em; font-weight: 500; margin-bottom: 12px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.error { color: #b54567; font-size: 14px; margin: 0; }
.error:not(:empty) { background: #fff0f3; border-radius: 16px; padding: 12px 16px; margin: 16px 0; }
.recovery-hint { background: #eeedff; color: #4c447d; border-radius: 14px; padding: 12px 14px; margin: 0 0 16px; font-size: 13px; }
label { display: block; margin-bottom: 20px; font-weight: 500; font-size: 14px; }
input, textarea, select { display: block; width: 100%; min-width: 0; border: 0; border-radius: 16px; padding: 14px 20px; background: var(--color-mist); color: var(--text); margin-top: 8px; min-height: 50px; outline: none; transition: background .3s, box-shadow .3s; }
input:focus, textarea:focus, select:focus { background: #fff; box-shadow: 0 0 0 4px rgba(99,102,241,.20), 0 10px 26px rgba(99,102,241,.14); }
input[readonly] { color: #7a879b; background: #f6f7fb; cursor: default; }
textarea { min-height: 112px; resize: vertical; line-height: 1.65; }
select { appearance: auto; cursor: pointer; }
fieldset { margin: 0 0 24px; border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
legend { font-weight: 500; padding: 0; margin-bottom: 8px; }
fieldset label { display: flex; align-items: center; gap: 10px; padding: 12px 20px; margin: 0; background: var(--color-mist); border-radius: 16px; flex: 1; cursor: pointer; }
fieldset label:has(input:checked) { background: #eeedff; color: #5356cf; }
input[type=radio] { flex-shrink: 0; width: 18px; height: 18px; min-height: 0; accent-color: var(--color-indigo); margin: 0; box-shadow: none; }
input[type=file] { max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 8px; background: #fff; font-size: 12px; }
input::file-selector-button { border: 0; border-radius: 16px; padding: 10px 16px; margin-right: 12px; background: #eef0fa; color: #5659bc; font: inherit; cursor: pointer; }
/* A quiet, photographic entrance. */
.auth { display: grid; grid-template-columns: 1.06fr 1fr; gap: 72px; align-items: center; width: min(1200px, calc(100% - 64px)); margin: 32px auto; min-height: calc(100svh - 64px); padding: 16px 64px 16px 16px; background: rgba(255,255,255,.9); border-radius: 32px; box-shadow: 0 24px 80px rgba(148,163,184,.20); }
.auth-cover { min-height: 690px; height: 100%; border-radius: 24px; position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 36px; background: #dbe5ef url('/assets/login-cover-v2.jpg') center / cover; }
.auth-cover::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg,rgba(221,232,246,.48) 0%,rgba(225,231,245,.1) 25%,rgba(43,56,90,.15) 52%,rgba(43,56,90,.72) 100%); }
.auth-brand { display: flex; align-items: center; gap: 14px; color: #36415d; }
.auth-brand small { color: #566481; }
.auth-story { color: #fff; padding-bottom: 16px; }
.auth-story .eyebrow { color: #e4e7f6; letter-spacing: .12em; margin-bottom: 16px; }
.auth-story h2 { font-size: 36px; line-height: 1.45; font-weight: 600; letter-spacing: .015em; margin-bottom: 16px; }
.auth-story p { color: #e9eef6; line-height: 1.8; max-width: 24em; }
.story-label { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; background: rgba(242,246,255,.18); padding: 10px 16px; font-size: 12px; backdrop-filter: blur(12px); margin-top: 20px; }
.story-label .icon { width: 16px; height: 16px; }
.auth-panel { width: 100%; max-width: 380px; justify-self: center; padding: 24px 0; }
.auth-tabs { display: flex; padding: 5px; background: var(--color-mist); border-radius: 18px; width: 180px; margin: 0 0 36px; }
.auth-tabs button { flex: 1; min-height: 36px; padding: 8px 16px; background: transparent; color: var(--muted); font-size: 14px; box-shadow: none; }
.auth-tabs button:hover { transform: none; color: var(--color-indigo); }
.auth-tabs .is-active { background: #fff; color: #5356d4; box-shadow: 0 6px 16px rgba(148,163,184,.18); }
.auth-heading .icon-chip { margin-bottom: 24px; }
.auth-heading h1[tabindex="-1"]:focus { outline: none; }
h1 { margin-bottom: 12px; }
.auth-heading p { color: var(--muted); margin-bottom: 32px; }
.auth-panel form > .primary { width: 100%; justify-content: space-between; margin-top: 4px; }
.auth-footnote { margin: 28px 0 0; display: flex; justify-content: center; gap: 7px; align-items: center; font-size: 12px; color: #8a94a8; }
.auth-footnote .icon { width: 14px; height: 14px; }
/* App shell */
.layout { max-width: 1440px; padding: 24px; margin: 0 auto; display: grid; grid-template-columns: 224px minmax(0,1fr); gap: 40px; min-height: 100svh; }
.sidebar { position: sticky; top: 24px; height: calc(100svh - 48px); min-height: 590px; align-self: start; display: flex; flex-direction: column; background: rgba(255,255,255,.9); box-shadow: 0 12px 40px rgba(148,163,184,.12); padding: 32px 16px 20px; border-radius: 24px; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; margin: 0 10px 48px; }
.sidebar-brand .brand { font-size: 23px; }
.sidebar-brand .brand-icon { width: 44px; height: 44px; }
.nav-label { color: #788298; font-size: 11px; font-weight: 500; letter-spacing: .08em; padding-left: 16px; margin-bottom: 16px; }
nav { display: flex; flex-direction: column; gap: 8px; }
nav a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 13px 16px; border-radius: 16px; color: #737c92; font-size: 14px; font-weight: 500; transition: background .3s,color .3s,transform .3s; }
nav a:hover { color: #595bc6; background: #f4f3ff; transform: translateX(3px); }
nav a[aria-current=page] { background: #eeedff; color: #5558d8; }
nav a[aria-current=page]::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #7779ed; margin-left: auto; flex-shrink: 0; }
.sidebar-account { margin-top: auto; padding: 32px 8px 0; }
.account-info { display: flex; align-items: center; gap: 12px; margin: 0 6px 16px; min-width: 0; }
.account-info p { margin: 0; font-size: 14px; font-weight: 500; min-width: 0; }
.account-info small { display: block; font-weight: 400; margin-top: 2px; }
.avatar { display: inline-flex; justify-content: center; align-items: center; background: linear-gradient(140deg,#e8e5ff,#e5edfb); color: #7772b3; width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; font-weight: 600; }
#logout { background: #f6f7fb; color: #7c859a; width: 100%; font-size: 12px; }
#logout .icon { width: 16px; height: 16px; }
.content { width: 100%; max-width: 1200px; min-width: 0; padding: 32px 16px 56px 0; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 40px; min-width: 0; }
.bar > div { min-width: 0; }
.bar > button { flex-shrink: 0; }
.page-description { color: var(--muted); margin: 12px 0 0; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.card { min-width: 0; background: #fff; border-radius: 24px; box-shadow: var(--shadow-card); overflow: hidden; }
.grid > .card { transition: transform .5s ease, box-shadow .5s ease; }
.grid > .card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
.card > a { display: flex; flex-direction: column; height: 100%; color: inherit; }
.card > a:focus-visible { outline-offset: -5px; border-radius: 24px; }
.card :is(img,.media-unavailable) { display: block; width: 100%; height: 212px; object-fit: cover; background: #e9edf5; }
.media-unavailable { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; color: #64748b; font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.media-unavailable .icon { width: 28px; height: 28px; color: #8585b4; }
.card-image { flex-shrink: 0; position: relative; padding: 10px 10px 0; }
.card-image :is(img,.media-unavailable), .card-image .default-cover { border-radius: 18px; }
.visibility-badge { display: flex; align-items: center; gap: 5px; position: absolute; top: 24px; right: 24px; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-radius: 999px; padding: 6px 10px; color: #365d57; font-size: 12px; font-weight: 500; box-shadow: 0 4px 20px rgba(93,117,138,.06); }
.visibility-badge .icon { width: 12px; height: 12px; }
.visibility-badge.private { color: #585a82; }
.card-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 24px; }
.card-body h2 { min-height: 2.9em; font-size: 20px; margin-bottom: 16px; line-height: 1.45; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.card-meta > span { min-width: 0; overflow-wrap: anywhere; }
.card-meta > span:last-child { flex-shrink: 0; white-space: nowrap; }
.card-meta > span:first-child { color: #595382; background: #f4f2fb; padding: 3px 9px; border-radius: 999px; }
.card-footer { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; margin: auto 0 0; }
.card-footer > span { min-width: 0; overflow-wrap: anywhere; }
.card-footer time { font-size: 12px; text-align: right; white-space: nowrap; }
.photo-card { padding: 10px 10px 0; }
.photo-card :is(img,.media-unavailable) { border-radius: 18px; object-fit: contain; background: #edf0f6; flex-shrink: 0; }
.photo-card .card-body { padding: 20px 14px 24px; }
.photo-card h2 { margin-bottom: 8px; }
.photo-card small { margin-top: auto; font-size: 13px; }
.default-cover { width: 100%; height: 212px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; color: #74729b; font-size: 12px; background: radial-gradient(ellipse at 75% 20%,#e4e8fa,transparent 70%),linear-gradient(135deg,#f3f0fb,#e9f0f7); }
.default-cover-icon { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.65); color: #9b96c6; border-radius: 24px; transform: rotate(-7deg); }
.default-cover-icon .icon { width: 32px; height: 32px; }
.empty { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 260px; padding: 48px 24px; background: rgba(255,255,255,.75); border-radius: 24px; text-align: center; color: #64748b; }
.empty p { margin: 20px 0 0; }
.empty-icon { width: 64px; height: 64px; border-radius: 24px; }
.empty-icon .icon { width: 28px; height: 28px; }
.panel { background: #fff; padding: 32px; border-radius: 24px; box-shadow: var(--shadow-card); min-width: 0; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: #f0effb; color: #595382; border-radius: 999px; margin: 0; min-height: 30px; max-width: 100%; overflow-wrap: anywhere; vertical-align: middle; font-size: 12px; line-height: 1.5; }
.tag.public, .tag.private { flex-shrink: 0; white-space: nowrap; }
.tag .icon { width: 14px; height: 14px; }
.tag.public { background: #eaf6f1; color: #326957; }
.album-head { display: grid; grid-template-columns: minmax(240px,.85fr) minmax(0,1.5fr); gap: 24px; margin-bottom: 24px; }
.album-head > .card { padding: 10px; align-self: start; aspect-ratio: 4 / 3; }
.album-head > .card :is(img,.media-unavailable), .album-head > .card .default-cover { border-radius: 18px; height: 100%; min-height: 0; max-height: none; }
.album-info { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.album-tags, .photo-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; margin: 0 0 20px; }
.photo-tags .photo-owner { min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: 13px; margin-left: 4px; }
.album-description { font-size: 16px; white-space: pre-line; }
.album-info > p:last-child { margin-bottom: 0; }
.album-info > p:not(.album-description) { font-size: 13px; color: var(--muted); }
.album-info .actions { margin-top: 8px; }
.upload { margin: 0 0 32px; display: grid; grid-template-columns: 56px minmax(0,1fr) auto; column-gap: 24px; align-items: center; background: #fafaff; box-shadow: 0 8px 28px rgba(148,163,184,.12); transition: background .3s,box-shadow .3s; }
.upload-icon { width: 56px; height: 56px; border-radius: 18px; grid-row: 1 / span 3; }
.upload-icon .icon { width: 25px; height: 25px; }
.upload label { margin-bottom: 8px; grid-column: 2; }
.upload small { grid-column: 2; font-size: 11px; }
.upload .error { grid-column: 2; }
.upload > button { grid-column: 3; grid-row: 1 / span 3; }
.upload.is-drop-target { background: #edecff; box-shadow: 0 0 0 4px rgba(99,102,241,.2),0 10px 26px rgba(99,102,241,.14); }
#upload-results:empty { display: none; }
#upload-results ul { padding-left: 48px; overflow-wrap: anywhere; }
#upload-results li { padding: 6px 0; }
#upload-results .upload-success { color: #387861; }
#upload-results .upload-failed { color: #b54567; }
.section-heading { margin: 40px 0 24px; }
.back-link { margin: -16px 0 24px; font-size: 12px; }
.back-link a { display: inline-block; padding: 10px 0; min-height: 44px; }
.back-link a::before { content: '←'; margin-right: 8px; }
.photo-head { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); gap: 24px; align-items: start; }
.photo-view { min-width: 0; position: sticky; top: 24px; }
.photo-view > :is(img,.media-unavailable) { display: block; max-width: 100%; width: 100%; max-height: 72svh; min-height: min(280px,72svh); object-fit: contain; background: #e5eaf2; border-radius: 24px; box-shadow: var(--shadow-card); }
.photo-view .actions:empty { display: none; }
.photo-view .actions { justify-content: center; margin-top: 24px; }
.photo-description { white-space: pre-line; font-size: 16px; line-height: 1.8; }
.photo-info { padding: 28px; }
.photo-info > .actions { gap: 8px; }
.photo-info > .actions button { font-size: 12px; padding: 11px 16px; }
#like, #favorite { color: #ad5482; background: #fcf0f7; }
#like[aria-pressed=true], #favorite[aria-pressed=true] { background: #f7ddea; color: #a94374; box-shadow: 0 6px 20px rgba(236,72,153,.1); }
#share-fallback:not(:empty) { margin-top: 24px; }
hr { border: 0; height: 1px; margin: 32px 0; background: linear-gradient(90deg,transparent,#e4e8f3,transparent); }
#comment-form { margin-bottom: 24px; }
#comment-form textarea { min-height: 96px; }
#comment-form > button { font-size: 14px; }
.photo-info .empty { min-height: 160px; background: #f8f9fc; padding: 24px; font-size: 12px; }
.photo-info .empty-icon { width: 44px; height: 44px; border-radius: 16px; }
.photo-info .empty-icon .icon { width: 22px; height: 22px; }
.comment { margin-top: 16px; padding: 20px; border-radius: 20px; background: #f8f9fc; overflow-wrap: anywhere; }
.comment b { font-weight: 600; font-size: 14px; }
.comment small { display: block; font-size: 10px; margin: 2px 0 12px; }
.comment p { white-space: pre-line; font-size: 14px; margin-bottom: 0; }
.comment button { font-size: 11px; min-height: 32px; padding: 8px 12px; margin-top: 12px; }
.profile-summary { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 32px; background: linear-gradient(115deg,#fff 40%,#f6f3ff); }
.profile-identity { display: flex; gap: 24px; align-items: center; min-width: 0; }
.avatar-large { width: 72px; height: 72px; font-size: 28px; }
.profile-identity > div { min-width: 0; }
.profile-identity h2 { margin-bottom: 8px; }
.profile-identity p { white-space: pre-line; color: var(--muted); margin: 0; font-size: 14px; }
.profile-metrics { display: flex; gap: 32px; flex-shrink: 0; }
.profile-metrics p { display: flex; flex-direction: column; text-align: center; margin: 0; }
.profile-metrics strong { font-size: 28px; font-weight: 700; color: #6e6bd2; line-height: 1.3; margin-bottom: 6px; }
.profile-metrics span { color: var(--muted); font-size: 12px; }
.profile-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; align-items: start; }
.profile-grid h2 { margin-bottom: 24px; }
.table-hint { display: none; }
.scroll:focus-visible { outline-offset: 3px; }
.scroll { overscroll-behavior-inline: contain; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; background: #fff; border-radius: 24px; box-shadow: var(--shadow-card); -webkit-overflow-scrolling: touch; }
table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 560px; font-size: 14px; }
th, td { text-align: left; padding: 22px 24px; vertical-align: middle; overflow-wrap: anywhere; max-width: 320px; }
.admin-comments tbody td { vertical-align: top; }
th { color: #68778e; font-weight: 500; font-size: 12px; background: #f8f9fe; white-space: nowrap; }
tbody tr:nth-child(even) { background: #fcfcff; }
tbody tr { transition: background .3s; }
tbody tr:hover { background: #f7f7ff; }
td .actions { flex-wrap: nowrap; gap: 8px; }
td button { font-size: 12px; padding: 9px 14px; min-height: 36px; white-space: nowrap; }
.content > .actions { margin-top: 32px; justify-content: center; }
dialog { overscroll-behavior: contain; scrollbar-gutter: stable; border: 0; border-radius: 24px; padding: 32px; width: min(480px,calc(100% - 32px)); max-height: calc(100svh - 48px); color: var(--text); background: #fff; box-shadow: 0 32px 100px rgba(78,80,129,.22); }
dialog[open] { animation: dialog-in .3s ease both; }
dialog::backdrop { background: rgba(55,64,94,.24); backdrop-filter: blur(8px); }
dialog h2 { margin-bottom: 28px; }
.delete-explanation { white-space: pre-line; }
dialog .actions { margin-top: 24px; }
#notice { position: fixed; z-index: 20; bottom: 32px; left: 50%; transform: translateX(-50%); max-width: min(560px,calc(100% - 32px)); width: max-content; padding: 16px 24px; border-radius: 20px; color: #4d6581; background: #fff; box-shadow: 0 16px 48px rgba(99,102,241,.2); margin: 0; font-size: 14px; }
#app[aria-busy=true] { cursor: progress; }
#app[aria-busy=true]:empty { min-height: 100svh; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (min-width: 1600px) { .layout { gap: 48px; } .content { padding-right: 0; } .card :is(img,.media-unavailable), .default-cover { height: 232px; } }
@media (max-width: 1200px) {
  .layout { grid-template-columns: 208px minmax(0,1fr); gap: 28px; }
  .content { padding-right: 0; }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .auth { gap: 48px; padding-right: 48px; }
  .auth-cover { padding: 28px; }
  .photo-head { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .profile-summary { flex-wrap: wrap; }
  .profile-metrics { gap: 40px; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 184px minmax(0,1fr); gap: 24px; padding: 16px; }
  .sidebar { top: 16px; height: calc(100svh - 32px); padding: 24px 12px 16px; }
  .sidebar-brand { margin: 0 4px 40px; gap: 10px; }
  .sidebar-brand .brand-icon { width: 36px; height: 40px; }
  .sidebar-brand .brand { font-size: 22px; }
  .sidebar-brand .brand small { font-size: 10px; }
  nav a { padding: 12px; gap: 10px; font-size: 12px; }
  .nav-label { padding-left: 12px; }
  .sidebar-account { padding-left: 0; padding-right: 0; }
  .bar { margin-bottom: 32px; gap: 16px; }
  .bar h1 { font-size: 24px; }
  .bar > button { font-size: 14px; padding: 12px 16px; }
  .page-description { font-size: 12px; }
  .card-body { padding: 20px; }
  .card-body h2 { font-size: 18px; }
  .card-footer { display: block; }
  .card-footer time { display: block; text-align: left; margin-top: 6px; }
  .album-head { grid-template-columns: minmax(0,1fr); }
  .album-head > .card { aspect-ratio: auto; }
  .album-head > .card :is(img,.media-unavailable), .album-head > .card .default-cover { height: 280px; }
  .upload { grid-template-columns: minmax(0,1fr) auto; gap: 8px 16px; padding: 24px; }
  .upload-icon { display: none; }
  .upload label, .upload small, .upload .error { grid-column: 1; }
  .upload > button { grid-column: 2; }
  .photo-head { grid-template-columns: minmax(0,1fr); }
  .photo-view { position: static; }
  .profile-grid { grid-template-columns: minmax(0,1fr); }
  .profile-summary, .panel { padding: 24px; }
  .auth { gap: 32px; width: calc(100% - 40px); margin: 20px auto; min-height: calc(100svh - 40px); padding: 12px 28px 12px 12px; }
  .auth-cover { min-height: 660px; padding: 24px; }
  .auth-story h2 { font-size: 28px; }
  .auth-story p { font-size: 12px; }
  .auth-tabs { margin-bottom: 28px; }
}
@media (max-width: 680px) {
  body { background: var(--color-mist); }
  .layout { display: block; padding: 12px; }
  .sidebar { position: static; height: auto; min-height: 0; padding: 12px 12px 4px; border-radius: 24px; margin-bottom: 16px; }
  .sidebar-brand { margin: 0 0 8px; padding: 0 4px; }
  .sidebar-brand .brand { font-size: 20px; }
  .sidebar-brand .brand-icon { width: 36px; height: 36px; border-radius: 12px; }
  .sidebar-brand .brand-icon .icon { width: 22px; height: 22px; }
  .sidebar-brand .brand small { display: inline; margin-left: 12px; font-size: 10px; letter-spacing: .04em; }
  .nav-label { display: none; }
  nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
  nav:has(a:nth-child(5)) { grid-template-columns: repeat(3,minmax(0,1fr)); }
  nav a { flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 4px; font-size: 11px; min-height: 48px; text-align: center; }
  nav a .icon { width: 18px; height: 18px; }
  nav a[aria-current=page]::after { display: none; }
  nav a:hover { transform: translateY(-2px); }
  .sidebar-account { margin-top: 2px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
  .account-info { margin: 0; gap: 8px; }
  .account-info .avatar { width: 28px; height: 28px; font-size: 12px; }
  .account-info p { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; }
  .account-info small { font-size: 10px; margin: 0; }
  #logout { width: auto; min-height: 34px; padding: 8px 12px; font-size: 11px; flex-shrink: 0; }
  #logout .icon { width: 14px; height: 14px; }
  .content { padding: 0 4px 40px; }
  .bar { align-items: flex-start; gap: 16px; margin-bottom: 28px; }
  .bar h1 { font-size: 24px; line-height: 1.35; }
  .bar .eyebrow { font-size: 10px; margin-bottom: 8px; }
  .bar > button { margin-top: 20px; font-size: 12px; min-height: 42px; padding: 11px 14px; gap: 5px; }
  .bar > button .icon { width: 16px; height: 16px; }
  .page-description { font-size: 12px; margin-top: 10px; }
  .grid { gap: 24px; grid-template-columns: minmax(0,1fr); }
  .card :is(img,.media-unavailable), .default-cover { height: 240px; }
  .card-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 24px; }
  .card-body h2 { min-height: 2.9em; font-size: 20px; }
  .card-footer { display: flex; }
  .card-footer time { margin: 0; text-align: right; }
  .content:has(.album-head) .bar { margin-bottom: 12px; }
  .content:has(.album-head) .bar h1 { margin-bottom: 0; }
  .album-head { gap: 12px; margin-bottom: 16px; }
  .album-head > .card { padding: 8px; }
  .album-head > .card :is(img,.media-unavailable), .album-head > .card .default-cover { height: clamp(144px, 42vw, 210px); min-height: 0; }
  .panel.album-info { padding: 16px; }
  .album-tags { margin-bottom: 10px; }
  .album-description { font-size: 14px; margin-bottom: 8px; }
  .album-info > p:not(.album-description) { margin-bottom: 0; }
  .album-info .actions { gap: 8px; }
  .album-info button { font-size: 12px; }
  .album-head + .section-heading { margin: 16px 0 12px; }
  .upload.panel { display: block; padding: 12px 16px; margin: 0 0 20px; }
  .upload > label { margin-bottom: 6px; }
  .upload input[type=file] { margin-top: 4px; min-height: 44px; padding: 4px; }
  .upload input::file-selector-button { padding: 8px 12px; }
  .upload > small { display: block; margin-bottom: 8px; }
  .upload > button { font-size: 14px; width: 100%; padding: 10px 16px; }
  .photo-view > :is(img,.media-unavailable) { max-height: 65svh; min-height: min(240px,65svh); }
  .photo-tags { gap: 8px; }
  input, textarea, select { font-size: 16px; }
  .photo-info { padding: 24px; }
  .profile-summary { gap: 24px; padding: 24px; }
  .profile-identity { gap: 16px; }
  .avatar-large { width: 56px; height: 56px; font-size: 24px; }
  .profile-metrics { width: 100%; justify-content: space-around; gap: 16px; }
  .profile-metrics strong { font-size: 24px; }
  .profile-metrics span { font-size: 11px; }
  .profile-identity p { font-size: 12px; }
  .profile-grid > .panel { padding: 24px; }
  th, td { padding: 18px 20px; }
  .admin-categories table { min-width: 0; table-layout: fixed; }
  .admin-categories th, .admin-categories td { padding: 18px 12px; }
  .admin-categories th { white-space: normal; font-size: 11px; }
  .admin-categories th:first-child { width: 32%; }
  .admin-categories th:nth-child(2) { width: 26%; }
  .admin-categories th:last-child { width: 42%; }
  .admin-categories td { font-size: 12px; }
  .admin-categories td .actions { flex-wrap: wrap; }
  .admin-categories td button { padding: 8px 10px; min-height: 36px; font-size: 11px; }
  .table-hint { display: block; position: sticky; left: 0; width: 100%; padding: 16px 20px 12px; margin: 0; font-size: 11px; color: #64748b; background: #fff; }
  .admin-photos th:last-child, .admin-photos td:last-child { position: sticky; right: 0; background: #fff; box-shadow: -12px 0 24px rgba(148,163,184,.10); }
  .admin-photos th:last-child { background: #f8f9fe; }
  dialog { padding: 24px; }
  .comment button, #logout, td button, .admin-categories td button { min-height: 44px; }
  #notice { bottom: 20px; padding: 14px 20px; font-size: 12px; }
  .auth { display: block; padding: 12px; width: calc(100% - 24px); margin: 12px auto; min-height: calc(100svh - 24px); border-radius: 28px; }
  .auth-cover { height: 210px; min-height: 0; padding: 20px 24px; background-position: center 43%; }
  .auth-cover::before { background: linear-gradient(90deg,rgba(223,233,246,.64),rgba(223,233,246,.16)); }
  .auth-brand { gap: 10px; }
  .auth-brand .brand-icon { width: 36px; height: 36px; }
  .auth-brand .brand-icon .icon { width: 22px; height: 22px; }
  .auth-brand .brand { font-size: 21px; }
  .auth-brand .brand small { font-size: 9px; margin-top: 3px; }
  .auth-story { padding: 0; color: #3f4c67; }
  .auth-story h2 { font-size: 24px; line-height: 1.4; margin-bottom: 0; }
  .auth-story .eyebrow, .auth-story p, .story-label { display: none; }
  .auth-panel { padding: 28px 16px 16px; max-width: 440px; margin: 0 auto; }
  .auth-tabs { margin-bottom: 28px; width: 160px; }
  .auth-heading .icon-chip { display: none; }
  .auth-heading h1 { font-size: 28px; }
  .auth-heading p { font-size: 12px; margin-bottom: 24px; }
  .auth-panel label { margin-bottom: 18px; }
  .auth-footnote { margin-top: 24px; font-size: 11px; }
}
@media (hover: none) {
  button:hover, .button:hover, .grid > .card:hover, nav a:hover { transform: none; }
}
@media (max-width: 380px) {
  .panel, .photo-info, .profile-grid > .panel { padding: 20px; }
  .bar { flex-wrap: wrap; gap: 12px; }
  .bar > button { margin-top: 0; }
  .card-footer { flex-wrap: wrap; gap: 4px 12px; }
  .card-footer time { text-align: left; }
  .admin-categories th, .admin-categories td { padding-left: 8px; padding-right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:hover, .button:hover, button:active, .button:active, .grid > .card:hover, nav a:hover { transform: none; }
}

/* Keep each moderation target and its action together on a phone. */
.admin-comment-text, .admin-comment-body p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-comment-body { min-width: 0; }
.admin-comment-body summary { cursor: pointer; border-radius: 8px; min-height: 44px; overflow-wrap: anywhere; }
.admin-comment-excerpt { white-space: pre-wrap; }
.admin-comment-expand, .admin-comment-collapse { display: block; color: #5356d4; font-size: 12px; margin-top: 8px; }
.admin-comment-collapse { display: none; }
.admin-comment-body[open] .admin-comment-expand, .admin-comment-body[open] .admin-comment-excerpt { display: none; }
.admin-comment-body[open] .admin-comment-collapse { display: inline; }
.admin-comment-body[open] p { margin-top: 12px; }
.admin-object-id { display: block; margin-top: 4px; }
@media (max-width: 680px) {
  .admin-comments { overflow: visible; background: transparent; border-radius: 0; box-shadow: none; }
  .admin-comments table { display: block; min-width: 0; }
  .admin-comments thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .admin-comments tbody { display: grid; gap: 16px; }
  .admin-comments tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 16px; gap: 10px 12px; min-width: 0; border-radius: 20px; background: #fff; box-shadow: var(--shadow-card); }
  .admin-comments tbody td { display: block; min-width: 0; max-width: none; padding: 0; font-size: 14px; }
  .admin-comments tbody td::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
  .admin-comments .admin-field-author_name { font-weight: 600; }
  .admin-comments .admin-field-created_at { text-align: right; }
  .admin-comments :is(.admin-field-photo_title,.admin-field-content,.admin-row-actions) { grid-column: 1 / -1; }
  .admin-comments .admin-field-content { border-top: 1px solid #eef0f6; padding-top: 10px; }
  .admin-comments td.admin-row-actions::before { display: none; }
  .admin-comments .admin-row-actions .actions { justify-content: flex-end; }
  .admin-comments .admin-row-actions button { min-height: 44px; padding: 10px 18px; }
}
