:root {
  color-scheme: light;
  --background: #f3f6fb;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --surface-soft: #edf3ff;
  --text: #111827;
  --muted: #64748b;
  --line: #d6dfec;
  --blue: #2563eb;
  --blue-dark: #1749bc;
  --blue-soft: #dce8ff;
  --green: #168653;
  --green-soft: #e7f7ee;
  --red: #c73e45;
  --red-soft: #fff0f1;
  --shadow: 0 24px 70px rgba(31, 51, 84, 0.11);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    linear-gradient(rgba(38, 99, 235, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 99, 235, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 0%, #dce7ff 0, transparent 38rem),
    var(--background);
  background-size: 56px 56px, 56px 56px, auto, auto;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 88px;
  padding: 14px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  object-fit: contain;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.tab {
  display: inline-flex;
  min-width: 168px;
  height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.tab:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.tab.active {
  color: var(--blue);
  border-color: #bfd1f4;
  background: var(--surface-solid);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.1);
}

.language {
  display: grid;
  grid-template-columns: repeat(2, 48px);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #e9eef6;
}

.language-button {
  width: 48px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  background: transparent;
}

.language-button.active {
  color: var(--blue);
  background: white;
  box-shadow: 0 3px 10px rgba(42, 61, 91, 0.12);
}

.page {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) 0 48px;
}

.hero {
  max-width: 850px;
  margin-bottom: 48px;
}

.eyebrow,
.section-label {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #50627d;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px var(--green-soft);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(46px, 7vw, 86px);
  font-weight: 830;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.hero-copy {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.converter-card,
.information-card {
  padding: clamp(28px, 4vw, 52px);
}

.converter-card {
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.converter-card h2,
.information-card h2 {
  margin: 12px 0 32px;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.field-label,
.select-field > span,
legend {
  display: block;
  margin-bottom: 10px;
  color: #3d4c64;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.video-preview {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #c9d8ef;
  border-radius: 14px;
  background: #f5f8ff;
}

.video-preview-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: white;
  font-size: 15px;
  background: var(--blue);
}

.video-preview.loading .video-preview-icon {
  animation: pulse 1.2s ease-in-out infinite;
}

.video-preview.error {
  border-color: #f0c3c6;
  background: var(--red-soft);
}

.video-preview.error .video-preview-icon {
  background: var(--red);
}

.video-preview-content {
  min-width: 0;
}

.video-preview-content span,
.video-preview-content strong {
  display: block;
}

.video-preview-status {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.video-preview.error .video-preview-status {
  margin: 0;
  color: var(--red);
}

.video-preview-content strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#videoPreviewDuration,
#youtubeVideoPreviewDuration {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.authentication-panel {
  margin-top: 18px;
  border: 1px solid #d7e0ed;
  border-radius: 14px;
  background: #f8faff;
}

.authentication-panel summary {
  position: relative;
  padding: 15px 44px 15px 16px;
  color: #3d4c64;
  font-size: 14px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.authentication-panel summary::-webkit-details-marker {
  display: none;
}

.authentication-panel summary::after {
  position: absolute;
  top: 50%;
  right: 17px;
  color: var(--blue);
  content: "+";
  transform: translateY(-50%);
}

.authentication-panel[open] summary::after {
  content: "−";
}

.authentication-content {
  padding: 0 16px 16px;
}

.cookie-picker {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px dashed #aebfd8;
  border-radius: 12px;
  background: white;
  cursor: pointer;
}

.cookie-picker:hover {
  border-color: var(--blue);
  background: var(--surface-soft);
}

.cookie-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cookie-picker-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: var(--blue);
  font-size: 23px;
  background: var(--blue-soft);
}

.cookie-picker strong,
.cookie-picker small {
  display: block;
}

.cookie-picker small {
  max-width: 420px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="url"],
input[type="password"],
input[type="text"],
select {
  width: 100%;
  height: 58px;
  border: 1px solid #c8d4e5;
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: white;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

input[type="url"],
input[type="password"],
input[type="text"] {
  padding: 0 18px;
}

input[type="url"]::placeholder,
input[type="password"]::placeholder,
input[type="text"]::placeholder {
  color: #9aa8bc;
}

input[type="url"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
}

.paste-button {
  min-width: 118px;
  height: 58px;
  border: 1px solid #bfd0eb;
  border-radius: 14px;
  color: var(--blue);
  font-weight: 750;
  background: var(--surface-soft);
}

.paste-button:hover {
  background: var(--blue-soft);
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 28px 0 30px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  height: 58px;
  padding: 4px;
  border: 1px solid #c8d4e5;
  border-radius: 14px;
  background: #eef2f8;
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  height: 48px;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 800;
}

.segmented input:checked + span {
  color: var(--blue);
  background: white;
  box-shadow: 0 3px 10px rgba(42, 61, 91, 0.12);
}

select {
  appearance: none;
  padding: 0 48px 0 16px;
  background:
    linear-gradient(45deg, transparent 50%, #68778d 50%) calc(100% - 21px) 26px / 6px 6px no-repeat,
    linear-gradient(135deg, #68778d 50%, transparent 50%) calc(100% - 15px) 26px / 6px 6px no-repeat,
    white;
}

.submit-button {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  border-radius: 15px;
  color: white;
  font-weight: 800;
  background: var(--blue);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.23);
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.submit-button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.limits {
  min-height: 20px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.information-card {
  display: flex;
  min-height: 480px;
  flex-direction: column;
  background: rgba(241, 245, 252, 0.88);
}

.shield {
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 30px;
  place-items: center;
  border-radius: 20px;
  color: var(--green);
  background: var(--green-soft);
}

.shield svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.information-card p {
  color: var(--muted);
  line-height: 1.65;
}

.feature-list {
  display: grid;
  gap: 14px;
  margin: auto 0 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 27px;
  color: #45556f;
  font-size: 14px;
  line-height: 1.45;
}

.feature-list li::before {
  position: absolute;
  top: 3px;
  left: 0;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 11px;
  content: "✓";
  background: var(--green);
}

.feedback {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  margin-top: 20px;
  padding: 22px 24px;
  border: 1px solid #c9d8ef;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 38px rgba(31, 51, 84, 0.08);
}

.feedback strong {
  display: block;
  margin-bottom: 5px;
}

.feedback p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.feedback.success {
  border-color: #b9e4cc;
  background: var(--green-soft);
}

.feedback.error {
  border-color: #f0c3c6;
  background: var(--red-soft);
}

.feedback-icon,
.spinner {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.success .feedback-icon {
  color: white;
  background: var(--green);
}

.error .feedback-icon {
  color: white;
  background: var(--red);
}

.spinner {
  border: 4px solid var(--blue-soft);
  border-top-color: var(--blue);
  animation: spin 900ms linear infinite;
}

.download-button {
  display: inline-flex;
  min-width: 150px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 12px;
  color: white;
  font-weight: 800;
  text-decoration: none;
  background: var(--green);
}

.hidden {
  display: none !important;
}

.legal {
  max-width: 750px;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

footer {
  display: flex;
  width: min(1240px, calc(100% - 40px));
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.62;
    transform: scale(0.94);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 14px;
  }

  .tabs {
    grid-column: 1 / -1;
    grid-row: 2;
  }

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

  .converter-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .information-card {
    min-height: 390px;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand {
    font-size: 19px;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
  }

  .language {
    grid-template-columns: repeat(2, 42px);
  }

  .language-button {
    width: 42px;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    min-width: 0;
    height: 44px;
    flex: 1;
    padding: 0 10px;
    font-size: 12px;
  }

  .page {
    width: min(100% - 24px, 1240px);
    padding-top: 48px;
  }

  .workspace {
    border-radius: 19px;
  }

  .converter-card,
  .information-card {
    padding: 26px 20px;
  }

  .url-control,
  .options-grid {
    grid-template-columns: 1fr;
  }

  .paste-button {
    width: 100%;
  }

  .feedback {
    grid-template-columns: auto 1fr;
  }

  .download-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  footer {
    flex-direction: column;
    justify-content: center;
    padding: 24px 0;
    text-align: center;
  }
}

/* Media merge and trim tools */
.topbar .tabs {
  flex-wrap: wrap;
}

.topbar .tabs .tab {
  min-width: 118px;
  padding-inline: 14px;
}

.media-tool-page .hero {
  max-width: 920px;
  margin-bottom: 36px;
}

.media-tool-page {
  padding-top: clamp(42px, 6vw, 72px);
}

.media-tool-workspace {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.72fr);
}

.media-tool-card .media-field-gap {
  margin-top: 24px;
}

.media-tool-card {
  padding: clamp(26px, 3vw, 42px);
}

.media-tool-card h2 {
  margin: 10px 0 26px;
  font-size: clamp(27px, 2.8vw, 36px);
}

.media-tool-card .select-field.media-field-gap {
  display: block;
  padding-top: 6px;
}

.media-tool-card > .select-field > select {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.media-output-name {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: white;
  font-size: 15px;
}

.media-output-name:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
}

.media-output-name + .field-help {
  margin-top: 8px;
}

.media-merge-settings {
  margin-top: 26px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faff;
}

.media-merge-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 28px 17px 0;
  cursor: pointer;
  list-style: none;
  position: relative;
  color: var(--text);
  font-size: 14px;
  font-weight: 820;
}

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

.media-merge-settings summary::after {
  position: absolute;
  right: 2px;
  content: "+";
  color: var(--blue);
  font-size: 22px;
}

.media-merge-settings[open] summary::after {
  content: "−";
}

.media-merge-settings summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.merge-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 4px 0 18px;
  border-top: 1px solid var(--line);
}

.merge-settings-grid .select-field {
  padding-top: 16px;
}

.merge-settings-grid .select-field > select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.media-merge-settings > .field-help {
  margin: -4px 0 18px;
}

.media-file-picker {
  min-height: 82px;
  padding-block: 14px;
}

.media-file-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.media-file-list:empty {
  display: none;
}

.media-file-list li {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px 10px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.media-file-list li > span:first-child {
  min-width: 0;
}

.media-file-list strong,
.media-file-list small {
  display: block;
}

.media-file-list strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-file-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.media-file-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 5px;
}

.media-file-actions button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid #bfd0eb;
  border-radius: 8px;
  color: var(--blue);
  background: white;
}

.media-file-actions button:hover:not(:disabled) {
  background: var(--blue-soft);
}

.media-file-actions button:disabled {
  cursor: default;
  opacity: 0.35;
}

.media-submit {
  margin-top: 28px;
}

.media-tool-icon {
  font-size: 30px;
  font-weight: 800;
}

.time-range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.clip-editor {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.clip-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.clip-editor-heading .field-label {
  margin-bottom: 5px;
}

.clip-editor-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.add-interval-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.clip-intervals {
  display: grid;
  gap: 12px;
}

.clip-interval {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faff;
}

.clip-interval-title {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clip-interval-title strong {
  color: #34445e;
  font-size: 14px;
}

.remove-interval-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid #efb7b7;
  border-radius: 8px;
  color: #b4232f;
  background: #fff7f7;
  font-size: 20px;
  line-height: 1;
}

.remove-interval-button:hover {
  border-color: #d64550;
  background: #fff0f0;
}

.clip-interval .time-range-grid {
  gap: 12px;
  margin-top: 10px;
}

.clip-interval .field-label {
  margin-bottom: 6px;
  font-size: 10px;
}

.clip-interval .time-range-grid input {
  height: 50px;
}

.time-range-grid input {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: white;
  font-variant-numeric: tabular-nums;
}

.time-range-grid input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
}

.media-duration {
  margin-top: 10px;
  padding: 10px 13px;
  border-radius: 10px;
  color: #315071;
  background: var(--blue-soft);
  font-size: 13px;
  font-weight: 720;
}

@media (max-width: 900px) {
  .topbar .tabs .tab {
    flex: 1 1 132px;
  }

  .media-tool-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar .tabs .tab {
    min-width: 0;
    flex: 1 1 calc(33.333% - 8px);
    padding-inline: 7px;
    font-size: 11px;
  }

  .time-range-grid {
    grid-template-columns: 1fr;
  }

  .merge-settings-grid {
    grid-template-columns: 1fr;
  }

  .media-merge-settings summary small {
    display: none;
  }

  .clip-editor-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .add-interval-button {
    width: 100%;
  }

  .media-file-list li {
    align-items: stretch;
    flex-direction: column;
  }

  .media-file-actions button {
    flex: 1;
  }
}

/* Public roadmap */
.roadmap-page {
  padding-top: clamp(48px, 7vw, 88px);
}

.roadmap-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 6vw, 72px);
  border: 1px solid #bfd1f4;
  border-radius: 32px;
  background:
    radial-gradient(circle at 92% 8%, rgba(37, 99, 235, 0.2), transparent 23rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(232, 240, 255, 0.9));
  box-shadow: var(--shadow);
}

.roadmap-hero::after {
  position: absolute;
  right: -72px;
  bottom: -112px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 36px rgba(37, 99, 235, 0.05),
    0 0 0 78px rgba(37, 99, 235, 0.04);
}

.roadmap-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin: 28px 0 22px;
  font-size: clamp(44px, 7vw, 84px);
}

.roadmap-hero .hero-copy {
  position: relative;
  z-index: 1;
  max-width: 790px;
}

.roadmap-view-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 820;
  text-decoration: none;
}

.roadmap-view-link:hover {
  color: var(--blue-dark);
}

.roadmap-summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(38px, 6vw, 70px);
  border-top: 1px solid rgba(37, 99, 235, 0.2);
}

.roadmap-summary > div {
  display: grid;
  gap: 7px;
  padding: 24px 22px 0 0;
}

.roadmap-summary strong {
  color: var(--blue);
  font-size: 13px;
  letter-spacing: 0.14em;
}

.roadmap-summary span {
  color: #3d4c64;
  font-size: 14px;
  font-weight: 780;
}

.roadmap-board,
.roadmap-principles,
.roadmap-note {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 48px rgba(31, 51, 84, 0.08);
}

.roadmap-board {
  padding: clamp(30px, 5vw, 60px);
}

.roadmap-board-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 48px;
  align-items: end;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.roadmap-board-heading h2,
.roadmap-principles h2,
.roadmap-note h2 {
  margin: 10px 0 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.roadmap-board-heading p,
.roadmap-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.roadmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  padding: 22px 0 4px;
  color: #55647d;
  font-size: 13px;
  font-weight: 780;
}

.roadmap-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.roadmap-legend i {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #6f7f98;
  box-shadow: 0 0 0 5px rgba(111, 127, 152, 0.1);
}

.roadmap-legend .legend-done {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(22, 134, 83, 0.1);
}

.roadmap-legend .legend-active {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.1);
}

.roadmap-stages {
  margin: 0;
  padding: 0;
  list-style: none;
}

.roadmap-stage {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  min-height: 240px;
}

.stage-marker {
  position: relative;
  display: flex;
  justify-content: flex-start;
  padding-top: 38px;
}

.stage-marker::after {
  position: absolute;
  top: 76px;
  bottom: -1px;
  left: 25px;
  width: 1px;
  content: "";
  background: var(--line);
}

.roadmap-stage:last-child .stage-marker::after {
  display: none;
}

.stage-marker span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  background: white;
}

