:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101418;
  color: #f4f0e8;
  --surface: #171c20;
  --surface-strong: #20262b;
  --outline: #39434b;
  --text-muted: #b8c0c7;
  --primary: #5fd4bd;
  --primary-ink: #ffffff;
  --accent: #ff8a6b;
  --accent-soft: #4c261e;
  --secondary: #ffd66b;
  --secondary-soft: #3e3212;
  --danger: #ff8a6b;
  --ok: #5fd4bd;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 8px 0;
}

.toolbar-link,
.guide-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  padding: 0 16px;
  color: #f4f0e8;
  text-decoration: none;
  background: var(--surface);
  font-weight: 760;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.step {
  min-height: 42px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--outline);
  border-radius: 18px;
  box-shadow: none;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    border-color 160ms ease;
}

.step.is-active {
  background: var(--primary);
  color: #04251f;
  border-color: transparent;
}

.step:not(.is-active):hover {
  background: var(--surface-strong);
  color: #f4f0e8;
}

h1 {
  margin: 0 0 6px;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--text-muted);
}

.hint {
  margin-top: 10px;
  font-size: 14px;
  min-height: 22px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.workflow-panel {
  min-height: 720px;
  overflow: hidden;
}

.step-panel {
  display: none;
  transform-origin: 50% 14px;
}

.step-panel.is-active {
  display: block;
  animation: panel-enter 220ms ease both;
}

.step-panel.is-leaving {
  display: block;
  animation: panel-exit 160ms ease both;
}

.step-panel.is-entering {
  animation: panel-enter 220ms ease both;
}

.step-panel h2 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: 0;
}

.muted {
  color: var(--text-muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px;
}

label {
  display: block;
  margin: 16px 0 7px;
  color: #e4ded5;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.02em;
}

input,
select,
textarea,
pre {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--outline);
  border-radius: 18px;
  background: var(--surface-strong);
  color: #f4f0e8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

input {
  padding: 13px 15px;
}

select {
  appearance: none;
  padding: 13px 40px 13px 15px;
  background-image:
    linear-gradient(45deg, transparent 50%, #e4ded5 50%),
    linear-gradient(135deg, #e4ded5 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

textarea {
  min-height: 300px;
  padding: 15px;
  resize: vertical;
}

pre {
  min-height: 372px;
  overflow: auto;
  padding: 15px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
}

.outcome {
  min-height: 220px;
  overflow: auto;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--outline);
  border-radius: 18px;
  background: var(--surface-strong);
  padding: 16px;
  color: #f4f0e8;
}

.outcome-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.outcome-header strong {
  font-size: 16px;
}

.outcome-header span,
.outcome li span {
  color: var(--text-muted);
  font-size: 13px;
}

.outcome h3 {
  margin: 18px 0 8px;
  color: var(--secondary);
  font-size: 14px;
  letter-spacing: 0;
}

.outcome ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.outcome li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: #161b1f;
}

.outcome li strong,
.confirm-summary li strong {
  line-height: 1.25;
}

.outcome details {
  margin-top: 16px;
  color: var(--text-muted);
}

.outcome summary {
  cursor: pointer;
  color: #f4f0e8;
  font-weight: 760;
}

.outcome-error,
.outcome-progress {
  display: grid;
  gap: 8px;
}

.outcome-error strong {
  color: var(--accent);
}

.outcome-ok {
  margin-bottom: 12px;
  color: var(--primary);
}

button,
.file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--primary);
  color: #04251f;
  cursor: pointer;
  font-weight: 760;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

button:hover,
.file:hover {
  box-shadow: 0 10px 22px rgba(95, 212, 189, 0.2);
  transform: translateY(-1px);
}

button:active,
.file:active {
  transform: translateY(0) scale(0.99);
}

.secondary {
  background: var(--secondary-soft);
  color: #ffe9a3;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

.recording-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.recording-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: stretch;
  border: 1px solid var(--outline);
  border-radius: 20px;
  background: linear-gradient(180deg, #20262b 0%, #171d22 100%);
  padding: 10px;
  animation: list-item-enter 240ms ease both;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.recording-item:hover {
  border-color: #52616b;
  transform: translateY(-1px);
}

.recording-item.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(95, 212, 189, 0.16);
}

.recording-main {
  display: grid;
  justify-items: start;
  gap: 5px;
  min-height: 72px;
  border-radius: 14px;
  background: transparent;
  color: #f4f0e8;
  text-align: left;
  box-shadow: none;
  padding: 4px 6px;
}

.recording-main:hover {
  transform: none;
  box-shadow: none;
}

.recording-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.recording-title-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.recording-meta,
.recording-actions,
.selected-card span,
.selected-card p {
  color: var(--text-muted);
  font-size: 13px;
}

.recording-actions {
  color: #dce7ed;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #2c3339;
  color: var(--text-muted);
  font-style: normal;
  font-size: 11px;
  font-weight: 760;
}

.status-pill.good {
  background: rgba(95, 212, 189, 0.16);
  color: var(--ok);
}

.status-pill.busy {
  background: rgba(255, 214, 107, 0.16);
  color: var(--secondary);
}

.status-pill.bad {
  background: rgba(255, 138, 107, 0.16);
  color: var(--danger);
}

.icon-button {
  width: 44px;
  min-height: 72px;
  padding: 0;
  background: #2c3339;
  color: #f4f0e8;
  border-radius: 14px;
  font-size: 20px;
}

.icon-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-library {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px dashed var(--outline);
  border-radius: 20px;
  background: rgba(32, 38, 43, 0.58);
}

.empty-library span {
  color: var(--text-muted);
  font-size: 13px;
}

.selected-card,
.suggestion,
.confirm-summary,
.action-sequence {
  display: grid;
  gap: 8px;
  min-height: 88px;
  border: 1px solid var(--outline);
  border-radius: 18px;
  background: var(--surface-strong);
  padding: 14px;
  color: #f4f0e8;
}

.suggestion strong {
  color: var(--secondary);
}

.create-project {
  margin-top: 12px;
  border: 1px solid var(--outline);
  border-radius: 18px;
  background: var(--surface-strong);
  padding: 12px;
}

.create-project summary {
  cursor: pointer;
  color: var(--secondary);
  font-weight: 760;
}

.sequence-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(120px, auto) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: #161b1f;
}

.sequence-row span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--secondary-soft);
  color: #ffe9a3;
  font-size: 12px;
  font-weight: 760;
}

