 :root {
  color-scheme: dark;
  --ink: #f1f3ed;
  --muted: #929b91;
  --panel: #151a16;
  --panel-raised: #1c231d;
  --line: rgba(227, 236, 224, .11);
  --accent: #bcf36b;
  --accent-ink: #18200f;
  --mono: "DM Mono", monospace;
  --sans: "Manrope", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #101411; color: var(--ink); font-family: var(--sans); }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 30px; border-bottom: 1px solid var(--line); background: #121713; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 1rem; font-weight: 800; letter-spacing: -.05em; }
.brand-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: .9rem; }
.topline { margin: 0; color: #768075; font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.account-area { display: flex; align-items: center; gap: 10px; }
.account-label { max-width: 190px; overflow: hidden; color: var(--muted); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.button { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font-size: .78rem; font-weight: 700; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.button:hover { transform: translateY(-1px); border-color: rgba(188,243,107,.55); }
.button-accent { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button-quiet { color: #c7cec3; }
.button-wide { width: 100%; min-height: 44px; }
.workspace { display: grid; grid-template-columns: minmax(400px, .95fr) minmax(440px, 1.05fr); gap: 1px; min-height: calc(100vh - 76px); background: var(--line); }
.map-panel, .gallery-panel { position: relative; min-width: 0; background: var(--panel); }
.map-panel { display: flex; min-height: calc(100vh - 76px); flex-direction: column; }
.map-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 28px 28px 19px; }
.section-kicker { display: block; margin-bottom: 8px; color: #90a282; font: 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
.map-heading h1 { margin-bottom: 0; font-size: clamp(1.45rem, 2.4vw, 2.2rem); letter-spacing: -.065em; line-height: 1.05; }
.map-heading p { max-width: 210px; margin-bottom: 0; color: var(--muted); font-size: .74rem; line-height: 1.6; }
#wallplace-map { flex: 1; min-height: 480px; background: #202720; }
.leaflet-container { color: #273027; font-family: var(--sans); }
.leaflet-control-zoom a { background: #182019 !important; color: var(--ink) !important; border-color: #343e34 !important; }
.leaflet-control-attribution { background: rgba(16,20,17,.8) !important; color: #abb4a9 !important; }
.leaflet-control-attribution a { color: var(--accent) !important; }
.wallplace-marker { position: relative; display: block; width: 24px; height: 24px; border: 2px solid #101411; border-radius: 50% 50% 50% 4px; background: var(--accent); box-shadow: 0 3px 15px rgba(0,0,0,.35); transform: rotate(-45deg); }
.wallplace-marker::after { content: ""; position: absolute; top: 7px; left: 7px; width: 6px; height: 6px; border-radius: 50%; background: #223016; }
.map-hint { position: absolute; z-index: 500; bottom: 19px; left: 18px; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 7px; background: rgba(18,23,19,.91); color: #cbd2c7; font-size: .69rem; pointer-events: none; backdrop-filter: blur(10px); }
.hint-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.map-status { position: absolute; z-index: 500; top: 110px; right: 20px; max-width: 240px; padding: 8px 10px; border-radius: 6px; background: rgba(18,23,19,.9); color: #aeb6ac; font: 10px var(--mono); pointer-events: none; }
.gallery-panel { display: flex; flex-direction: column; padding: 28px 28px 18px; }
.gallery-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.gallery-heading h2 { margin-bottom: 0; font-size: 1.45rem; letter-spacing: -.055em; }
.count-pill { padding: 6px 9px; border: 1px solid var(--line); border-radius: 30px; color: #c2cabe; font: 10px var(--mono); white-space: nowrap; }
.video-grid { display: grid; flex: 1; align-content: start; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 20px 0; }
.video-tile { position: relative; min-width: 0; overflow: hidden; aspect-ratio: 16/10; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; background: #080b09; isolation: isolate; }
.video-tile video { display: block; width: 100%; height: 100%; object-fit: cover; background: #080b09; }
.tile-index { position: absolute; z-index: 2; top: 10px; left: 10px; padding: 4px 7px; border: 1px solid rgba(255,255,255,.14); border-radius: 5px; background: rgba(10,13,10,.66); color: #e5e9df; font: 9px var(--mono); pointer-events: none; }
.tile-inspector { position: absolute; z-index: 4; inset: 0 0 0 auto; display: flex; width: min(72%, 250px); flex-direction: column; justify-content: end; padding: 13px; background: linear-gradient(90deg, transparent, rgba(8,11,9,.94) 34%); opacity: 0; transform: translateX(7px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
.video-tile:hover .tile-inspector, .video-tile:focus-within .tile-inspector, .video-tile.is-inspected .tile-inspector { opacity: 1; transform: translateX(0); pointer-events: auto; }
.tile-details { margin: 0 0 auto; padding-left: 16px; }
.tile-name {
  margin: 0 0 7px;
  overflow: hidden;
  color: white;
  font-size: 4px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  padding: 2px 4px;
}
.tile-creator, .tile-url { display: block; margin: 0 0 7px; overflow: hidden; color: #c3cbc0; font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.tile-url { color: var(--accent); text-decoration: none; }
.tile-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 16px; }
.tile-action { min-height: 30px; padding: 0 9px; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; background: rgba(13,17,13,.78); color: white; font-size: .64rem; font-weight: 700; }
.tile-action:hover { border-color: var(--accent); }
.empty-state { grid-column: 1/-1; display: grid; min-height: 260px; place-content: center; justify-items: center; padding: 28px; border: 1px dashed rgba(255,255,255,.13); border-radius: 12px; text-align: center; }
.empty-symbol { display: grid; width: 42px; height: 42px; margin-bottom: 12px; place-items: center; border: 1px solid rgba(188,243,107,.24); border-radius: 50%; color: var(--accent); font-size: 1.25rem; }
.empty-state h3 { margin-bottom: 7px; font-size: .92rem; }
.empty-state p { max-width: 270px; margin-bottom: 0; color: var(--muted); font-size: .72rem; line-height: 1.6; }
.gallery-footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 13px; border-top: 1px solid var(--line); color: #727c71; font: 9px var(--mono); }
.dialog-card { width: min(440px, calc(100vw - 30px)); padding: 0; border: 1px solid #354035; border-radius: 14px; background: #171d18; color: var(--ink); box-shadow: 0 28px 90px rgba(0,0,0,.58); }
.dialog-card::backdrop { background: rgba(4,7,5,.72); backdrop-filter: blur(3px); }
.dialog-top { display: flex; align-items: start; justify-content: space-between; padding: 22px 22px 5px; }
.dialog-top h2 { margin: 0 0 7px; font-size: 1.25rem; letter-spacing: -.05em; }
.dialog-copy { margin: 0; color: var(--muted); font-size: .72rem; }
.close-button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: #dce2d8; font-size: 1.25rem; line-height: 1; }
.stack-form { display: grid; gap: 13px; padding: 17px 22px 22px; }
.stack-form label { display: grid; gap: 7px; color: #d9ded6; font-size: .72rem; font-weight: 700; }
.stack-form input { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid #374137; border-radius: 7px; outline: none; background: #101511; color: white; font-size: .77rem; }
.stack-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(188,243,107,.1); }
.stack-form small { color: #879184; font-size: .63rem; font-weight: 400; line-height: 1.5; }
.creator-hint, .form-message { min-height: 1em; margin: 0; color: #aeb8a9; font-size: .68rem; line-height: 1.5; }
.form-message[data-error="true"] { color: #ff9e8f; }
.text-button { justify-self: center; border: 0; background: transparent; color: var(--accent); font-size: .7rem; }
.text-button[hidden] { display: none; }
@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .map-panel { min-height: 68vh; }
  #wallplace-map { min-height: 55vh; }
  .gallery-panel { min-height: 55vh; }
}
@media (max-width: 640px) {
  .topbar { height: auto; min-height: 68px; flex-wrap: wrap; gap: 8px; padding: 12px 15px; }
  .topline { display: none; }
  .account-area { gap: 6px; }
  .account-label { display: none; }
  .button { min-height: 35px; padding: 0 10px; font-size: .68rem; }
  .workspace { min-height: calc(100vh - 68px); }
  .map-panel { min-height: 60vh; }
  .map-heading { align-items: start; flex-direction: column; padding: 22px 17px 14px; }
  .map-heading p { max-width: 290px; }
  #wallplace-map { min-height: 48vh; }
  .gallery-panel { padding: 23px 15px 15px; }
  .video-grid { gap: 8px; padding: 14px 0; }
  .gallery-footer { flex-direction: column; }
  .map-hint { bottom: 13px; left: 10px; font-size: .61rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
