:root {
  --bg: #040508;
  --surface: #06080e;
  --border: #111827;
  --text: #c0d8e0;
  --muted: #2a4a55;
  --accent: #00f2ff;
  --accent-glow: rgba(0,242,255,0.35);
  --accent-dim: rgba(0,242,255,0.08);
  --online: #39ff14;
  --online-glow: rgba(57,255,20,0.4);
  --spider: #9b30ff;
  --spider-glow: rgba(155,48,255,0.3);
  --spider-dim: rgba(155,48,255,0.07);
  --spider-border: rgba(155,48,255,0.25);
  --files: #ff9500;
  --files-glow: rgba(255,149,0,0.3);
  --files-dim: rgba(255,149,0,0.07);
  --files-border: rgba(255,149,0,0.25);
  --tools: #00ff9b;
  --tools-glow: rgba(0,255,155,0.3);
  --tools-dim: rgba(0,255,155,0.07);
  --tools-border: rgba(0,255,155,0.25);
  --bay: #ff3333;
  --bay-glow: rgba(255,51,51,0.3);
  --bay-dim: rgba(255,51,51,0.07);
  --bay-border: rgba(255,51,51,0.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
  z-index: 999;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(0,200,255,0.07) 0%, transparent 65%),
    radial-gradient(ellipse 40% 30% at 15% 85%, rgba(57,255,20,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 85% 80%, rgba(155,48,255,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

body {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ctext y='20' font-size='20'%3E💀%3C/text%3E%3C/svg%3E") 12 12, crosshair;
}
a, button, [role='button'] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ctext y='20' font-size='20'%3E👻%3C/text%3E%3C/svg%3E") 12 12, pointer;
}

/* ── DRIPS ── */
.drip-container {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  pointer-events: none; z-index: 998;
}
.drip {
  width: 2px;
  background: linear-gradient(to bottom, rgba(0,200,255,0.45), transparent);
  border-radius: 0 0 3px 3px;
  animation: drip linear infinite;
  opacity: 0;
}
@keyframes drip {
  0%   { height: 0; transform: translateY(-10px); opacity: 0; }
  15%  { opacity: 0.3; }
  100% { height: 70px; transform: translateY(0); opacity: 0; }
}

/* ── WARNING TAPE ── */
.warning-tape {
  position: relative; z-index: 1;
  background: repeating-linear-gradient(-45deg, #03060d, #03060d 10px, #050b14 10px, #050b14 20px);
  border-bottom: 1px solid rgba(0,180,255,0.18);
  padding: 7px; text-align: center;
  font-size: 0.6rem; letter-spacing: 0.5em;
  color: rgba(0,180,255,0.45); text-transform: uppercase;
}

/* ── AUTH BAR ── */
#auth-bar {
  position: fixed; top: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: rgba(4,5,8,0.92);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0,180,255,0.15);
  border-top: none; border-right: none;
  backdrop-filter: blur(8px);
}
#auth-user-label { font-size: 0.62rem; letter-spacing: 0.2em; color: var(--accent); opacity: 0.8; }
.auth-btn {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.58rem; letter-spacing: 0.3em; color: var(--muted);
  border: 1px solid rgba(0,180,255,0.15); background: transparent;
  padding: 4px 12px; transition: all 0.2s; text-transform: uppercase;
}
.auth-btn:hover { color: var(--accent); border-color: rgba(0,242,255,0.4); }
.auth-btn.primary { color: var(--accent); border-color: rgba(0,242,255,0.3); }

/* ── MODALS (login + tile editor share this) ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 2000;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }

.login-box {
  background: var(--surface);
  border: 1px solid rgba(0,180,255,0.25);
  padding: 2.5rem 2rem;
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 1.1rem;
  position: relative;
  animation: modalIn 0.2s ease;
  max-height: 88vh;
  overflow-y: auto;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-logo-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.login-ghost { font-size: 3.5rem; animation: ghostFloat 5.5s ease-in-out infinite; }
.login-title {
  font-family: 'Cinzel', serif; font-size: 1.3rem; font-weight: 900;
  color: var(--accent); text-shadow: 0 0 20px var(--accent-glow);
  letter-spacing: 0.15em; text-align: center;
}
.login-sub { text-align: center; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.1em; margin-top: -0.5rem; }
.login-field { display: flex; flex-direction: column; gap: 0.4rem; }
.login-field label { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }
.login-field input, .login-field select, .login-field textarea {
  background: var(--bg); border: 1px solid rgba(0,180,255,0.2);
  color: var(--text); font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem; padding: 0.6rem 0.85rem; outline: none;
  border-radius: 2px; transition: border-color 0.2s; width: 100%;
}
.login-field input:focus, .login-field select:focus, .login-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 12px rgba(0,242,255,0.1); }
.login-btn {
  background: rgba(0,242,255,0.05); border: 1px solid rgba(0,180,255,0.25);
  color: var(--accent); font-family: 'Share Tech Mono', monospace;
  font-size: 0.88rem; padding: 0.65rem; letter-spacing: 0.12em;
  border-radius: 2px; transition: all 0.15s; width: 100%;
}
.login-btn:hover { background: rgba(0,242,255,0.1); box-shadow: 0 0 16px rgba(0,242,255,0.15); }
.login-btn:disabled { opacity: 0.4; }
.login-error { color: #ff4466; font-size: 0.75rem; text-align: center; letter-spacing: 0.06em; min-height: 1.2em; }
.login-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--muted);
  font-size: 1.1rem; line-height: 1; transition: color 0.2s;
}
.login-close:hover { color: var(--accent); }
.remember-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.68rem; color: var(--muted); letter-spacing: 0.1em; }
.remember-row input { width: 14px; height: 14px; accent-color: var(--accent); }

/* ── CONTENT ── */
.content-wrap {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  min-height: calc(100vh - 33px);
  padding: 0 24px 80px;
}

/* ── HEADER ── */
header { text-align: center; padding: 52px 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ghost-icon {
  font-size: 80px; display: block;
  filter: drop-shadow(0 0 30px var(--accent-glow));
  animation: ghostFloat 5.5s ease-in-out infinite;
  line-height: 1; margin-bottom: 4px;
}
@keyframes ghostFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); filter: drop-shadow(0 0 30px var(--accent-glow)); }
  50%       { transform: translateY(-12px) rotate(2deg); filter: drop-shadow(0 0 46px var(--accent-glow)); }
}
.site-title {
  font-family: 'Cinzel', serif; font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 900;
  letter-spacing: 0.22em; color: #fff;
  text-shadow: 0 0 20px rgba(0,242,255,0.45), 0 0 65px rgba(0,200,255,0.18);
  text-transform: uppercase; animation: spectralFlicker 7s infinite;
}
.site-title .dot { color: var(--accent); }
@keyframes spectralFlicker {
  0%, 88%, 100% { opacity: 1; text-shadow: 0 0 20px rgba(0,242,255,0.45), 0 0 65px rgba(0,200,255,0.18); }
  89%  { opacity: 0.7; text-shadow: 0 0 6px rgba(0,242,255,0.2); }
  90%  { opacity: 1; }
  92%  { opacity: 0.55; }
  93%  { opacity: 1; text-shadow: 0 0 35px rgba(0,242,255,0.65), 0 0 90px rgba(0,200,255,0.3); }
}
.tagline { font-size: 0.62rem; letter-spacing: 0.55em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
#greeting { font-size: 0.6rem; letter-spacing: 0.3em; color: var(--accent); opacity: 0.6; min-height: 1em; margin-top: 4px; transition: opacity 0.4s; }

.status-bar {
  display: flex; justify-content: center; gap: 0; margin: 22px auto 0;
  border: 1px solid rgba(0,180,255,0.15);
  font-size: 0.6rem; letter-spacing: 0.2em;
  overflow: hidden; max-width: 500px; width: 100%;
}
.status-item { flex: 1; padding: 9px 8px; text-align: center; border-right: 1px solid rgba(0,180,255,0.1); color: var(--accent); }
.status-item:last-child { border-right: none; }
.status-item span { display: block; color: var(--muted); font-size: 0.52rem; margin-bottom: 3px; letter-spacing: 0.15em; }

.h-rule {
  width: 100%; max-width: 740px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,180,255,0.12), transparent);
  margin: 36px 0 0;
}