.stage-current .stage-marker span {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

.stage-active .stage-marker span {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 7px var(--blue-soft);
}

.roadmap-stage article {
  padding: 38px 0 36px;
  border-bottom: 1px solid var(--line);
}

.roadmap-stage:last-child article {
  border-bottom: 0;
}

.stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-status {
  padding: 7px 10px;
  border-radius: 999px;
  color: #4a5a72;
  background: #edf1f7;
  letter-spacing: 0;
  text-transform: none;
}

.stage-current .stage-status {
  color: var(--green);
  background: var(--green-soft);
}

.stage-active .stage-status {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.roadmap-stage h3 {
  margin: 14px 0 10px;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.roadmap-stage p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.roadmap-stage ul {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.roadmap-stage li {
  position: relative;
  min-height: auto;
  padding: 13px 16px 13px 40px;
  border: 0;
  border-left: 3px solid rgba(37, 99, 235, 0.28);
  border-radius: 0 12px 12px 0;
  color: #293952;
  font-size: 15px;
  font-weight: 720;
  line-height: 1.45;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.025) 62%, transparent);
}

.roadmap-stage li::before {
  position: absolute;
  top: 18px;
  left: 17px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  color: var(--blue);
  content: "";
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
}

.stage-current li {
  border-left-color: rgba(22, 134, 83, 0.35);
  background: linear-gradient(90deg, rgba(22, 134, 83, 0.1), rgba(22, 134, 83, 0.02) 62%, transparent);
}

.stage-current li::before {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(22, 134, 83, 0.12);
}

.roadmap-stage:not(.stage-current):not(.stage-active) li {
  border-left-color: rgba(92, 109, 136, 0.25);
  background: linear-gradient(90deg, rgba(92, 109, 136, 0.08), rgba(92, 109, 136, 0.015) 62%, transparent);
}

.roadmap-stage:not(.stage-current):not(.stage-active) li::before {
  background: #6f7f98;
  box-shadow: 0 0 0 5px rgba(111, 127, 152, 0.11);
}

.roadmap-stage li.item-done {
  border-left-color: rgba(22, 134, 83, 0.35);
  background: linear-gradient(90deg, rgba(22, 134, 83, 0.1), rgba(22, 134, 83, 0.02) 62%, transparent);
}

.roadmap-stage li.item-done::before {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(22, 134, 83, 0.12);
}

.roadmap-stage li.item-active {
  border-left-color: rgba(37, 99, 235, 0.28);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.025) 62%, transparent);
}

