
:root {
  --bg: #081222;
  --bg2: #0f1f35;
  --panel: rgba(10, 20, 36, .92);
  --panel2: rgba(17, 38, 72, .92);
  --line: rgba(120, 170, 255, .16);
  --line2: rgba(255, 255, 255, .10);
  --text: #eef4ff;
  --muted: rgba(226, 236, 255, .74);
  --accent: #69a7ff;
  --accent2: #93d6ff;
  --danger: #ff9b9b;
  --green: #9af3c0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
  min-width: 0;
}

button {
  cursor: pointer;
  max-width: 100%;
  overflow-wrap: anywhere;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 39, 72, .92);
  color: var(--text);
  padding: 11px 14px;
  outline: none;
  font-size: 16px;
}

textarea {
  resize: vertical;
}

select option {
  color: #101827;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 18px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(50, 221, 176, .15), transparent 28%),
    radial-gradient(circle at top right, rgba(86, 149, 255, .12), transparent 26%),
    linear-gradient(180deg, #09111f, var(--bg2));
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(105, 167, 255, .10), transparent 26%),
    radial-gradient(circle at 80% 0%, rgba(147, 214, 255, .08), transparent 28%);
}

.layout {
  position: relative;
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(292px, 320px);
  gap: 18px;
  align-items: start;
}

.main-content {
  min-width: 0;
}

.panel,
.top-panel,
.brand-panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .16);
  backdrop-filter: blur(10px);
}

.top-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.language-switcher {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 39, 72, .72);
}

.language-switcher button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.language-switcher button.active {
  background: linear-gradient(90deg, #4cc3ff, #4d8dff);
  color: #061225;
}

.account-pill,
.rss-link {
  min-height: 46px;
  border-radius: 999px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(18, 39, 72, .92);
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.rss-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.brand-panel {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr);
  gap: 18px;
  align-items: center;
}

.english-intro {
  margin-top: 18px;
}

.brand-panel h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.06;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.brand-clock,
.clock-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(17, 38, 72, .95);
  padding: 18px;
}

.brand-clock span,
.clock-card span {
  color: var(--muted);
  font-size: 13px;
}

.brand-clock strong,
.clock-card strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(28px, 3.4vw, 36px);
  line-height: 1;
}

.brand-clock small,
.clock-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.tab-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.tab-bar button,
.primary-button,
.secondary-button,
.danger-button,
.mini-button,
.chip-button,
.settings-list button,
.legal-links button,
.admin-grid button {
  min-height: 44px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(18, 42, 80, .95);
  color: var(--text);
  padding: 10px 14px;
  font-weight: 800;
}

.tab-bar button {
  min-height: 54px;
  font-size: 17px;
}

.tab-bar button.active,
.primary-button,
.chip-button.active {
  background: linear-gradient(90deg, #4cc3ff, #4d8dff);
  color: #061325;
  border-color: rgba(147, 214, 255, .72);
}

.secondary-button {
  background: rgba(18, 42, 80, .95);
}

.danger-button {
  background: rgba(88, 25, 39, .88);
  border-color: rgba(255, 155, 155, .45);
  color: #ffd6d6;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .56fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.main-grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(320px, .78fr);
}

.main-stack {
  display: grid;
  gap: 18px;
}

.hero-card {
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(76, 195, 255, .18), transparent 36%),
    var(--panel);
}

.compact-hero .section-title {
  margin-bottom: 0;
}

