/* ==========================================================================
   1x1SPORT Reskin — styles for Taktiktafel v3
   Applied on top of styles.css + styles-v2.css via body.v3
   ========================================================================== */

/* Lovelo Black + Roboto Condensed are defined in assets/fonts/fonts.css */

/* ---- Brand palette override ---------------------------------------- */
body.v3 {
  --c-blue:       #59C2FB;
  --c-dark-blue:  #1F2D3F;
  --c-dark-blue-2:#1E2F40;
  --c-ink-brand:  #373C46;
  --c-cloud:      #EFEFEF;
  --c-yellow:     #FFD302;
  --c-red-b:      #E80707;
  --c-green-b:    #85CA59;
  --c-orange-b:   #FF9800;
  --c-green-ok:   #34d399;
  --c-red-error:  #ff6b6b;
  --c-outline:    #888;

  --shadow-sm:  0 8px 24px -8px rgba(31,45,63,0.35);
  --shadow-md:  0 24px 48px -24px rgba(31,45,63,0.35);
  --shadow-lg:  0 32px 80px -32px rgba(31,45,63,0.5);

  --bg: var(--c-cloud);
  --paper: #FFFFFF;
  --panel: #E5E5E5;
  --hover: #DADADA;
  --line-soft: rgba(31,45,63,0.14);
  --ink: var(--c-dark-blue);
  --ink-2: #455366;
  --ink-3: #7A8597;

  --font-ui:      'Roboto Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-display: 'Lovelo Black', 'Impact', 'Oswald', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  font-family: var(--font-ui);
  letter-spacing: 0;
  background: var(--bg);
  color: var(--ink);
}

/* ---- Dark-blue body mode (tweak) ----------------------------------- */
body.v3.theme-dark {
  --bg: var(--c-dark-blue);
  --paper: #243449;
  --panel: #1a2636;
  --hover: #2E4159;
  --ink: var(--c-cloud);
  --ink-2: rgba(239,239,239,0.78);
  --ink-3: rgba(239,239,239,0.55);
  --line-soft: rgba(239,239,239,0.14);
}

/* Bring the 1x1SPORT logo into the very top-left cell of the topbar
   (the 64px column that lines up with the side-tools below). */
body.v3 .tb-brand-logo {
  display: block;
  content: url('../assets/brand/logo-light.png');
  height: 44px; width: 44px;
  object-fit: contain;
  padding: 0;
  background: transparent;
}

/* ============ Top bar ============ */
body.v3 .topbar {
  height: 56px;
  background: var(--c-dark-blue);
  border-bottom: 2px solid var(--c-blue);
  padding: 0 16px 0 0;
  color: #fff;
}
body.v3.theme-dark .topbar { background: #0e1822; border-bottom-color: var(--c-yellow); }

body.v3 .tb-brand {
  /* Align the 1x1 brand mark to the 64px side-tools column below so the
     logo stacks vertically with the tool icons. */
  width: 64px;
  margin: 0;
  border-right: 1px solid rgba(255,255,255,0.12);
  padding: 0;
  background: transparent;
  gap: 0;
  justify-content: center;
}
/* Light logo on dark topbar — styled in the titlebar block above. */
/* Hide the "Taktikapp" wordmark — just the logo lives here now, aligned with
   the side-tools column. The app name is already in the document title. */
body.v3 .tb-brand-name { display: none; }

body.v3 .tb-menu-trigger {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.75);
  border-radius: 0;
  height: 36px;
  padding: 0 14px;
}
body.v3 .tb-menu-trigger:hover,
body.v3 .tb-menu-trigger.active {
  background: var(--c-blue);
  color: var(--c-dark-blue);
}
body.v3.theme-dark .tb-menu-trigger:hover,
body.v3.theme-dark .tb-menu-trigger.active {
  background: var(--c-yellow);
  color: var(--c-dark-blue);
}