.sequence-row small {
  color: var(--text-muted);
}

.confirm-summary ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.confirm-summary li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: #161b1f;
}

.confirm-summary li span {
  color: var(--text-muted);
  font-size: 13px;
}

#micTest {
  background: var(--secondary-soft);
  color: #ffe9a3;
}

#record {
  background: var(--accent);
  color: #32110b;
}

#record:hover {
  box-shadow: 0 10px 22px rgba(255, 138, 107, 0.22);
}

#stop {
  background: #45505a;
  color: #ffffff;
}

#submit {
  min-width: 156px;
  min-height: 52px;
  background: #8eb7ff;
  color: #081a35;
}

#submit:hover {
  box-shadow: 0 12px 26px rgba(142, 183, 255, 0.2);
}

.file input {
  display: none;
}

audio,
video {
  width: 100%;
  margin-top: 16px;
  accent-color: var(--accent);
  max-height: 220px;
  border-radius: 18px;
  background: #0b0f12;
}

.mic-meter {
  position: relative;
  height: 16px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: #11161a;
}

.mic-meter::before {
  position: absolute;
  inset: 0;
  content: "";
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.12) 0,
    rgba(255, 255, 255, 0.12) 1px,
    transparent 1px,
    transparent 18px
  );
}

#micLevel {
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  box-shadow: 0 0 18px rgba(95, 212, 189, 0.38);
  transition: width 90ms linear;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
  animation: backdrop-enter 180ms ease both;
}

.dialog-backdrop[hidden] {
  display: none;
}

.dialog {
  width: min(460px, 100%);
  border-radius: 28px;
  border: 1px solid var(--outline);
  background: var(--surface);
  padding: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
  animation: dialog-enter 220ms ease both;
}

.dialog h2 {
  margin: 0 0 8px;
  font-size: 23px;
  letter-spacing: 0;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.file:focus-within {
  outline: 3px solid rgba(142, 183, 255, 0.34);
  outline-offset: 2px;
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes panel-exit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
  }
}

@keyframes list-item-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.options {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--outline);
  border-radius: 18px;
  background: var(--surface-strong);
  color: #f4f0e8;
  font-size: 14px;
  letter-spacing: 0;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.note-preview {
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--outline);
  border-radius: 18px;
  background: var(--surface-strong);
  padding: 16px;
  color: #f4f0e8;
}

.note-preview h3,
.note-preview h4 {
  margin: 0 0 10px;
  letter-spacing: 0;
}