.roadmap-stage li.item-active::before {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
}

.roadmap-stage li.item-planned {
  border-left-color: rgba(92, 109, 136, 0.25);
  background: linear-gradient(90deg, rgba(92, 109, 136, 0.08), rgba(92, 109, 136, 0.015) 62%, transparent);
}

.roadmap-stage li.item-planned::before {
  background: #6f7f98;
  box-shadow: 0 0 0 5px rgba(111, 127, 152, 0.11);
}

.roadmap-principles {
  padding: clamp(30px, 5vw, 60px);
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.principle-grid article {
  min-height: 230px;
  padding: 26px;
  border: 1px solid #d8e1ee;
  border-radius: 18px;
  background: #f8faff;
}

.principle-grid article > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
  background: var(--blue-soft);
}

.principle-grid h3 {
  margin: 32px 0 10px;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.principle-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.roadmap-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 56px;
  align-items: center;
  padding: clamp(30px, 5vw, 60px);
  border-color: #bed0ef;
  background: linear-gradient(135deg, #eef4ff, rgba(255, 255, 255, 0.95));
}

.roadmap-note h2 {
  font-size: clamp(26px, 3vw, 38px);
}

@media (max-width: 1080px) {
  .topbar .tab {
    min-width: 138px;
    padding: 0 14px;
  }

}

@media (max-width: 760px) {
  .roadmap-summary,
  .principle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roadmap-board-heading,
  .roadmap-note {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .roadmap-stage {
    grid-template-columns: 66px minmax(0, 1fr);
  }
}

/* Experimental game-board roadmap */
.game-page {
  padding-top: clamp(38px, 6vw, 72px);
}

.game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  margin-bottom: 28px;
}

.game-hero h1 {
  max-width: 850px;
  margin: 20px 0 16px;
}

.game-hero .hero-copy {
  max-width: 760px;
}

.classic-view-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid #c7d4e8;
  border-radius: 14px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  background: white;
}