body.v3 .tb-menu {
  border-radius: 0;
  border: none;
  box-shadow: var(--shadow-sm);
  padding: 4px;
  background: var(--paper);
}
body.v3 .tb-menu-item {
  border-radius: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  height: 34px;
}
body.v3 .tb-menu-item:hover:not(:disabled) {
  background: var(--c-blue);
  color: var(--c-dark-blue);
}
body.v3 .tb-menu-item.locked { opacity: 0.45; }
body.v3 .tb-menu-item.locked:hover { opacity: 0.7; background: var(--hover); color: var(--ink); }
body.v3 .tb-menu-lock { margin-left: auto; opacity: 0.6; }
body.v3 .tb-menu-sep { background: var(--line-soft); }
body.v3 .tb-menu-kbd { font-family: var(--font-mono); color: var(--ink-3); }

/* Name + status */
body.v3 .tb-name {
  border-radius: 0;
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-weight: 500;
  color: #fff;
}
body.v3 .tb-name:hover { background: rgba(255,255,255,0.08); border-color: var(--c-blue); }
body.v3 .tb-name-ext { color: var(--c-blue); font-weight: 700; }
body.v3 .tb-name-input {
  border-radius: 0;
  border: 2px solid var(--c-blue);
  background: var(--paper);
  color: var(--ink);
}
body.v3 .tb-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.6);
}
body.v3 .tb-status-dot { background: var(--c-blue); box-shadow: 0 0 0 3px rgba(89,194,251,0.22); }
body.v3 .tb-status-ok { color: rgba(255,255,255,0.7); }
body.v3 .tb-status-ok .tb-status-dot {
  background: var(--c-green-ok);
  box-shadow: 0 0 0 3px rgba(52,211,153,0.25);
  animation: led-pulse 2.5s ease-in-out infinite;
}
@keyframes led-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(52,211,153,0.25); }
  50% { opacity: .55; box-shadow: 0 0 0 5px rgba(52,211,153,0.12); }
}
body.v3 .tb-status-saving .tb-status-dot { background: var(--c-blue); box-shadow: 0 0 0 3px rgba(89,194,251,0.22); }
body.v3 .tb-status-error { color: var(--c-red-error); }
body.v3 .tb-status-error .tb-status-dot { background: var(--c-red-error); box-shadow: 0 0 0 3px rgba(255,107,107,0.22); animation: none; }

/* Right side */
body.v3 .tb-iconbtn {
  border-radius: 0;
  color: rgba(255,255,255,0.8);
  width: 36px; height: 36px;
}
body.v3 .tb-iconbtn:hover { background: var(--c-blue); color: var(--c-dark-blue); }
body.v3.theme-dark .tb-iconbtn:hover { background: var(--c-yellow); color: var(--c-dark-blue); }