.note-preview h4 {
  margin-top: 18px;
  color: var(--secondary);
  font-size: 14px;
}

.note-preview ul {
  margin: 0;
  padding-left: 20px;
}

.note-preview li {
  margin: 8px 0;
}

.guide-body {
  background:
    linear-gradient(180deg, rgba(95, 212, 189, 0.08), transparent 330px),
    #101418;
}

.guide-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px;
}

.guide-hero {
  display: grid;
  gap: 18px;
  padding: 14px 0 24px;
}

.guide-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.guide-nav button {
  min-height: 42px;
}

.guide-kicker {
  width: fit-content;
  border: 1px solid rgba(95, 212, 189, 0.38);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(95, 212, 189, 0.12);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.guide-hero h1 {
  max-width: 820px;
  font-size: 54px;
  line-height: 1.02;
}

.guide-lead {
  max-width: 780px;
  color: #d6dee3;
  font-size: 18px;
  line-height: 1.6;
}

.guide-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.guide-side {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}

.guide-side article,
.guide-section,
.guide-close {
  border: 1px solid var(--outline);
  border-radius: 22px;
  background: rgba(23, 28, 32, 0.92);
  box-shadow: var(--shadow);
}

.guide-side article {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.guide-side span {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.guide-side strong {
  font-size: 17px;
}

.guide-side p,
.guide-section p,
.guide-close p,
.pillar-grid p {
  line-height: 1.55;
}

.guide-main {
  display: grid;
  gap: 14px;
}

.guide-section {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
}

.step-marker {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--primary);
  color: #04251f;
  font-weight: 900;
}

.guide-section h2,
.guide-close h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.guide-section ul {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: #dce7ed;
}

.guide-section li {
  line-height: 1.45;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.pillar-grid section {
  border: 1px solid var(--outline);
  border-radius: 16px;
  background: var(--surface-strong);
  padding: 14px;
}

.pillar-grid h3 {
  margin: 0 0 8px;
  color: var(--secondary);
  font-size: 16px;
}

.guide-close {
  padding: 22px;
  background: linear-gradient(135deg, rgba(95, 212, 189, 0.16), rgba(142, 183, 255, 0.1)), var(--surface);
}

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

  .toolbar,
  .grid,
  .steps {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  h1 {
    font-size: 32px;
  }

  .panel {
    border-radius: 22px;
    padding: 16px;
  }

  textarea {
    min-height: 220px;
  }

  pre {
    min-height: 220px;
  }

  .outcome {
    min-height: 180px;
  }

  .outcome-header {
    display: grid;
  }

  .note-preview {
    min-height: 150px;
    max-height: 260px;
  }

  .row,
  .actions-row,
  .dialog-actions {
    flex-direction: column;
  }

  button,
  .file {
    width: 100%;
  }

  .workflow-panel {
    min-height: auto;
  }

  .recording-item {
    grid-template-columns: 1fr;
  }

  .recording-title-row {
    display: grid;
  }

  .icon-button {
    width: 100%;
    min-height: 42px;
  }

  .sequence-row {
    grid-template-columns: 28px 1fr;
  }

  .sequence-row div {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .guide-shell {
    padding: 14px;
  }

  .guide-nav,
  .guide-grid,
  .pillar-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .guide-hero h1 {
    font-size: 36px;
  }

  .guide-lead {
    font-size: 16px;
  }

  .guide-side {
    position: static;
  }

  .guide-section {
    grid-template-columns: 1fr;
    border-radius: 20px;
    padding: 16px;
  }
}

@media print {
  :root {
    color-scheme: light;
    background: #ffffff;
    color: #111827;
  }

  body,
  .guide-body {
    background: #ffffff;
    color: #111827;
  }

  .guide-shell {
    max-width: none;
    padding: 0;
  }

  .guide-nav {
    display: none;
  }

  .guide-hero h1,
  .guide-section h2,
  .guide-close h2 {
    color: #111827;
  }

  .guide-lead,
  .guide-section p,
  .guide-close p,
  .guide-section li,
  .guide-side p,
  .pillar-grid p {
    color: #374151;
  }

  .guide-grid {
    display: block;
  }

  .guide-side {
    position: static;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 12px;
  }

  .guide-side article,
  .guide-section,
  .guide-close,
  .pillar-grid section {
    box-shadow: none;
    break-inside: avoid;
    background: #ffffff;
    border-color: #d1d5db;
  }
}