.game-shell {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 4vw, 46px);
  border: 1px solid #b9c8ec;
  border-radius: 34px;
  background:
    linear-gradient(rgba(37, 99, 235, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.96), transparent 25rem),
    radial-gradient(circle at 92% 82%, rgba(124, 77, 204, 0.18), transparent 23rem),
    radial-gradient(circle at 62% 42%, rgba(255, 103, 139, 0.09), transparent 19rem),
    #eaf3ff;
  background-size: 28px 28px, 28px 28px, auto, auto;
  box-shadow: 0 26px 70px rgba(31, 51, 109, 0.16);
}

.game-shell::before,
.game-shell::after {
  position: absolute;
  width: 230px;
  height: 230px;
  border: 2px dashed rgba(37, 99, 235, 0.18);
  border-radius: 50%;
  content: "";
}

.game-shell::before {
  top: -120px;
  right: -70px;
}

.game-shell::after {
  bottom: -140px;
  left: -80px;
}

.game-board-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.game-controls {
  display: flex;
  min-width: 260px;
  align-items: center;
  gap: 16px;
  padding: 13px 18px 13px 13px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 18px;
  color: #30405c;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.1);
}

.game-controls strong,
.game-controls span {
  display: block;
}

.game-controls strong {
  color: var(--blue);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-controls span {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 750;
}

.game-die {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 2px solid rgba(37, 99, 235, 0.28);
  border-radius: 14px;
  background: white;
  box-shadow:
    inset -5px -5px 10px rgba(37, 99, 235, 0.08),
    0 8px 16px rgba(37, 99, 235, 0.13);
  transform: rotate(-7deg);
}

.game-die i {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.game-die i:nth-child(1) { top: 10px; left: 10px; }
.game-die i:nth-child(2) { top: 10px; right: 10px; }
.game-die i:nth-child(3) { top: 21px; left: 21px; }
.game-die i:nth-child(4) { right: 10px; bottom: 10px; }
.game-die i:nth-child(5) { bottom: 10px; left: 10px; }

.game-board-heading h2 {
  margin: 8px 0 0;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.05em;
}

.game-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 34px;
  color: #55647d;
  font-size: 12px;
  font-weight: 760;
}

.game-instruction {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 720px;
  align-items: center;
  gap: 12px;
  margin: -14px 0 52px;
  color: #4c5e80;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.5;
}

.game-instruction > span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 18px;
  background: linear-gradient(135deg, var(--blue), #7c4dcc);
  box-shadow: 0 6px 14px rgba(74, 80, 190, 0.22);
}

.game-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.game-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c9c2b4;
}

