/* 管理画面専用: サイバー風テーマ(ネオンシアン × マゼンタ、常にダーク) */
:root, :root[data-theme] {
  color-scheme: dark;
  --bg: #04050d; --card: rgba(9, 15, 36, 0.86); --text: #dff6ff; --muted: #8db6d0; --muted-soft: #7fa6c2;
  --accent: #00e5ff; --accent-dark: #7df3ff; --accent-soft: rgba(0, 229, 255, 0.14);
  --border: #1d4266; --border-soft: #14304d; --danger: #ff4d8d; --danger-soft: rgba(255, 77, 141, 0.16);
  --sage: #39ff9c; --sage-soft: rgba(57, 255, 156, 0.14); --saturday: #7dc4ff;
  --neon: #00e5ff; --neon2: #ff2bd6;
}
html body {
  font-family: "Cascadia Mono", Consolas, Menlo, "BIZ UDGothic", "Yu Gothic UI", monospace;
  background:
    radial-gradient(900px 500px at 8% -10%, rgba(0, 229, 255, 0.16), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(255, 43, 214, 0.14), transparent 60%),
    linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px) 0 0 / 36px 36px,
    #04050d;
  color: var(--text);
  letter-spacing: 0.03em;
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
}
#theme-toggle { display: none !important; }
h1 { color: var(--neon); text-shadow: 0 0 12px rgba(0, 229, 255, 0.7); letter-spacing: 0.12em; }
h1::before { content: "> "; color: var(--neon2); }
html body .card {
  background: var(--card);
  border: 1px solid rgba(0, 229, 255, 0.35); border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 43, 214, 0.08), 0 0 22px rgba(0, 229, 255, 0.12), inset 0 0 24px rgba(0, 229, 255, 0.04);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}
html body h2 {
  color: var(--neon); text-transform: uppercase; letter-spacing: 0.14em; font-size: 1.1rem;
  border-bottom: 1px solid rgba(0, 229, 255, 0.4); text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}
html body h2::before { content: "// "; color: var(--neon2); }
html body label { color: var(--accent-dark); letter-spacing: 0.08em; }
html body input, html body select, html body textarea, html body .admin-textarea {
  background: rgba(2, 6, 20, 0.9); color: var(--text); border: 1px solid rgba(0, 229, 255, 0.45); border-radius: 2px;
}
html body input:focus, html body select:focus, html body textarea:focus {
  outline: none; border-color: var(--neon); box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.25), 0 0 14px rgba(0, 229, 255, 0.35);
}
html body button {
  background: linear-gradient(90deg, #00e5ff, #38a8ff); color: #02121c !important; border: 1px solid #00e5ff; border-radius: 2px;
  font-weight: 800; letter-spacing: 0.1em; text-transform: none;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.45);
}
html body button:hover { filter: brightness(1.12); box-shadow: 0 0 22px rgba(0, 229, 255, 0.75); transform: none; }
html body button.secondary, html body .row-item-actions button.secondary, html body .log-chip, html body .edit-cancel, html body .modal-cancel {
  background: transparent !important; color: var(--neon) !important; border: 1px solid rgba(0, 229, 255, 0.6) !important; box-shadow: none;
}
html body button.secondary:hover, html body .log-chip:hover { background: rgba(0, 229, 255, 0.14) !important; box-shadow: 0 0 14px rgba(0, 229, 255, 0.4); }
html body .log-chip.on { background: var(--neon) !important; color: #02121c !important; box-shadow: 0 0 14px rgba(0, 229, 255, 0.6); }
html body button.danger {
  background: transparent; color: var(--danger) !important; border: 1px solid var(--danger); box-shadow: none;
}
html body button.danger:hover { background: var(--danger-soft); box-shadow: 0 0 14px rgba(255, 77, 141, 0.55); }
.row-item, .log-item, .msg-row { border-bottom: 1px dashed rgba(0, 229, 255, 0.25); }
.row-item-main { color: #fff; }
.row-item-sub, .log-time { color: var(--muted); }
.log-time { color: var(--neon2); }
.err { color: var(--danger); text-shadow: 0 0 6px rgba(255, 77, 141, 0.5); }
.empty { color: var(--muted); }
.msg-badge { background: var(--neon2); color: #fff; box-shadow: 0 0 12px rgba(255, 43, 214, 0.7); border-radius: 2px; }
.admin-link, a.home-link { border-color: var(--neon) !important; color: var(--neon); }
::selection { background: var(--neon2); color: #fff; }

/* 管理画面のレイアウト崩れ修正: 行はいつも「上=名前と説明 / 下=ボタン(折り返し)」にする */
html body .row-item { flex-direction: column; align-items: stretch; gap: 10px; }
html body .row-item > div:first-child { min-width: 0; word-break: break-word; }
html body .row-item-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; flex-shrink: 1; }
html body .row-item-actions button { flex: 1 1 auto; width: auto; min-width: 0; padding: 10px 12px; }
html body .row-item-actions a { display: contents; }
html body #main-screen .card { min-width: 0; overflow-wrap: anywhere; }