.hero-inner h1 {
  margin: 18px 0 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-inner > p {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.now-card {
  margin-top: 22px;
  border-radius: 20px;
  background: rgba(5, 12, 24, .72);
  border: 1px solid var(--line2);
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.eyebrow {
  color: rgba(226, 236, 255, .56);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 900;
}

.now-card strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.now-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.hero-actions,
.button-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 12px;
}

.program-card,
.bgm-card,
.comment,
.letter,
.selected-bgm-box,
.selected-mini,
.admin-grid > div {
  min-width: 0;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel2);
  padding: 14px;
}

.program-card-top,
.bgm-card-head,
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.program-card h3 {
  margin: 12px 0 0;
  font-size: 20px;
  line-height: 1.35;
}

.program-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.program-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.program-actions .mini-button {
  width: 100%;
  margin-top: 0;
  min-height: 40px;
  padding: 8px 10px;
}

.mini-button.primary {
  background: linear-gradient(90deg, #4cc3ff, #4d8dff);
  color: #061325;
  border-color: rgba(147, 214, 255, .72);
}

.program-meta,
.program-bgm,
.bgm-meta,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.program-meta,
.program-bgm {
  margin-top: 10px;
}

.chip-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.chip-row.wrap {
  flex-wrap: wrap;
}

.chip-row.scroll {
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.mood-bar {
  margin-top: 12px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(76, 195, 255, .12), rgba(147, 214, 255, .04)),
    rgba(5, 12, 24, .46);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.chip-button {
  flex: 0 0 auto;
  min-height: 38px;
  font-size: 13px;
  white-space: nowrap;
}

.chip-button.small {
  min-height: 36px;
  font-size: 12px;
  padding: 8px 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.badge-cyan {
  background: rgba(76, 195, 255, .20);
  color: #dff4ff;
}

.badge-green {
  background: rgba(56, 210, 142, .16);
  color: var(--green);
}

.section-title {
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.section-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.bgm-panel {
  overflow: hidden;
}

.embedded-bgm {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(5, 12, 24, .58);
  padding: 14px;
}

.bgm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.bgm-grid.compact {
  grid-template-columns: 1fr;
}

.bgm-card.selected {
  outline: 2px solid rgba(147, 214, 255, .72);
}

.bgm-title {
  font-weight: 900;
  line-height: 1.35;
}

.round-button {
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(6, 13, 26, .90);
  color: var(--text);
  font-weight: 900;
}

.mini-button.full {
  width: 100%;
  margin-top: 12px;
}

.playback-bar {
  margin-top: 10px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.playback-bar span {
  display: block;
  width: 42%;
  height: 100%;
  background: var(--accent2);
}

.comment-grid,
.letter-list,
.form-stack,
.settings-list,
.legal-links {
  display: grid;
  gap: 10px;
}

.form-stack label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.method-card {
  min-height: 112px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(17, 38, 72, .84);
  color: var(--text);
  padding: 14px;
  text-align: left;
}

.method-card.active {
  border-color: rgba(147, 214, 255, .72);
  background: linear-gradient(135deg, rgba(76, 195, 255, .24), rgba(17, 38, 72, .88));
}

.method-card strong,
.method-card span {
  display: block;
}

.method-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.selected-bgm-box span,
.selected-mini span,
.admin-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.selected-bgm-box strong,
.selected-mini strong,
.admin-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
}

.selected-bgm-box p,
.selected-mini p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.inline-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
  gap: 18px;
}

.account-card {
  background:
    radial-gradient(circle at top right, rgba(154, 243, 192, .12), transparent 34%),
    var(--panel);
}

.account-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-feature-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.account-feature-grid span {
  min-height: 40px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(17, 38, 72, .86);
  color: var(--muted);
  padding: 10px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
}

.email-login-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
}

.email-auth-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 12, 24, .42);
}

.email-auth-tabs button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  min-height: 34px;
  padding: 7px 10px;
  font-weight: 900;
  cursor: pointer;
}

.email-auth-tabs button.active {
  background: rgba(100, 180, 255, .18);
  color: var(--text);
}

.email-login-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, .8fr) auto;
  gap: 10px;
  align-items: end;
}

.email-login-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.email-login-grid input {
  min-height: 42px;
  border-radius: 12px;
  padding: 9px 12px;
}

.email-login-grid small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.email-login-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  gap: 8px;
}

.email-login-actions-single {
  grid-template-columns: minmax(140px, 1fr);
}