body.v3 .tb-btn-primary {
  background: var(--c-cloud);
  color: var(--c-dark-blue);
  border-radius: 0;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  height: 36px;
  padding: 0 18px;
  border-left: 3px solid var(--c-blue);
}
body.v3 .tb-btn-primary:hover { background: #fff; color: var(--c-dark-blue); border-left-color: var(--c-dark-blue); }
body.v3.theme-dark .tb-btn-primary { background: var(--c-cloud); color: var(--c-dark-blue); border-left-color: var(--c-yellow); }
body.v3.theme-dark .tb-btn-primary:hover { background: #fff; }

body.v3 .tb-lang {
  border-radius: 0;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  height: 30px;
  padding: 2px;
}
body.v3 .tb-lang-btn { border-radius: 0; font-family: var(--font-ui); font-weight: 700; letter-spacing: 0.12em; color: rgba(255,255,255,0.7); }
body.v3 .tb-lang-btn.active { background: var(--c-blue); color: var(--c-dark-blue); }
body.v3.theme-dark .tb-lang-btn.active { background: var(--c-yellow); color: var(--c-dark-blue); }

/* ============ Side tools (same color as right panel) ============ */
body.v3 .sidetools {
  background: var(--paper);
  border-right: 1px solid var(--line-soft);
  padding: 12px 0;
  width: 64px;
  overflow: visible;
}
body.v3.theme-dark .sidetools { background: var(--panel); border-right-color: rgba(255,255,255,0.1); }
body.v3 .editor-v2 { grid-template-columns: 64px 1fr 320px; }
body.v3 .st-btn {
  width: 44px; height: 44px;
  border-radius: 0;
  color: var(--ink-2);
  border: 1px solid transparent;
  position: relative;
}
body.v3 .st-btn:hover { background: var(--hover); color: var(--c-dark-blue); }
body.v3 .st-btn.active {
  background: var(--c-dark-blue);
  color: var(--c-blue);
  border-color: var(--c-dark-blue);
}
body.v3.theme-dark .st-btn { color: rgba(255,255,255,0.7); }
body.v3.theme-dark .st-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
body.v3.theme-dark .st-btn.active {
  background: var(--c-yellow);
  color: var(--c-dark-blue);
  border-color: var(--c-yellow);
}
body.v3 .st-btn.locked { opacity: 0.4; }
body.v3 .st-btn.locked:hover { opacity: 0.7; }
body.v3 .st-lock {
  position: absolute; bottom: 4px; right: 4px;
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-dark-blue); color: var(--c-blue);
  border-radius: 2px; pointer-events: none;
}
body.v3.theme-dark .st-lock { background: var(--c-yellow); color: var(--c-dark-blue); }
body.v3 .st-sep { background: var(--line-soft); width: 32px; }
body.v3.theme-dark .st-sep { background: rgba(255,255,255,0.12); }
body.v3 .st-tip {
  background: var(--c-cloud);
  color: var(--c-dark-blue);
  outline: 1px solid var(--c-outline);
  border-radius: 0;
  font-family: var(--font-ui);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}
/* st-tip arrow: ::before = outline (5px #888), ::after = fill (4px cloud) on top */
body.v3 .st-tip::before { border: 5px solid transparent; border-right-color: var(--c-outline); }
body.v3 .st-tip::after {
  content: '';
  position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
  border: 4px solid transparent; border-right-color: var(--c-cloud);
}
body.v3 .st-tip-kbd { border-color: var(--c-dark-blue); color: var(--c-dark-blue); font-family: var(--font-mono); }

/* Right panel tooltips — same style as left sidebar */
body.v3 .tooltip .tt-desc { display: none; }
body.v3 .tooltip {
  background: var(--c-cloud);
  color: var(--c-dark-blue);
  outline: 1px solid var(--c-outline);
  border-radius: 0;
  font-family: var(--font-ui);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}
/* tool-tile tooltip arrow: ::before = outline (5px #888), ::after = fill (4px cloud) on top */
body.v3 .tool-tile .tooltip::before {
  content: '';
  position: absolute; bottom: 100%; top: auto; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: var(--c-outline);
}
body.v3 .tool-tile .tooltip::after { border-top-color: transparent; border-bottom-color: var(--c-cloud); }
body.v3 .swatch .tooltip { outline: none; }
body.v3 .swatch .tooltip::before { display: none; }

/* ============ Canvas wrap ============ */
body.v3 .canvas-wrap-v2 {
  padding: 28px 28px 0;
  background:
    url('../assets/brand/bg-light-web.webp') center/cover no-repeat,
    var(--bg);
}
body.v3.theme-dark .canvas-wrap-v2 {
  background:
    url('../assets/brand/bg-dark-blue-web.webp') center/cover no-repeat,
    var(--bg);
}

body.v3 .stage.v2 {
  border-radius: 0;
  border: none;
  box-shadow: var(--shadow-md);
  background: var(--paper);
}
body.v3 .stage.v2.dark { background: var(--c-dark-blue); }

/* Outline-less attacker/defender tokens — kill the black stroke baked into
   primitives.jsx so the shapes read as clean color blocks on the pitch. */
body.v3 .stage-svg polygon[stroke="#111"],
body.v3 .stage-svg circle[stroke="#111"],
body.v3 .stage-svg path[stroke="#111"] {
  stroke: none !important;
}

/* No extra corner overlay — the 1x1SPORT mark baked into the field SVG
   (top-left of the pitch) is the canonical brand placement. */

/* Footer */
body.v3 .canvas-footer { color: var(--ink-2); font-family: var(--font-ui); }
body.v3 .cf-chip {
  border-radius: 0;
  background: var(--c-dark-blue);
  border: none;
  color: var(--c-blue);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 5px 10px;
}
body.v3.theme-dark .cf-chip { background: var(--c-yellow); color: var(--c-dark-blue); }
body.v3 .cf-btn { border-radius: 0; color: var(--ink-2); }
body.v3 .cf-btn:hover { background: var(--c-dark-blue); color: var(--c-blue); }
body.v3 .cf-zoom { font-family: var(--font-mono); color: var(--ink); }

/* ============ Right panel ============ */
body.v3 .panel.v2 {
  background: var(--paper);
  border-left: 1px solid var(--line-soft);
}
body.v3 .panel-head {
  background: var(--c-dark-blue);
  color: #fff;
  border-bottom: 3px solid var(--c-blue);
  padding: 16px 20px;
}
body.v3.theme-dark .panel-head { border-bottom-color: var(--c-yellow); }
body.v3 .panel-head h3 {
  color: var(--c-dark-blue);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
body.v3 .panel-head .panel-dot { background: var(--c-blue); width: 8px; height: 8px; border-radius: 0; }
body.v3.theme-dark .panel-head .panel-dot { background: var(--c-yellow); }

body.v3 .panel-section { border-bottom: 1px solid var(--line-soft); background: var(--paper); }
body.v3 .panel-section h4 {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  text-transform: uppercase;
}
body.v3 .sub-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink);
  /* Focus-typo nod: small blue bar left of title */
  padding-left: 12px;
  position: relative;
}
body.v3 .sub-title::before {
  content: '';
  position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 4px;
  background: var(--c-blue);
}
body.v3.theme-dark .sub-title::before { background: var(--c-yellow); }

