:root {
  color-scheme: dark;
  --bg: #1b1b1b;
  --header: #0d0d0d;
  --panel: #202020;
  --panel-soft: #242424;
  --text: #eeeeee;
  --muted: #b7b7b7;
  --line: #454545;
  --blue: #6288ef;
  --blue-hover: #7c9cf3;
  --yellow: #ffc400;
  --danger: #d85d55;
  --shadow: 0 0 0 1px rgba(255,255,255,.08), 0 2px 5px rgba(0,0,0,.2), 0 14px 36px rgba(0,0,0,.18);
  --field: #1d1d1d;
  --field-focus: #222;
  --nav-hover: #171717;
  --control-hover: #292929;
  --control-hover-strong: #333;
  --media-bg: #121212;
  --item-bg: #151515;
  --progress-bg: #181818;
  --input-bg: #191919;
  --toast-bg: #080808;
  --brand-text: #f3f3f3;
  --on-accent: #fff;
  --image-outline: rgba(255,255,255,.1);
  --backdrop: rgba(0,0,0,.58);
  --image-label: rgba(0,0,0,.8);
  --notice-text: #b9c9f8;
  --success-text: #8fdaa9;
  --pending-text: #ffd95c;
  --error-text: #f08b84;
  --status-muted: #aaa;
  --status-bg: #333;
  --premium-bg: #ffc400;
  --premium-text: #171100;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --header: #fff;
  --panel: #fff;
  --panel-soft: #f0f2f5;
  --text: #1d2430;
  --muted: #626b78;
  --line: #d5dae1;
  --blue: #3569d4;
  --blue-hover: #2457bd;
  --yellow: #9a6700;
  --danger: #bd3f39;
  --shadow: 0 0 0 1px rgba(0,0,0,.06), 0 2px 5px rgba(0,0,0,.06), 0 14px 36px rgba(0,0,0,.07);
  --field: #fff;
  --field-focus: #fff;
  --nav-hover: #f0f2f5;
  --control-hover: #e8ebef;
  --control-hover-strong: #e1e5ea;
  --media-bg: #e9edf2;
  --item-bg: #f0f2f5;
  --progress-bg: #eef1f5;
  --input-bg: #fff;
  --toast-bg: #1d2430;
  --brand-text: #1b2028;
  --on-accent: #fff;
  --image-outline: rgba(0,0,0,.1);
  --backdrop: rgba(17,24,39,.35);
  --image-label: rgba(0,0,0,.76);
  --notice-text: #31569d;
  --success-text: #237344;
  --pending-text: #795d00;
  --error-text: #a8332e;
  --status-muted: #68717e;
  --status-bg: #e6e9ed;
  --premium-bg: #f2b900;
  --premium-text: #201700;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: Arial, "Microsoft YaHei", sans-serif; font-size: 16px; }
body.drawer-open { overflow: hidden; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }
button, input, select { font: inherit; letter-spacing: 0; }
input, textarea { color: var(--text); }
button, select { cursor: pointer; }
button { color: inherit; }
.ui-icon { width: 1.1em; height: 1.1em; display: inline-block; flex: none; vertical-align: -.17em; stroke-width: 2; pointer-events: none; transition-property: opacity, transform; transition-duration: 150ms; transition-timing-function: ease-out; }
img { display: block; max-width: 100%; outline: 1px solid var(--image-outline); outline-offset: -1px; }
h1, h2, h3 { margin: 0; letter-spacing: 0; text-wrap: balance; }
p, li { text-wrap: pretty; }
.shell { width: min(1300px, calc(100% - 32px)); margin-inline: auto; }

.site-header { height: 56px; background: var(--header); position: relative; z-index: 20; }
.nav { height: 56px; padding: 0 12px; display: flex; align-items: center; }
.brand { min-height: 44px; margin-right: 18px; display: inline-flex; align-items: center; color: var(--brand-text); }
.brand strong { font-size: 27px; line-height: 1; text-transform: lowercase; }
.brand strong span { color: var(--blue); }
.nav-links { min-width: 0; flex: 1; display: flex; justify-content: space-between; align-items: center; }
.nav-primary, .nav-account { display: flex; align-items: center; gap: 5px; }
.nav-links a, .nav-button { min-height: 44px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 2px; background: transparent; color: var(--blue); font-size: 16px; transition-property: color, background-color, transform; transition-duration: 150ms; }
.nav-links .ui-icon { width: 18px; height: 18px; }
.nav-links a.nav-premium { min-height: 56px; padding: 0 18px 0 16px; border-radius: 0; background: var(--premium-bg); color: var(--premium-text); box-shadow: inset 0 -3px 0 rgba(0,0,0,.14); }
.nav-links a.nav-premium:hover { background: var(--yellow); color: var(--premium-text); filter: brightness(1.04); }
.nav-links a.nav-premium .ui-icon { width: 20px; height: 20px; fill: currentColor; }
.nav-form { margin: 0; }
.nav-links a:hover, .nav-links a[aria-current="page"], .nav-button:hover { color: var(--text); background: var(--nav-hover); }
.nav-links a:active, .nav-button:active, button:active, .primary-button:active, .secondary-button:active, .outline-button:active { transform: scale(.96); }
.library-count { min-width: 20px; height: 20px; padding-inline: 5px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--blue); color: var(--on-accent); font-size: 11px; font-variant-numeric: tabular-nums; }
.icon-button { width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: 2px; background: transparent; transition-property: background-color, transform; transition-duration: 150ms; }
.icon-button .ui-icon { width: 22px; height: 22px; }
.icon-button:hover { background: var(--control-hover); }
.nav-toggle { display: none; margin-left: auto; }
.nav-toggle span { width: 20px; height: 2px; display: block; margin: 2px; background: var(--text); }

