@import url("https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700,900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  /* PyCon JP 2026 design tokens */
  --pycon-red: #e1363e;
  --pycon-red-strong: #c9222a;
  --pycon-red-deep: #a81e29;
  --pycon-navy: #1a3156;
  --pycon-cream: #fdf3f0;
  --pycon-surface: #f7f8fa;
  --pycon-border: #e4e7ec;
  --pycon-green: #1a6645;

  --bg-1: #ffffff;
  --bg-2: var(--pycon-cream);
  --ink: var(--pycon-navy);
  --muted: #5a6473;
  --text-muted: #6b7686;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --line: var(--pycon-border);
  --line-strong: #cbd2dc;
  --accent: var(--pycon-red);
  --accent-strong: var(--pycon-red-strong);
  --accent-soft: rgba(225, 54, 62, 0.1);
  --accent-2: #f2a98f;
  --indigo: var(--pycon-navy);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 4px 14px rgba(26, 49, 86, 0.06);
  --shadow-md: 0 14px 32px rgba(26, 49, 86, 0.08);
  --shadow-lg: 0 28px 56px rgba(26, 49, 86, 0.12);
  --ring: 0 0 0 3px rgba(225, 54, 62, 0.22);
  --caption-font-scale: 1;
  --font-sans: "Satoshi", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 100% -10%, rgba(225, 54, 62, 0.07), transparent 55%),
    radial-gradient(760px 480px at 0% 0%, rgba(26, 49, 86, 0.06), transparent 52%),
    linear-gradient(180deg, #ffffff 0%, var(--pycon-surface) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: rgba(225, 54, 62, 0.16);
}

.home-shell,
.caption-shell,
.layout {
  padding: 24px;
}

.card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  box-shadow: var(--shadow-md);
}

.card {
  position: relative;
  max-width: 720px;
  margin: 11vh auto;
  padding: 40px;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pycon-red), var(--pycon-navy));
}

.eyebrow {
  display: inline-block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pycon-red);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
}

h1,
h2 {
  margin-top: 0;
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
  color: var(--pycon-navy);
}

.lead {
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.65;
}

.home-title {
  margin: 14px 0 10px;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.08;
  color: var(--pycon-navy);
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

.home-features {
  list-style: none;
  margin: 28px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 640px) {
  .home-features {
    grid-template-columns: 1fr;
  }
}

.home-feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.home-feature strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.98rem;
}

.home-feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.home-feature-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.home-feature-dot--polish {
  background: var(--pycon-green);
  box-shadow: 0 0 0 4px rgba(26, 102, 69, 0.14);
}

@media (max-width: 640px) {
  .home-features {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card {
    padding: 28px 22px;
    margin: 6vh auto;
  }
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease,
    background 150ms ease, filter 150ms ease, color 150ms ease, border-color 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.2);
}

.primary {
  background: var(--pycon-red);
  color: white;
}

.primary:hover {
  background: var(--pycon-red-strong);
}

.secondary {
  background: var(--pycon-navy);
  color: white;
}

.secondary:hover {
  background: #142746;
}

.danger {
  background: var(--pycon-red-deep);
  color: white;
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
}

.panel {
  padding: 22px;
}

.controls h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.controls > p {
  margin-top: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.controls label {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.inline-actions {
  margin-top: 10px;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(12, 140, 106, 0.4);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: #fff;
}

input::placeholder,
textarea::placeholder {
  color: rgba(74, 88, 116, 0.55);
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
}

.field-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.status {
  margin-top: 12px;
  color: var(--muted);
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.recording-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
  background: #8a93a8;
}

.recording-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.recording-level-wrap {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 32, 59, 0.08);
  overflow: hidden;
}

.recording-level {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 80ms linear;
}

.recording-indicator.is-stopped .recording-label {
  color: var(--muted);
}

.recording-indicator.is-connecting .recording-dot {
  background: #f0a500;
  animation: recording-pulse 1.2s ease-in-out infinite;
}

.recording-indicator.is-connecting .recording-label {
  color: #9a6700;
}

.recording-indicator.is-recording .recording-dot {
  background: #e02424;
  animation: recording-pulse 1.2s ease-in-out infinite;
}

.recording-indicator.is-recording .recording-label {
  color: #b91c1c;
}

.recording-indicator.is-recording .recording-level {
  background: #e02424;
}

@keyframes recording-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.55;
    transform: scale(0.88);
  }
}