body.v3 .reset-btn { border-radius: 0; color: var(--ink-3); }
body.v3 .reset-btn:hover { background: var(--c-dark-blue); color: var(--c-blue); }

/* Tool tiles */
body.v3 .tool-tile {
  border-radius: 0;
  background: var(--bg);
  border: 1.5px solid transparent;
  transition: all .15s var(--ease, ease);
}
body.v3 .tool-tile:hover { border-color: var(--c-dark-blue); background: var(--paper); }
body.v3 .tool-tile.active {
  background: var(--c-dark-blue);
  color: #fff;
  border-color: var(--c-dark-blue);
}
body.v3.theme-dark .tool-tile { background: var(--panel); }
body.v3.theme-dark .tool-tile:hover { border-color: var(--c-yellow); }
body.v3.theme-dark .tool-tile.active { background: var(--c-yellow); color: var(--c-dark-blue); border-color: var(--c-yellow); }

/* Color swatches */
body.v3 .swatch {
  border-radius: 0;
  width: 30px; height: 30px;
  border: 2px solid transparent;
}
body.v3 .swatch.active {
  border-color: var(--c-dark-blue);
  box-shadow: inset 0 0 0 2px var(--paper);
}
body.v3.theme-dark .swatch.active { border-color: var(--c-yellow); box-shadow: inset 0 0 0 2px var(--c-dark-blue); }

/* Text input */
body.v3 .t-input {
  border-radius: 0;
  border: 1.5px solid var(--line-soft);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  height: 36px;
}
body.v3 .t-input:focus { border-color: var(--c-blue); outline: 2px solid var(--c-blue); outline-offset: -1px; }

/* Slider */
body.v3 .slider-row input[type="range"] { accent-color: var(--c-blue); }
body.v3.theme-dark .slider-row input[type="range"] { accent-color: var(--c-yellow); }
body.v3 .slider-row .val { font-family: var(--font-mono); color: var(--ink); font-weight: 500; }

