:root {
  color-scheme: light;
}

[hidden] { display: none !important; }

.speaking-history-page {
  min-height: 100vh;
  margin: 0;
  color: #17345c;
  background: linear-gradient(180deg, #edf7ff 0%, #f8fbff 52%, #eef5ff 100%);
}

.speaking-history-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 60px;
}

.speaking-history-topbar,
.speaking-history-section-heading,
.speaking-history-training__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.speaking-history-topbar { min-height: 68px; }
.speaking-history-main { display: grid; gap: 18px; }

.speaking-history-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 230px;
  padding: 34px 40px;
  overflow: hidden;
  border: 1px solid #dbe7fb;
  border-radius: 24px;
  background: linear-gradient(125deg, #e8f5ff 0%, #eef2ff 58%, #e5ddff 100%);
  box-shadow: 0 14px 32px rgba(61, 102, 171, 0.1);
}

.speaking-history-eyebrow,
.speaking-history-section-label {
  color: #4b78cf;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.speaking-history-hero h1 { margin: 8px 0 10px; color:#15345d; font-size:clamp(2rem, 4vw, 3.5rem); }
.speaking-history-hero p:last-child { max-width:690px; margin:0; color:#627b9d; line-height:1.8; }
.speaking-history-hero__mark {
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  border-radius: 34px;
  color: #fff;
  background: linear-gradient(145deg, #70aaff, #477ce8);
  box-shadow: 0 18px 30px rgba(55, 111, 214, 0.22);
  font-size: 3rem;
  font-weight: 800;
  line-height: 0.7;
  transform: rotate(4deg);
}
.speaking-history-hero__mark span { font-size:.55rem; letter-spacing:.18em; }

.speaking-history-import,
.speaking-history-card,
.speaking-history-training {
  border: 1px solid #dfe8f7;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(56, 96, 159, 0.07);
}

.speaking-history-import {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 24px;
  padding: 24px 28px;
}
.speaking-history-import h2,
.speaking-history-section-heading h2 { margin:5px 0 0; color:#17365e; font-size:1.25rem; }
.speaking-history-import p { margin:7px 0 0; color:#71829b; }

.speaking-history-file-button,
.speaking-history-primary-button,
.speaking-history-outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.speaking-history-file-button,
.speaking-history-primary-button { border:0; color:#fff; background:#477fe4; box-shadow:0 7px 16px rgba(71,127,228,.2); }
.speaking-history-outline-button { border:1px solid #cddcf6; color:#4772c5; background:#f8fbff; }
.speaking-history-file-button:hover,
.speaking-history-primary-button:hover { background:#356bd0; }
.speaking-history-outline-button:hover { border-color:#7fa6ec; background:#edf4ff; }
.speaking-history-import__status { grid-column:1 / -1; padding-top:12px; border-top:1px solid #edf1f8; font-size:.82rem; }
.speaking-history-import__status.is-error { color:#bd4d4d; }
.speaking-history-import__status.is-success { color:#3c70ca; }

.speaking-history-results { display:grid; gap:18px; padding-top:8px; }
.speaking-history-section-heading { padding:0 4px; }
.speaking-history-section-heading--compact { align-items:flex-end; padding:0; }
.speaking-history-section-heading--compact h2 { font-size:1.08rem; }

.speaking-history-metrics { display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; }
.speaking-history-metrics article { padding:18px 20px; border:1px solid #dee8fa; border-radius:18px; background:linear-gradient(145deg,#fff,#f4f8ff); }
.speaking-history-metrics article > span { display:block; color:#7487a6; font-size:.78rem; }
.speaking-history-metrics strong { display:inline-block; margin-top:8px; color:#3e73dc; font-size:2rem; }
.speaking-history-metrics small { margin-left:5px; color:#8796ad; }

.speaking-history-grid { display:grid; grid-template-columns:0.85fr 1.15fr; gap:16px; }
.speaking-history-card { padding:22px; }
.speaking-history-weaknesses,
.speaking-history-expressions,
.speaking-history-records { display:grid; gap:10px; margin-top:17px; }
.speaking-history-weakness { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:12px; padding:13px 14px; border-radius:14px; background:#f5f8ff; }
.speaking-history-weakness i { width:10px; height:10px; border-radius:50%; background:#5a88e7; }
.speaking-history-weakness strong { color:#244a7d; }
.speaking-history-weakness span { color:#71829d; font-size:.78rem; }

.speaking-history-expression { padding:14px 15px; border:1px solid #e3eafa; border-radius:14px; background:#fbfdff; }
.speaking-history-expression strong { display:block; color:#17385f; line-height:1.65; }
.speaking-history-expression p { margin:6px 0 0; color:#71829b; font-size:.82rem; line-height:1.6; }

.speaking-history-record { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:14px; padding:15px 16px; border:1px solid #e2eafa; border-radius:15px; background:#fbfdff; }
.speaking-history-record__score { display:grid; place-items:center; width:54px; height:54px; border-radius:17px; color:#fff; background:#638ee8; font-weight:800; }
.speaking-history-record__score.is-low { background:#ec826f; }
.speaking-history-record__copy strong { display:block; color:#19395f; line-height:1.55; }
.speaking-history-record__copy p { margin:5px 0 0; color:#71829a; font-size:.8rem; line-height:1.55; }
.speaking-history-record__button { padding:8px 13px; border:1px solid #cedcf5; border-radius:999px; color:#4471c7; background:#fff; font:inherit; font-size:.76rem; font-weight:700; cursor:pointer; }

.speaking-history-training { padding:26px; scroll-margin-top:20px; }
.speaking-history-progress { padding:7px 12px; border-radius:999px; color:#4775ca; background:#edf3ff; font-size:.78rem; font-weight:700; }
.speaking-history-training__prompt { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:20px; padding:16px; border:1px solid #dbe6f9; border-radius:18px; background:#f8fbff; }
.speaking-history-training__prompt > div { padding:16px; border-radius:14px; background:#fff; }
.speaking-history-training__prompt > div:last-child { background:#edf3ff; }
.speaking-history-training__prompt span,
.speaking-history-transcript > span,
.speaking-history-feedback span { color:#7185a5; font-size:.75rem; font-weight:700; }
.speaking-history-training__prompt p { margin:7px 0 0; color:#193b66; font-weight:600; line-height:1.75; }

.speaking-history-hold-button { display:grid; place-items:center; width:126px; height:126px; margin:22px auto 12px; border:0; border-radius:50%; color:#fff; background:linear-gradient(145deg,#61a0ff,#3179e9); box-shadow:0 14px 28px rgba(48,117,226,.27); font:inherit; font-weight:800; cursor:pointer; touch-action:none; user-select:none; }
.speaking-history-hold-button.is-recording { background:linear-gradient(145deg,#ff8b7b,#e95c59); animation:history-recording-pulse 1s ease-in-out infinite; }
.speaking-history-hold-button:disabled { cursor:wait; opacity:.65; }
@keyframes history-recording-pulse { 50% { transform:scale(1.04); } }
.speaking-history-status { margin:0 0 16px; color:#6f819d; text-align:center; }
.speaking-history-status.is-error { color:#bd4d4d; }
.speaking-history-status.is-success { color:#3970cc; }

.speaking-history-transcript,
.speaking-history-feedback { margin-top:13px; padding:17px 19px; border:1px solid #dde7f7; border-radius:16px; background:#fbfdff; }
.speaking-history-transcript p,
.speaking-history-feedback > p,
.speaking-history-feedback section p { margin:7px 0 0; color:#294666; line-height:1.75; }
.speaking-history-feedback > div { display:flex; justify-content:space-between; gap:15px; }
.speaking-history-feedback > div strong { color:#3e75dc; }
.speaking-history-feedback section { margin-top:12px; padding:13px 15px; border-radius:13px; background:#edf3ff; }
.speaking-history-feedback section p { color:#193b67; font-weight:600; }
.speaking-history-training__actions { justify-content:flex-end; margin-top:16px; }

.speaking-history-empty { margin:8px 0 0; color:#8b98aa; font-size:.86rem; }

@media (max-width: 760px) {
  .speaking-history-shell { width:min(100% - 20px, 600px); padding-top:10px; }
  .speaking-history-topbar { gap:8px; }
  .speaking-history-topbar .speaking-redesign-back { padding:8px 10px; font-size:.65rem; }
  .speaking-history-hero { grid-template-columns:1fr; min-height:0; padding:25px 21px; }
  .speaking-history-hero__mark { display:none; }
  .speaking-history-import { grid-template-columns:1fr; padding:20px; }
  .speaking-history-file-button { width:100%; }
  .speaking-history-metrics { grid-template-columns:1fr 1fr; }
  .speaking-history-grid { grid-template-columns:1fr; }
  .speaking-history-record { grid-template-columns:auto 1fr; }
  .speaking-history-record__button { grid-column:1 / -1; }
  .speaking-history-training { padding:18px 14px; }
  .speaking-history-training__prompt { grid-template-columns:1fr; padding:10px; }
  .speaking-history-training__actions { flex-wrap:wrap; }
}
