:root {
  color-scheme: dark;
  --black: #000;
  --ink: #030404;
  --panel: #070909;
  --panel-2: #0a0d0d;
  --line: rgba(255,255,255,.09);
  --line-bright: rgba(255,255,255,.16);
  --text: #f4f8f7;
  --muted: #889491;
  --dim: #596360;
  --mint: #67f7b7;
  --mint-strong: #32ee9c;
  --cyan: #45d9ff;
  --violet: #a77aff;
  --amber: #ffbd59;
  --red: #ff5d73;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 80px rgba(0,0,0,.68);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #000; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--text); background: #000; overflow-x: hidden; }
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
::selection { color: #00160d; background: var(--mint); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #020303; }
::-webkit-scrollbar-thumb { background: #222927; border: 2px solid #020303; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #35413d; }

.ambient { position: fixed; z-index: 0; width: 42vw; height: 42vw; border-radius: 50%; filter: blur(120px); opacity: .07; pointer-events: none; }
.ambient-a { top: -30vw; right: -15vw; background: var(--mint); }
.ambient-b { bottom: -32vw; left: -16vw; background: var(--violet); }
.noise { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .025; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E"); }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.button, .icon-button, .avatar-button, .view-switch button, .tag-option, .media-nav {
  position: relative;
  border: 0;
  cursor: pointer;
  user-select: none;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .25s ease, opacity .2s ease;
}
.button:active, .icon-button:active, .avatar-button:active, .view-switch button:active, .tag-option:active, .media-nav:active { transform: scale(.96); }
.button:disabled, .icon-button:disabled { cursor: not-allowed; opacity: .48; }

.button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border-radius: 10px; font-size: .84rem; font-weight: 720; letter-spacing: -.01em; white-space: nowrap; }
.button svg { width: 17px; height: 17px; }
.button-primary { color: #00150d; background: var(--mint); box-shadow: 0 0 0 1px rgba(103,247,183,.1), 0 8px 28px rgba(50,238,156,.13); }
.button-primary:hover { background: #82ffc8; box-shadow: 0 0 0 1px rgba(103,247,183,.25), 0 8px 34px rgba(50,238,156,.2); transform: translateY(-1px); }
.button-secondary { color: #d6dddb; background: #0c0f0f; border: 1px solid var(--line); }
.button-secondary:hover { color: #fff; background: #111515; border-color: var(--line-bright); transform: translateY(-1px); }
.button-danger { color: #fff; background: #da314c; box-shadow: 0 8px 30px rgba(218,49,76,.18); }
.button-danger:hover { background: #f1445e; transform: translateY(-1px); }
.button-wide { width: 100%; min-height: 49px; }
.button-wide svg { margin-left: auto; }

.icon-button { width: 39px; height: 39px; display: inline-grid; place-items: center; flex: 0 0 auto; color: #9aa5a2; background: #090b0b; border: 1px solid var(--line); border-radius: 10px; }
.icon-button:hover { color: #fff; border-color: rgba(103,247,183,.3); background: #0c1110; box-shadow: 0 0 18px rgba(103,247,183,.06); }
.icon-button svg { width: 18px; height: 18px; }

.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; color: #91a39e; font-size: .7rem; font-weight: 780; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow > span { width: 18px; height: 1px; background: var(--mint); box-shadow: 0 0 10px rgba(103,247,183,.55); }

/* Login */
.login-screen { position: relative; z-index: 2; min-height: 100vh; display: grid; place-items: center; padding: 36px 24px; background: radial-gradient(circle at 70% 42%, rgba(68,217,255,.04), transparent 32%), #000; }
.login-screen.is-leaving { animation: loginExit .5s cubic-bezier(.7,0,.3,1) forwards; }
.login-shell { width: min(100%, 1020px); min-height: 610px; position: relative; display: grid; grid-template-columns: 1.08fr .92fr; gap: 90px; align-items: center; padding: 80px 72px; border: 1px solid rgba(255,255,255,.07); border-radius: 24px; overflow: hidden; background: linear-gradient(145deg, rgba(9,12,11,.94), rgba(1,2,2,.98)); box-shadow: 0 40px 120px rgba(0,0,0,.9), inset 0 1px rgba(255,255,255,.025); }
.login-shell::before { content: ""; position: absolute; width: 420px; height: 420px; right: -210px; top: -180px; border-radius: 50%; background: var(--mint); opacity: .045; filter: blur(75px); }
.login-shell::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 49.9%, rgba(255,255,255,.045) 50%, transparent 50.1%); }
.login-brand { position: absolute; top: 30px; left: 36px; display: flex; align-items: center; gap: 11px; }
.login-brand img { filter: drop-shadow(0 0 14px rgba(103,247,183,.12)); }
.login-brand div { display: flex; align-items: baseline; gap: 7px; }
.login-brand strong { font-size: .94rem; letter-spacing: .09em; }
.login-brand span { color: #64706d; font: 700 .65rem ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .06em; }
.login-copy { position: relative; z-index: 1; }
.login-copy h1 { margin: 0; font-size: clamp(3rem, 5vw, 4.8rem); line-height: .95; letter-spacing: -.065em; font-weight: 780; }
.login-copy h1 em { color: var(--mint); font-style: normal; text-shadow: 0 0 30px rgba(103,247,183,.1); }
.login-copy > p:last-child { max-width: 430px; margin: 25px 0 0; color: var(--muted); font-size: .94rem; line-height: 1.72; }
.login-copy > p strong { color: #dce4e1; font-weight: 650; }
.key-card { position: relative; z-index: 1; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: rgba(5,7,7,.9); box-shadow: 0 24px 60px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.025); }
.key-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 27px; }
.security-glyph { width: 43px; height: 43px; display: grid; place-items: center; color: var(--mint); border: 1px solid rgba(103,247,183,.18); border-radius: 12px; background: rgba(103,247,183,.05); }
.security-glyph svg { width: 21px; height: 21px; }
.key-card h2 { margin: 0 0 4px; font-size: 1.05rem; letter-spacing: -.02em; }
.key-card-head p { margin: 0; color: var(--muted); font-size: .77rem; }
.field-label { display: block; margin: 0 0 8px; color: #adb7b4; font-size: .71rem; font-weight: 700; }
.key-input-wrap { position: relative; margin-bottom: 13px; }
.key-input-wrap input { width: 100%; height: 50px; padding: 0 48px 0 14px; color: #eaf3f0; background: #020303; border: 1px solid rgba(255,255,255,.11); border-radius: 10px; outline: none; font: 500 .86rem ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .02em; transition: border-color .2s, box-shadow .2s; }
.key-input-wrap input::placeholder { color: #3f4846; }
.key-input-wrap input:focus { border-color: rgba(103,247,183,.55); box-shadow: 0 0 0 3px rgba(103,247,183,.06); }
.reveal-key { position: absolute; right: 6px; top: 6px; width: 38px; height: 38px; border: 0; background: transparent; }
.form-status { min-height: 18px; margin: 11px 0 0; color: var(--red); font-size: .72rem; line-height: 1.4; text-align: center; }
.form-status.success { color: var(--mint); }
.secure-note { display: flex; gap: 9px; align-items: flex-start; margin-top: 16px; padding-top: 16px; color: #64706d; border-top: 1px solid rgba(255,255,255,.06); font-size: .66rem; line-height: 1.5; }
.secure-note svg { width: 15px; height: 15px; flex: 0 0 auto; color: #798581; }
.login-foot { position: absolute; right: 35px; bottom: 24px; margin: 0; color: #3f4745; font: 600 .61rem ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .07em; text-transform: uppercase; }

/* App shell */
.app-shell { position: relative; z-index: 1; min-height: 100vh; animation: appEnter .65s cubic-bezier(.16,1,.3,1) both; }
.site-header { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 5vw, 72px); border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(0,0,0,.82); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img { filter: drop-shadow(0 0 10px rgba(103,247,183,.12)); }
.brand > span { display: flex; gap: 7px; align-items: baseline; }
.brand strong { font-size: .88rem; letter-spacing: .08em; }
.brand small { color: #59625f; font: 700 .6rem ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .05em; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.live-status { height: 34px; display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; padding: 0 12px; color: #7e8a86; border: 1px solid rgba(255,255,255,.07); border-radius: 99px; font: 650 .67rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.live-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px rgba(103,247,183,.65); animation: livePulse 2.4s ease-in-out infinite; }
.avatar-button { width: 39px; height: 39px; display: grid; place-items: center; margin-left: 2px; color: #b8c4c0; background: #0d1110; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; font-size: .67rem; font-weight: 760; }
.avatar-button:hover { color: #fff; border-color: rgba(255,93,115,.35); box-shadow: 0 0 18px rgba(255,93,115,.08); }
.avatar-button i { position: absolute; right: -1px; bottom: 2px; width: 8px; height: 8px; border: 2px solid #000; border-radius: 50%; background: var(--mint); }
.sound-off { display: none; }
.sound-button[aria-pressed="false"] .sound-on { display: none; }
.sound-button[aria-pressed="false"] .sound-off { display: block; }
.refresh-button.is-spinning svg { animation: spin .75s cubic-bezier(.5,.1,.5,.9) infinite; }

main { width: min(100% - 44px, 1380px); margin: 0 auto; padding: 70px 0 90px; }
.hero-section { display: flex; align-items: flex-end; justify-content: space-between; gap: 60px; padding: 22px 0 52px; }
.hero-copy h1 { margin: 0; font-size: clamp(3.1rem, 7vw, 6.6rem); line-height: .88; letter-spacing: -.07em; font-weight: 780; }
.hero-copy h1 em { color: var(--mint); font-style: normal; }
.hero-copy > p:last-child { max-width: 580px; margin: 23px 0 0; color: var(--muted); font-size: .95rem; line-height: 1.65; }
.hero-stats { display: flex; align-items: center; flex: 0 0 auto; margin-bottom: 4px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(5,7,7,.76); }
.stat-block { min-width: 84px; text-align: center; }
.stat-block strong { display: block; color: #eef6f3; font: 660 1.12rem ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.035em; }
.stat-block span { display: block; margin-top: 4px; color: #596460; font-size: .62rem; font-weight: 720; letter-spacing: .08em; text-transform: uppercase; }
.stat-divider { width: 1px; height: 28px; margin: 0 10px; background: var(--line); }

.archive-panel { padding-top: 27px; border-top: 1px solid rgba(255,255,255,.08); }
.archive-heading { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 20px; }
.archive-heading h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.035em; }
.archive-heading p { margin: 6px 0 0; color: var(--dim); font-size: .73rem; }
.view-switch { display: flex; gap: 3px; padding: 3px; background: #070909; border: 1px solid var(--line); border-radius: 10px; }
.view-switch button { height: 33px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; color: #68726f; background: transparent; border-radius: 7px; font-size: .68rem; font-weight: 670; }
.view-switch button svg { width: 15px; height: 15px; }
.view-switch button[aria-pressed="true"] { color: #dff7ee; background: #121716; box-shadow: inset 0 0 0 1px rgba(103,247,183,.11); }
.view-switch button:hover:not([aria-pressed="true"]) { color: #a6b1ae; }

.filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) 190px 140px; gap: 9px; margin-bottom: 12px; }
.search-box, .select-wrap { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 13px; color: #5f6b67; background: #050707; border: 1px solid var(--line); border-radius: 10px; transition: border-color .2s, background-color .2s, box-shadow .2s; }
.search-box:focus-within, .select-wrap:focus-within { border-color: rgba(103,247,183,.35); background: #070a09; box-shadow: 0 0 0 3px rgba(103,247,183,.035); }
.search-box > svg, .select-wrap > svg:first-child { width: 17px; height: 17px; flex: 0 0 auto; }
.search-box input, .select-wrap select { width: 100%; min-width: 0; height: 100%; padding: 0; color: #dce4e1; background: transparent; border: 0; outline: 0; font-size: .77rem; }
.search-box input::placeholder { color: #4d5754; }
.search-box input::-webkit-search-cancel-button { filter: invert(1); opacity: .35; }
.search-box kbd { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; color: #515b58; background: #0d1010; border: 1px solid rgba(255,255,255,.07); border-radius: 5px; font: 500 .65rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 18px; cursor: pointer; }
.select-wrap select option { color: #dce4e1; background: #080a0a; }
.select-wrap .chevron { position: absolute; right: 10px; width: 14px; height: 14px; pointer-events: none; }
.compact { padding-left: 12px; }

.sync-line { display: flex; align-items: center; justify-content: space-between; min-height: 31px; margin-bottom: 14px; color: #46504d; font-size: .63rem; }
.sync-line > span { display: flex; align-items: center; gap: 5px; }
.sync-line i { width: 5px; height: 5px; margin-right: 3px; border-radius: 50%; background: #4e625b; }
.sync-line b { color: #64736e; font-weight: 680; }
.sync-line.is-syncing i { background: var(--cyan); box-shadow: 0 0 8px rgba(69,217,255,.5); animation: syncBlink .75s ease-in-out infinite; }
.sync-line.is-syncing b { color: #7ddfff; }

/* Build collection */
.build-collection { position: relative; min-height: 230px; transition: opacity .2s ease, transform .25s ease; }
.build-collection.view-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.build-collection.is-refreshing { opacity: .55; transform: translateY(3px); pointer-events: none; }
.build-card { min-width: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; background: #050707; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; box-shadow: 0 12px 35px rgba(0,0,0,.18); animation: cardIn .48s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--order, 0) * 38ms); transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s ease, box-shadow .25s ease; }
.build-card:hover { transform: translateY(-4px); border-color: rgba(103,247,183,.22); box-shadow: 0 18px 45px rgba(0,0,0,.38), 0 0 24px rgba(103,247,183,.035); }
.card-media { width: 100%; position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; padding: 0; color: inherit; background: #080b0a; border: 0; cursor: pointer; }
.card-media::after { content: ""; position: absolute; inset: auto 0 0; height: 44%; pointer-events: none; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.card-media img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .55s cubic-bezier(.2,.7,.2,1), filter .35s; }
.build-card:hover .card-media img { transform: scale(1.035); filter: saturate(1.08); }
.card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, rgba(103,247,183,.075), transparent 35%), linear-gradient(135deg, #060a08, #030404); }
.card-placeholder::before, .card-placeholder::after { content: ""; position: absolute; border: 1px solid rgba(103,247,183,.09); transform: rotate(45deg); }
.card-placeholder::before { width: 72px; height: 72px; }
.card-placeholder::after { width: 45px; height: 45px; }
.card-placeholder img { position: relative; z-index: 1; width: 48px; height: 48px; opacity: .45; }
.image-count { position: absolute; z-index: 2; right: 10px; bottom: 9px; height: 24px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; color: #dce7e3; background: rgba(0,0,0,.72); border: 1px solid rgba(255,255,255,.12); border-radius: 7px; backdrop-filter: blur(7px); font: 620 .61rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.image-count svg { width: 12px; height: 12px; }
.card-content { min-height: 210px; display: flex; flex: 1; flex-direction: column; padding: 17px; }
.tag-row { min-height: 22px; display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.tag { height: 20px; display: inline-flex; align-items: center; padding: 0 7px; color: #83ab9c; background: rgba(103,247,183,.055); border: 1px solid rgba(103,247,183,.1); border-radius: 5px; font: 720 .54rem ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.tag[data-tone="1"] { color: #80dff5; background: rgba(69,217,255,.055); border-color: rgba(69,217,255,.12); }
.tag[data-tone="2"] { color: #bca1f4; background: rgba(167,122,255,.055); border-color: rgba(167,122,255,.12); }
.tag[data-tone="3"] { color: #e9b862; background: rgba(255,189,89,.05); border-color: rgba(255,189,89,.12); }
.card-title { margin: 0 0 7px; color: #f0f5f3; font-size: 1.01rem; font-weight: 710; letter-spacing: -.03em; overflow-wrap: anywhere; }
.card-description { display: -webkit-box; overflow: hidden; margin: 0; color: #74807c; font-size: .73rem; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-meta { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-top: 14px; color: #56615d; font-size: .63rem; }
.card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.card-meta svg { width: 13px; height: 13px; }
.card-actions { display: flex; gap: 7px; margin-top: auto; padding-top: 16px; }
.card-actions .button { min-height: 36px; padding: 0 12px; font-size: .68rem; }
.card-actions .primary-action { flex: 1; }
.card-actions .icon-button { width: 36px; height: 36px; }
.danger-icon:hover, .card-actions .delete-card:hover { color: #ff8294; border-color: rgba(255,93,115,.34); background: rgba(255,93,115,.055); box-shadow: 0 0 18px rgba(255,93,115,.06); }

.build-collection.view-list { display: flex; flex-direction: column; gap: 8px; }
.view-list .build-card { min-height: 116px; display: grid; grid-template-columns: 176px minmax(0,1fr); }
.view-list .build-card:hover { transform: translateX(3px); }
.view-list .card-media { height: 100%; aspect-ratio: auto; }
.view-list .card-content { min-height: 0; display: grid; grid-template-columns: minmax(200px, 1fr) minmax(140px,.65fr) auto; grid-template-rows: auto auto; column-gap: 24px; align-content: center; padding: 15px 17px; }
.view-list .tag-row { grid-column: 1; grid-row: 1; margin: 0 0 7px; }
.view-list .card-title { grid-column: 1; grid-row: 2; margin: 0; }
.view-list .card-description { grid-column: 2; grid-row: 1 / 3; align-self: center; -webkit-line-clamp: 2; }
.view-list .card-meta { grid-column: 3; grid-row: 1; align-self: center; justify-content: flex-end; margin: 0; white-space: nowrap; }
.view-list .card-actions { grid-column: 3; grid-row: 2; justify-content: flex-end; margin: 4px 0 0; padding: 0; }
.view-list .primary-action { flex: 0 auto; }
.view-list .image-count { right: 8px; bottom: 8px; }

.skeleton { min-height: 390px; pointer-events: none; }
.skeleton .card-media { background: #080a0a; }
.skeleton .card-media::before, .skeleton .line { content: ""; display: block; border-radius: 6px; background: linear-gradient(90deg, #090c0b 0%, #111614 45%, #090c0b 90%); background-size: 220% 100%; animation: shimmer 1.25s linear infinite; }
.skeleton .card-media::before { position: absolute; inset: 0; border-radius: 0; }
.skeleton .line { height: 9px; margin-bottom: 10px; }
.skeleton .line.short { width: 37%; }
.skeleton .line.title { width: 70%; height: 15px; margin-top: 5px; }

.empty-state { min-height: 330px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed rgba(255,255,255,.09); border-radius: 14px; background: rgba(5,7,7,.5); animation: fadeIn .35s ease both; }
.empty-cube { width: 57px; height: 57px; position: relative; margin-bottom: 21px; transform: rotate(30deg) skew(-5deg); border: 1px solid rgba(103,247,183,.26); box-shadow: inset 0 0 24px rgba(103,247,183,.035), 0 0 22px rgba(103,247,183,.03); }
.empty-cube::before, .empty-cube::after { content: ""; position: absolute; border: 1px solid rgba(103,247,183,.15); }
.empty-cube::before { inset: 10px; }
.empty-cube::after { inset: 21px; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.empty-state h3 { margin: 0 0 8px; font-size: 1rem; }
.empty-state p { max-width: 350px; margin: 0 0 20px; color: var(--muted); font-size: .75rem; line-height: 1.6; }

footer { min-height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 5vw, 72px); color: #3e4744; border-top: 1px solid rgba(255,255,255,.055); font-size: .62rem; }
footer i { color: var(--mint); font-style: normal; }
footer strong { color: #5b6863; }

/* Dialogs */
.modal { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 22px; color: var(--text); background: rgba(0,0,0,.78); border: 0; backdrop-filter: blur(14px); overflow: auto; }
.modal::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(14px); }
.modal[open] { display: grid; place-items: center; animation: modalBackdrop .24s ease both; }
.modal[open] .modal-card { animation: modalIn .42s cubic-bezier(.16,1,.3,1) both; }
.modal-card { width: min(100%, 820px); max-height: calc(100vh - 44px); display: flex; flex-direction: column; overflow: hidden; color: var(--text); background: #060808; border: 1px solid rgba(255,255,255,.11); border-radius: 18px; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; gap: 30px; padding: 25px 26px 21px; border-bottom: 1px solid var(--line); }
.modal-head .eyebrow { margin-bottom: 8px; }
.modal-head h2 { margin: 0; font-size: 1.55rem; letter-spacing: -.045em; }
.modal-head p:last-child { margin: 7px 0 0; color: var(--muted); font-size: .75rem; }
.close-modal { background: transparent; }
.upload-scroll { overflow-y: auto; padding: 24px 26px 8px; }
.form-grid { display: grid; gap: 12px; }
.two-columns { grid-template-columns: 1fr 1fr; }
.three-columns { grid-template-columns: 1fr 1fr .7fr; }
.input-group { display: block; position: relative; margin-bottom: 17px; }
.input-group > span, .tag-fieldset legend { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; color: #aeb8b5; font-size: .68rem; font-weight: 690; }
.input-group > span b, .tag-fieldset legend > b { color: var(--mint); }
.input-group input, .input-group textarea { width: 100%; color: #dfe8e5; background: #020303; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; outline: none; font-size: .76rem; transition: border-color .2s, box-shadow .2s; }
.input-group input { height: 43px; padding: 0 12px; }
.input-group textarea { min-height: 80px; padding: 11px 12px; line-height: 1.55; resize: vertical; }
.input-group input:focus, .input-group textarea:focus { border-color: rgba(103,247,183,.43); box-shadow: 0 0 0 3px rgba(103,247,183,.04); }
.input-group input::placeholder, .input-group textarea::placeholder { color: #3e4744; }
.input-group > small { position: absolute; right: 8px; bottom: 7px; color: #47514e; font-size: .58rem; }
.input-group > small b { font-weight: 600; }
.tag-fieldset { margin: 0 0 19px; padding: 0; border: 0; }
.tag-fieldset legend { width: 100%; }
.tag-fieldset legend small { margin-left: auto; color: #4c5653; font-weight: 500; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-option { height: 28px; padding: 0 10px; color: #6f7c77; background: #050707; border: 1px solid rgba(255,255,255,.08); border-radius: 7px; font: 690 .61rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.tag-option:hover { color: #aab6b2; border-color: rgba(255,255,255,.16); }
.tag-option[aria-pressed="true"] { color: #b9ffe0; background: rgba(103,247,183,.07); border-color: rgba(103,247,183,.28); box-shadow: 0 0 15px rgba(103,247,183,.035); }
.drop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drop-zone { min-height: 170px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; background: #030505; border: 1px dashed rgba(255,255,255,.15); border-radius: 12px; cursor: pointer; transition: border-color .2s, background-color .2s, transform .2s, box-shadow .2s; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: rgba(103,247,183,.45); background: rgba(103,247,183,.025); box-shadow: inset 0 0 30px rgba(103,247,183,.02); }
.drop-zone.is-dragging { transform: scale(.99); }
.drop-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 11px; color: var(--mint); background: rgba(103,247,183,.055); border: 1px solid rgba(103,247,183,.13); border-radius: 10px; }
.drop-icon svg { width: 19px; height: 19px; }
.drop-zone strong { color: #d9e3df; font-size: .74rem; }
.drop-zone strong b { color: var(--mint); }
.drop-zone p { margin: 7px 0 6px; color: #5b6662; font-size: .66rem; }
.drop-zone p span { color: #90eac2; }
.drop-zone > small { color: #3e4744; font-size: .56rem; }
.file-pill { max-width: 90%; margin-top: 12px; padding: 6px 9px; overflow: hidden; color: #b8c7c2; background: #0a100e; border: 1px solid rgba(103,247,183,.14); border-radius: 7px; font: 600 .58rem ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.image-previews { display: flex; justify-content: center; gap: 5px; max-width: 100%; margin-top: 11px; }
.image-previews img { width: 34px; height: 34px; object-fit: cover; border: 1px solid rgba(255,255,255,.14); border-radius: 6px; }
.paste-details { margin: 14px 0 7px; }
.paste-details summary { width: fit-content; color: #63706c; cursor: pointer; font-size: .65rem; }
.paste-details[open] summary { margin-bottom: 12px; color: #8e9d98; }
.code-input textarea { min-height: 150px; font: 500 .67rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.upload-progress { height: 2px; overflow: hidden; background: #0b0e0d; }
.upload-progress span { width: 35%; height: 100%; display: block; background: var(--mint); box-shadow: 0 0 12px var(--mint); animation: uploadBar 1.2s ease-in-out infinite; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 17px 26px; border-top: 1px solid var(--line); background: #050707; }

.detail-card { width: min(100%, 1080px); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(410px,.95fr); }
.detail-media { min-height: 650px; position: relative; overflow: hidden; background: #030404; }
.detail-media::after { content: ""; position: absolute; inset: auto 0 0; height: 35%; pointer-events: none; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.detail-media > img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; animation: imageEnter .35s ease both; }
.detail-placeholder { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, rgba(103,247,183,.075), transparent 28%), #030504; }
.detail-placeholder img { width: 84px; height: 84px; opacity: .5; filter: drop-shadow(0 0 24px rgba(103,247,183,.1)); }
.detail-close { position: absolute; z-index: 4; top: 14px; left: 14px; color: #e2eae7; background: rgba(0,0,0,.6); border-color: rgba(255,255,255,.18); backdrop-filter: blur(10px); }
.media-nav { width: 38px; height: 38px; position: absolute; z-index: 3; top: 50%; display: grid; place-items: center; color: #eef5f3; background: rgba(0,0,0,.56); border: 1px solid rgba(255,255,255,.15); border-radius: 50%; backdrop-filter: blur(8px); }
.media-nav:hover { background: rgba(0,0,0,.78); border-color: rgba(103,247,183,.3); }
.media-prev { left: 14px; }
.media-next { right: 14px; }
.media-dots { position: absolute; z-index: 3; left: 50%; bottom: 17px; display: flex; gap: 5px; transform: translateX(-50%); }
.media-dots button { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.35); cursor: pointer; transition: width .2s, background .2s; }
.media-dots button.active { width: 18px; border-radius: 9px; background: var(--mint); box-shadow: 0 0 8px rgba(103,247,183,.45); }
.detail-content { min-width: 0; display: flex; flex-direction: column; overflow: auto; padding: 28px; }
.detail-title-row { display: flex; justify-content: space-between; gap: 20px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.detail-title-row h2 { margin: 0; font-size: 1.7rem; line-height: 1.1; letter-spacing: -.05em; overflow-wrap: anywhere; }
.detail-title-row p { margin: 8px 0 0; color: #61706b; font-size: .68rem; }
.detail-description { margin: 20px 0 0; color: #8d9995; font-size: .76rem; line-height: 1.65; white-space: pre-wrap; }
.detail-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 20px 0; }
.detail-fact { padding: 11px; background: #040606; border: 1px solid rgba(255,255,255,.07); border-radius: 8px; }
.detail-fact span { display: block; margin-bottom: 5px; color: #4e5955; font-size: .53rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.detail-fact strong { display: block; overflow: hidden; color: #bac5c1; font: 600 .67rem ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.code-panel { min-height: 250px; display: flex; flex-direction: column; overflow: hidden; background: #010202; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; }
.code-head { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 11px; color: #4e5955; background: #070909; border-bottom: 1px solid rgba(255,255,255,.07); font-size: .55rem; }
.code-head > div { display: flex; align-items: center; min-width: 0; }
.code-head strong { margin-left: 8px; overflow: hidden; color: #6d7874; font: 550 .56rem ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.code-dot { width: 7px; height: 7px; display: inline-block; margin-right: 4px; border-radius: 50%; }
.code-dot.red { background: #d95464; }.code-dot.amber { background: #dca845; }.code-dot.green { background: #4bbd78; }
.code-panel pre { flex: 1; max-height: 280px; margin: 0; overflow: auto; padding: 14px; color: #79cba4; font: 500 .59rem/1.62 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-panel.is-loading pre { color: #3f4946; }
.code-panel.is-loading code { animation: codePulse 1s ease-in-out infinite; }
.detail-actions { display: flex; gap: 8px; margin-top: 16px; }
.detail-actions .copy-button { flex: 1; }

.confirm-card { width: min(100%, 430px); align-items: center; padding: 30px; text-align: center; }
.confirm-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 18px; color: #ff7d91; background: rgba(255,93,115,.07); border: 1px solid rgba(255,93,115,.18); border-radius: 14px; }
.confirm-icon svg { width: 24px; height: 24px; }
.confirm-card h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.035em; }
.confirm-card p { margin: 10px 0 25px; color: var(--muted); font-size: .74rem; line-height: 1.6; }
.confirm-card p strong { color: #dce5e2; }
.confirm-card .modal-actions { width: 100%; padding: 0; border: 0; background: transparent; }
.confirm-card .modal-actions .button { flex: 1; }

.toast-stack { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { min-width: 240px; max-width: min(390px, calc(100vw - 44px)); display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #cbd6d2; background: rgba(8,11,10,.96); border: 1px solid rgba(255,255,255,.11); border-radius: 10px; box-shadow: 0 16px 45px rgba(0,0,0,.55); backdrop-filter: blur(15px); font-size: .7rem; animation: toastIn .35s cubic-bezier(.16,1,.3,1) both; }
.toast::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--mint); box-shadow: 0 0 9px rgba(103,247,183,.5); }
.toast.error::before { background: var(--red); box-shadow: 0 0 9px rgba(255,93,115,.5); }
.toast.is-leaving { animation: toastOut .25s ease forwards; }

@keyframes appEnter { from { opacity: 0; transform: translateY(8px); } }
@keyframes loginExit { to { opacity: 0; transform: scale(1.012); visibility: hidden; } }
@keyframes livePulse { 50% { opacity: .45; box-shadow: 0 0 3px rgba(103,247,183,.2); } }
@keyframes syncBlink { 50% { opacity: .25; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.992); } }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalBackdrop { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes imageEnter { from { opacity: .4; transform: scale(1.015); } }
@keyframes uploadBar { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
@keyframes codePulse { 50% { opacity: .38; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(18px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(12px); } }

@media (max-width: 1050px) {
  .login-shell { gap: 48px; padding: 74px 48px; }
  .build-collection.view-gallery { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .view-list .build-card { grid-template-columns: 145px minmax(0,1fr); }
  .view-list .card-content { grid-template-columns: minmax(180px,1fr) auto; }
  .view-list .card-description { display: none; }
  .view-list .card-meta, .view-list .card-actions { grid-column: 2; }
  .detail-card { grid-template-columns: .9fr 1.1fr; }
  .detail-media { min-height: 620px; }
}

@media (max-width: 780px) {
  .login-screen { padding: 12px; }
  .login-shell { min-height: calc(100vh - 24px); grid-template-columns: 1fr; gap: 35px; padding: 94px 24px 64px; border-radius: 18px; }
  .login-shell::after { display: none; }
  .login-copy h1 { font-size: clamp(2.7rem, 13vw, 4.2rem); }
  .login-copy > p:last-child { margin-top: 18px; }
  .key-card { padding: 22px; }
  .site-header { padding: 0 17px; }
  .live-status, .header-upload span, .sound-button { display: none; }
  .header-upload { width: 39px; min-height: 39px; padding: 0; }
  main { width: min(100% - 28px, 1380px); padding-top: 42px; }
  .hero-section { display: block; padding-bottom: 38px; }
  .hero-copy h1 { font-size: clamp(3.5rem, 17vw, 6rem); }
  .hero-stats { width: 100%; justify-content: space-evenly; margin-top: 30px; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .build-collection.view-gallery { grid-template-columns: 1fr; }
  .view-list .build-card { min-height: 145px; grid-template-columns: 120px minmax(0,1fr); }
  .view-list .card-content { display: flex; padding: 13px; }
  .view-list .tag-row { margin-bottom: 7px; }
  .view-list .card-title { margin-bottom: 6px; }
  .view-list .card-meta { justify-content: flex-start; margin-top: 6px; }
  .view-list .card-actions { justify-content: flex-start; margin-top: auto; padding-top: 8px; }
  .view-list .card-actions .primary-action span { display: none; }
  .view-list .card-actions .primary-action { width: 36px; flex: 0 0 auto; padding: 0; }
  .modal { padding: 10px; }
  .modal-card { max-height: calc(100vh - 20px); }
  .two-columns, .three-columns, .drop-grid { grid-template-columns: 1fr; }
  .detail-card { display: flex; }
  .detail-media { min-height: 260px; flex: 0 0 260px; }
  .detail-content { padding: 22px; }
  .detail-facts { grid-template-columns: repeat(2,1fr); }
  footer { display: none; }
}

@media (max-width: 500px) {
  .brand small { display: none; }
  .hero-copy > p:last-child { font-size: .84rem; }
  .hero-stats { padding: 14px 8px; }
  .stat-block { min-width: 70px; }
  .stat-divider { margin: 0 3px; }
  .archive-heading { align-items: flex-start; }
  .view-switch button { width: 34px; justify-content: center; padding: 0; }
  .view-switch button span { display: none; }
  .sync-line small { display: none; }
  .filter-bar { grid-template-columns: 1fr; }
  .search-box, .select-wrap { grid-column: auto; }
  .view-list .build-card { min-height: 132px; grid-template-columns: 105px minmax(0,1fr); }
  .view-list .tag-row .tag:nth-child(n+3), .view-list .card-meta span:nth-child(n+2), .view-list .card-actions .download-card { display: none; }
  .card-content { min-height: 205px; }
  .modal-head, .upload-scroll, .detail-content { padding-left: 17px; padding-right: 17px; }
  .modal-actions { padding-left: 17px; padding-right: 17px; }
  .detail-media { min-height: 220px; flex-basis: 220px; }
  .detail-title-row h2 { font-size: 1.45rem; }
  .detail-facts { grid-template-columns: 1fr 1fr; }
  .detail-actions { flex-direction: column; }
  .confirm-card { padding: 26px 18px; }
  .confirm-card .modal-actions { flex-direction: column-reverse; }
  .toast-stack { right: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