pre {
  min-height: 180px;
  max-height: 34vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
}

.transcript-block + .transcript-block {
  margin-top: 18px;
}

.transcript-block h2 {
  margin-bottom: 6px;
}

.transcript-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.transcript-text {
  margin: 0;
  min-height: 220px;
  max-height: 38vh;
  line-height: 1.55;
  font-family: var(--font-sans);
}

.transcript-text--translation {
  font-size: 1.05rem;
  font-weight: 600;
}

.transcript-text:empty::before {
  display: block;
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}

#sourceText:empty::before {
  content: "Waiting for original speech...";
}

#translatedText:empty::before {
  content: "Waiting for translation...";
}

.captions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.caption-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compact-controls {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  gap: 8px;
}

.spotlight {
  border: 1px solid rgba(12, 140, 106, 0.28);
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.audience-body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.audience-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
}

.audience-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 16px calc(10px + env(safe-area-inset-top));
  padding-top: calc(14px + env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.audience-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.audience-header h1 {
  margin: 0;
  font-size: 1.15rem;
}

.audience-connect-btn {
  padding: 10px 14px;
  flex-shrink: 0;
}

.audience-controls {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
  margin-top: 10px;
}

.audience-controls .display-toggle {
  grid-column: 1 / -1;
  justify-self: start;
}

.audience-controls input {
  margin-top: 0;
  padding: 10px 12px;
}

.audience-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.audience-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  min-height: 0;
}

.audience-section {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
  margin-bottom: 0;
}

.audience-section--translation,
.speaker-section.audience-section--translation {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.viewport-hint {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  opacity: 0.45;
  transition: opacity 160ms ease;
}

.speaker-transcript .viewport-hint {
  opacity: 0.62;
}

.audience-section:has(.sentence-viewport.has-older) .viewport-hint {
  opacity: 1;
}

.sentence-viewport {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.45));
  box-shadow: inset 0 1px 2px rgba(17, 32, 59, 0.04);
  scroll-padding-bottom: 12px;
}

.sentence-viewport,
.audience-scroll,
pre {
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 32, 59, 0.22) transparent;
}

.sentence-viewport::-webkit-scrollbar,
.audience-scroll::-webkit-scrollbar,
pre::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.sentence-viewport::-webkit-scrollbar-thumb,
.audience-scroll::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb {
  background: rgba(17, 32, 59, 0.2);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sentence-viewport::-webkit-scrollbar-thumb:hover,
.audience-scroll::-webkit-scrollbar-thumb:hover,
pre::-webkit-scrollbar-thumb:hover {
  background: rgba(17, 32, 59, 0.35);
  background-clip: padding-box;
}

.sentence-viewport--translation {
  max-height: min(46vh, calc(5 * 7.4rem));
}

.sentence-viewport--source {
  max-height: min(34vh, calc(5 * 5.8rem));
}

.sentence-viewport::before {
  content: "";
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  display: block;
  height: 28px;
  margin-bottom: -28px;
  background: linear-gradient(to bottom, rgba(242, 247, 255, 0.98), rgba(242, 247, 255, 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 2;
}

.sentence-viewport.is-scrolled-up::before {
  opacity: 1;
}

.sentence-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}

.audience-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.audience-section-head h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.audience-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(12, 140, 106, 0.12);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.audience-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  animation: recording-pulse 1.2s ease-in-out infinite;
}

.sentence-item {
  position: relative;
  margin: 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  line-height: 1.55;
  word-break: break-word;
  flex-shrink: 0;
  scroll-margin-bottom: 12px;
  animation: sentence-in 220ms ease-out;
}

@keyframes sentence-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sentence-item {
    animation: none;
  }
}