.upload-hero { min-height: 452px; padding: 50px 20px 24px; text-align: center; }
.ad-slot { width: min(970px, calc(100% - 32px)); min-height: 90px; margin: 22px auto; display: grid; place-items: center; position: relative; overflow: hidden; color: var(--muted); text-align: center; }
.ad-slot-upload-top { margin-bottom: 0; }
.ad-slot-upload-bottom, .ad-slot-viewer-bottom { margin-block: 0 38px; }
.ad-slot-viewer-sidebar { width: 100%; min-height: 250px; margin: 28px 0 0; }
.ad-label { position: absolute; top: 3px; right: 4px; z-index: 1; color: var(--muted); font-size: 9px; line-height: 1; text-transform: uppercase; }
.ad-content { width: 100%; min-width: 0; overflow: hidden; }
.ad-content img, .ad-content iframe { max-width: 100%; margin-inline: auto; }
.upload-intro { max-width: 620px; margin: 0 auto 24px; }
.upload-intro h1 { font-size: 35px; font-weight: 700; line-height: 1.25; }
.upload-intro p { margin: 23px auto 0; color: var(--text); font-size: 16px; line-height: 1.55; }
.upload-panel { width: min(400px, 100%); margin: 0 auto; }
.upload-options { display: grid; gap: 15px; }
.upload-options label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
select, input[type="url"] { width: 100%; height: 39px; padding: 0 38px 0 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--field); color: var(--text); outline: none; transition-property: border-color, box-shadow, background-color; transition-duration: 150ms; }
select:focus, input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(98,136,239,.16); background: var(--field-focus); }
.drop-zone { min-height: 50px; margin: 15px auto 0; padding: 0; display: flex; align-items: center; justify-content: center; outline: none; }
.drop-zone strong { min-width: 210px; min-height: 49px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--blue); border-radius: 6px; color: var(--blue); font-size: 18px; font-weight: 400; transition-property: color, background-color, transform, box-shadow; transition-duration: 150ms; }
.drop-zone .ui-icon { width: 21px; height: 21px; }
.drop-zone:hover strong, .drop-zone:focus strong, .drop-zone.is-dragging strong { color: var(--text); background: rgba(98,136,239,.12); box-shadow: 0 0 0 3px rgba(98,136,239,.12); }
.upload-hint { margin: 16px -100px 0; color: var(--text); font-size: 15px; }
.upload-terms { margin: 28px -140px 0; color: var(--text); font-size: 15px; }
.upload-terms a { margin-left: 3px; }
.file-queue { margin-top: 15px; display: grid; gap: 1px; overflow: hidden; border-radius: 4px; background: var(--line); text-align: left; }
.queue-item { min-width: 0; padding: 9px; display: grid; grid-template-columns: 44px minmax(0,1fr) 40px; align-items: center; gap: 10px; background: var(--panel); }
.queue-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 2px; }
.queue-item div { min-width: 0; }
.queue-item strong, .queue-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item strong { font-size: 13px; }
.queue-item span { margin-top: 3px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.queue-item button { width: 40px; height: 40px; border: 0; border-radius: 2px; background: transparent; font-size: 21px; }
.queue-item button:hover { background: var(--control-hover-strong); }
.primary-button, .secondary-button, .danger-button, .outline-button { min-height: 48px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--blue); border-radius: 6px; background: transparent; color: var(--blue); font-weight: 400; transition-property: color, background-color, box-shadow, transform; transition-duration: 150ms; }
.primary-button:hover, .outline-button:hover { color: var(--text); background: rgba(98,136,239,.12); }
.secondary-button { min-height: 42px; border-color: var(--line); color: var(--text); }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.danger-button { border-color: var(--danger); color: var(--danger); }
.upload-submit { width: 100%; margin-top: 14px; }
.remote-field { margin-top: 15px; }
.remote-field > label { display: block; margin-bottom: 8px; text-align: left; }
.remote-field > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.remote-field .primary-button { min-height: 39px; }
.upload-progress { height: 50px; margin-top: 14px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--progress-bg); }
.upload-progress > span { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(98,136,239,.17); transition: width 180ms ease-out; }
.upload-progress p { position: relative; height: 100%; margin: 0; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; }
.upload-progress b { font-variant-numeric: tabular-nums; }
.form-error { margin: 14px 0 0; padding: 12px 14px; border: 1px solid rgba(216,93,85,.55); border-radius: 4px; color: var(--error-text); font-size: 13px; }
.stagger-item { opacity: 0; transform: translateY(12px); filter: blur(4px); animation: enter 380ms ease-out forwards; }
.stagger-item:nth-child(2) { animation-delay: 90ms; }
@keyframes enter { to { opacity: 1; transform: translateY(0); filter: blur(0); } }

