:root {
  --ink: #17221f;
  --muted: #68736f;
  --paper: #f5f4ef;
  --card: #fffef9;
  --line: #deddd5;
  --green: #1e6652;
  --green-soft: #dfeee7;
  --blue: #416c8d;
  --blue-soft: #e7eef4;
  --amber: #a65d22;
  --amber-soft: #fff0dc;
  --shadow: 0 18px 45px rgba(31, 48, 43, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(66, 130, 101, 0.12), transparent 26rem),
    var(--paper);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; }

.topbar {
  min-height: 78px;
  padding: 14px max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(30, 102, 82, 0.14);
  background: rgba(245, 244, 239, 0.88);
  backdrop-filter: blur(12px);
}

.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-logo {
  display: block; width: 46px; height: 46px;
  border-radius: 15px; object-fit: cover;
  box-shadow: 0 8px 20px rgba(30, 102, 82, .22);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 20px; line-height: 1.1; }
.brand small { color: var(--muted); margin-top: 2px; }
.prototype { color: var(--green); background: var(--green-soft); padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.account-menu { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.account-menu form { margin: 0; }
.account-menu button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--green); background: var(--card); font: 700 13px/1 inherit; cursor: pointer; }

.page { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 64px 0 90px; }
.hero, .detail-header { display: flex; align-items: end; justify-content: space-between; gap: 48px; margin-bottom: 42px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; max-width: 800px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -.035em; font-weight: 500; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 28px; line-height: 1.15; font-weight: 500; }
.lead { max-width: 650px; margin: 18px 0 0; color: var(--muted); font-size: 18px; }
.hero-number { min-width: 150px; text-align: right; }
.hero-number strong { display: block; color: var(--green); font: 500 72px/1 Georgia, serif; }
.hero-number span { color: var(--muted); }

.recording-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 22px; }
.recording-card { display: block; min-height: 360px; padding: 28px; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); transition: transform .2s, border-color .2s; }
.recording-card:hover { transform: translateY(-3px); border-color: rgba(30, 102, 82, .45); }
.card-topline { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; }
.status { padding: 5px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 800; }
.recording-card h2 { margin-top: 26px; font-size: 31px; }
.filename { margin: 8px 0 0; color: var(--muted); word-break: break-word; }
.card-stats, .summary-stats { display: grid; margin: 30px 0 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.card-stats { grid-template-columns: repeat(4, 1fr); }
dl div { min-width: 0; }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 4px 0 0; font-size: 18px; font-weight: 750; }
.notice { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; color: var(--amber); font-weight: 700; }
.notice span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--amber-soft); }
.open-link { display: block; margin-top: 22px; color: var(--green); font-weight: 800; }
.open-link b { margin-left: 5px; }
.empty-state { padding: 70px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: 22px; }

.back-link { display: inline-block; margin-bottom: 30px; color: var(--green); font-weight: 800; text-decoration: none; }
.detail-header { align-items: center; }
.detail-header h1 { font-size: clamp(38px, 5vw, 60px); }
.summary-stats { flex: 0 0 360px; grid-template-columns: repeat(3, 1fr); padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.summary-stats div { padding: 0 14px; border-right: 1px solid var(--line); }
.summary-stats div:last-child { border: 0; }
.summary-stats dd { font-size: 28px; font-family: Georgia, serif; }
.summary-stats .warning-stat dd { color: var(--amber); }

.player-panel { position: sticky; top: 14px; z-index: 10; display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 24px; padding: 18px 22px; color: white; background: #183b32; border-radius: 20px; box-shadow: 0 20px 50px rgba(24, 59, 50, .25); }
.player-copy strong, .player-copy span { display: block; }
.player-copy span { margin-top: 3px; color: #b9d1ca; font-size: 13px; }
audio { width: 100%; height: 42px; }

.transcript-section { margin-top: 64px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 24px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.speaker-two { background: var(--blue); }
.uncertain-dot { background: var(--amber); }
.transcript { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.segment { display: grid; grid-template-columns: 82px 1fr; gap: 20px; padding: 22px 26px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--green); }
.segment:last-child { border-bottom: 0; }
.segment-speaker-two { border-left-color: var(--blue); background: var(--blue-soft); }
.segment-uncertain { border-left-color: var(--amber); background: var(--amber-soft); }
.timestamp { align-self: start; padding: 5px 9px; border: 0; border-radius: 8px; color: var(--green); background: var(--green-soft); font: 800 13px/1.4 inherit; cursor: pointer; }
.segment-uncertain .timestamp { color: var(--amber); background: #fff8ed; }
.segment-meta { display: flex; align-items: center; gap: 12px; min-height: 24px; }
.segment-meta strong { font-size: 14px; }
.uncertain-label { color: var(--amber); font-size: 12px; font-weight: 800; }
.segment-body p { margin: 8px 0 0; font-size: 18px; }

.login-shell { min-height: calc(100vh - 230px); display: grid; place-items: center; }
.login-card { width: min(100%, 590px); padding: 52px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.login-card h1 { margin: 12px auto 0; font-size: clamp(38px, 6vw, 58px); }
.login-card .lead { margin: 20px auto 0; }
.login-mark { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 26px; border-radius: 20px; color: white; background: var(--green); font-size: 32px; font-weight: 800; box-shadow: 0 12px 28px rgba(30, 102, 82, .22); }
.yandex-login { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; margin-top: 32px; padding: 14px 20px; border-radius: 14px; color: #171717; background: #ffdd2d; text-decoration: none; font-weight: 800; }
.yandex-login span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: white; background: #fc3f1d; font-weight: 800; }
.auth-error, .auth-note { margin: 24px 0 0; padding: 12px 14px; border-radius: 12px; color: var(--amber); background: var(--amber-soft); font-weight: 700; }
.login-footnote { margin: 16px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .topbar { padding: 12px 18px; }
  .prototype { display: none; }
  .account-menu span { display: none; }
  .page { width: min(100% - 28px, 1180px); padding-top: 40px; }
  .hero, .detail-header { display: block; }
  .hero-number { margin-top: 24px; text-align: left; }
  .summary-stats { margin-top: 26px; }
  .player-panel { grid-template-columns: 1fr; gap: 10px; }
  .player-copy span { display: none; }
  .section-heading { display: block; }
  .legend { margin-top: 16px; }
  .segment { grid-template-columns: 64px 1fr; gap: 12px; padding: 18px 14px; }
  .segment-body p { font-size: 16px; }
  .card-stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .login-card { padding: 34px 22px; }
}
