@charset "UTF-8";

:root {
  --espresso: #4a2f28;
  --terracotta: #a17260;
  --ivory: #f3f3ee;
  --paper: #fffefa;
  --ink: #3d2d27;
  --muted: #736b62;
  --line: #dddcd2;
  --line-dark: #c7b8aa;
  --wash: #eee9df;
  --accent: #845444;
  --danger: #a33732;
  --radius: 12px;
  --serif: Georgia, "Times New Roman", serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--ivory);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; min-width: 320px; font-size: 14px; line-height: 1.6; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
button, input, a { outline-offset: 4px; }
:focus-visible { outline: 3px solid #b57238; outline-offset: 4px; }
::selection { background: #d8b6a1; color: #30221d; }
[hidden] { display: none !important; }
.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; }
.muted { color: var(--muted); }
.accent { color: var(--terracotta); }
.skip-link { position: fixed; left: 18px; top: 12px; z-index: 200; padding: 11px 18px; border-radius: 6px; background: var(--paper); color: var(--espresso); transform: translateY(-160%); box-shadow: 0 3px 16px #33221924; font-weight: 600; }
.skip-link:focus { transform: translateY(0); }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1320px; min-height: 104px; padding: 22px 40px; margin: auto; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: inline-flex; flex-shrink: 0; align-items: center; gap: 23px; text-decoration: none; }
.brand-logo { width: 200px; height: auto; }
.brand-caption { padding-left: 22px; border-left: 1px solid #cfc3b5; font-family: var(--serif); font-size: 26px; line-height: 1.25; letter-spacing: -.7px; color: var(--espresso); }
.header-actions { display: flex; align-items: center; gap: 19px; }
.header-actions form { margin: 0; }
.header-nav { display: flex; align-items: center; gap: 5px; }
.header-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; color: var(--muted); text-decoration: none; font-size: 13px; border-radius: 6px; }
.header-nav a:hover { color: var(--espresso); background: #f4f0e8; }
.header-nav a.is-active { color: var(--espresso); background: #eee8df; font-weight: 600; }
.user-avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #d7c7b8; color: var(--espresso); background: #ede3d7; font-family: var(--serif); font-size: 20px; text-decoration: none; }
.user-avatar:hover { background: #e4d5c4; }

.container { flex: 1; width: 100%; max-width: 1320px; padding: 36px 40px 64px; margin: 0 auto; }
.eyebrow { display: block; color: var(--accent); font-size: 12px; font-weight: 650; letter-spacing: 2px; text-transform: uppercase; line-height: 1.5; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr); gap: 24px; margin-bottom: 36px; align-items: stretch; }
.upload-panel, .overview-panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.upload-panel { padding: 24px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.panel-heading h2 { font-size: 19px; line-height: 1.35; font-weight: 550; letter-spacing: -.5px; }
.panel-heading > .muted { margin-left: auto; font-size: 12px; text-align: right; max-width: 190px; }
.panel-heading > svg, .overview-icon svg { width: 20px; height: 20px; color: var(--terracotta); }
.overview-icon { display: inline-flex; margin-left: auto; }
.drop-zone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 220px; padding: 24px 20px; border: 1px dashed #c6b7a7; border-radius: 9px; background: #f8f7f0; text-align: center; cursor: pointer; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--terracotta); background: #f0e9de; }
.drop-zone.is-dragging { box-shadow: inset 0 0 0 1px var(--terracotta); }
.drop-zone:focus-within { outline: 3px solid #b57238; outline-offset: 3px; }
.drop-zone [type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.upload-symbol { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 14px; border: 1px solid #dac8b5; border-radius: 50%; background: #f0e7da; color: var(--accent); }
.upload-symbol svg { width: 22px; height: 22px; }
.drop-zone h3 { font-family: var(--serif); font-size: 25px; font-weight: 400; letter-spacing: -.5px; line-height: 1.4; }
.drop-zone .button { margin-top: 16px; }
.upload-formats, .drop-zone .file-types { margin-top: 15px; color: var(--muted); font-size: 12px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 6px; font-size: 13px; font-weight: 600; line-height: 1.45; text-decoration: none; }
.button svg { width: 17px; height: 17px; }
.button-primary { background: var(--espresso); border-color: var(--espresso); color: var(--paper); }
.button-primary:hover { background: #614136; border-color: #614136; }
.button-primary:disabled { background: #e8e4db; color: #777066; border-color: #e0dace; box-shadow: none; }
.button-secondary { background: var(--paper); color: var(--espresso); border-color: #cabaa8; }
.button-secondary:hover { background: #f0e7dc; border-color: #a68a72; }
.button-ghost { background: transparent; border-color: transparent; color: var(--muted); padding-right: 10px; padding-left: 10px; }
.button-ghost:hover { color: var(--espresso); background: #eee9df; }
.upload-bottom { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 19px; }
.upload-bottom .button { flex-shrink: 0; }
.selected-files:empty { display: none; }
.selected-files { padding: 16px; margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; background: #f6f2e9; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.selection-summary { font-weight: 600; }
.selection-names { margin-top: 4px; color: var(--muted); font-size: 12px; }
.selection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; margin-top: 13px; }
.selection-preview { min-width: 0; margin: 0; }
.selection-preview img { width: 100%; height: 76px; object-fit: cover; border-radius: 5px; background: #e3dccf; border: 1px solid #d9d1c4; }
.selection-preview span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; color: var(--muted); margin-top: 4px; }
[data-clear-files] { min-height: 44px; border: 0; background: transparent; color: var(--accent); padding: 9px 0; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; font-weight: 600; }
.upload-form noscript { display: block; margin-top: 20px; padding: 16px; border-radius: 6px; background: #f2ece1; border: 1px solid #d7c6b3; font-size: 13px; }
.upload-form noscript label, .upload-form noscript input { display: block; margin: 12px 0; max-width: 100%; }
.upload-form noscript input { font-size: 14px; }

.overview-panel { display: flex; flex-direction: column; padding: 24px; }
.overview-panel .panel-heading { margin-bottom: 28px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 25px; }
.stats-grid > :first-child { padding-right: 17px; border-right: 1px solid var(--line); }
.stat-value { font-family: var(--serif); font-size: clamp(28px, 2.8vw, 36px); line-height: 1.1; letter-spacing: -1px; color: var(--espresso); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat-value small { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.stat-label { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.storage-meter { display: block; width: 100%; height: 5px; margin-top: 9px; overflow: hidden; border: 0; border-radius: 4px; background: #e9e4da; color: var(--terracotta); accent-color: var(--terracotta); }
.storage-meter::-webkit-progress-bar { background: #e9e4da; border-radius: 4px; }
.storage-meter::-webkit-progress-value { background: var(--terracotta); border-radius: 4px; }
.storage-meter::-moz-progress-bar { background: var(--terracotta); border-radius: 4px; }
.storage-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 14px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.privacy-note { display: flex; align-items: center; gap: 13px; padding-top: 24px; margin-top: auto; font-size: 13px; color: var(--muted); line-height: 1.7; }
.privacy-note > span { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 35px; height: 35px; background: #f1e8dc; color: var(--accent); border-radius: 7px; }
.privacy-note > span svg { width: 17px; height: 17px; }
.privacy-note > svg { color: var(--terracotta); }

.library-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.library-header h2 { display: flex; align-items: center; gap: 11px; font-family: var(--serif); font-size: 32px; line-height: 1.3; font-weight: 400; letter-spacing: -1px; }
.count-badge, .image-count { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; padding: 2px 8px; border: 1px solid #d5cbbb; border-radius: 5px; background: #ebe5d9; color: var(--accent); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0; line-height: 1.6; }
.library-tools { display: flex; align-items: center; gap: 12px; }
.search-form { display: flex; align-items: center; gap: 10px; min-width: 0; width: 258px; border: 1px solid #d4cec3; border-radius: 6px; background: var(--paper); padding: 0 13px; }
.search-form > svg { width: 17px; height: 17px; color: #8f7e6b; }
.search-form input { min-width: 0; width: 100%; height: 44px; border: 0; padding: 0; background: transparent; color: var(--ink); font-size: 13px; outline: none; }
.search-form input::placeholder { color: #80786e; opacity: 1; }
.search-form:focus-within { outline: 3px solid #b57238; outline-offset: 3px; }
.search-form .button { padding: 8px; }
.view-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid #d4cec3; border-radius: 7px; background: var(--paper); }
.view-switch button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 4px; color: #807566; background: transparent; }
.view-switch button:hover { color: var(--espresso); background: #f2ecdf; }
.view-switch button[aria-pressed="true"] { color: var(--paper); background: var(--espresso); }
.view-switch svg { width: 19px; height: 19px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.image-card { min-width: 0; overflow: hidden; border: 1px solid #ddd7cc; border-radius: 10px; background: var(--paper); }
.image-card:hover { border-color: #bda38b; box-shadow: 0 5px 20px #4a2f2809; }
.image-preview { display: block; position: relative; width: 100%; aspect-ratio: 1.44; overflow: hidden; background: #e9e5dc; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview:focus-visible { outline-offset: -4px; }
.image-type { position: absolute; right: 12px; bottom: 12px; padding: 3px 8px; border: 1px solid #fffefa55; border-radius: 4px; background: #fffefaea; color: var(--espresso); font-size: 12px; letter-spacing: .7px; font-weight: 600; line-height: 1.5; }
.image-card-body { padding: 19px; min-width: 0; }
.image-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 600; line-height: 1.6; }
.image-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.card-actions { display: flex; align-items: center; gap: 8px; padding-top: 16px; margin-top: 17px; border-top: 1px solid #e7e1d7; }
.card-actions form { display: flex; flex-shrink: 0; margin: 0; }
.copy-button { display: inline-flex; align-items: center; justify-content: center; flex: 1; gap: 7px; min-width: 0; min-height: 44px; padding: 9px 11px; border: 1px solid #d4c1ad; border-radius: 5px; background: #f1e8dd; color: #664535; font-size: 12px; font-weight: 600; }
.copy-button:hover { border-color: #b79577; background: #e8dac9; }
.copy-button svg { width: 16px; height: 16px; }
.icon-button { display: inline-flex; flex-shrink: 0; justify-content: center; align-items: center; width: 44px; height: 44px; padding: 10px; border: 1px solid #ded6ca; border-radius: 5px; background: var(--paper); color: #807466; text-decoration: none; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover { color: var(--espresso); background: #f0e9dd; border-color: #c5ae92; }
.icon-button.danger:hover { color: var(--danger); background: #f9e9e3; border-color: #d5b1a0; }
.gallery-grid[data-layout="list"] { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.gallery-grid[data-layout="list"] .image-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); }
.gallery-grid[data-layout="list"] .image-preview { width: 150px; min-height: 116px; aspect-ratio: auto; height: 100%; }
.gallery-grid[data-layout="list"] .image-card-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: center; column-gap: 25px; padding: 21px 24px; }
.gallery-grid[data-layout="list"] .image-name { grid-column: 1; align-self: end; }
.gallery-grid[data-layout="list"] .image-meta { grid-column: 1; align-self: start; }
.gallery-grid[data-layout="list"] .card-actions { grid-column: 2; grid-row: 1 / 3; align-self: center; border: 0; padding: 0; margin: 0; }
.gallery-grid[data-layout="list"] .copy-button { min-width: 116px; }
.empty-state { display: flex; flex-direction: column; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 58px 25px 62px; text-align: center; }
.empty-symbol { display: grid; place-items: center; width: 55px; height: 55px; margin-bottom: 19px; border-radius: 50%; color: #9c7554; background: #f1e8dc; border: 1px solid #e0d3c1; }
.empty-symbol svg { width: 24px; height: 24px; }
.empty-state h3 { margin-bottom: 10px; font-family: var(--serif); font-size: 27px; font-weight: 400; letter-spacing: -.6px; }
.empty-state p { max-width: 480px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.empty-state .button { margin-top: 21px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 17px; margin-top: 32px; font-size: 13px; color: var(--muted); }

.alert { padding: 14px 18px; margin-bottom: 22px; border: 1px solid; border-radius: 7px; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.alert-success { background: #edf1e6; border-color: #c9d5ba; color: #455e31; }
.alert-error { background: #fbede5; border-color: #e7c5b2; color: #974032; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 100; width: max-content; max-width: calc(100vw - 32px); padding: 13px 20px; border: 1px solid #81604e; border-radius: 7px; background: var(--espresso); color: var(--paper); box-shadow: 0 5px 24px #35231b24; transform: translateX(-50%); font-size: 13px; overflow-wrap: anywhere; }
.toast.is-error { background: #813b30; border-color: #a35c4a; }

.auth-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr); align-items: center; gap: 64px; width: 100%; max-width: 1120px; padding: 46px 40px 58px; margin: 0 auto; }
.auth-story { position: relative; display: grid; place-items: center; isolation: isolate; overflow: hidden; min-height: 420px; padding: 42px; border-radius: var(--radius); background: var(--espresso); }
.auth-brand-logo { position: relative; z-index: 2; width: 270px; height: auto; }
.auth-watermark { position: absolute; z-index: -1; width: 440px; max-width: none; height: 460px; object-fit: contain; right: -116px; bottom: -91px; filter: invert(1); opacity: .8; pointer-events: none; }
.auth-panel { min-width: 0; width: 100%; align-self: center; }
.auth-card { padding: 36px 0; background: transparent; }
.auth-icon { display: grid; place-items: center; width: 47px; height: 47px; margin-bottom: 27px; border: 1px solid #d8c7b4; border-radius: 10px; background: #eee6d9; color: var(--accent); }
.auth-icon svg { width: 21px; height: 21px; }
.auth-card > .eyebrow { margin-bottom: 12px; }
.auth-card h1, .auth-card h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.2; letter-spacing: -.8px; }
.auth-card h1 + .auth-form, .auth-card h2 + .auth-form { margin-top: 28px; }
.auth-card > p { margin-top: 12px; margin-bottom: 28px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-form .field { display: flex; flex-direction: column; gap: 8px; }
.auth-form label { display: block; color: #57463b; font-size: 13px; font-weight: 600; }
.auth-form input { display: block; width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #cec5b9; border-radius: 6px; color: var(--ink); background: var(--paper); font-size: 16px; }
.auth-form input::placeholder { color: #847c70; opacity: 1; }
.auth-form input:focus { border-color: #a17456; }
.auth-form > label > input { margin-top: 8px; }
.auth-form .button { width: 100%; min-height: 48px; margin-top: 4px; font-size: 14px; }
.form-hint { color: var(--muted); font-size: 12px; line-height: 1.8; }
.form-hint svg { width: 13px; height: 13px; margin-right: 5px; color: var(--terracotta); }
.auth-form > .form-hint { text-align: center; }
.auth-card > .form-hint { padding-top: 21px; margin: 25px 0 0; border-top: 1px solid #dcd5c9; color: var(--muted); font-size: 12px; line-height: 1.8; }
.auth-card .form-hint a { color: var(--accent); }
.auth-card .alert { margin-top: 22px; }
.setup-notice { margin-bottom: 22px; padding: 16px 18px; border: 1px solid #d8c5ad; border-radius: 6px; background: #f0e8d9; color: #6a513e; font-size: 13px; line-height: 1.8; }
.setup-notice code { font-size: 12px; color: var(--espresso); overflow-wrap: anywhere; }
.setup-notice a { color: var(--espresso); font-weight: 600; }
.auth-top-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-size: 13px; text-decoration: none; }
.auth-top-link:hover { color: var(--espresso); text-decoration: underline; }
.account-container { max-width: 680px; }
.account-container > .auth-top-link { margin-bottom: 15px; }
.account-container .auth-card { padding: 37px 39px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.account-container .auth-card h1, .account-container .auth-card h2 { font-size: 32px; }

.share-container { flex: 1; width: 100%; max-width: 1160px; padding: 40px 40px 62px; margin: 0 auto; }
.share-heading { display: flex; justify-content: space-between; align-items: center; gap: 25px; margin-bottom: 27px; }
.share-heading .eyebrow { margin-bottom: 10px; }
.share-heading h1 { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 36px); font-weight: 400; line-height: 1.2; letter-spacing: -.8px; overflow-wrap: anywhere; }
.share-heading p { margin-top: 10px; color: var(--muted); font-size: 13px; }
.share-heading .button { flex-shrink: 0; }
.share-image { display: flex; align-items: center; justify-content: center; min-height: 300px; padding: 25px; background: var(--paper); border: 1px solid #d8cec0; border-radius: 9px; box-shadow: 0 7px 30px #4a2f2806; overflow: hidden; }
.share-image img { width: auto; height: auto; max-width: 100%; max-height: 73vh; object-fit: contain; border-radius: 2px; }
.share-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 23px; color: var(--muted); font-size: 12px; }
.share-footer > span { display: inline-flex; align-items: center; gap: 8px; }
.share-footer > span svg { width: 15px; height: 15px; color: var(--terracotta); }
.share-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.share-footer .copy-button { flex: 0 0 auto; }

@media (max-width: 1260px) {
  .header-actions { gap: 12px; }
  .auth-layout { gap: 48px; }
}

@media (max-width: 1040px) {
  .header-inner, .container, .share-container { padding-right: 28px; padding-left: 28px; }
  .brand { gap: 17px; }
  .brand-logo { width: 182px; }
  .brand-caption { padding-left: 17px; font-size: 24px; }
  .header-nav a { padding: 10px 12px; }
  .workspace-grid { grid-template-columns: minmax(0, 1.6fr) minmax(268px, 1fr); gap: 19px; }
  .upload-panel, .overview-panel { padding: 23px; }
  .panel-heading { align-items: flex-start; }
  .panel-heading > .muted { max-width: 135px; }
  .gallery-grid { gap: 18px; }
  .image-card-body { padding: 16px; }
  .card-actions { gap: 6px; }
  .copy-button { padding: 9px 7px; }
  .auth-layout { padding: 35px 28px 48px; gap: 38px; }
  .auth-story { padding: 36px 30px; }

}

@media (max-width: 820px) {
  .header-inner { min-height: 94px; gap: 16px; }
  .brand-logo { width: 160px; }
  .brand { gap: 13px; }
  .brand-caption { padding-left: 13px; font-size: 23px; }
  .header-actions { gap: 8px; }
  .header-nav a { padding: 10px; font-size: 12px; }
  .header-actions .button { padding-right: 5px; padding-left: 5px; font-size: 12px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-bottom: 36px; }
  .overview-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; }
  .overview-panel .panel-heading { grid-column: 1 / -1; margin-bottom: 22px; }
  .stats-grid { grid-column: 1; margin-bottom: 20px; }
  .storage-meter, .storage-caption { grid-column: 1; }
  .privacy-note { grid-column: 2; grid-row: 2 / 5; align-self: center; margin: 0; padding: 0; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .library-header { gap: 18px; }
  .library-tools { gap: 9px; }
  .search-form { width: 205px; }
  .view-switch { gap: 0; padding: 0; }
  .view-switch button { width: 44px; }
  .auth-layout { gap: 30px; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); }
  .auth-story { padding: 30px 25px; min-height: 380px; }
  .auth-brand-logo { width: 235px; }

  .share-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 680px) {
  .header-inner { padding: 19px 22px; flex-wrap: wrap; gap: 18px; }
  .brand-logo { width: 185px; }
  .brand { gap: 18px; }
  .brand-caption { padding-left: 18px; font-size: 25px; }
  .header-actions { flex: 1 0 100%; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
  .header-actions:empty { display: none; }
  .header-nav { margin-right: auto; gap: 4px; }
  .header-nav a { padding: 10px 15px; font-size: 13px; }
  .header-actions .button { padding-right: 8px; padding-left: 8px; font-size: 13px; }
  .container { padding: 25px 22px 45px; }
  .upload-panel, .overview-panel { padding: 23px; }
  .library-header { align-items: stretch; flex-direction: column; gap: 19px; }
  .library-tools { width: 100%; }
  .search-form { width: auto; flex: 1; }
  .search-form input { font-size: 16px; }
  .library-header h2 { font-size: 31px; }
  .gallery-grid { gap: 17px; }
  .image-card-body { padding: 14px; }
  .card-actions { flex-wrap: wrap; gap: 6px; }
  .copy-button { font-size: 12px; }
  .gallery-grid[data-layout="list"] .image-card { grid-template-columns: 125px minmax(0, 1fr); }
  .gallery-grid[data-layout="list"] .image-preview { width: 125px; min-height: 160px; }
  .gallery-grid[data-layout="list"] .image-card-body { display: flex; flex-direction: column; justify-content: center; align-items: stretch; padding: 16px; }
  .gallery-grid[data-layout="list"] .image-name, .gallery-grid[data-layout="list"] .image-meta { align-self: auto; }
  .gallery-grid[data-layout="list"] .card-actions { align-self: auto; padding-top: 13px; }
  .gallery-grid[data-layout="list"] .copy-button { min-width: 0; }
  .auth-layout { max-width: 460px; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 36px 22px; }
  .auth-story { display: none; }

  .auth-card { padding: 25px 7px; }
  .auth-icon { margin-bottom: 20px; }

  .account-container .auth-card { padding: 29px; }
  .share-container { padding: 30px 22px 45px; }
  .share-heading { flex-direction: column; align-items: flex-start; gap: 20px; }
  .share-image { padding: 15px; min-height: 250px; }
}

@media (max-width: 460px) {
  .header-inner { padding: 18px; }
  .brand-logo { width: 171px; }
  .brand { gap: 15px; }
  .brand-caption { padding-left: 15px; font-size: 24px; }
  .header-actions { gap: 8px; }
  .header-nav { gap: 1px; }
  .header-nav a { padding: 10px 12px; }
  .header-actions .button { gap: 6px; padding-right: 1px; padding-left: 1px; font-size: 12px; }
  .header-actions .button svg { width: 15px; height: 15px; }
  .user-avatar { width: 40px; height: 44px; }
  .container { padding: 20px 18px 40px; }
  .upload-panel, .overview-panel { padding: 20px; }
  .panel-heading { gap: 12px; margin-bottom: 20px; }
  .panel-heading h2 { font-size: 18px; }
  .panel-heading > .muted { display: none; }
  .drop-zone { min-height: 230px; padding: 24px 15px; }
  .drop-zone h3 { font-size: 25px; }
  .upload-formats { max-width: 210px; line-height: 1.8; }
  .upload-bottom { flex-wrap: wrap; gap: 13px; margin-top: 17px; }
  .upload-bottom .button { width: 100%; }
  .overview-panel { display: flex; }
  .overview-panel .panel-heading { margin-bottom: 22px; }
  .stats-grid { width: 100%; margin-bottom: 20px; gap: 18px; }
  .stat-value { font-size: 34px; }
  .privacy-note { margin-top: 25px; align-self: stretch; }
  .gallery-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .image-preview { aspect-ratio: 1.39; }
  .image-card-body { padding: 18px; }
  .card-actions { gap: 8px; flex-wrap: nowrap; }
  .gallery-grid[data-layout="list"] .image-card { grid-template-columns: 94px minmax(0, 1fr); }
  .gallery-grid[data-layout="list"] .image-preview { width: 94px; min-height: 194px; }
  .gallery-grid[data-layout="list"] .image-type { right: 7px; bottom: 7px; padding: 2px 6px; }
  .gallery-grid[data-layout="list"] .image-card-body { padding: 14px; }
  .gallery-grid[data-layout="list"] .card-actions { flex-wrap: wrap; justify-content: flex-start; gap: 7px; }
  .gallery-grid[data-layout="list"] .copy-button { flex-basis: 100%; }
  .gallery-grid[data-layout="list"] .image-meta { gap: 4px; font-size: 12px; }
  .empty-state { padding: 40px 22px; }
  .empty-state h3 { font-size: 26px; }
  .empty-state p { font-size: 13px; }
  .view-switch button { width: 44px; }
  .search-form { padding-right: 11px; padding-left: 11px; gap: 8px; }
  .auth-layout { padding-right: 18px; padding-left: 18px; }

  .auth-card { padding: 24px 4px; }

  .account-container .auth-card { padding: 26px 22px; }

  .share-container { padding: 27px 18px 40px; }
  .share-image { min-height: 220px; padding: 10px; }
  .share-actions { width: 100%; }
  .share-actions .button { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