/* Preview box */
body.v3 .preview {
  border-radius: 0;
  border: 1.5px dashed var(--line-soft);
  background: var(--bg);
  position: relative;
}
body.v3 .preview::before {
  content: 'PREVIEW';
  position: absolute; top: 6px; right: 8px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

/* ============ Splash screen ============ */
body.v3 .splash {
  background:
    url('../assets/brand/bg-light-web.webp') center/cover no-repeat,
    var(--bg);
}
body.v3.theme-dark .splash {
  background:
    url('../assets/brand/bg-dark-blue-web.webp') center/cover no-repeat,
    var(--bg);
}
body.v3 .splash-art { display: none; }
body.v3 .splash-card {
  background: var(--paper);
  backdrop-filter: none;
  border-radius: 0;
  border: 3px solid var(--c-dark-blue);
  box-shadow: var(--shadow-lg);
  padding: 48px 56px 36px;
  max-width: 560px;
  position: relative;
  text-align: left;
}
body.v3.theme-dark .splash-card { background: var(--c-dark-blue); border-color: var(--c-yellow); color: #fff; }
body.v3 .splash-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 12px;
  background: var(--c-blue);
}
body.v3.theme-dark .splash-card::before { background: var(--c-yellow); }
body.v3 .splash-logo {
  margin: 0 0 28px 0;
  height: 48px; width: auto;
  object-fit: contain;
}
body.v3 .splash h1 {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  color: var(--ink);
}
body.v3.theme-dark .splash h1 { color: #fff; }
body.v3 .splash h1 .thin {
  font-family: var(--font-ui);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.55em;
  color: var(--ink-2);
  display: block;
  margin-bottom: 2px;
  letter-spacing: 0.2em;
}
body.v3.theme-dark .splash h1 .thin { color: rgba(239,239,239,0.7); }

body.v3 .splash-tagline {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 18px;
  color: var(--ink-2);
  margin: 0 0 28px;
  max-width: 420px;
  line-height: 1.35;
}
body.v3.theme-dark .splash-tagline { color: rgba(239,239,239,0.75); }
body.v3 .splash-tagline b { font-weight: 700; color: var(--ink); }
body.v3.theme-dark .splash-tagline b { color: var(--c-yellow); }

body.v3 .splash-lang {
  border: 1px solid var(--line-soft);
  margin: 0 0 24px 0;
}
body.v3 .splash-lang .tb-lang-btn { color: var(--ink-2); }
body.v3 .splash-lang .tb-lang-btn.active { background: var(--c-dark-blue); color: var(--c-blue); }
body.v3.theme-dark .splash-lang .tb-lang-btn.active { background: var(--c-yellow); color: var(--c-dark-blue); }

body.v3 .splash-actions {
  flex-direction: row;
  max-width: none;
  gap: 10px;
}
body.v3 .splash-actions .btn {
  border-radius: 0;
  border: 2px solid var(--c-dark-blue);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.1em;
  height: 52px;
  padding: 0 24px;
  flex: 1;
  text-transform: uppercase;
  font-size: 13px;
}
body.v3 .splash-actions .btn.primary {
  background: var(--c-blue);
  color: var(--c-dark-blue);
  border-color: var(--c-dark-blue);
}
body.v3 .splash-actions .btn.primary:hover { background: var(--c-dark-blue); color: var(--c-blue); }
body.v3 .splash-actions .btn:not(.primary):hover { background: var(--c-dark-blue); color: #fff; }
body.v3.theme-dark .splash-actions .btn { background: transparent; color: #fff; border-color: var(--c-yellow); }
body.v3.theme-dark .splash-actions .btn.primary { background: var(--c-yellow); color: var(--c-dark-blue); }

/* Guest (logged-out) splash: beide Board-Buttons weiß mit grauem Rahmen,
   "Mit E-Mail anmelden" ist die einzige farbige CTA (hellblau). */
body.v3 .splash-guest .splash-actions .btn,
body.v3 .splash-guest .splash-actions .btn.primary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--ink-3);
}
body.v3 .splash-guest .splash-actions .btn:hover {
  background: var(--c-dark-blue); color: #fff; border-color: var(--c-dark-blue);
}
.splash-guest .splash-login-btn {
  background: var(--c-blue);
  border-color: var(--c-dark-blue);
  color: var(--c-dark-blue);
}
.splash-guest .splash-login-btn:hover {
  background: var(--c-dark-blue);
  color: #fff;
  opacity: 1;
}

/* Old boards screen styles removed — see styles-boards.css */

/* Login prompt on splash — sits above the board actions */
.splash-login-section {
  width: 100%;
  margin: 0 0 12px;
}
.splash-login-btn {
  width: 100%; padding: 0 24px; height: 60px;
  background: var(--c-dark-blue); border: 2px solid var(--c-dark-blue);
  cursor: pointer;
  font-family: var(--font-ui); font-size: 15px; font-weight: 700;
  color: #fff; letter-spacing: 0.06em; text-transform: uppercase;
  transition: opacity 0.15s;
}
.splash-login-btn:hover { opacity: 0.88; }

body.v3 .splash-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  text-transform: uppercase;
}
body.v3 .splash-version {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-blue);
  background: var(--c-dark-blue);
  padding: 6px 12px;
  top: 24px; right: 24px;
}
body.v3.theme-dark .splash-version { background: var(--c-yellow); color: var(--c-dark-blue); }