.email-login-actions button {
  min-height: 42px;
  border-radius: 12px;
  padding: 8px 10px;
}

.text-link-button {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 4px 2px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.text-link-button:disabled {
  cursor: wait;
  opacity: .55;
}

.form-message.success {
  border-color: rgba(77, 216, 148, .32);
  color: #b7f8d6;
}

.owner-empty {
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid rgba(147, 214, 255, .22);
  background: rgba(5, 12, 24, .66);
  padding: 16px;
}

.owner-empty strong {
  display: block;
  font-size: 16px;
}

.owner-empty p {
  margin: 8px 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.ad-stack {
  display: grid;
  gap: 10px;
}

.ad-slot {
  min-height: 144px;
  border-radius: 18px;
  border: 1px dashed rgba(147, 214, 255, .34);
  background:
    linear-gradient(135deg, rgba(105, 167, 255, .12), rgba(154, 243, 192, .06)),
    rgba(17, 38, 72, .72);
  padding: 16px;
  display: block;
}

.ad-slot.compact {
  min-height: 112px;
}

.ad-creative {
  width: 100%;
  height: 100%;
  min-height: 112px;
  border-radius: 12px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .06), transparent 34%),
    linear-gradient(135deg, rgba(76, 195, 255, .18), rgba(77, 216, 148, .10));
}

.full {
  width: 100%;
}

.seo-page {
  min-height: 100vh;
  padding: 32px;
  background:
    radial-gradient(circle at 18% 14%, rgba(79, 184, 255, .18), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(77, 216, 148, .15), transparent 26%),
    var(--bg);
  color: var(--text);
}

.seo-home-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  background: rgba(17, 38, 72, .78);
}

.seo-article {
  max-width: 860px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(22px, 5vw, 46px);
  background: rgba(8, 18, 34, .9);
  box-shadow: var(--shadow);
}

.seo-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.seo-article h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 64px);
  line-height: 1.05;
}

.seo-description {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.seo-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.seo-meta div,
.seo-post-list a {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(17, 38, 72, .64);
  padding: 13px;
}

.seo-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.seo-meta dd {
  margin: 6px 0 0;
  font-weight: 900;
}

.seo-open-app {
  display: inline-flex;
  width: auto;
  margin-top: 24px;
  text-decoration: none;
}

.seo-post-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.seo-post-list a {
  display: grid;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
}

.seo-post-list span {
  color: var(--muted);
  line-height: 1.55;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .78fr);
  gap: 18px;
  margin-top: 18px;
}

.settings-list button,
.legal-links button {
  text-align: left;
  width: 100%;
}

.admin-panel {
  grid-column: 1 / -1;
}

.compact-account {
  grid-column: 1 / -1;
}

.compact-legal {
  padding: 14px;
}

.tiny-legal {
  grid-column: 1 / -1;
  padding: 9px 11px;
  border-radius: 14px;
  opacity: .78;
}

.tiny-legal:hover,
.tiny-legal:focus-within {
  opacity: 1;
}

.tiny-legal summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  list-style-position: inside;
}

.tiny-legal details[open] summary {
  color: var(--text);
}

.tiny-legal .legal-links.compact {
  margin-top: 10px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.tiny-legal .legal-links.compact button {
  min-height: 34px;
  border-radius: 11px;
  padding: 7px 9px;
  font-size: 12px;
}

.tiny-legal .legal-preview {
  padding: 10px;
}

.tiny-legal .legal-preview strong {
  font-size: 13px;
}

.tiny-legal .legal-preview p {
  font-size: 12px;
  line-height: 1.5;
}

.compact-letter-card {
  padding: 11px 13px;
  border-radius: 14px;
}

.compact-letter-card summary {
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
  list-style-position: inside;
}

.compact-letter-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.compact-letter-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.compact-letter-body textarea {
  min-height: 112px;
}

.legal-links.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.legal-links.compact button {
  min-height: 38px;
  border-radius: 13px;
  padding: 8px 10px;
  font-size: 13px;
}

.legal-links.compact button.active {
  border-color: rgba(147, 214, 255, .72);
  background: rgba(76, 195, 255, .18);
}

.legal-links.secondary {
  margin-top: 10px;
  opacity: .78;
}

.legal-preview {
  margin-top: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(5, 12, 24, .52);
  padding: 12px;
}

.legal-preview strong {
  display: block;
  font-size: 14px;
}

.legal-preview p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.dev-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 42, 80, .95);
  color: var(--text);
  padding: 9px 12px;
  text-decoration: none;
  font-weight: 800;
}