.audience-section--translation .sentence-item {
  font-size: clamp(1.25rem, 5vw, 1.65rem);
  font-weight: 700;
  line-height: 1.45;
  border-color: rgba(12, 140, 106, 0.22);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(12, 140, 106, 0.08);
}

.sentence-list--source .sentence-item {
  font-size: clamp(1rem, 3.8vw, 1.15rem);
  color: #24324d;
}

.sentence-live {
  margin: 6px 0 0;
  padding: 12px 14px;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px dashed rgba(12, 140, 106, 0.35);
  background: rgba(12, 140, 106, 0.06);
  color: var(--ink);
  font-size: clamp(1.15rem, 4.8vw, 1.45rem);
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.sentence-live--source {
  border-color: rgba(17, 32, 59, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: clamp(0.95rem, 3.6vw, 1.05rem);
  font-weight: 500;
}

.jump-live-btn {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: #1f2f52;
  color: white;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(17, 32, 59, 0.24);
  cursor: pointer;
}

@media (min-width: 768px) {
  .audience-app {
    max-width: 760px;
    margin: 0 auto;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.35);
  }
}

.layout--speaker {
  min-height: 100vh;
  align-items: stretch;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
}

.speaker-transcript {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: calc(100vh - 48px);
}

.speaker-transcript-head h2 {
  margin: 0 0 4px;
}

.speaker-transcript-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.speaker-transcript-title-row h2 {
  margin: 0;
}

.btn-compact {
  padding: 8px 12px;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.speaker-transcript-head {
  display: grid;
  gap: 8px;
  margin-bottom: 2px;
}

@media (min-width: 720px) {
  .speaker-transcript-head {
    grid-template-columns: minmax(0, 360px) 1fr;
    align-items: center;
    column-gap: 16px;
  }

  .speaker-transcript-head .provider-tabs {
    margin-bottom: 0;
  }

  .speaker-transcript-head .speaker-toolbar {
    justify-self: end;
  }

  .speaker-transcript-head .transcript-hint,
  .speaker-transcript-head .caption-legend {
    grid-column: 1 / -1;
  }
}

.speaker-display-options {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 4px;
}

.display-toggle {
  margin-left: 0;
}

.sentence-list--flow {
  display: block;
  gap: 0;
  padding: 16px 18px;
  line-height: 1.65;
  word-break: break-word;
}

.sentence-list--flow .sentence-item {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  animation: none;
  scroll-margin-bottom: 0;
}

.sentence-list--flow .sentence-item:not(:last-child) {
  margin-right: 0.28em;
}

.audience-section--translation .sentence-list--flow,
.speaker-section.audience-section--translation .sentence-list--flow {
  font-size: clamp(1.25rem, 5vw, 1.65rem);
  font-weight: 700;
  line-height: 1.65;
}

.sentence-list--source.sentence-list--flow {
  font-size: clamp(1rem, 3.8vw, 1.15rem);
  font-weight: 400;
  color: #24324d;
}

.sentence-list--flow .sentence-item--polished,
.sentence-list--flow .sentence-item--processed {
  padding-right: 0;
}

.sentence-list--flow .sentence-item--polished::after,
.sentence-list--flow .sentence-item--processed::after {
  position: relative;
  top: auto;
  right: auto;
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 0.2em 0 0.1em;
  vertical-align: 0.15em;
}

.is-paragraph-display .sentence-viewport--translation {
  font-size: clamp(1.25rem, 5vw, 1.65rem);
  line-height: 1.65;
  max-height: calc(var(--paragraph-line-limit, 7) * 1.65em + 32px);
}

.is-paragraph-display .sentence-viewport--source {
  font-size: clamp(1rem, 3.8vw, 1.15rem);
  line-height: 1.65;
  max-height: calc(var(--paragraph-line-limit, 7) * 1.65em + 32px);
}

.is-paragraph-display .speaker-transcript .sentence-viewport--translation,
.is-paragraph-display .speaker-transcript .sentence-viewport--source {
  max-height: calc(var(--paragraph-line-limit, 7) * 1.65em + 32px);
}

.is-paragraph-display .sentence-live {
  margin-top: 0;
  padding: 12px 18px 16px;
  border: none;
  border-top: 1px dashed rgba(12, 140, 106, 0.28);
  border-radius: 0 0 18px 18px;
  background: rgba(12, 140, 106, 0.04);
}

.is-paragraph-display .sentence-live--source {
  border-top-color: rgba(17, 32, 59, 0.14);
  background: rgba(255, 255, 255, 0.5);
}

.transcript-hint--edit {
  margin: 0;
  color: var(--accent);
  font-size: 0.88rem;
}

.speaker-section {
  margin-bottom: 0;
}

.speaker-section .audience-section-head h3 {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.speaker-transcript .sentence-viewport--translation {
  max-height: min(32vh, calc(5 * 7.4rem));
}

.speaker-transcript .sentence-viewport--source {
  max-height: min(26vh, calc(5 * 5.8rem));
}

.sentence-item--editable {
  cursor: text;
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

.sentence-item--editable:hover {
  border-color: rgba(12, 140, 106, 0.45);
}

.sentence-item--editable:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(12, 140, 106, 0.18);
  background: #fff;
}

.jump-live-btn--inline {
  position: static;
  transform: none;
  align-self: center;
  margin-top: 4px;
}

.provider-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  max-width: 360px;
  margin: 10px 0 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(17, 32, 59, 0.05);
}

.provider-tabs--audience {
  margin-top: 12px;
  max-width: none;
}

.provider-tab {
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease,
    box-shadow 160ms ease;
}

.provider-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

.provider-tab.is-active {
  color: #fff;
  box-shadow: 0 6px 14px rgba(12, 140, 106, 0.28);
}

.provider-tab[data-provider-tab="openai"].is-active {
  background: var(--accent);
  border-color: var(--accent);
}

.provider-tab[data-provider-tab="gemini"].is-active {
  background: var(--indigo);
  border-color: var(--indigo);
  box-shadow: 0 6px 14px rgba(35, 71, 197, 0.28);
}

.polished-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.polished-toggle:hover {
  border-color: rgba(12, 140, 106, 0.4);
  color: var(--accent-strong);
}

.polished-toggle:has(input:checked) {
  background: var(--accent-soft);
  border-color: rgba(12, 140, 106, 0.4);
  color: var(--accent-strong);
}

.polished-toggle input {
  width: auto;
  margin: 0;
  accent-color: var(--accent-strong);
  cursor: pointer;
}

.sentence-item--polished,
.sentence-item--processed {
  padding-right: 30px;
}

.sentence-item--polished::after,
.sentence-item--processed::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
  pointer-events: none;
}

.provider-panels {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.provider-panel {
  display: none;
  flex-direction: column;
  gap: 28px;
  min-height: 0;
}

.provider-panel.is-active {
  display: flex;
}

.provider-panel[hidden] {
  display: none !important;
}

.provider-panels--audience {
  flex: 1;
}

.provider-panels--audience .provider-panel.is-active {
  flex: 1;
}

.provider-panels--audience .audience-scroll {
  flex: 1;
  min-height: 0;
}

@media (max-width: 920px) {
  .layout--speaker {
    grid-template-columns: 1fr;
  }

  .speaker-transcript .sentence-viewport--translation {
    max-height: min(38vh, calc(5 * 7.4rem));
  }

  .speaker-transcript .sentence-viewport--source {
    max-height: min(30vh, calc(5 * 5.8rem));
  }

  .is-paragraph-display .speaker-transcript .sentence-viewport--translation,
  .is-paragraph-display .speaker-transcript .sentence-viewport--source {
    max-height: calc(var(--paragraph-line-limit, 7) * 1.65em + 32px);
  }
}

.confirm-modal {
  width: min(92vw, 440px);
  max-width: 440px;
  padding: 0;
  border: none;
  border-radius: 22px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.confirm-modal::backdrop {
  background: rgba(17, 32, 59, 0.45);
  backdrop-filter: blur(6px);
}

.confirm-modal-card {
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 255, 0.96));
  box-shadow: 0 28px 60px rgba(17, 32, 59, 0.18);
}

.confirm-modal-eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.confirm-modal-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  line-height: 1.25;
}