/* ── EDIT MODE BANNER ── */
#edit-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px;
  width: 100%; max-width: 740px;
  background: rgba(255,51,51,0.08);
  border: 1px solid var(--bay-border);
  color: var(--bay);
  font-size: 0.66rem; letter-spacing: 0.1em; line-height: 1.6;
  text-align: center; padding: 10px 16px;
  margin: 22px 0 6px;
}
.save-status {
  font-family: 'Share Tech Mono', monospace; font-size: 0.62rem; letter-spacing: 0.12em;
  background: transparent; border: 1px solid transparent; padding: 3px 10px; color: var(--muted);
}
.save-status.ok    { color: var(--tools); }
.save-status.busy  { color: var(--muted); }
.save-status.error { color: #ff4466; border-color: rgba(255,68,102,0.35); }
.save-status:disabled { cursor: inherit; }

/* ── SECTION LABEL ── */
.section-label {
  width: 100%; max-width: 740px; text-align: center; font-size: 0.62rem;
  letter-spacing: 0.55em; text-transform: uppercase; margin: 30px 0 14px;
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.section-label::before, .section-label::after {
  content: ''; height: 1px; width: 60px; margin: 0 18px;
  background: linear-gradient(90deg, transparent, rgba(0,200,255,0.25));
}
.section-label::after { background: linear-gradient(270deg, transparent, rgba(0,200,255,0.25)); }
.section-label.spider { color: var(--spider); }
.section-label.spider::before { background: linear-gradient(90deg, transparent, rgba(155,48,255,0.3)); }
.section-label.spider::after  { background: linear-gradient(270deg, transparent, rgba(155,48,255,0.3)); }
.section-label.files { color: var(--files); }
.section-label.files::before { background: linear-gradient(90deg, transparent, rgba(255,149,0,0.3)); }
.section-label.files::after  { background: linear-gradient(270deg, transparent, rgba(255,149,0,0.3)); }
.section-label.tools { color: var(--tools); }
.section-label.tools::before { background: linear-gradient(90deg, transparent, rgba(0,255,155,0.3)); }
.section-label.tools::after  { background: linear-gradient(270deg, transparent, rgba(0,255,155,0.3)); }
.section-label.bay { color: var(--bay); }
.section-label.bay::before { background: linear-gradient(90deg, transparent, rgba(255,51,51,0.3)); }
.section-label.bay::after  { background: linear-gradient(270deg, transparent, rgba(255,51,51,0.3)); }

/* ── GRID ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; width: 100%; max-width: 740px; }

/* ── BASE TILE ── */
.tile {
  background: var(--surface); border: 1px solid var(--border);
  padding: 20px 20px 18px; text-decoration: none; color: var(--text);
  display: flex; align-items: center; gap: 18px;
  position: relative; overflow: hidden;
  transition: all 0.28s cubic-bezier(0.4,0,0.2,1);
}
.tile::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity 0.28s;
}
.tile::after { content: ''; position: absolute; inset: 0; background: var(--accent-dim); opacity: 0; transition: opacity 0.28s; }
.tile:hover { transform: translateX(5px); border-color: rgba(0,242,255,0.28); box-shadow: 0 0 30px rgba(0,242,255,0.1), inset 0 0 20px rgba(0,242,255,0.03); }
.tile:hover::before { opacity: 1; }
.tile:hover::after  { opacity: 1; }

.tile.spider::before { background: linear-gradient(90deg, transparent, var(--spider), transparent); }
.tile.spider::after  { background: var(--spider-dim); }
.tile.spider:hover   { border-color: var(--spider-border); box-shadow: 0 0 32px var(--spider-glow), inset 0 0 22px rgba(155,48,255,0.04); }
.tile.spider .tile-name { color: var(--spider); }
.tile.spider .tile-emoji { filter: drop-shadow(0 0 8px var(--spider)); }
.tile.spider .status-dot { background: var(--spider); box-shadow: 0 0 9px var(--spider); }
.tile.spider .tile-arrow { color: var(--spider); }

.tile.files::before { background: linear-gradient(90deg, transparent, var(--files), transparent); }
.tile.files::after  { background: var(--files-dim); }
.tile.files:hover   { border-color: var(--files-border); box-shadow: 0 0 32px var(--files-glow), inset 0 0 22px rgba(255,149,0,0.04); }
.tile.files .tile-name { color: var(--files); }
.tile.files .tile-emoji { filter: drop-shadow(0 0 8px var(--files)); }
.tile.files .status-dot { background: var(--files); box-shadow: 0 0 9px var(--files); }
.tile.files .tile-arrow { color: var(--files); }

.tile.tools::before { background: linear-gradient(90deg, transparent, var(--tools), transparent); }
.tile.tools::after  { background: var(--tools-dim); }
.tile.tools:hover   { border-color: var(--tools-border); box-shadow: 0 0 32px var(--tools-glow), inset 0 0 22px rgba(0,255,155,0.04); }
.tile.tools .tile-name { color: var(--tools); }
.tile.tools .tile-emoji { filter: drop-shadow(0 0 8px var(--tools)); }
.tile.tools .status-dot { background: var(--tools); box-shadow: 0 0 9px var(--tools); }
.tile.tools .tile-arrow { color: var(--tools); }

.tile.bay::before { background: linear-gradient(90deg, transparent, var(--bay), transparent); }
.tile.bay::after  { background: var(--bay-dim); }
.tile.bay:hover   { border-color: var(--bay-border); box-shadow: 0 0 32px var(--bay-glow), inset 0 0 22px rgba(255,51,51,0.04); }
.tile.bay .tile-name { color: var(--bay); }
.tile.bay .tile-emoji { filter: drop-shadow(0 0 8px var(--bay)); }
.tile.bay .status-dot { background: var(--bay); box-shadow: 0 0 9px var(--bay); }
.tile.bay .tile-arrow { color: var(--bay); }

.tile-emoji { font-size: 1.9rem; position: relative; z-index: 1; flex-shrink: 0; line-height: 1; }
.tile-icon-wrap { color: var(--accent); filter: drop-shadow(0 0 10px var(--accent-glow)); position: relative; z-index: 1; flex-shrink: 0; }
.tile-info { position: relative; z-index: 1; flex: 1; }
.tile-name { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; letter-spacing: 0.08em; color: var(--accent); }
.tile-desc { font-size: 0.62rem; color: var(--muted); margin-top: 4px; letter-spacing: 0.08em; line-height: 1.55; }
.status-dot {
  position: absolute; top: 13px; right: 13px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--online); box-shadow: 0 0 9px var(--online-glow); z-index: 1; animation: dotPulse 2.2s infinite;
}
@keyframes dotPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.28; transform: scale(0.65); } }
.tile-arrow {
  position: absolute; right: 16px; bottom: 13px; font-size: 0.68rem; letter-spacing: 0.1em;
  color: var(--accent); opacity: 0; transition: opacity 0.2s, right 0.2s; z-index: 1;
}
.tile:hover .tile-arrow { opacity: 0.65; right: 12px; }