/* ============ Field picker ============ */
body.v3 .picker {
  background:
    url('../assets/brand/bg-light-web.webp') center/cover no-repeat,
    var(--bg);
}
body.v3.theme-dark .picker {
  background:
    url('../assets/brand/bg-dark-blue-web.webp') center/cover no-repeat,
    var(--bg);
}
body.v3 .picker-head h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink);
  position: relative;
  padding-left: 20px;
}
body.v3 .picker-head h2::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 8px;
  background: var(--c-blue);
}
body.v3.theme-dark .picker-head h2 { color: #fff; }
body.v3.theme-dark .picker-head h2::before { background: var(--c-yellow); }

body.v3 .picker-head .step {
  font-family: var(--font-mono);
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.22em;
}
body.v3 .picker-card {
  background: var(--paper);
  border-radius: 0;
  border: 2px solid var(--c-dark-blue);
  padding: 28px;
  transition: all .18s var(--ease, ease);
  position: relative;
}
body.v3 .picker-card:hover {
  background: var(--c-dark-blue);
  color: #fff;
  transform: translateY(-3px);
}
body.v3 .picker-card:hover svg path,
body.v3 .picker-card:hover svg rect,
body.v3 .picker-card:hover svg line,
body.v3 .picker-card:hover svg polygon,
body.v3 .picker-card:hover svg circle { stroke: var(--c-blue); }
body.v3 .picker-card .pc-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: inherit;
}

/* ============ Modal ============ */
body.v3 .modal-bg {
  position: fixed;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(31,45,63,0.35);
}
body.v3 .modal {
  border-radius: 0;
  border: 3px solid var(--c-dark-blue);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}
body.v3 .modal header {
  background: var(--c-dark-blue);
  color: #fff;
  border-bottom: 3px solid var(--c-blue);
  padding: 18px 24px;
}
body.v3.theme-dark .modal header { border-bottom-color: var(--c-yellow); }
body.v3 .modal header h3 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
}
body.v3 .modal header .close { border-radius: 0; color: rgba(255,255,255,0.7); }
body.v3 .modal header .close:hover { background: var(--c-blue); color: var(--c-dark-blue); }