.confirm-modal-message {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.confirm-modal-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.confirm-modal-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.88rem;
  font-weight: 600;
}

.confirm-modal-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.confirm-modal-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.confirm-modal-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-strong);
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.confirm-modal-actions .btn {
  min-width: 120px;
}

.confirm-modal[open] .confirm-modal-card {
  animation: confirm-modal-in 180ms ease-out;
}

@keyframes confirm-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.speaker-body {
  min-height: 100vh;
}

.speaker-controls-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.speaker-controls-top h1 {
  margin: 0;
}

.speaker-eyebrow {
  margin-bottom: 6px;
}

.speaker-home-link {
  margin-top: 4px;
}

.speaker-settings {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.speaker-settings-summary {
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.speaker-settings-summary::-webkit-details-marker {
  display: none;
}

.speaker-settings-body {
  padding: 0 14px 14px;
}

.speaker-actions {
  margin-top: 14px;
}

.speaker-status {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.speaker-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 8px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.speaker-toolbar .display-toggle {
  margin-left: 0;
}

.caption-size-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.caption-size-label {
  padding: 0 6px 0 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.caption-size-btn {
  min-width: 32px;
  border: none;
  border-radius: 999px;
  padding: 5px 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.caption-size-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(12, 140, 106, 0.25);
}

.caption-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.caption-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
  flex-shrink: 0;
}

.speaker-hide-source .speaker-source-panel {
  display: none !important;
}

.speaker-hide-source .speaker-section.audience-section--translation {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.speaker-transcript .audience-section--translation .sentence-item,
.speaker-transcript .audience-section--translation .sentence-list--flow,
.speaker-transcript .audience-section--translation .sentence-live,
.is-paragraph-display .speaker-transcript .sentence-viewport--translation {
  font-size: calc(clamp(1.25rem, 5vw, 1.65rem) * var(--caption-font-scale, 1));
}

.speaker-transcript .sentence-list--source.sentence-list--flow,
.speaker-transcript .audience-section--source .sentence-item,
.speaker-transcript .audience-section--source .sentence-live,
.is-paragraph-display .speaker-transcript .sentence-viewport--source {
  font-size: calc(clamp(1rem, 3.8vw, 1.15rem) * var(--caption-font-scale, 1));
}

@media (min-width: 1100px) {
  .layout--speaker {
    grid-template-columns: 400px 1fr;
  }

  .speaker-transcript .sentence-viewport--translation {
    max-height: min(42vh, calc(5 * 7.4rem));
  }

  .speaker-transcript .sentence-viewport--source {
    max-height: min(34vh, calc(5 * 5.8rem));
  }
}

@media (max-width: 920px) {
  .speaker-settings[open] .speaker-settings-summary {
    border-bottom: 1px solid var(--line);
  }

  .caption-size-group {
    margin-left: 0;
  }
}

.login-card {
  max-width: 440px;
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.login-form label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
}

.login-form input {
  margin-top: 0;
}

.login-error {
  margin: 0;
  color: #b42318;
  font-size: 0.9rem;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.login-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 0.9rem;
}

.speaker-controls-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.speaker-user {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.program-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.stage-list,
.talk-admin-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.stage-card,
.talk-admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.stage-card-head,
.talk-admin-head {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.stage-card-slug {
  margin: 4px 0 8px;
}

.stage-card-actions,
.talk-admin-links .inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
}

.stage-badge--live {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

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

.stage-hall-qr,
.talk-admin-qr {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 10px;
}

.stage-hall-qr img,
.talk-admin-qr img {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}

.stage-hall-links {
  flex: 1;
  min-width: 0;
}

.talk-admin-actions {
  margin-top: 10px;
}

.talk-url-input {
  width: 100%;
  margin-bottom: 8px;
  font-size: 0.78rem;
}

.audience-session-info {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .program-talk-grid,
  .talk-admin-qr {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

.speaker-page {
  min-height: 100vh;
}

.speaker-page-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px;
}

.speaker-page-panel {
  margin-top: 16px;
}

.speaker-shell-header {
  padding: 16px 16px 0;
  max-width: 1200px;
  margin: 0 auto;
}

.speaker-shell-header--live {
  padding-bottom: 0;
}

.speaker-shell-header--compact {
  padding: 0;
  max-width: none;
}

.speaker-shell-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.speaker-shell-top h1 {
  margin: 0;
}

.speaker-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.speaker-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}

.speaker-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.55);
}

.speaker-nav a.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: rgba(12, 140, 106, 0.2);
}

.speaker-hub-card-wrap {
  max-width: 760px;
}

.speaker-hub-grid {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.speaker-hub-tile {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.speaker-hub-tile:hover {
  border-color: rgba(12, 140, 106, 0.35);
  box-shadow: var(--shadow-sm);
}

.speaker-hub-tile-label {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.speaker-hub-tile strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.speaker-hub-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.speaker-live-settings {
  padding-top: 4px;
}

.speaker-section-title {
  margin: 0 0 12px;
  font-size: 1rem;
}

.form-message {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
}

.form-message--error {
  color: #b42318;
  background: rgba(180, 35, 24, 0.08);
  border: 1px solid rgba(180, 35, 24, 0.18);
}

.form-message--saved {
  color: #166534;
  background: rgba(22, 101, 52, 0.08);
  border: 1px solid rgba(22, 101, 52, 0.18);
}

.inline-form-row {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.delete-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.delete-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.delete-confirm input {
  margin-top: 3px;
}

.layout--speaker {
  padding-top: 8px;
}

@media (min-width: 640px) {
  .inline-form-row {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

@media (min-width: 900px) {
  .speaker-hub-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── PyCon JP landing ── */
.home-shell--pycon {
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.pycon-topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.pycon-topnav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--pycon-navy);
}

.pycon-topnav-brand img {
  width: 48px;
  height: 48px;
  display: block;
}

.pycon-topnav-brand strong {
  display: block;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.pycon-topnav-brand span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

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

.pycon-hero {
  flex: 1;
  display: grid;
  align-items: center;
  gap: 32px;
  padding: clamp(40px, 8vh, 88px) clamp(20px, 4vw, 48px) 48px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

.pycon-hero-copy h1 {
  margin: 12px 0 16px;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 900;
}

.pycon-hero-copy h1 .dot {
  color: var(--pycon-red);
}

.pycon-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.pycon-hero-meta strong {
  color: var(--pycon-navy);
}

.pycon-hero-art {
  position: relative;
  min-height: 280px;
  display: grid;
  place-items: center;
}

.pycon-hero-art img.logotype {
  width: min(100%, 420px);
  height: auto;
}

.pycon-hero-art img.hero-deco {
  position: absolute;
  inset: auto 0 -24px;
  width: 100%;
  opacity: 0.9;
  pointer-events: none;
}

.pycon-footer {
  border-top: 1px solid var(--line);
  padding: 22px clamp(20px, 4vw, 48px);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.84rem;
  background: #fff;
}

.pycon-footer img {
  height: 28px;
  width: auto;
}

.pycon-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.pycon-brand-mark img {
  width: 32px;
  height: 32px;
  display: block;
}

@media (max-width: 860px) {
  .pycon-hero {
    grid-template-columns: 1fr;
    padding-top: 36px;
  }

  .pycon-hero-art {
    order: -1;
    min-height: 200px;
  }
}


.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.login-brand img {
  width: 52px;
  height: 52px;
  display: block;
}

.login-brand strong {
  display: block;
  color: var(--pycon-navy);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.login-brand span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}