.debug-text {
  color: var(--danger);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.admin-grid button {
  margin-top: 14px;
  min-height: 40px;
  font-size: 13px;
}

.right-rail {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  display: grid;
  gap: 18px;
  min-width: 0;
  align-self: start;
}

.rail-status {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.maintenance-banner {
  position: sticky;
  top: 10px;
  z-index: 20;
  max-width: 1500px;
  margin: 0 auto 14px;
  border: 1px solid rgba(255, 190, 90, .38);
  border-radius: 22px;
  background: rgba(77, 52, 14, .74);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.notice-banner {
  position: sticky;
  top: 10px;
  z-index: 21;
  max-width: 1500px;
  margin: 0 auto 14px;
  border: 1px solid rgba(147, 214, 255, .34);
  border-radius: 22px;
  background: rgba(17, 38, 72, .92);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.notice-banner span {
  color: var(--text);
  font-weight: 800;
}

.notice-banner button {
  margin-left: auto;
  min-height: 38px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 42, 80, .95);
  color: var(--text);
  padding: 8px 12px;
  font-weight: 800;
}

.form-message {
  margin: 12px 0 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(5, 12, 24, .58);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.form-message.error {
  border-color: rgba(255, 155, 155, .34);
  color: var(--danger);
}

.file-field {
  margin: 12px 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.file-field input {
  min-height: 48px;
}

.form-grid.wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.settings-list button:disabled,
.admin-grid button:disabled {
  cursor: not-allowed;
  opacity: .54;
}

.maintenance-banner span {
  color: var(--muted);
}

.maintenance-banner button {
  margin-left: auto;
  min-height: 40px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 42, 80, .95);
  color: var(--text);
  padding: 8px 12px;
  font-weight: 800;
}

.min-w-0 {
  min-width: 0;
}

.small-text {
  font-size: 13px;
  line-height: 1.6;
}

@media (min-width: 961px) and (max-width: 1180px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 292px;
  }

  .program-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .method-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .app-shell {
    padding: 16px;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 980px;
  }

  .top-panel {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .brand-panel {
    grid-template-columns: minmax(0, 1.1fr) minmax(210px, .55fr);
  }

  .right-rail {
    position: static;
    max-height: none;
    overflow: visible;
    grid-template-columns: 1fr 1fr;
  }

  .main-grid,
  .main-grid.two,
  .settings-grid,
  .inline-grid {
    grid-template-columns: 1fr;
  }

  .bgm-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ad-slot {
    min-height: 120px;
  }
}

@media (min-width: 821px) and (max-width: 960px) {
  .main-grid,
  .main-grid.two,
  .settings-grid,
  .inline-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .program-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid.wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-title {
    align-items: flex-start;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px 12px 88px;
  }

  .top-panel {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: stretch;
  }

  .language-switcher,
  .account-pill {
    width: 100%;
  }

  .language-switcher button {
    flex: 1;
  }

  .account-pill,
  .rss-link {
    border-radius: 14px;
  }

  .brand-panel {
    grid-template-columns: 1fr;
  }

  .tab-bar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 30;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
    padding: 8px;
    overflow-x: visible;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(8, 18, 34, .97);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .34);
    backdrop-filter: blur(12px);
  }

  .tab-bar button {
    min-height: 44px;
    border-radius: 12px;
    padding: 7px 5px;
    font-size: 13px;
  }

  .now-card {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .form-grid.wide,
  .email-login-grid,
  .method-grid,
  .account-feature-grid,
  .admin-grid,
  .seo-meta,
  .right-rail {
    grid-template-columns: 1fr;
  }

  .email-login-actions {
    grid-template-columns: 1fr;
  }

  .bgm-grid.compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .program-grid,
  .bgm-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .button-line {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

/* ---- Site footer (運営情報リンク群) ---- */
.site-footer {
  position: relative;
  margin-top: 28px;
  padding: 22px 18px 32px;
  border-top: 1px solid var(--line);
  background: rgba(8, 18, 34, .72);
  color: var(--muted);
}

.site-footer-inner {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 24px;
  align-items: center;
}

.site-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-footer-brand strong {
  color: var(--text);
  font-size: 16px;
  letter-spacing: .02em;
}

.site-footer-brand span {
  font-size: 13px;
  color: var(--muted);
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.site-footer-links button {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(18, 39, 72, .78);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.site-footer-links button:hover,
.site-footer-links button:focus-visible {
  border-color: var(--accent);
  background: rgba(18, 39, 72, .98);
  outline: none;
}

.site-footer-copy {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
  opacity: .85;
}

.subpage-shell .site-footer {
  margin-top: 32px;
}

/* ---- Subpage shell ---- */
.subpage-shell {
  padding-bottom: 24px;
}

.subpage-layout {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 0 0;
}

.subpage {
  display: grid;
  gap: 18px;
}

.subpage-header {
  display: grid;
  gap: 10px;
}

.subpage-back {
  justify-self: start;
  min-height: 40px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
}

.subpage-title {
  margin: 4px 0 0;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: .01em;
}

.subpage-lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.subpage-note {
  margin: 4px 0 0;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 200, 120, .35);
  background: rgba(80, 55, 18, .35);
  color: #ffe6c0;
  font-size: 13px;
  line-height: 1.6;
}

.subpage-grid {
  display: grid;
  gap: 16px;
}

.subpage-card {
  display: grid;
  gap: 10px;
}

.subpage-card h2 {
  margin: 0;
}

.subpage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.subpage-success {
  border-color: rgba(154, 243, 192, .45);
  background: linear-gradient(180deg, rgba(20, 60, 44, .55), rgba(10, 20, 36, .92));
}

/* ---- Meta list (About) ---- */
.meta-list {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}

.meta-list > div {
  display: contents;
}

.meta-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding-top: 2px;
}

.meta-list dd {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  word-break: break-word;
}

.link-button {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent2);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
  color: #cfe7ff;
  outline: none;
}

/* ---- Contact form ---- */
.contact-form {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  gap: 6px;
}

.form-row label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.required-mark {
  color: var(--danger);
  margin-left: 2px;
}

.form-hint {
  color: var(--muted);
  font-size: 12px;
}

.form-error {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 155, 155, .45);
  background: rgba(80, 18, 28, .55);
  color: #ffd6d6;
  font-size: 14px;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible,
.contact-form select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(105, 167, 255, .25);
}

/* ---- Legal tabs / document ---- */
.legal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legal-tabs button {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(18, 42, 80, .85);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}

.legal-tabs button.active {
  background: linear-gradient(90deg, #4cc3ff, #4d8dff);
  color: #061325;
  border-color: rgba(147, 214, 255, .72);
}

.legal-tabs button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(105, 167, 255, .35);
}

.legal-document {
  padding: 22px 22px 26px;
}

/* ---- Minimal markdown styling ---- */
.md-body {
  display: grid;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
}

.md-body .md-h1 {
  margin: 6px 0 4px;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: .01em;
}

.md-body .md-h2 {
  margin: 14px 0 2px;
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--accent2);
}

.md-body .md-h3 {
  margin: 10px 0 0;
  font-size: 16px;
  color: var(--accent2);
}

.md-body .md-p {
  margin: 0;
  color: var(--text);
}

.md-body .md-list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 6px;
}

.md-body .md-list li {
  line-height: 1.75;
}

@media (max-width: 820px) {
  .site-footer-inner {
    grid-template-columns: 1fr;
  }

  .site-footer-links {
    justify-content: flex-start;
  }

  .subpage-layout {
    padding: 4px 4px 0;
  }

  .meta-list {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }

  .meta-list dt {
    padding-top: 8px;
  }
}

/* ------------------------------------------------------------------ */
/* YouTubeライク視聴体験 v3: サムネイル付きカード / 番組詳細 / チャンネル / コメント */
/* ------------------------------------------------------------------ */

.program-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.program-card-body {
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.program-card h3 {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.4;
}

.program-title-link {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: left;
  padding: 0;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.program-title-link:hover {
  color: var(--accent2);
}

.program-thumb-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.program-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(10, 24, 48, .9);
  overflow: hidden;
}

.program-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.program-thumb.large {
  border-radius: 16px;
  border: 1px solid var(--line);
}

.program-thumb.thumb-auto {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 14px;
  box-sizing: border-box;
}

.program-thumb.thumb-auto .thumb-genre {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, .92);
  background: rgba(6, 14, 28, .42);
  border-radius: 999px;
  padding: 3px 10px;
}

.program-thumb.thumb-auto .thumb-title {
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .42);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.program-thumb.large.thumb-auto .thumb-title {
  font-size: 24px;
  -webkit-line-clamp: 3;
}

.thumb-g0 { background: linear-gradient(135deg, #16336b, #0e6f64); }
.thumb-g1 { background: linear-gradient(135deg, #243a8c, #6a3d9c); }
.thumb-g2 { background: linear-gradient(135deg, #0c4a6e, #1d7fb8); }
.thumb-g3 { background: linear-gradient(135deg, #5b2d62, #a8456b); }
.thumb-g4 { background: linear-gradient(135deg, #14532d, #3f8e4f); }
.thumb-g5 { background: linear-gradient(135deg, #7c4a16, #b8762a); }

.channel-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #061325;
  font-weight: 900;
  flex: none;
  line-height: 1;
}

.program-channel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  min-width: 0;
}

.channel-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-link:hover {
  color: var(--accent2);
}

.channel-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.program-card-stats {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.program-card .program-actions {
  margin-top: auto;
  padding-top: 12px;
}

/* 番組詳細ビュー */
.watch-layout {
  max-width: 980px;
}

.program-detail-stack,
.channel-stack {
  display: grid;
  gap: 14px;
}

.detail-back {
  justify-self: start;
}

.program-detail .detail-title {
  margin: 14px 0 0;
  font-size: 26px;
  line-height: 1.35;
}

.detail-meta-row {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.detail-channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.detail-channel-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  padding: 4px;
  cursor: pointer;
  min-width: 0;
}

.detail-channel-button.as-text {
  cursor: default;
}

.detail-channel-button:not(.as-text):hover strong {
  color: var(--accent2);
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-description {
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 24, 48, .55);
  padding: 12px 14px;
}

.detail-description p {
  margin: 0;
  color: var(--text);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

/* コメント */
.comment-form {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.comment-form textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.comment-login-prompt {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.comment-list {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.comment-item {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.comment-content {
  min-width: 0;
  flex: 1;
}

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.comment-head strong {
  font-size: 14px;
}

.comment-content p {
  margin: 4px 0 0;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-delete {
  margin-top: 0;
}

/* チャンネル */
.channel-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.channel-header-row h1 {
  margin: 0;
  font-size: 24px;
}

.channel-bio {
  margin: 6px 0 0;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.avatar-color-row {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.avatar-color-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.avatar-color-option {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.avatar-color-option.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
}

@media (max-width: 520px) {
  .detail-channel-row {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-actions .primary-button {
    width: 100%;
  }

  .channel-header-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