.tile.disabled { opacity: 0.35; filter: grayscale(0.65); pointer-events: none; }
.tile.disabled .status-dot { animation: none; opacity: 0.4; }
.tile.disabled .tile-arrow { color: var(--muted); }

/* Add-tile ghost card (edit mode only) */
.tile.add-tile {
  border: 1px dashed rgba(0,180,255,0.28);
  background: transparent;
  justify-content: center;
  color: var(--muted);
}
.tile.add-tile:hover { border-color: var(--accent); color: var(--accent); }
.tile.add-tile .tile-name { color: inherit; font-size: 0.85rem; text-align: center; }

.tile.spider .web-corner {
  position: absolute; top: 0; right: 0; width: 54px; height: 54px; opacity: 0.18;
  pointer-events: none; z-index: 0; transition: opacity 0.28s;
}
.tile.spider:hover .web-corner { opacity: 0.38; }
.spider-web-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: 0.05; transition: opacity 0.28s; }
.tile.spider:hover .spider-web-bg { opacity: 0.12; }

/* ── HUB BUTTON ── */
.hub-btn-wrap { width: 100%; max-width: 740px; display: flex; justify-content: center; margin-top: 36px; }
.hub-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 28px;
  border: 1px solid rgba(0,200,255,0.2); background: transparent; color: var(--muted);
  font-family: 'Share Tech Mono', monospace; font-size: 0.62rem; letter-spacing: 0.35em;
  text-transform: uppercase; text-decoration: none; transition: all 0.25s; position: relative; overflow: hidden;
}
.hub-btn::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0; transition: opacity 0.25s;
}
.hub-btn:hover { border-color: rgba(0,200,255,0.4); color: var(--accent); box-shadow: 0 0 20px rgba(0,200,255,0.08); }
.hub-btn:hover::before { opacity: 1; }

