/* Berri hangteszt
   Füzetlap-világ: hűvös papír, tintakék szöveg, pontrácsos lap a leiratnak,
   szövegkiemelő-sárga az áraknak. A málnaszín egyedül a felvételé. */

:root {
  --paper: #F3F6FA;
  --page: #FFFFFF;
  --ink: #14213D;
  --ink-soft: #56617A;
  --line: #D5DCE8;
  --edge: #8E9AB3;
  --dot: #C6CFE0;
  --berry: #C2185B;
  --berry-deep: #8C0F40;
  --marker: #FFE45E;
  --good: #1B6E4F;
  --bad: #A8231C;
  --focus: #2F6FED;

  --ui: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.9531rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: var(--step-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
ol,
ul,
dl,
dd,
fieldset {
  margin: 0;
  padding: 0;
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.visually-hidden:focus-visible + .button {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ keret */

.brand {
  font-family: var(--text);
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 1rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

.layout {
  display: grid;
  gap: 2.5rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

@media (min-width: 60rem) {
  .layout {
    grid-template-columns: 22rem minmax(0, 1fr);
    gap: 3.5rem;
    align-items: start;
  }
}

.section-title {
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.3;
}

.empty {
  color: var(--ink-soft);
}

/* ----------------------------------------------------------------- gombok */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.25rem;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button-primary {
  width: 100%;
  min-height: 3.25rem;
  background: var(--ink);
  color: #fff;
}

.button-primary:hover {
  background: #0C1730;
}

.button-primary:disabled {
  background: #AEB7C8;
  cursor: not-allowed;
}

.button-quiet {
  background: var(--page);
  border-color: var(--ink);
  color: var(--ink);
}

.button-quiet:hover {
  background: var(--paper);
}

.text-button {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;
}

.text-button.is-armed {
  color: var(--bad);
  font-weight: 600;
  white-space: normal;
  text-align: right;
}

/* ------------------------------------------------------------ hang bevitele */

.capture,
.clip {
  padding: 1.75rem 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--page);
}

.capture {
  text-align: center;
}

.recorder {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
}

.record-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 6.5rem;
  height: 6.5rem;
  margin: 1.75rem 0 2.25rem;
  border: 0;
  border-radius: 50%;
  background: var(--berry);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .record-button:hover {
    background: var(--berry-deep);
  }
}

/* A gyűrű a mikrofon hangerejével tágul (--level: 0…1, az app.js állítja). */
.record-button::before {
  content: "";
  position: absolute;
  inset: -0.625rem;
  border: 2px solid var(--berry);
  border-radius: 50%;
  opacity: 0.22;
  transform: scale(calc(1 + var(--level, 0) * 0.3));
  transition: transform 90ms linear, opacity 150ms ease;
}

.record-button.is-recording::before {
  background: rgba(194, 24, 91, 0.1);
  opacity: 0.7;
}

.record-glyph {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  transition: border-radius 150ms ease, transform 150ms ease;
}

.record-button.is-recording .record-glyph {
  border-radius: 5px;
  transform: scale(0.82);
}

.record-timer {
  font-size: var(--step-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.record-hint {
  color: var(--ink-soft);
}

.capture-or {
  margin: 1.25rem 0;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.dropzone {
  padding: 1.25rem 1rem;
  border: 1.5px dashed var(--edge);
  border-radius: 10px;
}

.dropzone.is-over {
  border-style: solid;
  border-color: var(--ink);
  background: var(--paper);
}

.dropzone-note {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.clip-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.clip-meta {
  color: var(--ink-soft);
}

.clip-estimate:empty {
  display: none;
}

.clip-estimate {
  margin-top: 0.5rem;
}

.clip-player {
  display: block;
  width: 100%;
  margin: 1rem 0 0.5rem;
}

/* ------------------------------------------------------------ beállítások */

.settings {
  margin-top: 1.75rem;
}

.field,
.field-group {
  display: grid;
  gap: 0.375rem;
}

.field-group {
  gap: 0.5rem;
}

.field-group > legend {
  margin-bottom: 0.5rem;
  padding: 0;
}

.settings > .field,
.gate-form > .field {
  margin-top: 1.25rem;
}

.field-label {
  font-size: var(--step-0);
  font-weight: 600;
}

.field-help {
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid var(--edge);
  border-radius: 10px;
  background: var(--page);
  color: var(--ink);
  font: inherit;
}

.field textarea {
  resize: vertical;
}

.field-inline {
  grid-template-columns: auto 6.5rem auto;
  align-items: center;
  justify-content: start;
  gap: 0.625rem;
}

.field-inline input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--page);
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--ink);
}

.choice-off {
  background: transparent;
  color: var(--ink-soft);
  cursor: not-allowed;
}

.choice input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.125rem 0 0;
  accent-color: var(--ink);
}

.choice-text {
  display: grid;
}

.choice-name {
  font-weight: 600;
}

.choice-price {
  color: var(--ink-soft);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.settings > .button-primary {
  margin-top: 1.75rem;
}

.run-progress {
  display: block;
  width: 100%;
  height: 0.375rem;
  margin-top: 0.75rem;
  accent-color: var(--ink);
}

.status {
  min-height: 1.5rem;
  margin-top: 0.75rem;
}

.status-bad {
  color: var(--bad);
}

.status-good {
  color: var(--good);
}

.notice {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--ink-soft);
  border-radius: 0 8px 8px 0;
  background: var(--page);
  text-align: left;
}

.notice-bad {
  border-left-color: var(--bad);
  color: var(--bad);
}

.capture > .notice {
  margin-bottom: 1.25rem;
  background: var(--paper);
}

/* --------------------------------------------------------------- eredmény */

.results {
  display: grid;
  gap: 2.5rem;
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 1rem;
  margin-bottom: 0.5rem;
}

.result-title {
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.3;
}

/* A leirat lapja: pontrács és margóvonal, mint a füzetben. */
.sheet {
  position: relative;
  padding: 1.5rem 1.25rem 1.75rem 2.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background-color: var(--page);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.3px);
  background-size: 1.25rem 1.25rem;
  background-position: 0.5rem 0.5rem;
}

.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.5rem;
  width: 1px;
  background: var(--berry);
  opacity: 0.45;
}

@media (min-width: 40rem) {
  .sheet {
    padding: 2rem 2.5rem 2.25rem 4rem;
  }

  .sheet::before {
    left: 2.75rem;
  }
}

.sheet-text {
  max-width: 38em;
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sheet-text-empty {
  color: var(--ink-soft);
  font-style: italic;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1rem 1.5rem;
  margin-top: 1.25rem;
}

.fact-label {
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.fact-value {
  font-variant-numeric: tabular-nums;
}

.cost {
  padding: 0 0.15em;
  background: linear-gradient(transparent 48%, var(--marker) 48%);
  color: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fact:first-child,
.fact-wide {
  grid-column: 1 / -1;
}

.fact:first-child .fact-value {
  font-size: var(--step-1);
  line-height: 1.3;
}

.tech {
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.tech-summary {
  min-height: 2.75rem;
  padding: 0.625rem 0;
  cursor: pointer;
}

.tech-list {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.25rem 1rem;
  padding-bottom: 0.5rem;
  overflow-wrap: anywhere;
}

.result-failed .notice,
.result > .notice {
  margin-top: 0.75rem;
}

/* ------------------------------------------------------- költés, előzmények */

.pane-output {
  display: grid;
  gap: 3rem;
  min-width: 0;
}

.totals-line {
  margin-top: 0.5rem;
  font-size: var(--step-1);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.totals-note {
  max-width: 38em;
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.history-list {
  margin-top: 0.5rem;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.history-list:empty {
  display: none;
}

.history-item {
  border-top: 1px solid var(--line);
}

.history-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 1rem;
  padding: 0.75rem 0;
  cursor: pointer;
  list-style: none;
  font-variant-numeric: tabular-nums;
}

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

.history-when {
  font-weight: 600;
}

.history-cost {
  text-align: right;
}

.history-model,
.history-length {
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.history-length {
  text-align: right;
}

.history-when {
  order: 1;
}

.history-cost {
  order: 2;
}

.history-model {
  order: 3;
}

.history-length {
  order: 4;
}

@media (min-width: 40rem) {
  .history-summary {
    grid-template-columns: 9rem minmax(0, 1fr) 4rem 11rem;
    align-items: baseline;
  }

  .history-model {
    order: 2;
    font-size: var(--step-0);
  }

  .history-length {
    order: 3;
    font-size: var(--step-0);
  }

  .history-cost {
    order: 4;
  }
}

.history-details[open] > .history-summary {
  padding-bottom: 0.25rem;
}

.history-body {
  padding: 0 0 1rem;
}

.history-file {
  color: var(--ink-soft);
  font-size: var(--step--1);
  overflow-wrap: anywhere;
}

.history-text {
  max-width: 38em;
  margin-top: 0.5rem;
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.history-text-empty {
  color: var(--ink-soft);
  font-style: italic;
}

/* ------------------------------------------------- belépés, beállítási oldal */

.gate {
  max-width: 24rem;
  margin: 0 auto;
  padding: 14vh 1.25rem 3rem;
}

.gate-lead {
  margin-top: 0.5rem;
  color: var(--ink-soft);
}

.gate-form {
  margin-top: 0.75rem;
}

.gate-form > .notice {
  margin-top: 1rem;
}

.gate-form > .button-primary {
  margin-top: 1.25rem;
}

.gate-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-left: 1.25rem;
}

.gate-note {
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

@media (prefers-reduced-motion: reduce) {
  .record-button::before,
  .record-glyph {
    transition: none;
  }
}