.pricing-section { padding: 24px 20px 52px; text-align: center; }
.pricing-shell { width: min(1296px, 100%); margin: 0 auto; }
.pricing-section h2 { font-size: 28px; line-height: 1.3; }
.pricing-lead { margin: 24px 0 27px; }
.account-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.plan-card, .price-card { overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--field); }
.plan-card.premium, .price-card { border-color: var(--blue); }
.plan-card h3, .price-card h3 { min-height: 52px; padding: 11px 14px; border-bottom: 1px solid var(--line); color: #777b89; font-size: 28px; }
.plan-card h3 { display: flex; align-items: center; gap: 9px; }
.plan-card h3 .ui-icon { width: 25px; height: 25px; }
.plan-card.premium h3, .price-card h3 { color: var(--blue); }
.plan-card ul { margin: 0; padding: 0; list-style: none; }
.plan-card li { height: 41px; padding: 0 12px; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.plan-card li:last-child { border-bottom: 0; }
.outline-button { margin-top: 22px; min-width: 178px; font-size: 18px; }
.annual-title { margin-top: 22px; }
.price-plans { margin-top: 32px; display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; align-items: start; }
.price-card { min-height: 180px; }
.price-card h3 { font-size: 27px; }
.price-card strong, .price-card b, .price-card small { display: block; font-variant-numeric: tabular-nums; }
.price-card strong { margin-top: 22px; font-size: 21px; }
.price-card b { margin-top: 8px; color: var(--yellow); font-size: 20px; }
.price-card small { margin-top: 8px; color: var(--muted); }

.admin-header-actions { display: flex; align-items: center; gap: 10px; }
.admin-header-actions form { margin: 0; }
.admin-header-actions .outline-button { margin-top: 0; min-width: 120px; }
.api-token-section { margin-top: 26px; }
.api-token-section .section-title { margin-bottom: 20px; }
.api-token-section .section-title p { margin: 6px 0 0; color: var(--muted); }
.token-reveal { margin-bottom: 20px; padding: 16px; border-radius: 5px; background: var(--panel-soft); box-shadow: var(--shadow); }
.token-reveal > strong { display: block; margin-bottom: 10px; color: var(--pending-text); }
.token-reveal > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.token-reveal input { min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.token-create-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.token-create-form label { margin: 0; }
.token-list { margin-top: 22px; border-top: 1px solid var(--line); }
.token-list article { min-width: 0; padding: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.token-list article > div { min-width: 0; display: grid; gap: 5px; }
.token-list code { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.token-list small { color: var(--muted); font-variant-numeric: tabular-nums; }
.compact-button { min-height: 40px; padding-inline: 16px; }
.api-example { margin-top: 20px; }
.api-example summary { min-height: 40px; display: flex; align-items: center; color: var(--blue); cursor: pointer; }
.api-example pre { max-width: 100%; margin: 8px 0 0; padding: 14px; overflow: auto; border-radius: 5px; background: var(--item-bg); color: var(--text); }

.results-section { padding: 54px 0 70px; }
.section-heading { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.eyebrow { display: inline-block; margin-bottom: 8px; color: var(--blue); font-size: 12px; }
.section-heading h2 { font-size: 26px; }
.result-list { display: grid; gap: 12px; }
.result-card { min-width: 0; display: grid; grid-template-columns: 156px minmax(0,1fr); overflow: hidden; border-radius: 5px; background: var(--panel); box-shadow: var(--shadow); }
.result-card > img { width: 156px; height: 100%; min-height: 180px; object-fit: cover; }
.result-content { min-width: 0; padding: 18px; }
.result-top { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.result-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.result-top span { flex: none; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.result-actions { display: grid; grid-template-columns: 124px minmax(0,1fr) 44px; gap: 8px; align-items: end; }
.result-actions label { min-width: 0; }
.result-actions label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.result-actions select, .result-actions input { min-width: 0; height: 44px; }
.result-actions input { width: 100%; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--input-bg); color: var(--muted); font-size: 12px; }
.result-actions button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--blue); border-radius: 4px; background: transparent; color: var(--blue); transition-property: color, background-color, transform; transition-duration: 150ms; }
.result-actions button:hover { background: rgba(98,136,239,.1); color: var(--blue-hover); }
.result-actions button .ui-icon { width: 19px; height: 19px; }

.viewer { padding: 48px 0 80px; display: grid; grid-template-columns: minmax(0,1.5fr) minmax(320px,.65fr); gap: 38px; align-items: start; }
.viewer-stage { min-height: 540px; display: grid; place-items: center; overflow: hidden; border-radius: 5px; background: var(--media-bg); box-shadow: var(--shadow); }
.viewer-stage img { max-height: 75vh; object-fit: contain; }
.viewer-info { position: sticky; top: 28px; }
.viewer-info h1 { font-size: 36px; font-weight: 500; overflow-wrap: anywhere; }
.image-meta { display: flex; gap: 16px; margin: 12px 0 28px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.image-share-shortcuts { margin: -8px 0 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.image-share-shortcuts a { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--blue); border-radius: 4px; color: var(--blue); transition-property: color, background-color, transform; transition-duration: 150ms; }
.image-share-shortcuts a:hover { background: rgba(98,136,239,.1); color: var(--blue-hover); }
.image-share-shortcuts .ui-icon { width: 20px; height: 20px; }
.copy-field { display: block; margin-bottom: 14px; }
.copy-field > span:first-child { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.copy-field > span:last-child { display: grid; grid-template-columns: minmax(0,1fr) 48px; }
.copy-field input { min-width: 0; height: 44px; padding: 0 10px; border: 1px solid var(--line); border-right: 0; border-radius: 4px 0 0 4px; background: var(--input-bg); color: var(--muted); font-size: 11px; }
.copy-field button { min-width: 48px; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--blue); border-radius: 0 4px 4px 0; background: transparent; color: var(--blue); transition-property: color, background-color, transform; transition-duration: 150ms; }
.copy-field button:hover { background: rgba(98,136,239,.1); color: var(--blue-hover); }
.copy-field button .ui-icon { width: 19px; height: 19px; }
.delete-link, .text-link { min-height: 44px; display: inline-flex; align-items: center; margin-top: 7px; color: var(--danger); font-size: 13px; }
.narrow-section { width: min(680px, calc(100% - 48px)); min-height: 570px; margin: 0 auto; padding: 80px 0; text-align: center; }
.narrow-section h1 { font-size: 44px; }
.narrow-section > p { color: var(--muted); line-height: 1.8; }
.narrow-section .primary-button { margin-top: 15px; }
.delete-page img { width: 250px; height: 190px; margin: 30px auto 22px; object-fit: cover; border-radius: 4px; }
.delete-page form { display: flex; justify-content: center; align-items: center; gap: 20px; }
.prose { text-align: left; }
.prose h2 { margin: 42px 0 10px; font-size: 21px; }
.prose p { margin: 0; }

.library-drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; visibility: hidden; }
.library-drawer[aria-hidden="false"] { pointer-events: auto; visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: var(--backdrop); opacity: 0; transition: opacity 180ms ease-out; }
.drawer-panel { position: absolute; top: 0; right: 0; width: min(460px, 100%); height: 100%; padding: 24px; overflow-y: auto; background: var(--panel); transform: translateX(100%); transition: transform 220ms cubic-bezier(.2,0,0,1); box-shadow: -8px 0 50px rgba(0,0,0,.35); }
.library-drawer[aria-hidden="false"] .drawer-backdrop { opacity: 1; }
.library-drawer[aria-hidden="false"] .drawer-panel { transform: translateX(0); }
.drawer-panel header { display: flex; justify-content: space-between; align-items: start; }
.drawer-panel h2 { font-size: 30px; }
.library-grid { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.library-item { position: relative; overflow: hidden; border-radius: 4px; aspect-ratio: 1.2; background: var(--item-bg); box-shadow: 0 0 0 1px var(--image-outline); }
.library-item img { width: 100%; height: 100%; object-fit: cover; }
.library-item span { position: absolute; inset: auto 7px 7px; padding: 6px 8px; overflow: hidden; border-radius: 3px; background: var(--image-label); color: var(--on-accent); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.library-empty { margin-top: 36px; color: var(--muted); text-align: center; line-height: 1.7; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 4px; background: var(--toast-bg); color: var(--on-accent); box-shadow: var(--shadow); font-size: 13px; opacity: 0; transform: translate(-50%,12px); filter: blur(4px); pointer-events: none; transition-property: opacity, transform, filter; transition-duration: 180ms; }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); filter: blur(0); }

.site-footer { min-height: 210px; padding: 30px 20px 24px; background: var(--header); color: var(--muted); font-size: 14px; text-align: center; }
.footer-inner { width: min(760px,100%); margin: 0 auto; }
.footer-links { margin-bottom: 16px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 25px; }
.footer-links a, .footer-controls button { min-height: 40px; display: inline-flex; align-items: center; color: var(--blue); }
.footer-links-primary a { gap: 7px; }
.footer-links-primary .ui-icon, .language-form .ui-icon { width: 18px; height: 18px; }
.footer-controls { margin: 4px 0 10px; display: flex; justify-content: center; gap: 22px; }
.footer-controls button { padding: 0 6px; border: 0; background: transparent; }
.theme-toggle { width: 44px; height: 44px; position: relative; justify-content: center; border-radius: 4px !important; transition-property: background-color, transform; transition-duration: 150ms; }
.theme-toggle:hover { background: var(--nav-hover); }
.theme-icon { width: 21px; height: 21px; position: absolute; transition-property: opacity, transform, filter; transition-duration: 180ms; transition-timing-function: cubic-bezier(.2,0,0,1); }
.theme-icon-sun, [data-theme="light"] .theme-icon-moon { opacity: 0; transform: scale(.25); filter: blur(4px); }
.theme-icon-moon, [data-theme="light"] .theme-icon-sun { opacity: 1; transform: scale(1); filter: blur(0); }
.language-form, .language-form label { margin: 0; min-height: 40px; display: inline-flex; align-items: center; gap: 7px; }
.language-form select { width: auto; min-width: 128px; height: 40px; padding-block: 0; border-color: transparent; background-color: transparent; color: var(--blue); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.site-footer p { margin: 0; }

.flash { padding: 12px 20px; border-bottom: 1px solid var(--line); text-align: center; }
.site-notice { padding: 10px 20px; border-bottom: 1px solid rgba(98,136,239,.25); background: rgba(98,136,239,.1); color: var(--notice-text); text-align: center; }
.flash-success { background: rgba(56,145,94,.16); color: var(--success-text); }
.flash-error, .inline-error { background: rgba(216,93,85,.12); color: var(--error-text); }
.inline-error { margin-bottom: 18px; padding: 12px 14px; border: 1px solid rgba(216,93,85,.42); border-radius: 4px; }
.auth-page { min-height: 650px; padding: 70px 16px; display: grid; place-items: start center; }
.auth-card { width: min(430px,100%); padding: 30px; border-radius: 6px; background: var(--panel); box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: 12px; font-size: 31px; }
.auth-card > p { color: var(--muted); line-height: 1.6; }
.auth-card > p:last-child { margin: 22px 0 0; text-align: center; }
.auth-card .field-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.registration-newsletter { margin-top: 20px !important; color: var(--text) !important; }
.auth-card label, .settings-card label, .membership-plans label { display: grid; gap: 7px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.auth-card input, .auth-card select, .settings-card input, .settings-card textarea, .table-card input, .membership-plans select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--input-bg); outline: none; }
.settings-card textarea { resize: vertical; }
.newsletter-compose-card textarea { min-height: 230px; line-height: 1.6; }
.newsletter-campaigns td:not(:first-child) { font-variant-numeric: tabular-nums; }
.auth-card input:focus, .auth-card select:focus, .settings-card input:focus, .settings-card textarea:focus, .table-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(98,136,239,.14); }
.auth-card .primary-button { width: 100%; margin-top: 22px; }
.oauth-login { margin-top: 22px; display: grid; gap: 10px; }
.auth-divider { height: 22px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.oauth-button { width: 100%; min-height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--input-bg); transition-property: border-color, background-color, transform; transition-duration: 150ms; }
.oauth-button:hover { border-color: var(--blue); color: var(--text); background: var(--control-hover); }
.oauth-button .ui-icon { width: 20px; height: 20px; flex: none; }
.setup-page { padding-block: 42px 70px; }
.setup-card { width: min(720px, 100%); }
.setup-section { min-width: 0; margin: 24px 0 0; padding: 20px 0 0; border: 0; border-top: 1px solid var(--line); }
.setup-section legend { padding: 0 12px 0 0; color: var(--text); font-size: 17px; font-weight: 650; }
.setup-database-fields[hidden] { display: none; }
.setup-card .field-hint { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-label-row a { min-height: 28px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; }
.recovery-card > p { margin-top: 0; }
.recovery-action { width: 100%; min-height: 44px; margin-top: 22px; display: inline-flex; align-items: center; justify-content: center; }
.page-heading { padding: 44px 0 28px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.page-heading h1 { font-size: 34px; }
.page-heading p { margin: 10px 0 0; color: var(--muted); }
.account-page, .billing-page, .admin-page { min-height: 700px; padding-bottom: 70px; }
.account-stats, .admin-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.account-stats { grid-template-columns: repeat(4,1fr); }
.admin-stats { grid-template-columns: repeat(4,1fr); }
.account-stats article, .admin-stats article { min-height: 120px; padding: 20px; border-radius: 5px; background: var(--panel); box-shadow: var(--shadow); }
.account-stats span, .admin-stats span, .admin-stats small { display: block; color: var(--muted); }
.account-stats strong, .admin-stats strong { display: block; margin-top: 14px; font-size: 27px; font-variant-numeric: tabular-nums; }
.admin-stats small { margin-top: 8px; }
.account-columns, .dashboard-grid, .settings-grid { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-grid { align-items: start; }
.settings-card { padding: 22px; border-radius: 5px; background: var(--panel); box-shadow: var(--shadow); }
.settings-card h2 { margin-bottom: 12px; font-size: 21px; }
.settings-card h3 { margin: 25px 0 4px; color: var(--blue); }
.settings-card > p { color: var(--muted); line-height: 1.6; }
.settings-card .field-hint { margin: 12px 0 0; font-size: 12px; }
.settings-card .secondary-button, .settings-card .primary-button { margin-top: 20px; }
.wide-card { width: min(900px,100%); }
.smtp-settings-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.smtp-settings-heading h2 { margin-bottom: 6px; }
.smtp-settings-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.smtp-status { min-height: 28px; padding: 0 10px; display: inline-flex; flex: none; align-items: center; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.smtp-status.is-ready { border-color: rgba(50,153,101,.36); background: rgba(50,153,101,.1); color: var(--success); }
.smtp-settings-card > h3 { padding-top: 4px; border-top: 1px solid var(--line); }
.smtp-server-row { grid-template-columns: minmax(0, 1fr) 160px; }
.smtp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.smtp-actions .secondary-button, .smtp-actions .primary-button { min-height: 44px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check-row { min-height: 44px; display: flex !important; grid-template-columns: none !important; flex-direction: row; align-items: center; gap: 10px !important; }
.check-row input { width: 18px; min-height: 18px; height: 18px; }
.user-gallery, .table-card { margin-top: 28px; padding: 22px; border-radius: 5px; background: var(--panel); box-shadow: var(--shadow); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.image-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; }
.image-grid a { min-width: 0; overflow: hidden; border-radius: 4px; background: var(--item-bg); }
.image-grid img { width: 100%; aspect-ratio: 1.2; object-fit: cover; }
.image-grid span { padding: 8px; display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 34px 0; color: var(--muted); text-align: center; }
.files-page { min-height: 720px; padding: 34px 0 76px; }
.files-breadcrumb { min-height: 44px; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.files-breadcrumb a { min-height: 44px; display: inline-flex; align-items: center; color: var(--blue); }
.files-breadcrumb a:first-child { width: 44px; justify-content: center; margin-left: -12px; font-size: 24px; }
.files-breadcrumb a:first-child .ui-icon { width: 21px; height: 21px; }
.files-breadcrumb strong { color: var(--text); font-weight: 400; }
.files-toolbar { margin: 28px 0 30px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); align-items: center; gap: 24px; }
.files-toolbar-primary { min-width: 0; display: flex; align-items: center; gap: 10px; }
.upgrade-button { min-height: 44px; padding: 0 16px; display: inline-flex; flex: none; align-items: center; gap: 7px; border-radius: 5px; background: var(--premium-bg); color: var(--premium-text); }
.upgrade-button .ui-icon { width: 18px; height: 18px; }
.upgrade-button:hover { color: var(--premium-text); filter: brightness(1.04); }
.gallery-create-form { min-width: 0; display: grid; grid-template-columns: minmax(150px, 260px) auto; gap: 10px; }
.gallery-create-form input, .gallery-search-form input { width: 100%; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; outline: none; background: var(--input-bg); }
.gallery-create-form input:focus, .gallery-search-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(98,136,239,.14); }
.gallery-create-form .primary-button { min-height: 44px; padding-inline: 16px; border-radius: 5px; }
.gallery-search-form { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 44px; }
.gallery-search-form input { border-radius: 5px 0 0 5px; }
.gallery-search-form button { width: 44px; height: 44px; border: 1px solid var(--line); border-left: 0; border-radius: 0 5px 5px 0; background: var(--input-bg); color: var(--blue); font-size: 25px; transition-property: color, background-color, transform; transition-duration: 150ms; }
.gallery-search-form button .ui-icon { width: 20px; height: 20px; }
.gallery-search-form button:hover { background: var(--control-hover); color: var(--blue-hover); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 280px)); gap: 22px; }
.gallery-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); transition-property: border-color, box-shadow, transform; transition-duration: 170ms; }
.gallery-card:hover { border-color: var(--blue); color: var(--text); box-shadow: var(--shadow); transform: translateY(-2px); }
.gallery-card:focus-visible { outline: 3px solid rgba(98,136,239,.35); outline-offset: 3px; }
.gallery-cover { width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; background: var(--media-bg); }
.gallery-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 220ms ease-out; }
.gallery-card:hover .gallery-cover img { transform: scale(1.025); }
.gallery-placeholder { width: 54px; height: 54px; color: var(--line); }
.gallery-card-body { min-height: 66px; padding: 11px 14px; display: grid; align-content: center; gap: 4px; }
.gallery-card-body strong { min-width: 0; overflow: hidden; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.gallery-card-body small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.gallery-empty { min-height: 300px; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); text-align: center; }
.gallery-empty > .ui-icon { width: 50px; height: 50px; color: var(--line); }
.gallery-empty h2 { color: var(--text); font-size: 18px; }
.gallery-detail-heading { margin: 26px 0 28px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.gallery-detail-heading h1 { font-size: 32px; }
.gallery-detail-heading p { margin: 8px 0 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.gallery-detail-heading .primary-button { min-height: 44px; }
.files-image-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.files-image-grid a { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--muted); transition-property: border-color, transform; transition-duration: 160ms; }
.files-image-grid a:hover { border-color: var(--blue); color: var(--text); transform: translateY(-2px); }
.files-image-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.files-image-grid span { padding: 9px 10px; display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.upload-gallery-return { min-height: 36px; margin-bottom: 8px; display: inline-flex; align-items: center; }
.profile-page { width: min(808px, calc(100% - 32px)); min-height: 760px; padding: 92px 0 64px; }
.profile-settings-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.profile-settings-panel > header { min-height: 54px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.profile-settings-panel > header h1 { font-size: 25px; font-weight: 500; }
.profile-settings-panel > header a { min-height: 44px; display: inline-flex; align-items: center; }
.profile-settings-body { padding: 22px 20px 20px; }
.profile-form-error { grid-column: 1 / -1; }
.profile-setting-row { min-height: 70px; display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: center; gap: 24px; }
.profile-setting-row > label, .profile-setting-label { color: var(--text); font-size: 17px; }
.profile-setting-row input, .profile-setting-row select { min-width: 0; height: 48px; border: 1px solid var(--line); background: var(--input-bg); outline: none; }
.profile-setting-row input:focus, .profile-setting-row select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(98,136,239,.14); }
.profile-email-field { display: grid; grid-template-columns: 54px minmax(0, 1fr); }
.profile-email-field span { display: grid; place-items: center; border: 1px solid var(--line); border-right: 0; border-radius: 6px 0 0 6px; color: var(--text); font-size: 21px; font-weight: 700; }
.profile-email-field .ui-icon { width: 20px; height: 20px; color: var(--muted); }
.profile-email-field input { width: 100%; padding: 0 15px; border-radius: 0 6px 6px 0; background: var(--control-hover-strong); color: var(--text); }
.profile-url-field { min-width: 0; display: grid; grid-template-columns: minmax(170px, auto) minmax(100px, 1fr) 48px; }
.profile-url-field > span { height: 48px; padding: 0 12px; display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-right: 0; border-radius: 6px 0 0 6px; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.profile-url-field input { width: 100%; padding: 0 12px; border-radius: 0; }
.profile-url-field button { width: 48px; height: 48px; border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; background: var(--input-bg); color: var(--blue); font-size: 20px; transition-property: background-color, color, transform; transition-duration: 150ms; }
.profile-url-field button .ui-icon { width: 19px; height: 19px; }
.profile-url-field button:hover { background: var(--control-hover); color: var(--blue-hover); }
.profile-setting-row > select { width: 100%; padding: 0 14px; border-radius: 6px; color: var(--text); }
.profile-sort-control { min-width: 0; display: grid; grid-template-columns: auto minmax(150px, 1fr); }
.sort-segments { display: flex; }
.sort-segments label { width: 56px; height: 48px; position: relative; display: grid; place-items: center; border: 1px solid var(--line); color: var(--blue); cursor: pointer; }
.sort-segments label:first-child { border-radius: 6px 0 0 6px; }
.sort-segments label + label { border-left: 0; }
.sort-segments input { width: 100%; height: 100%; position: absolute; inset: 0; z-index: 1; opacity: 0; cursor: pointer; }
.sort-segments label:has(input:checked) { border-color: var(--blue); background: var(--blue); color: var(--on-accent); }
.sort-segments label:has(input:focus-visible) { box-shadow: inset 0 0 0 3px var(--panel), 0 0 0 3px rgba(98,136,239,.25); }
.sort-segments label > span:not(.sr-only) { font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
.sort-segments .ui-icon { width: 20px; height: 20px; }
.profile-sort-control > select { min-width: 0; padding: 0 14px; border-left: 0; border-radius: 0 6px 6px 0; color: var(--text); }
.profile-toggle-row { align-items: start; padding-top: 17px; }
.switch-control { min-height: 32px; position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch-control input { width: 100%; height: 100%; position: absolute; inset: 0; z-index: 1; opacity: 0; cursor: pointer; }
.switch-control > span { width: 42px; height: 24px; padding: 3px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--input-bg); transition-property: border-color, background-color; transition-duration: 160ms; }
.switch-control > span::after { width: 16px; height: 16px; border-radius: 50%; background: var(--muted); content: ''; transition: transform 160ms ease-out; }
.switch-control input:checked + span { border-color: var(--blue); background: var(--blue); }
.switch-control input:checked + span::after { background: var(--on-accent); transform: translateX(18px); }
.switch-control input:focus-visible + span { box-shadow: 0 0 0 3px rgba(98,136,239,.25); }
.switch-control strong { font-weight: 400; }
.switch-control > span, .switch-control strong { pointer-events: none; }
.profile-toggle-row p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.profile-save-row { min-height: 64px; }
.profile-save-row .primary-button { width: 170px; }
.delete-account-form { margin-top: 30px; }
.delete-account-form .danger-button { min-height: 42px; padding-inline: 14px; color: var(--muted); }
.delete-account-form .danger-button:hover { color: var(--danger); background: rgba(216,93,85,.08); }
.public-gallery-heading { margin: 24px 0 28px; }
.public-gallery-heading h1 { font-size: 32px; }
.public-gallery-heading p { margin: 8px 0 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.gallery-page { min-height: 720px; padding: 34px 0 76px; }
.gallery-page .files-breadcrumb small { color: var(--muted); font-variant-numeric: tabular-nums; }
.gallery-action-bar { margin: 24px 0 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.gallery-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.gallery-actions form { margin: 0; }
.gallery-action-button { min-height: 44px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--blue); border-radius: 5px; background: transparent; color: var(--blue); font-weight: 400; transition-property: color, background-color, border-color, transform; transition-duration: 150ms; }
.gallery-action-button > .ui-icon { width: 18px; height: 18px; }
.gallery-action-button:hover { background: rgba(98,136,239,.1); color: var(--blue-hover); }
.gallery-action-button b { color: var(--premium-bg); font-size: 14px; }
.gallery-action-button b .ui-icon { width: 14px; height: 14px; }
.gallery-action-button.is-premium-locked { border-color: var(--line); color: var(--muted); }
.gallery-delete-button { border-color: var(--line); color: var(--muted); }
.gallery-delete-button:hover { border-color: var(--danger); background: rgba(216,93,85,.08); color: var(--danger); }
.gallery-delete-button:disabled { opacity: .45; cursor: not-allowed; }
.gallery-search-form { width: min(320px, 100%); min-width: 240px; display: grid; grid-template-columns: minmax(0, 1fr) 44px; }
.gallery-search-form input { min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px 0 0 5px; background: var(--input-bg); outline: none; }
.gallery-search-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(98,136,239,.14); }
.gallery-search-form button { width: 44px; height: 44px; border: 1px solid var(--line); border-left: 0; border-radius: 0 5px 5px 0; background: var(--input-bg); color: var(--blue); font-size: 24px; }
.gallery-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 220px)); gap: 16px; }
.gallery-photo-card { min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); text-align: left; transition-property: border-color, box-shadow, transform; transition-duration: 160ms; }
.gallery-photo-card:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-2px); }
.gallery-photo-card:focus-visible { outline: 3px solid rgba(98,136,239,.35); outline-offset: 3px; }
.gallery-photo-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-photo-card span { min-height: 48px; padding: 0 12px; display: flex; align-items: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-settings-dialog { width: min(500px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.gallery-settings-dialog::backdrop { background: var(--backdrop); }
.gallery-settings-dialog form { padding: 20px; }
.gallery-settings-dialog header { margin: -20px -20px 18px; padding: 0 16px; min-height: 54px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.gallery-settings-dialog h2 { font-size: 21px; }
.gallery-settings-dialog header button, .image-settings-panel header button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 28px; }
.gallery-settings-dialog header button .ui-icon, .image-settings-panel header button .ui-icon { width: 23px; height: 23px; }
.gallery-settings-dialog label { display: grid; gap: 8px; color: var(--muted); }
.gallery-settings-dialog input { height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--input-bg); }
.gallery-settings-dialog .primary-button { width: 100%; margin-top: 18px; }
body.lightbox-open { overflow: hidden; }
.image-lightbox { position: fixed; inset: 0; z-index: 100; }
.image-lightbox[aria-hidden="true"] { display: none; }
.image-lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.94); }
.image-lightbox-toolbar { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); z-index: 2; display: flex; align-items: center; gap: 2px; }
.image-lightbox-toolbar form { margin: 0; }
.image-lightbox-toolbar button { width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--blue); font-size: 27px; transition: background-color 150ms, color 150ms, transform 150ms; }
.image-lightbox-toolbar button .ui-icon { width: 23px; height: 23px; }
.image-lightbox-toolbar button:hover { background: rgba(255,255,255,.1); color: #fff; }
.image-lightbox-stage { position: absolute; inset: 0; margin: 0; pointer-events: none; }
.image-lightbox-stage img { width: calc(100% - 164px); height: calc(100% - 118px); max-width: none; position: absolute; inset: 24px 82px 94px; object-fit: contain; outline: 0; filter: drop-shadow(0 18px 35px rgba(0,0,0,.45)); pointer-events: auto; }
.image-lightbox-stage figcaption { max-width: min(720px, calc(100% - 40px)); position: absolute; bottom: 62px; left: 50%; overflow: hidden; color: rgba(255,255,255,.7); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; transform: translateX(-50%); }
.image-lightbox-shortcuts { position: absolute; bottom: 16px; left: 50%; z-index: 2; display: flex; gap: 14px; color: rgba(255,255,255,.55); font-size: 12px; transform: translateX(-50%); }
.image-lightbox-shortcuts kbd { min-width: 30px; padding: 5px 7px; display: inline-flex; justify-content: center; border-radius: 4px; background: rgba(255,255,255,.9); color: #222; font: inherit; }
.image-settings-panel { width: min(1050px, calc(100% - 48px)); max-height: calc(100dvh - 76px); position: absolute; top: 38px; left: 50%; z-index: 4; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--header); color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.65); transform: translateX(-50%); }
.image-settings-panel[aria-hidden="true"] { display: none; }
.image-lightbox:has(.image-settings-panel[aria-hidden="false"]) .image-lightbox-shortcuts, .image-lightbox:has(.image-settings-panel[aria-hidden="false"]) .image-lightbox-stage figcaption { display: none; }
.image-settings-panel form { padding: 22px; display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: start; gap: 18px 26px; }
.image-settings-panel header { min-height: 64px; margin: -22px -22px 0; padding: 0 16px; grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; background: var(--blue); color: var(--on-accent); }
.image-settings-panel header h2 { font-size: 25px; }
.image-settings-panel header h2 { display: flex; align-items: center; gap: 9px; }
.image-settings-panel header h2 .ui-icon { width: 24px; height: 24px; }
.image-settings-panel header button { color: rgba(255,255,255,.7); }
.image-settings-panel form > img { width: min(660px, 100%); max-height: 42vh; grid-column: 2; justify-self: end; border-radius: 5px; object-fit: contain; }
.image-settings-panel label { grid-column: 1 / -1; display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: start; gap: 26px; }
.image-settings-panel label > span { padding-top: 12px; font-size: 17px; }
.image-settings-panel input, .image-settings-panel textarea, .image-settings-panel select { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--input-bg); outline: none; color: var(--text); }
.image-settings-panel input, .image-settings-panel select { height: 48px; }
.image-settings-panel textarea { resize: vertical; }
.image-settings-panel input:focus, .image-settings-panel textarea:focus, .image-settings-panel select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(98,136,239,.18); }
.image-settings-panel .primary-button { width: 210px; grid-column: 2; }
.membership-plans { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.membership-plans article { padding: 22px; border: 1px solid var(--blue); border-radius: 5px; background: var(--panel); }
.membership-plans article > strong { display: block; margin: 16px 0; color: var(--blue); font-size: 25px; font-variant-numeric: tabular-nums; }
.membership-plans article > p { min-height: 44px; color: var(--muted); }
.membership-plans .primary-button { width: 100%; margin-top: 14px; }
.membership-plans article > p.payment-unavailable { min-height: 105px; margin: 16px 0 0; display: flex; align-items: center; justify-content: center; text-align: center; }
.sbp-page { width: min(760px, calc(100% - 32px)); padding: 58px 0 84px; }
.sbp-page > header { text-align: center; }
.sbp-page > header h1 { margin-top: 8px; font-size: 32px; }
.sbp-page > header p { margin: 14px 0 0; color: var(--muted); }
.sbp-payment-layout { margin-top: 34px; display: grid; grid-template-columns: 356px minmax(0, 1fr); align-items: center; gap: 36px; }
.sbp-qr { width: 356px; margin: 0; padding: 18px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.sbp-qr img { width: 320px; height: 320px; aspect-ratio: 1; border-radius: 4px; background: #fff; outline-color: rgba(0,0,0,.1); }
.sbp-qr figcaption { min-height: 28px; padding-top: 10px; overflow: hidden; color: #4b5563; font-size: 12px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.sbp-payment-details > span { color: var(--muted); font-size: 13px; }
.sbp-payment-details > strong { margin-top: 6px; display: block; color: var(--text); font-size: 28px; font-variant-numeric: tabular-nums; }
.sbp-waiting { margin: 22px 0; display: flex; align-items: center; gap: 9px; color: var(--pending-text); }
.sbp-waiting i { width: 9px; height: 9px; flex: none; border-radius: 50%; background: currentColor; animation: sbp-pulse 1.4s ease-in-out infinite; }
.sbp-actions { display: grid; gap: 10px; }
.sbp-actions .primary-button, .sbp-actions .secondary-button { width: 100%; }
.sbp-actions > a:last-child { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
@keyframes sbp-pulse { 50% { opacity: .35; transform: scale(.75); } }
.table-scroll { margin-top: 16px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 400; }
td { font-size: 13px; }
td small { margin-top: 4px; display: block; color: var(--muted); }
.table-card select, .table-card input { min-width: 118px; height: 40px; }
.table-button { min-width: 56px; height: 40px; border: 1px solid var(--blue); border-radius: 4px; background: transparent; color: var(--blue); }
.plans-admin .section-title { align-items: flex-start; }
.plans-admin .section-title p { margin: 6px 0 0; color: var(--muted); }
.plans-table td { vertical-align: middle; }
.plan-name-button { min-width: 210px; min-height: 48px; padding: 4px 0; display: grid; gap: 4px; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.plan-name-button strong { font-size: 14px; font-weight: 600; }
.plan-name-button small { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.plan-name-button:hover strong { color: var(--blue-hover); }
.tabular-number { font-variant-numeric: tabular-nums; }
.plan-status { min-height: 28px; padding: 0 9px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 12px; }
.plan-status.is-active { border-color: rgba(56,145,94,.45); background: rgba(56,145,94,.12); color: var(--success-text); }
.plan-status.is-inactive { background: var(--status-bg); }
.plan-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.plan-inline-form { margin: 0; }
.plan-row-actions .table-button, .plan-row-actions .danger-button { min-height: 40px; padding-inline: 12px; font-size: 12px; }
.plan-dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100dvh - 36px); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.plan-dialog::backdrop { background: var(--backdrop); }
.plan-dialog form { max-height: calc(100dvh - 36px); padding: 22px; overflow-y: auto; }
.plan-dialog header { min-height: 58px; margin: -22px -22px 20px; padding: 0 14px 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.plan-dialog header h2 { margin: 0; font-size: 21px; }
.plan-dialog header .icon-button { color: var(--muted); }
.plan-dialog label { display: grid; gap: 7px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.plan-dialog .form-row label { margin-top: 0; }
.plan-dialog input, .plan-dialog textarea { width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--input-bg); color: var(--text); outline: none; }
.plan-dialog textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
.plan-dialog input:focus, .plan-dialog textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(98,136,239,.14); }
.plan-price-overrides { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.plan-price-overrides summary { min-height: 40px; display: flex; align-items: center; color: var(--blue); cursor: pointer; }
.plan-price-overrides .form-row { margin-top: 2px; }
.plan-code-readonly { margin: 0 0 2px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.plan-code-readonly code { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.plan-dialog .check-row { width: fit-content; min-height: 32px; margin-top: 14px; display: inline-flex !important; color: var(--text); cursor: pointer; }
.plan-dialog .check-row input[type="checkbox"] { flex: 0 0 18px; width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; border: 0; box-shadow: none; accent-color: var(--blue); }
.plan-dialog .check-row input[type="checkbox"]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.plan-dialog-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }
.plan-dialog-actions button { min-width: 120px; min-height: 44px; }
.status { padding: 5px 8px; border-radius: 3px; background: var(--status-bg); font-size: 11px; }
.status-paid { background: rgba(56,145,94,.2); color: var(--success-text); }
.status-pending { background: rgba(255,196,0,.13); color: var(--pending-text); }
.status-sending { background: rgba(98,136,239,.14); color: var(--blue); }
.status-completed { background: rgba(56,145,94,.2); color: var(--success-text); }
.status-cancelled, .status-refunded { color: var(--status-muted); }
.status-partially_refunded { background: rgba(255,196,0,.13); color: var(--pending-text); }
.order-actions { min-width: 148px; display: flex; flex-wrap: wrap; gap: 6px; }
.order-actions:not(.is-enhanced) { min-width: 292px; display: grid; gap: 12px; }
.order-actions:not(.is-enhanced) form { min-width: 0; display: grid; gap: 8px; }
.order-actions:not(.is-enhanced) form + form { padding-top: 12px; border-top: 1px solid var(--line); }
.order-actions:not(.is-enhanced) input, .order-actions:not(.is-enhanced) select { min-width: 0; width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--input-bg); color: var(--text); }
.order-actions:not(.is-enhanced) label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.order-actions:not(.is-enhanced) button { width: 100%; min-height: 40px; padding: 0 12px; font-size: 13px; }
.order-action-trigger { min-height: 40px; padding: 0 11px; display: inline-flex; flex: 1 1 auto; align-items: center; justify-content: center; border: 1px solid var(--blue); border-radius: 4px; background: transparent; color: var(--blue); font-size: 12px; transition-property: color, background-color, border-color, transform; transition-duration: 150ms; }
.order-action-trigger:hover { background: rgba(98,136,239,.1); color: var(--blue-hover); }
.order-action-trigger.is-danger { border-color: var(--danger); color: var(--danger); }
.order-action-trigger.is-danger:hover { background: rgba(216,93,85,.08); color: var(--danger); }
.order-action-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.order-action-dialog::backdrop { background: var(--backdrop); }
.order-action-dialog form { padding: 22px; display: grid; gap: 14px; }
.order-action-dialog header { min-height: 56px; margin: -22px -22px 4px; padding: 0 14px 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.order-action-dialog h2 { margin: 0; font-size: 20px; }
.order-action-dialog header .icon-button { color: var(--muted); }
.order-action-dialog label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.order-action-dialog input, .order-action-dialog select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--input-bg); color: var(--text); }
.order-action-dialog-buttons { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.order-action-dialog-buttons .secondary-button, .order-action-dialog-buttons .primary-button, .order-action-dialog-buttons .danger-button { width: 100%; min-height: 44px; padding-inline: 12px; }
.admin-tabs { margin-bottom: 22px; display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.admin-tabs a { min-height: 44px; padding: 0 13px; display: inline-flex; align-items: center; white-space: nowrap; border-bottom: 2px solid transparent; }
.admin-tabs a[aria-current="page"] { border-bottom-color: var(--blue); color: var(--text); }
.log-filter { margin-top: 18px; display: flex; align-items: end; gap: 10px; }
.log-filter label { min-width: 220px; color: var(--muted); font-size: 12px; }
.log-filter select { width: 100%; margin-top: 6px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--input-bg); color: var(--text); }
.log-pagination { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.log-pagination a { min-width: 34px; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 4px; }
.log-pagination a[aria-current="page"] { border-color: var(--blue); background: var(--blue); color: var(--on-accent); }
.detail-list { margin: 0; }
.detail-list div { min-height: 42px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-variant-numeric: tabular-nums; }

@media (max-width: 820px) {
  .site-header, .nav { height: 56px; }
  .nav-toggle { display: inline-grid; }
  .nav-links { position: absolute; top: 56px; left: 0; right: 0; padding: 8px; display: grid; gap: 2px; background: var(--header); box-shadow: 0 12px 30px rgba(0,0,0,.35); opacity: 0; transform: translateY(-8px); pointer-events: none; transition-property: opacity, transform; transition-duration: 160ms; }
  .nav-links.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-primary, .nav-account { display: grid; }
  .nav-links a, .nav-button { width: 100%; justify-content: flex-start; }
  .nav-links a.nav-premium { min-height: 44px; border-radius: 2px; box-shadow: none; }
  .account-plans, .price-plans { grid-template-columns: 1fr; }
  .admin-stats, .account-stats { grid-template-columns: 1fr 1fr; }
  .membership-plans { grid-template-columns: 1fr; }
  .sbp-payment-layout { grid-template-columns: 1fr; justify-items: center; gap: 28px; }
  .sbp-payment-details { width: min(356px, 100%); text-align: center; }
  .log-filter { align-items: stretch; flex-direction: column; }
  .log-filter label { min-width: 0; }
  .sbp-waiting { justify-content: center; }
  .image-grid { grid-template-columns: repeat(3,1fr); }
  .files-toolbar { grid-template-columns: 1fr; gap: 14px; }
  .gallery-search-form { width: min(100%, 360px); }
  .files-image-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1300px); }
  .upload-hero { min-height: 440px; padding: 42px 16px 22px; }
  .upload-intro h1 { font-size: 29px; }
  .upload-intro p { margin-top: 18px; font-size: 15px; }
  .upload-hint, .upload-terms { margin-left: 0; margin-right: 0; }
  .pricing-section { padding-inline: 12px; }
  .pricing-section h2 { font-size: 24px; }
  .account-plans, .price-plans { gap: 16px; }
  .plan-card h3, .price-card h3 { font-size: 23px; }
  .section-heading { align-items: start; flex-direction: column; }
  .result-card { grid-template-columns: 1fr; }
  .result-card > img { width: 100%; height: 180px; min-height: 0; }
  .result-actions { grid-template-columns: 1fr 44px; }
  .result-actions label:first-child { grid-column: 1 / -1; }
  .viewer { padding: 24px 0 64px; grid-template-columns: 1fr; }
  .viewer-stage { min-height: 340px; }
  .viewer-info { position: static; }
  .viewer-info h1 { font-size: 30px; }
  .narrow-section { width: calc(100% - 32px); padding: 64px 0; }
  .narrow-section h1 { font-size: 36px; }
  .delete-page form { flex-direction: column; gap: 4px; }
  .footer-links-primary { display: none; }
  .site-footer { min-height: 180px; }
  .page-heading { align-items: start; flex-direction: column; }
  .plans-admin .section-title { align-items: stretch; flex-direction: column; }
  .plans-admin .section-title .primary-button { width: 100%; }
  .plan-dialog-actions { flex-direction: column; }
  .plan-dialog-actions button { width: 100%; }
  .account-columns, .dashboard-grid, .settings-grid, .form-row, .smtp-server-row { grid-template-columns: 1fr; }
  .smtp-settings-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .smtp-status { align-self: flex-start; }
  .smtp-actions { flex-direction: column; }
  .smtp-actions button { width: 100%; }
  .admin-stats, .account-stats { grid-template-columns: 1fr; }
  .image-grid { grid-template-columns: repeat(2,1fr); }
  .auth-card { padding: 22px; }
  .admin-header-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .admin-header-actions .outline-button { width: 100%; }
  .token-create-form, .token-reveal > div { grid-template-columns: 1fr; }
  .token-list article { align-items: stretch; flex-direction: column; }
  .token-list article form, .token-list .compact-button { width: 100%; }
  .files-page { min-height: 620px; padding-top: 22px; }
  .files-toolbar { margin: 18px 0 24px; }
  .files-toolbar-primary { align-items: stretch; flex-direction: column; }
  .upgrade-button { width: 100%; justify-content: center; }
  .gallery-create-form { grid-template-columns: minmax(0, 1fr) auto; }
  .gallery-search-form { width: 100%; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gallery-card-body { min-height: 62px; padding: 9px 10px; }
  .gallery-detail-heading { margin-top: 18px; align-items: stretch; flex-direction: column; }
  .gallery-detail-heading .primary-button { width: 100%; }
  .files-image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .profile-page { width: min(100% - 24px, 808px); min-height: 650px; padding-top: 34px; }
  .sbp-page { width: min(100% - 24px, 760px); padding-top: 36px; }
  .sbp-page > header h1 { font-size: 27px; }
  .sbp-qr { width: min(356px, 100%); }
  .sbp-qr img { width: 100%; height: auto; }
  .profile-settings-panel > header { padding-inline: 16px; }
  .profile-settings-body { padding: 16px; }
  .profile-setting-row { padding: 9px 0; grid-template-columns: 1fr; gap: 8px; }
  .profile-url-field { grid-template-columns: minmax(0, 1fr) 48px; }
  .profile-url-field > span { grid-column: 1 / -1; border-right: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; }
  .profile-url-field input { border-radius: 0 0 0 6px; }
  .profile-url-field button { border-top: 1px solid var(--line); border-radius: 0 0 6px 0; }
  .profile-save-row > span { display: none; }
  .profile-save-row .primary-button { width: 100%; }
  .delete-account-form .danger-button { width: 100%; }
  .public-gallery-heading { margin-top: 16px; }
  .public-gallery-heading h1 { font-size: 27px; }
  .gallery-page { min-height: 620px; padding-top: 22px; }
  .gallery-action-bar { margin: 18px 0 24px; align-items: stretch; flex-direction: column; gap: 12px; }
  .gallery-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-action-button { width: 100%; }
  .gallery-search-form { width: 100%; min-width: 0; }
  .gallery-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gallery-photo-card span { min-height: 42px; padding-inline: 9px; font-size: 12px; }
  .image-lightbox-toolbar { top: max(4px, env(safe-area-inset-top)); right: max(4px, env(safe-area-inset-right)); }
  .image-lightbox-toolbar button { width: 44px; height: 44px; }
  .image-lightbox-stage img { width: calc(100% - 16px); height: calc(100% - 100px); inset: 58px 8px 42px; }
  .image-lightbox-stage figcaption, .image-lightbox-shortcuts { display: none; }
  .image-settings-panel { width: 100%; max-height: 100dvh; inset: 0; border: 0; border-radius: 0; transform: none; }
  .image-settings-panel form { min-height: 100dvh; padding: 16px; grid-template-columns: 1fr; gap: 14px; }
  .image-settings-panel header { margin: -16px -16px 0; grid-column: 1; }
  .image-settings-panel form > img { max-height: 34vh; grid-column: 1; justify-self: center; }
  .image-settings-panel label { grid-column: 1; grid-template-columns: 1fr; gap: 6px; }
  .image-settings-panel label > span { padding-top: 0; }
  .image-settings-panel .primary-button { width: 100%; grid-column: 1; }
}

@media (max-width: 410px) {
  .gallery-create-form { grid-template-columns: 1fr; }
  .gallery-create-form .primary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