/* ── FOOTER ── */
footer {
  margin-top: 64px; text-align: center; font-size: 0.58rem; letter-spacing: 0.32em;
  color: #1a2e35; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.footer-dns { display: flex; gap: 20px; align-items: center; font-size: 0.56rem; letter-spacing: 0.22em; color: #1a2e35; }
.footer-dns a { color: #263e48; text-decoration: none; transition: color 0.2s; letter-spacing: 0.2em; }
.footer-dns a:hover { color: var(--accent); }
.footer-sep { color: #111e24; }
.footer-ai { font-size: 0.5rem; letter-spacing: 0.25em; color: #141c22; display: flex; gap: 16px; align-items: center; margin-top: 2px; }
.footer-ai a { color: #182028; text-decoration: none; transition: color 0.2s; display: inline-flex; align-items: center; gap: 5px; }
.footer-ai a:hover { color: var(--accent); }
.footer-ai .ai-icon { font-size: 0.85rem; line-height: 1; }

/* ════════════════════════════════════════════════════════════
   Added for the single-page hub + editor
   ════════════════════════════════════════════════════════════ */

/* ── SIGNED-OUT VIEW (was a separate login page) ── */
.login-view {
  position: relative; z-index: 1;
  min-height: calc(100vh - 33px);
  display: flex; align-items: center; justify-content: center;
  padding: 48px 20px;
}
.login-title .dot { color: var(--accent); }
.text-btn {
  align-self: center;
  background: none; border: none; padding: 2px 4px;
  font-family: 'Share Tech Mono', monospace; font-size: 0.68rem; letter-spacing: 0.12em;
  color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
  transition: color 0.2s;
}
.text-btn:hover { color: var(--accent); }

/* ── NOTICE (tile list or edit-mode problems) ── */
.notice {
  position: relative; z-index: 1;
  width: calc(100% - 48px); max-width: 740px; margin: 18px auto 0; padding: 10px 16px;
  border: 1px solid var(--files-border); background: var(--files-dim); color: var(--files);
  font-size: 0.66rem; letter-spacing: 0.08em; line-height: 1.6; text-align: center;
}
.empty-hub { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.12em; margin-top: 30px; text-align: center; }

/* Tiles render into #hub-body; let its children lay out as if they sat directly in .content-wrap */
#hub-body { display: contents; }

/* ── STATUS BAR COUNT ── */
.status-item b { font-weight: inherit; }

/* ── EDIT MODE ── */
.tile.editable { padding-bottom: 32px; }       /* room for the always-visible ✎ EDIT marker */
.tile.editable .tile-arrow { opacity: 0.65; right: 12px; }
.tile.editable.disabled { pointer-events: auto; }          /* greyed-out tiles still need to be editable */
.section-label.editable { gap: 0; }
.section-label.editable:hover { filter: brightness(1.5); }
.tile.add-tile { min-height: 76px; }

/* ── DRAG TO REORDER (edit mode) ── */
.tile.editable { user-select: none; -webkit-user-select: none; }
.drag-grip {                                   /* mice can grab the whole tile; fingers use this strip */
  position: absolute; left: 0; top: 0; bottom: 0; width: 18px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: grab; touch-action: none; transition: color 0.2s;
}
.drag-grip::before {                           /* six dots */
  content: ''; width: 8px; height: 13px;
  background-image: radial-gradient(circle, currentColor 1.1px, transparent 1.5px);
  background-size: 4px 4.5px;
}
.tile.editable:hover .drag-grip { color: var(--accent); }
.tile.drag-source {                            /* the slot where the tile will land */
  opacity: 0.3; border-style: dashed; border-color: rgba(0,242,255,0.45);
}
.drag-ghost {                                  /* the copy that follows the pointer */
  position: fixed; left: 0; top: 0; margin: 0; z-index: 3000;
  pointer-events: none; opacity: 0.95;
  transition: none !important;
  transform: rotate(1.2deg) scale(1.02);
  border-color: rgba(0,242,255,0.55);
  box-shadow: 0 0 34px rgba(0,242,255,0.22), 0 18px 40px rgba(0,0,0,0.6);
}
.drag-ghost.files  { border-color: var(--files);  box-shadow: 0 0 34px var(--files-glow),  0 18px 40px rgba(0,0,0,0.6); }
.drag-ghost.tools  { border-color: var(--tools);  box-shadow: 0 0 34px var(--tools-glow),  0 18px 40px rgba(0,0,0,0.6); }
.drag-ghost.bay    { border-color: var(--bay);    box-shadow: 0 0 34px var(--bay-glow),    0 18px 40px rgba(0,0,0,0.6); }
.drag-ghost.spider { border-color: var(--spider); box-shadow: 0 0 34px var(--spider-glow), 0 18px 40px rgba(0,0,0,0.6); }
body.dragging, body.dragging * { cursor: grabbing !important; }
body.dragging .tile:hover { transform: none; }  /* keep drop targets still while dragging */
@media (pointer: coarse) {                     /* touch screens: a wider strip that's easy to hold */
  .tile.editable { padding-left: 46px; }
  .drag-grip { width: 40px; }
}

.modal-title { font-size: 1rem; }
.modal-overlay .login-box { gap: 0.85rem; max-width: 420px; }
.login-field textarea { resize: vertical; min-height: 3.4em; line-height: 1.45; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.85rem; }
.login-error:empty { display: none; }          /* no empty gap until there's something to say */
.icon-row { display: flex; gap: 0.6rem; align-items: stretch; }
.icon-row input { flex: 1; min-width: 0; }
.icon-preview {
  flex: 0 0 44px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(0,180,255,0.2); background: var(--bg);
  font-size: 1.35rem; color: var(--accent);
}
.icon-preview svg { width: 22px; height: 22px; }
.modal-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.modal-row .auth-btn { flex: 1 1 auto; padding: 7px 10px; }
.auth-btn:disabled { opacity: 0.35; pointer-events: none; }
.auth-btn.danger { border-color: var(--bay-border); color: var(--bay); }
.auth-btn.danger:hover { border-color: var(--bay); color: #ff6666; }

/* ── KEYBOARD FOCUS ── */
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.tile:focus-visible { outline-offset: -1px; border-color: rgba(0,242,255,0.45); }

/* ── PHONES: 16px inputs stop iOS zooming the page on focus ── */
@media (max-width: 600px) {
  .login-field input, .login-field select, .login-field textarea { font-size: 16px; }
  .field-pair { grid-template-columns: 1fr; }
  .login-box { padding: 2rem 1.4rem; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .drag-ghost { transform: none; }
  .drip-container { display: none; }
}
