/* Shared switch; all visual overrides below are scoped to the cyber theme. */
.header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.25rem; }
.theme-toolbar { display: flex; align-items: center; gap: .55rem; font-size: var(--text-small); }
.theme-label { color: #444; }
.theme-options { display: inline-flex; gap: .25rem; }
.theme-options button { min-block-size: 2.75rem; padding: .35em .65em; font-size: inherit; background: #f5f5f0; }
.theme-options button[aria-pressed="true"] { background: #d1dbc5; border-color: #607652; box-shadow: inset 0 -3px #607652; font-weight: bold; }

html[data-theme="cyber"] {
  color-scheme: dark;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: #e3eaf3;
  background: #080e19;
  --cyber-muted: #a2b1c5;
  --cyber-accent: #68e5e1;
  --page-width: 74rem;
  --page-gutter: clamp(1rem, 3vw, 2rem);
  --post-inset: 0rem;
}
html[data-theme="cyber"] body {
  background: radial-gradient(ellipse at 85% 0%, #123b492e, transparent 45%), #080e19;
  min-block-size: 100vh;
  letter-spacing: .015em;
}
html[data-theme="cyber"] a { color: #76e5e2; }
html[data-theme="cyber"] a:visited { color: #a6b9f4; }
html[data-theme="cyber"] a:hover { color: #bcffff; }
html[data-theme="cyber"] :is(a, button, input, textarea, select, summary):focus-visible { outline-color: #8df5ee; outline-width: 2px; }
html[data-theme="cyber"] .site-header {
  background-color: #0b1420;
  background-image: linear-gradient(#5bcacc07 1px, transparent 1px), linear-gradient(90deg, #5bcacc07 1px, transparent 1px);
  background-size: 28px 28px;
  border-bottom: 1px solid #284450;
  box-shadow: 0 1px 20px #20cece08;
}
html[data-theme="cyber"] .header-inner { padding-block: 1.25rem; gap: 1rem 2rem; }
html[data-theme="cyber"] .site-brand { display: grid; gap: .1rem; }
html[data-theme="cyber"] .site-brand > a {
  color: #eaf9ff;
  font-size: clamp(1.65rem, 1.35rem + 1vw, 2.25rem);
  letter-spacing: .08em;
  text-shadow: 0 0 24px #73e9e22b;
}
html[data-theme="cyber"] .site-brand > a::before { content: ''; display: inline-block; inline-size: .6em; block-size: .6em; margin-inline-end: .55em; border: 2px solid #68e5e1; box-shadow: inset 0 0 8px #68e5e140, 0 0 12px #68e5e120; transform: rotate(45deg); }
html[data-theme="cyber"] .site-brand span { color: var(--cyber-muted); font-size: .8em; letter-spacing: .06em; }
html[data-theme="cyber"] .home-link { color: #b9cbdc; text-decoration: none; }
html[data-theme="cyber"] :is(.theme-label, .reading-label) { color: var(--cyber-muted); }
html[data-theme="cyber"] :is(.theme-options, .text-size-options) { gap: .15rem; padding: .2rem; border: 1px solid #304252; background: #080e19; border-radius: .55rem; }
html[data-theme="cyber"] :is(.theme-options button, .text-size-button) { background: transparent; color: #b1bfd0; border: 1px solid transparent; border-radius: .35rem; box-shadow: none; }
html[data-theme="cyber"] :is(.theme-options button, .text-size-button)[aria-pressed="true"] { color: #9ff8f0; background: #17343b; border-color: #3c767b; box-shadow: none; }
html[data-theme="cyber"] main { margin-block: 1.4rem 2.5rem; }
html[data-theme="cyber"] .reading-toolbar { margin-bottom: 1.3rem; }
html[data-theme="cyber"] main > h1 { font-weight: 700; letter-spacing: .035em; line-height: 1.6; margin-block: .35rem 1.1rem; }
html[data-theme="cyber"] main > h1::before { content: '//'; color: #68e5e1; font-family: Consolas, monospace; margin-inline-end: .55em; font-weight: 400; }
html[data-theme="cyber"] :is(.muted, .breadcrumb, .report, footer) { color: var(--cyber-muted); }
html[data-theme="cyber"] .breadcrumb a { color: #abc3d4; text-decoration: none; }
html[data-theme="cyber"] .boards { gap: .5rem; margin-block: 1rem; }
html[data-theme="cyber"] .boards a { background: #101c2a; border-color: #2b3c50; border-radius: .5rem; color: #b7c7d7; padding: .4em .85em; }
html[data-theme="cyber"] .boards a[aria-current="page"] { color: #92f2e9; background: #14343b; border-color: #397b7d; }
html[data-theme="cyber"] .boards a:hover { background: #172d3b; }
html[data-theme="cyber"] .panel { background: #101a28; border: 1px solid #293d50; border-radius: .85rem; padding: clamp(1rem, 2.4vw, 1.65rem); margin-block: 1.3rem; box-shadow: 0 12px 28px #00000012; }
html[data-theme="cyber"] .section-heading { background: transparent; border: 0; border-bottom: 1px solid #2b3f50; padding: 0 0 .8rem; margin-bottom: .55rem; }
html[data-theme="cyber"] .section-heading h2 { font-weight: 600; color: #e2edf7; }
html[data-theme="cyber"] .section-heading > a { color: #90d9d9; text-decoration: none; }
html[data-theme="cyber"] .thread-list { padding: 0; }
html[data-theme="cyber"] .thread { border-bottom: 1px solid #23374a; border-radius: .35rem; padding: .95em .4em; gap: .3em .7em; }
html[data-theme="cyber"] .thread:last-child { border-bottom-color: transparent; }
html[data-theme="cyber"] .thread strong { color: #dfedf7; text-decoration: none; }
html[data-theme="cyber"] .thread:hover { background: #17283a; }
html[data-theme="cyber"] .thread:hover strong { color: #91f1e9; }
html[data-theme="cyber"] :is(.thread-number, .thread small) { color: #a3b3c5; font-family: Consolas, "Yu Gothic UI", monospace; }
html[data-theme="cyber"] .thread-actions { gap: .65rem; margin-block: 1.2rem; }
html[data-theme="cyber"] .thread-actions a { background: #111f2e; border: 1px solid #30495c; border-radius: .45rem; color: #bfdae6; text-decoration: none; padding: .5em .9em; }
html[data-theme="cyber"] .thread-actions a:hover { border-color: #619b9e; background: #17313e; }
html[data-theme="cyber"] .posts-panel { background: transparent; border: 0; padding: 0; box-shadow: none; }
html[data-theme="cyber"] .post { background: #101a28; border: 1px solid #293d50; border-radius: .75rem; padding: clamp(1rem, 2.2vw, 1.6rem); margin-bottom: .85rem; }
html[data-theme="cyber"] .post:last-of-type { border-bottom: 1px solid #293d50; }
html[data-theme="cyber"] .meta { color: #a7b8ca; gap: .25em .55em; margin-bottom: .8rem; }
html[data-theme="cyber"] .meta time { font-family: Consolas, monospace; font-size: .92em; }
html[data-theme="cyber"] .res-number { font-family: Consolas, monospace; color: #83eeea; background: #16333e; border: 1px solid #38616e; padding: .05em .55em; border-radius: .3rem; }
html[data-theme="cyber"] .ai { border-color: #397a7b; background: #123538; color: #8bece0; border-radius: .25rem; font-family: Consolas, monospace; font-size: .8em; letter-spacing: .08em; padding: .08em .5em; }
html[data-theme="cyber"] .human { border-color: #586a94; background: #202b45; color: #c3d0ff; border-radius: .25rem; font-size: .8em; padding: .08em .45em; }
html[data-theme="cyber"] .body { color: #e3eaf3; line-height: 1.9; max-inline-size: 49em; letter-spacing: .025em; }
html[data-theme="cyber"] .anchor { color: #77e8df; text-decoration-thickness: 1px; }
html[data-theme="cyber"] .post:target { border-color: #65d8ce; background: #132c37; outline: 1px solid #65d8ce; outline-offset: 2px; box-shadow: 0 0 22px #51d6cf0d; }
html[data-theme="cyber"] .report { margin-top: .6rem; }
html[data-theme="cyber"] .report summary { font-size: .9em; color: #a2b1c5; }
html[data-theme="cyber"] :is(input, textarea, select) { color: #e3eaf3; background: #0a1320; border: 1px solid #41566b; border-radius: .45rem; padding: .65em .75em; }
html[data-theme="cyber"] ::placeholder { color: #92a3b9; opacity: 1; }
html[data-theme="cyber"] button { background: #123b42; border: 1px solid #4b999b; border-radius: .45rem; color: #b9fff4; padding: .5em 1.15em; }
html[data-theme="cyber"] button:hover { background: #1d4c52; }
html[data-theme="cyber"] button:disabled { opacity: .55; cursor: not-allowed; }
html[data-theme="cyber"] .anchor-preview { background: #132436; color: #e3eaf3; border-color: #609fa8; border-radius: .6rem; box-shadow: 0 12px 36px #0008; }
html[data-theme="cyber"] .skip-link { background: #142d3a; color: #abfff5; }
html[data-theme="cyber"] footer { border-color: #2a3d50; padding-block: 1.2rem; line-height: 1.8; }
@media (max-width: 40rem) {
  .header-actions { inline-size: 100%; justify-content: space-between; gap: .35rem .75rem; }
  html[data-theme="cyber"] .header-inner { padding-block: 1rem; }
  html[data-theme="cyber"] .meta time { flex-basis: 100%; }
  html[data-theme="cyber"] .reading-toolbar { justify-content: flex-start; }
  html[data-theme="cyber"] .post { border-radius: .6rem; }
  html[data-theme="cyber"] .section-heading h2 { flex-basis: 100%; }
}
@media (forced-colors: active) {
  html[data-theme="cyber"] :is(.res-number, .ai, .human, .theme-options, .text-size-options) { border: 1px solid ButtonText; }
}

/* v10.7: decorative layers never intercept input or move post text. */
.cyber-atmosphere, .logo-echo { display: none; }
html .site-brand > a .brand-title { position: relative; display: inline-block; font: inherit; color: inherit; letter-spacing: inherit; }

html[data-theme="cyber"] body {
  isolation: isolate;
  background:
    radial-gradient(ellipse 60rem 42rem at 0% 0%, #12445166, transparent 75%),
    radial-gradient(ellipse 58rem 50rem at 100% 12rem, #49306944, transparent 75%),
    #080e19;
}
html[data-theme="cyber"] :is(.site-header, main, footer) { position: relative; z-index: 1; }
html[data-theme="cyber"] .cyber-atmosphere { display: block; position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; contain: strict; }
.cyber-atmosphere > span { position: absolute; inset: 0; pointer-events: none; }
.cyber-atmosphere::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 24rem 85% at 0% 50%, #1c8d9c35, transparent 85%),
              radial-gradient(ellipse 24rem 85% at 100% 55%, #7751b83d, transparent 85%);
}
.fx-grid {
  background-image: linear-gradient(#54b9d02b 1px, transparent 1px), linear-gradient(90deg, #54b9d02b 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(90deg, #000d, #0005 25%, #0005 75%, #000d);
}
.fx-circuit {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='640' viewBox='0 0 640 640'%3E%3Cg fill='none' stroke='%2370dadf' stroke-width='1' opacity='.32'%3E%3Cpath d='M0 128h80l48-48h160m-160 0v80l48 48h144m320 176h-96l-64 64H320m160 0v96l-64 64H224M0 512h96l64-64v-96m480-288H544l-48 48v112'/%3E%3C/g%3E%3Cg fill='%238d7de6' opacity='.55'%3E%3Ccircle cx='288' cy='80' r='3'/%3E%3Ccircle cx='320' cy='208' r='3'/%3E%3Ccircle cx='224' cy='608' r='3'/%3E%3Ccircle cx='496' cy='224' r='3'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center top;
  opacity: .85;
  background-repeat: repeat;
  mask-image: linear-gradient(90deg, #000, #0009 25%, #0009 75%, #000);
}
.fx-circuit::before, .fx-circuit::after {
  content: ''; position: absolute; top: -12rem; left: clamp(.4rem, 2.5vw, 2rem);
  inline-size: 2px; block-size: 10rem;
  background: linear-gradient(transparent, #7af5e18c, transparent);
  box-shadow: 0 0 16px #64e6e52b;
  animation: edge-signal 18s linear infinite;
}
.fx-circuit::after { left: auto; right: clamp(.4rem, 2.5vw, 2rem); background: linear-gradient(transparent, #ba97ff99, transparent); animation-delay: -9s; }
@keyframes edge-signal { to { transform: translateY(calc(100vh + 24rem)); } }
.fx-glitch {
  background: repeating-linear-gradient(transparent 0 178px, #69e0e45c 178px 179px, transparent 179px 359px, #b393f54d 359px 361px, transparent 361px 540px);
  mask-image: linear-gradient(90deg, #000, #0005 22%, #0005 78%, #000);
  opacity: 0;
  animation: ambient-glitch 23s linear infinite;
}
@keyframes ambient-glitch {
  0%, 90%, 96%, 100% { opacity: 0; transform: translateX(0); }
  91% { opacity: .4; transform: translateX(-8px); }
  93% { opacity: .22; transform: translateX(6px); }
  95% { opacity: .3; transform: translateX(0); }
}
html[data-theme="cyber"] .site-header {
  overflow: hidden;
  background-color: #0b1421ed;
  background-image: radial-gradient(ellipse at 15% 0%, #27748635, transparent 65%), linear-gradient(90deg, transparent 55%, #5b347927), linear-gradient(#7ac5dc0b 1px, transparent 1px), linear-gradient(90deg, #7ac5dc0b 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
  border-image: linear-gradient(90deg, #244657, #69e7da99 25%, #9b75df88 70%, #244657) 1;
  box-shadow: 0 10px 50px #070e2099;
}
html[data-theme="cyber"] .header-inner { position: relative; z-index: 1; padding-block: 1.6rem; }
html[data-theme="cyber"] .site-header::after { content: ''; position: absolute; top: 0; bottom: 0; left: -20%; inline-size: 20%; pointer-events: none; background: linear-gradient(100deg, transparent, #73d9f007, transparent); transform: skewX(-18deg); animation: header-sweep 24s ease-in-out infinite; }
@keyframes header-sweep { 0%, 76% { left: -20%; } 94%, 100% { left: 110%; } }
html[data-theme="cyber"] .site-brand > a { text-shadow: 0 0 26px #65e1e33b; }
html[data-theme="cyber"] .site-brand > a::before { background: linear-gradient(135deg, #72e9df16, #a178ef19); border-color: #80ede4; box-shadow: inset 0 0 10px #68e5e130, 0 0 18px #68e5e12e; }
html[data-theme="cyber"] .site-brand .logo-echo { display: block; position: absolute; inset: 0; font: inherit; letter-spacing: inherit; pointer-events: none; opacity: 0; }
.logo-echo::before { content: attr(data-text); }
html[data-theme="cyber"] .site-brand .echo-cyan { color: #64f4ee; clip-path: inset(18% 0 48% 0); animation: logo-glitch-cyan 21s linear infinite; }
html[data-theme="cyber"] .site-brand .echo-violet { color: #bc90ff; clip-path: inset(58% 0 17% 0); animation: logo-glitch-violet 21s linear infinite; }
@keyframes logo-glitch-cyan {
  0%, 91%, 94%, 100% { opacity: 0; transform: translateX(0); }
  92% { opacity: .45; transform: translateX(-2px); }
  93% { opacity: .25; transform: translateX(2px); }
}
@keyframes logo-glitch-violet {
  0%, 91%, 94%, 100% { opacity: 0; transform: translateX(0); }
  92% { opacity: .3; transform: translateX(2px); }
  93% { opacity: .4; transform: translateX(-1px); }
}
html[data-theme="cyber"] :is(.post, .panel:not(.posts-panel)) {
  position: relative;
  border: 1px solid transparent;
  background: linear-gradient(125deg, #152638f5, #101a2bf5 55%, #151c31f5) padding-box,
              linear-gradient(125deg, #63e8e05c, #a680ed40 55%, #35465b) border-box;
  box-shadow: inset 0 1px #bcf9ff07, 0 12px 40px #02060f33;
}
html[data-theme="cyber"] .post:last-of-type { border-bottom-color: transparent; }
html[data-theme="cyber"] .post { margin-bottom: 1.2rem; }
html[data-theme="cyber"] :is(.post, .panel:not(.posts-panel))::before {
  content: ''; position: absolute; top: -1px; left: -1px; inline-size: 2.25rem; block-size: 1.25rem;
  border-top: 1px solid #8ce8e7aa; border-left: 1px solid #8ce8e777; border-top-left-radius: inherit;
  pointer-events: none;
}
html[data-theme="cyber"] .section-heading { border-bottom-color: #58668c44; }
html[data-theme="cyber"] .section-heading h2 { color: #e5eaff; }
html[data-theme="cyber"] .human { background: #29233d; color: #d9c6ff; border-color: #77618d; }
html[data-theme="cyber"] .post:target { background: linear-gradient(125deg, #15343df7, #182539f7) padding-box, linear-gradient(145deg, #8bf3e4, #aa86ec) border-box; outline-color: #73ddd180; box-shadow: 0 0 32px #61d8df12; }
html[data-theme="cyber"] .post:target::after { content: ''; position: absolute; top: 1.4rem; bottom: 1.4rem; left: 0; inline-size: 3px; border-radius: 0 3px 3px 0; background: #8df1e4; box-shadow: 0 0 12px #80eee670; pointer-events: none; }
html[data-theme="cyber"] :is(button, .thread, .boards a, .thread-actions a) { transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease; }
html[data-theme="cyber"] :is(button, .boards a, .thread-actions a):is(:hover, :focus-visible) { border-color: #87deda; box-shadow: 0 0 18px #57dbe318, inset 0 1px #a0f7eb12; }
html[data-theme="cyber"] .thread:is(:hover, :focus-visible) { background: linear-gradient(90deg, #26465444, #44325e33); }
html[data-theme="cyber"] ::selection { background: #3e6c83; color: #f1ffff; }
html[data-theme="cyber"] .post-author { color: #b9e9dc; }
html[data-theme="cyber"] .tripcode { color: #c6b4f1; }
html[data-theme="cyber"] .poster-id, html[data-theme="cyber"] .poster-id:visited { color: #a9d8df; }
html[data-theme="cyber"] .identity-help { color: #aab9cd; }
html[data-theme="cyber"] .identity-filter { color: #c8e2ed; border-color: #436d7a; border-radius: .6rem; background: #122734; }
@media (max-width: 40rem) {
  html[data-theme="cyber"] .header-inner { padding-block: 1.2rem; }
  html[data-theme="cyber"] .reading-toolbar { justify-content: flex-start; }
  .fx-grid { background-size: 48px 48px; }
  .fx-circuit { opacity: .65; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme="cyber"] *, html[data-theme="cyber"] *::before, html[data-theme="cyber"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html[data-theme="cyber"] :is(.fx-glitch, .logo-echo), html[data-theme="cyber"] .site-header::after { display: none !important; }
}
@media (forced-colors: active) {
  html[data-theme="cyber"] .cyber-atmosphere, html[data-theme="cyber"] .logo-echo { display: none; }
  html[data-theme="cyber"] :is(.post, .panel:not(.posts-panel)) { border: 1px solid CanvasText; background: Canvas; }
}