body.v3 .modal .path {
  border-radius: 0;
  background: var(--bg);
  border-left: 3px solid var(--c-blue);
  color: var(--ink);
}
body.v3 .modal .field label {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--ink-2);
}
body.v3 .modal footer {
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
}
body.v3 .btn.sm {
  border-radius: 0;
  font-family: var(--font-ui);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  height: 38px;
  border: 2px solid var(--c-dark-blue);
}
body.v3 .btn.sm:not(.primary) { background: transparent; color: var(--ink); }
body.v3 .btn.sm:not(.primary):hover { background: var(--c-dark-blue); color: #fff; }
body.v3 .btn.sm.primary { background: var(--c-blue); color: var(--c-dark-blue); border-color: var(--c-dark-blue); }
body.v3 .btn.sm.primary:hover { background: var(--c-dark-blue); color: var(--c-blue); }
body.v3 .btn.sm.ok { background: var(--c-green-b); color: var(--c-dark-blue); border-color: var(--c-dark-blue); }
body.v3 .btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

/* ============ Share dialog ============ */
body.v3 .share-modal { width: min(680px, 92vw); }
body.v3 .login-modal { width: min(440px, 92vw); }
body.v3 .share-tabs {
  display: grid; grid-template-columns: repeat(2, 1fr);
  background: var(--c-dark-blue);
  border-bottom: 3px solid var(--c-blue);
}
body.v3.theme-dark .share-tabs { border-bottom-color: var(--c-yellow); }
body.v3 .share-tab {
  background: transparent; border: 0; color: rgba(255,255,255,0.6);
  font-family: var(--font-ui); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 11px;
  padding: 14px 8px; display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; border-right: 1px solid rgba(255,255,255,0.08);
  transition: background 120ms, color 120ms;
}
body.v3 .share-tab:last-child { border-right: 0; }
body.v3 .share-tab:hover { color: #fff; background: rgba(255,255,255,0.04); }
body.v3 .share-tab.active { background: var(--c-blue); color: var(--c-dark-blue); }
body.v3.theme-dark .share-tab.active { background: var(--c-yellow); }
body.v3 .share-tab-ico { font-size: 14px; line-height: 1; }

body.v3 .share-body { padding: 24px; min-height: 340px; }
body.v3 .share-mode-banner {
  padding: 14px 16px; margin-bottom: 18px;
  border-left: 4px solid var(--c-blue);
  background: var(--bg);
}
body.v3 .share-mode-banner[data-mode="edit"] { border-left-color: var(--c-yellow); }
body.v3 .share-mode-title {
  font-family: var(--font-ui); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink);
}
body.v3 .share-mode-sub { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

body.v3 .share-linkrow { display: flex; gap: 8px; }
body.v3 .share-link-input {
  flex: 1; font-family: var(--font-mono); font-size: 11px; padding: 10px 12px;
  background: var(--bg); border: 2px solid var(--c-dark-blue); color: var(--ink);
  border-radius: 0;
}

body.v3 .share-link-meta { margin-top: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
body.v3 .share-warn { color: var(--c-red-b); }

body.v3 .share-hint {
  margin-top: 12px; font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3);
}

body.v3 .share-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

body.v3 .share-image-preview {
  background: #fff; border: 2px solid var(--c-dark-blue);
  min-height: 240px; display: grid; place-items: center;
  padding: 16px; margin-bottom: 12px;
}
body.v3 .share-image-preview img { max-width: 100%; max-height: 260px; display: block; }
body.v3 .share-image-loading { color: var(--ink-3); font-family: var(--font-mono); font-size: 12px; }

body.v3 .share-footer-meta {
  flex: 1; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  display: flex; align-items: center; gap: 8px;
}
body.v3 .share-footer-name { color: var(--ink); font-weight: 500; }
body.v3 .modal footer { display: flex; align-items: center; gap: 12px; }

/* ============ Tweaks panel ============ */
body.v3 .tweaks {
  border-radius: 0;
  border: 2px solid var(--c-dark-blue);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}
body.v3 .tweaks header {
  background: var(--c-dark-blue);
  color: #fff;
  border-bottom: 2px solid var(--c-blue);
  padding: 12px 16px;
}
body.v3 .tweaks header h4 {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.06em;
}
body.v3 .switch { border-radius: 0; background: var(--hover); }
body.v3 .switch::after { border-radius: 0; }
body.v3 .switch.on { background: var(--c-blue); }
body.v3.theme-dark .switch.on { background: var(--c-yellow); }

/* ============ Toast ============ */
body.v3 .toast {
  border-radius: 0;
  background: var(--c-dark-blue);
  color: #fff;
  border-left: 4px solid var(--c-blue);
  font-family: var(--font-ui);
  font-weight: 500;
}
body.v3.theme-dark .toast { border-left-color: var(--c-yellow); }

/* ============ Context menu ============ */
body.v3 .ctx-menu {
  z-index: 200;
  background: var(--paper);
  border: 2px solid var(--c-dark-blue);
  box-shadow: var(--shadow-sm);
  padding: 4px;
  min-width: 140px;
}
body.v3.theme-dark .ctx-menu { background: var(--panel); border-color: var(--c-yellow); }
body.v3 .ctx-menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 12px;
  background: none; border: none;
  font-family: var(--font-ui); font-size: 13px; font-weight: 500;
  color: var(--ink); cursor: pointer;
}
body.v3 .ctx-menu-item:hover {
  background: var(--c-dark-blue); color: #fff;
}
body.v3.theme-dark .ctx-menu-item:hover {
  background: var(--c-yellow); color: var(--c-dark-blue);
}

/* ============ Viewer (read-only shared board) ============ */
/* Override global body { overflow: hidden } from styles.css for the viewer — handled via body.page-scroll class */

.viewer-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.viewer-header {
  background: var(--c-dark-blue);
  border-bottom: 3px solid var(--c-blue);
  padding: 0 24px;
  position: relative; z-index: 10;
  flex-shrink: 0;
}
.viewer-header-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  height: 56px;
}
.viewer-brand {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.viewer-logo { height: 32px; width: auto; }
.viewer-via {
  font-family: var(--font-ui); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.6);
}
.viewer-title {
  flex: 1; min-width: 0;
  font-family: var(--font-display); font-weight: 900;
  font-size: 16px; text-transform: uppercase; letter-spacing: 0.03em;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.viewer-actions { display: flex; gap: 8px; flex-shrink: 0; }

.viewer-canvas {
  flex: 1 1 0; min-height: 0;
  overflow-y: auto;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 24px;
  background:
    url('../assets/brand/bg-light-web.webp') center/cover no-repeat fixed,
    var(--bg);
}
.viewer-stage {
  max-width: 600px; width: 100%;
  flex-shrink: 0;
}
.viewer-stage .viewer-svg {
  position: static;
  inset: auto;
  display: block; width: 100%; height: auto;
  background: var(--paper);
  border: 3px solid var(--c-dark-blue);
  box-shadow: var(--shadow-md);
  touch-action: auto;
}

.viewer-footer {
  background: var(--paper);
  border-top: 1px solid var(--line-soft);
  padding: 12px 24px;
  flex-shrink: 0;
  position: relative; z-index: 10;
}
.viewer-footer-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.viewer-footer-text {
  font-family: var(--font-ui); font-size: 12px; color: var(--ink-3);
}
.viewer-footer-text a { color: var(--ink-2); text-decoration: underline; }
.viewer-footer-text a:hover { color: var(--ink); }
.viewer-report-link {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-ui); font-size: 12px; color: var(--ink-3);
  text-decoration: underline; padding: 4px 0;
}
.viewer-footer-legal {
  display: flex; align-items: center; gap: 16px;
}
.viewer-footer-legal a {
  font-family: var(--font-ui); font-size: 12px; color: var(--ink-3);
  text-decoration: underline; white-space: nowrap;
}
.viewer-footer-legal a:hover { color: var(--ink); }
.viewer-report-link:hover { color: var(--c-red-b); }

@media (max-width: 640px) {
  .viewer-header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 8px; }
  .viewer-via { display: none; }
  .viewer-canvas { padding: 16px 12px; }
  .viewer-stage { max-width: 100%; }
}


/* ============ Responsive ============ */
@media (max-width: 1200px) {
  body.v3 .editor-v2 { grid-template-columns: 64px 1fr 280px; }
}
@media (max-width: 900px) {
  body.v3 .editor-v2 { grid-template-columns: 48px 1fr 200px; }
  body.v3 .tb-nav { display: flex; }
  body.v3 .tb-status { display: none; }
}
@media (max-width: 640px) {
  body.v3 .editor-v2 {
    grid-template-columns: 48px 1fr;
    grid-template-areas: "top top" "tools canvas";
  }
}


/* Modals: scrollable and capped on mobile */
@media (max-width: 900px) {
  body.v3 .modal-bg { align-items: flex-start; padding-top: 0; }
  body.v3 .modal {
    max-height: 100dvh;
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  body.v3 .modal .body,
  body.v3 .modal .share-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
  body.v3 .share-modal { width: 100vw; max-height: 100dvh; }
}