.game-legend .legend-done {
  background: var(--green);
}

.game-legend .legend-active {
  background: var(--blue);
}

.board-track {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 48px;
  padding: 8px 12px;
}

.board-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
}

.board-row-label {
  position: absolute;
  z-index: 4;
  top: -34px;
  left: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  color: #30405c;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 18px rgba(43, 62, 121, 0.1);
}

.board-row.reverse .board-row-label {
  right: 4px;
  left: auto;
}

.board-row-label span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 10px;
  font-weight: 900;
  background: var(--blue);
}

.board-row-label strong {
  font-weight: 850;
}

.stage-foundation .board-row-label span { background: var(--green); }
.stage-meaning .board-row-label span { background: var(--blue); }
.stage-studio .board-row-label span { background: #df4f78; }
.stage-growth .board-row-label span { background: #7c4dcc; }

.board-row::before {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 4%;
  left: 4%;
  height: 18px;
  border: 4px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  content: "";
  background: linear-gradient(90deg, #4fcba0, #4c9edb);
  box-shadow: 0 4px 12px rgba(65, 83, 162, 0.22);
  transform: translateY(-50%);
}

.board-row:not(:last-child)::after {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 4%;
  width: 18px;
  height: calc(100% + 28px);
  border: 4px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  content: "";
  background: linear-gradient(#4c9edb, #7772e2);
  box-shadow: 0 4px 12px rgba(65, 83, 162, 0.2);
}

.board-row.reverse:not(:last-child)::after {
  right: auto;
  left: 4%;
}

.stage-meaning::before {
  background: linear-gradient(90deg, #5d72e8, #925fd5);
}

.stage-studio::before {
  background: linear-gradient(90deg, #e45b82, #9a65dc);
}

.stage-growth::before {
  background: linear-gradient(90deg, #815bd0, #2aa7c7);
}

.board-row.reverse {
  direction: rtl;
}

.board-row.reverse > * {
  direction: ltr;
}

.board-cell {
  position: relative;
  display: flex;
  min-height: 122px;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  border: 3px solid rgba(78, 101, 164, 0.2);
  border-radius: 28px;
  color: #55627a;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.65),
    0 10px 22px rgba(56, 73, 137, 0.13);
}

.board-cell::after {
  position: absolute;
  top: 50%;
  right: -14px;
  color: white;
  content: "→";
  font-size: 18px;
  font-weight: 900;
  transform: translateY(-50%);
}

.board-row.reverse .board-cell::after {
  right: auto;
  left: -14px;
  content: "←";
}

.board-row .board-cell:last-child::after {
  display: none;
}

.cell-number {
  color: #6d7ca2;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.board-cell strong {
  display: block;
  margin-top: 18px;
  color: #202a42;
  font-size: 14px;
  line-height: 1.25;
}

.board-cell.done {
  border-color: rgba(22, 134, 83, 0.35);
  background: rgba(231, 247, 238, 0.98);
}

.board-cell.active {
  border-color: rgba(37, 99, 235, 0.48);
  background: linear-gradient(145deg, #e9f0ff, #dce7ff);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.6),
    0 12px 24px rgba(37, 99, 235, 0.15);
}

.board-cell.milestone {
  border-style: dashed;
  border-color: rgba(124, 77, 204, 0.5);
  background: linear-gradient(145deg, #f4efff, #eae1ff);
}

.stage-foundation .board-cell.milestone {
  border-color: rgba(22, 134, 83, 0.5);
  background: linear-gradient(145deg, #e4faef, #cdf3e0);
}

.stage-meaning .board-cell.milestone {
  border-color: rgba(92, 80, 204, 0.52);
  background: linear-gradient(145deg, #edf0ff, #dddfff);
}

.stage-studio .board-cell {
  border-color: rgba(223, 79, 120, 0.22);
  background: linear-gradient(145deg, #fff7fa, #ffeaf1);
}

.stage-studio .board-cell.milestone {
  border-color: rgba(223, 79, 120, 0.5);
  background: linear-gradient(145deg, #fff0f5, #ffdce8);
}

.stage-growth .board-cell {
  border-color: rgba(124, 77, 204, 0.23);
  background: linear-gradient(145deg, #faf7ff, #eee7ff);
}

.stage-growth .board-cell.milestone {
  border-color: rgba(42, 167, 199, 0.52);
  background: linear-gradient(145deg, #eafaff, #dbf3fa);
}

.cell-celebration {
  position: absolute;
  top: 12px;
  right: 14px;
  color: #526ee3;
  font-size: 20px;
  font-weight: 900;
}

.stage-foundation .cell-celebration { color: var(--green); }
.stage-studio .cell-celebration { color: #df4f78; }
.stage-growth .cell-celebration { color: #1d98ba; }

.game-pawn {
  position: absolute;
  top: -25px;
  right: 15px;
  width: 44px;
  height: 58px;
  filter: drop-shadow(0 7px 5px rgba(31, 51, 84, 0.22));
}

.game-pawn::before {
  position: absolute;
  top: 0;
  left: 12px;
  width: 20px;
  height: 20px;
  border: 3px solid white;
  border-radius: 50%;
  content: "";
  background: var(--blue);
}

.game-pawn::after {
  position: absolute;
  right: 2px;
  bottom: 0;
  left: 2px;
  height: 38px;
  border: 3px solid white;
  border-radius: 50% 50% 22% 22%;
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
  content: "";
  background: var(--blue);
}

.game-chapters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.game-chapter {
  padding: 18px;
  border: 1px solid rgba(75, 96, 157, 0.18);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.76);
}

.game-chapter span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-chapter h3 {
  margin: 10px 0 7px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.game-chapter p {
  margin: 0;
  color: #66728a;
  font-size: 13px;
  line-height: 1.5;
}

.game-party {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  gap: 24px;
  margin-top: 28px;
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.92);
}

.game-party h2 {
  margin: 9px 0 0;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.045em;
}

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

.party-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid #d9e1ed;
  border-radius: 17px;
  background: #f8faff;
}

.party-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  content: "";
  background: linear-gradient(90deg, var(--blue), #57b6d8);
}

.party-card:nth-child(2)::before {
  background: linear-gradient(90deg, #7c4dcc, #cb5fb2);
}

.party-card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--green), #5ac4a0);
}

.party-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50% 50% 45% 45%;
  color: white;
  font-size: 22px;
  background: var(--blue);
  box-shadow: 0 0 0 6px var(--blue-soft);
}

.party-card:nth-child(2) .party-avatar {
  background: #7c4dcc;
  box-shadow: 0 0 0 6px #efe6ff;
}

.party-card:nth-child(3) .party-avatar {
  background: var(--green);
  box-shadow: 0 0 0 6px var(--green-soft);
}

.party-card h3 {
  margin: 22px 0 8px;
}

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

@media (max-width: 900px) {
  .game-hero,
  .game-party {
    grid-template-columns: 1fr;
  }

  .game-board-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-controls {
    min-width: 0;
  }

  .game-legend {
    justify-content: flex-start;
  }

  .board-row {
    grid-template-columns: repeat(5, minmax(118px, 1fr));
  }

  .board-track {
    overflow-x: auto;
    padding-top: 28px;
  }

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

@media (max-width: 660px) {
  .party-cards,
  .game-chapters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .roadmap-hero {
    padding: 28px 22px;
    border-radius: 24px;
  }

  .roadmap-summary {
    grid-template-columns: 1fr 1fr;
  }

  .roadmap-summary > div {
    padding-right: 10px;
  }

  .roadmap-board,
  .roadmap-principles,
  .roadmap-note {
    padding: 26px 20px;
    border-radius: 22px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.processing-content {
  min-width: 0;
  width: 100%;
}

.processing-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.processing-heading strong {
  margin-bottom: 0;
}

#progressPercent {
  color: var(--blue);
  font-size: 18px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  width: 100%;
  height: 10px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue-soft);
}

#progressBar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 350ms ease;
}

.processing-log {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.processing-log summary {
  padding: 14px 0 8px;
  color: #3d4c64;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.processing-log ol {
  max-height: 150px;
  margin: 0;
  padding: 0 0 2px;
  overflow-y: auto;
  list-style: none;
}

.processing-log li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.processing-log time {
  color: #8290a5;
  font-variant-numeric: tabular-nums;
}

.transcription-card h2 {
  margin-bottom: 24px;
}

.source-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  height: 58px;
  padding: 4px;
  border: 1px solid #c8d4e5;
  border-radius: 14px;
  background: #eef2f8;
}

.source-button {
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 800;
  background: transparent;
}

.source-button:hover {
  color: var(--blue);
}

.source-button.active {
  color: var(--blue);
  background: white;
  box-shadow: 0 3px 10px rgba(31, 51, 84, 0.1);
}

.transcription-options {
  margin-top: 26px;
}

.secret-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.whisper-profile-field {
  display: block;
  margin-top: 26px;
}

.secret-toggle,
.secondary-button {
  min-width: 108px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid #bfd0eb;
  border-radius: 12px;
  color: var(--blue);
  font-weight: 750;
  background: var(--surface-soft);
}

.secret-toggle {
  height: 58px;
}

.secret-toggle:hover,
.secondary-button:hover {
  background: var(--blue-soft);
}

.field-help {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.file-heading {
  margin-top: 26px;
}

.source-panel input[type="url"] {
  width: 100%;
}

.file-picker {
  display: flex;
  min-height: 100px;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px dashed #aebfd8;
  border-radius: 15px;
  color: var(--text);
  background: #f8faff;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.file-picker:hover,
.file-picker.dragging,
.file-picker.has-file {
  border-color: var(--blue);
  background: var(--surface-soft);
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-picker-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  color: var(--blue);
  font-size: 28px;
  background: var(--blue-soft);
}

.file-picker strong,
.file-picker small {
  display: block;
}

.file-picker small {
  max-width: 430px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transcription-submit {
  margin-top: 28px;
}

.transcript-result {
  margin-top: 20px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid #b9e4cc;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 38px rgba(31, 51, 84, 0.08);
}

.transcript-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.transcript-heading h2 {
  margin: 8px 0 6px;
  font-size: clamp(27px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.transcript-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.result-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 22px;
  padding: 5px;
  border: 1px solid #c8d4e5;
  border-radius: 14px;
  background: #edf2f9;
}

.result-tab {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  font: inherit;
  font-weight: 820;
  background: transparent;
  cursor: pointer;
}

.result-tab:hover {
  color: var(--blue);
}

.result-tab.active {
  border-color: #bfd0eb;
  color: var(--blue);
  background: white;
  box-shadow: 0 3px 12px rgba(31, 51, 84, 0.09);
}

.result-tab:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.result-toolbar > strong,
.result-toolbar > div > strong {
  font-size: 17px;
}

.result-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.result-actions .download-button {
  border: 0;
  cursor: pointer;
}

#transcriptText,
#reportText {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  padding: 20px;
  border: 1px solid #c8d4e5;
  border-radius: 14px;
  outline: none;
  color: var(--text);
  font: inherit;
  line-height: 1.65;
  background: #fbfcff;
}

#transcriptText:focus,
#reportText:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
}

#reportText {
  min-height: 420px;
  white-space: pre-wrap;
}

.report-setup {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid #c8d4e5;
  border-radius: 16px;
  background: linear-gradient(145deg, #fbfdff, #f3f7ff);
}

.report-introduction {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.report-step {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  color: var(--blue);
  font-weight: 900;
  background: var(--blue-soft);
}

.report-introduction h3 {
  margin: 1px 0 6px;
  font-size: clamp(21px, 2.4vw, 28px);
  letter-spacing: -0.035em;
}

.report-introduction p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.report-contents {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 22px 0 26px;
  padding: 18px;
  border: 1px solid #d9e3f1;
  border-radius: 13px;
  list-style: none;
  background: white;
}

.report-contents li {
  position: relative;
  padding-left: 24px;
  color: #3d4f6c;
  font-size: 13px;
  font-weight: 720;
}

.report-contents li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 900;
}

.report-key-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.report-key-help a {
  flex: 0 0 auto;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.model-help {
  min-height: 22px;
  margin-top: 8px;
}

.model-help.is-paid {
  margin-bottom: 4px;
  padding: 9px 11px;
  border: 1px solid #f0d49a;
  border-radius: 9px;
  color: #765015;
  background: #fff8e8;
}

.credential-persistence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 12px;
  padding: 13px 15px;
  border: 1px solid #d5dfed;
  border-radius: 12px;
  background: #f8faff;
  color: #42536e;
  font-size: 12px;
  font-weight: 720;
}

.credential-persistence label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.credential-persistence input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--blue);
}

.credential-status {
  margin-left: auto;
  color: var(--muted);
}

.credential-status.is-saved {
  color: var(--green);
}

.credential-management {
  justify-content: space-between;
}

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

.credential-save,
.credential-delete {
  min-height: 40px;
  padding: 9px 15px;
  border-radius: 9px;
  font: inherit;
  cursor: pointer;
}

.credential-save {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.16);
}

.credential-save:hover:not(:disabled) {
  background: #1754d1;
}

.credential-save:disabled,
.credential-delete:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.credential-delete {
  border: 1px solid #efb7b7;
  color: #b4232f;
  background: #fff7f7;
}

.credential-delete:hover {
  border-color: #d64550;
  background: #fff0f0;
}

.report-submit {
  width: 100%;
  margin-top: 20px;
}

.report-status,
.report-error {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 116px;
  padding: 24px;
  border: 1px solid #c8d4e5;
  border-radius: 16px;
  background: #f8faff;
}

.report-status p,
.report-error p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.report-error {
  margin-top: 14px;
  border-color: #f1b8bd;
  background: #fff4f4;
}

.report-error > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-weight: 900;
  background: #cf3946;
}

.report-status.hidden,
.report-error.hidden {
  display: none;
}

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

.history-save-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.history-section {
  margin-top: 28px;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.history-heading h2 {
  margin: 6px 0 8px;
  font-size: clamp(28px, 4vw, 42px);
}

.history-heading p,
.history-item p,
.history-empty {
  margin: 0;
  color: var(--muted);
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.history-item h3 {
  margin: 0 0 7px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.history-item p {
  font-size: 14px;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.history-delete {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff1f2;
  color: #b91c1c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.history-refresh,
.report-history-open {
  min-height: 42px;
  padding: 0 16px;
  white-space: nowrap;
}

.report-history-section {
  scroll-margin-top: 24px;
}

.summary-card > select {
  width: 100%;
  min-height: 58px;
  padding: 0 48px 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.summary-text-label {
  margin-top: 24px;
}

#summarySourceText {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.55;
}

#summarySourceText[readonly] {
  background: var(--surface-soft);
}

.summary-text-meta {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.summary-card .report-submit {
  margin-top: 22px;
}

.prompt-inspector {
  margin: 22px 0 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  overflow: hidden;
}

.prompt-inspector summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.prompt-inspector summary::-webkit-details-marker {
  display: none;
}

.prompt-inspector summary::after {
  content: "+";
  color: var(--blue);
  font-size: 24px;
  line-height: 1;
}

.prompt-inspector[open] summary::after {
  content: "−";
}

.prompt-inspector-body {
  padding: 0 20px 20px;
}

.prompt-inspector-body > p,
.prompt-preview-meta,
.prompt-parameters,
.prompt-preview-error {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.prompt-preview {
  display: grid;
  gap: 18px;
}

.prompt-stage {
  display: grid;
  gap: 10px;
}

.prompt-stage h3 {
  margin: 0;
  font-size: 17px;
}

.prompt-message {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.prompt-message strong {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prompt-message pre {
  margin: 0;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.prompt-parameters {
  margin-bottom: 0;
}

.summary-workspace + .report-status,
.summary-workspace + .report-error,
.summary-workspace ~ .report-status,
.summary-workspace ~ .report-error {
  margin-top: 28px;
  border-radius: 22px;
}

@media (max-width: 760px) {
  .history-heading,
  .history-item {
    align-items: stretch;
    flex-direction: column;
  }

  .history-actions {
    flex-wrap: wrap;
  }

  .history-actions > * {
    flex: 1 1 auto;
  }
}

.faq-section {
  margin-top: 28px;
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 38px rgba(31, 51, 84, 0.07);
}

.faq-section h2 {
  margin: 10px 0 8px;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.045em;
}

.faq-intro {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  position: relative;
  padding: 20px 48px 20px 0;
  list-style: none;
  color: var(--text);
  font-size: 17px;
  font-weight: 820;
  cursor: pointer;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 50%;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 20px;
  line-height: 1;
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 0 22px;
  color: var(--muted);
  line-height: 1.65;
}

.faq-answer > p {
  margin: 0;
}

.provider-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.provider-links a,
.provider-links .provider-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 126px;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid #c8d4e5;
  border-radius: 14px;
  color: var(--blue);
  text-decoration: none;
  background: #f8faff;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.provider-links .provider-card-local {
  border-color: #b7dfc8;
  background: #f1fbf5;
}

.provider-links a:hover {
  transform: translateY(-1px);
  border-color: var(--blue);
  background: var(--surface-soft);
}

.provider-links a > span:first-child,
.provider-links .provider-card > span:first-child {
  min-width: 0;
}

.provider-links strong,
.provider-links small {
  display: block;
}

.provider-links strong {
  color: var(--text);
  font-size: 16px;
}

.provider-links small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.provider-links a > span:last-child,
.provider-links .provider-card > span:last-child {
  flex: 0 0 auto;
  margin-top: auto;
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
}

.provider-links .provider-card-local > span:last-child {
  color: #168c52;
}

@media (max-width: 1180px) {
  .provider-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .provider-links {
    grid-template-columns: 1fr;
  }

  .provider-links a,
  .provider-links .provider-card {
    min-height: 72px;
  }
}

@media (max-width: 620px) {
  .secret-control,
  .transcription-options {
    grid-template-columns: 1fr;
  }

  .secret-toggle {
    width: 100%;
  }

  .transcript-heading,
  .result-toolbar,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .result-switch,
  .report-contents {
    grid-template-columns: 1fr;
  }

  .report-key-help {
    align-items: flex-start;
    flex-direction: column;
  }

  .credential-persistence {
    align-items: flex-start;
    flex-direction: column;
  }

  .credential-status {
    margin-left: 0;
  }

  .credential-actions,
  .credential-save,
  .credential-delete {
    width: 100%;
  }

  .result-actions .download-button,
  .secondary-button {
    width: 100%;
  }
}
