@import url("https://fonts.googleapis.com/css2?family=Alexandria:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap");

:root {
  --paper: #f5f1e8;
  --paper-deep: #eae4d8;
  --surface: rgba(255, 253, 248, 0.88);
  --ink: #152b29;
  --muted: #6e7974;
  --orange: #ec6238;
  --orange-dark: #cc4724;
  --green: #315e58;
  --lime: #d8e285;
  --line: rgba(21, 43, 41, 0.12);
  --shadow: 0 22px 55px rgba(32, 50, 45, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(49, 94, 88, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 94, 88, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  font-family: "IBM Plex Sans Arabic", "Tahoma", sans-serif;
  position: relative;
  overflow-x: hidden;
}

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

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(236, 98, 56, 0.25);
  outline-offset: 2px;
}

.page-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  z-index: -1;
}

.glow-one {
  background: rgba(216, 226, 133, 0.3);
  top: -230px;
  right: -110px;
}

.glow-two {
  background: rgba(236, 98, 56, 0.1);
  bottom: -260px;
  left: -120px;
}

.topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand > span:last-child {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand strong {
  font-family: "Alexandria", sans-serif;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.brand small {
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 700;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: 0 10px 24px rgba(236, 98, 56, 0.22);
}

.brand-mark i {
  width: 3px;
  border-radius: 3px;
  background: #fff9ef;
}

.brand-mark i:nth-child(1),
.brand-mark i:nth-child(5) { height: 10px; }
.brand-mark i:nth-child(2),
.brand-mark i:nth-child(4) { height: 20px; }
.brand-mark i:nth-child(3) { height: 28px; }

.local-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  font-weight: 600;
}

.local-pill b {
  font: inherit;
}

.local-pill span,
footer p span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  color: #5c9b66;
  background: #5c9b66;
  box-shadow: 0 0 0 5px rgba(92, 155, 102, 0.12);
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  gap: 42px;
  align-items: center;
  padding: 8px 0 38px;
}

.kicker,
.eyebrow {
  margin: 0 0 9px;
  color: var(--orange-dark);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

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

h1,
h2,
.brand strong {
  font-family: "Alexandria", "IBM Plex Sans Arabic", sans-serif;
}

h1 {
  max-width: 770px;
  margin-bottom: 16px;
  font-size: clamp(2.7rem, 5.2vw, 4.8rem);
  line-height: 1.16;
  letter-spacing: -0.055em;
}

h1 em {
  color: var(--orange);
  font-style: normal;
  position: relative;
}

h1 em::after {
  content: "";
  position: absolute;
  right: 2%;
  left: 2%;
  bottom: -8px;
  height: 7px;
  background: var(--lime);
  border-radius: 60% 40% 55% 45%;
  transform: rotate(-1deg);
  z-index: -1;
}

.hero-copy {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.9;
}

.profile-card {
  min-height: 250px;
  padding: 26px;
  display: grid;
  grid-template-columns: 156px 1fr;
  gap: 26px;
  align-items: center;
  color: #fdf9ef;
  background:
    radial-gradient(circle at 12% 10%, rgba(216, 226, 133, 0.17), transparent 36%),
    var(--green);
  border-radius: 32px 8px 32px 32px;
  box-shadow: 0 24px 55px rgba(49, 94, 88, 0.2);
  position: relative;
  overflow: hidden;
}

.profile-card::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  left: -42px;
  bottom: -72px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 19px rgba(255,255,255,0.025), 0 0 0 38px rgba(255,255,255,0.025);
}

.score-ring {
  --score: 0;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--lime) calc(var(--score) * 1%), rgba(255,255,255,0.12) 0);
  position: relative;
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: inherit;
  background: var(--green);
}

.score-ring div {
  position: relative;
  display: grid;
  text-align: center;
}

.score-ring strong {
  color: var(--lime);
  font-family: "Alexandria", sans-serif;
  font-size: 2rem;
}

.score-ring small {
  color: rgba(255,255,255,0.68);
  font-size: 0.72rem;
}

.profile-meta {
  display: grid;
  gap: 15px;
}

.profile-meta span {
  padding-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255,255,255,0.68);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
}

.profile-meta span:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.profile-meta b {
  color: #fff;
  font-weight: 600;
}

.tabs {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 24px;
  padding: 6px;
  gap: 4px;
  background: rgba(231, 225, 214, 0.88);
  border: 1px solid rgba(21,43,41,0.07);
  border-radius: 18px;
}

.tab {
  border: 0;
  padding: 12px 22px;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  transition: 180ms ease;
}

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

.tab.active {
  color: var(--ink);
  background: #fffdf8;
  box-shadow: 0 7px 20px rgba(32, 50, 45, 0.08);
}

.tab-icon {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  margin-left: 5px;
  color: var(--orange);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: reveal 240ms ease both;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.72fr);
  gap: 20px;
}

.surface {
  background: var(--surface);
  border: 1px solid rgba(21, 43, 41, 0.1);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.editor-card,
.recorder-card,
.lexicon-form-card {
  padding: 30px;
}

.output-card,
.samples-card,
.dictionary-card {
  padding: 26px;
}

.section-head,
.output-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.72rem);
  letter-spacing: -0.035em;
}

.select-wrap {
  display: grid;
  gap: 5px;
}

.select-group {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.select-wrap span,
.lexicon-form label span,
.upload-grid label > span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255,255,255,0.75);
}

select {
  min-width: 145px;
  padding: 9px 13px;
  border-radius: 11px;
}

.text-field {
  margin-top: 22px;
  display: grid;
  position: relative;
}

textarea {
  width: 100%;
  resize: vertical;
  border-radius: 18px;
  padding: 20px 20px 38px;
  line-height: 1.9;
}

#text {
  min-height: 235px;
  font-size: 1.03rem;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(236, 98, 56, 0.6);
  outline: none;
  box-shadow: 0 0 0 4px rgba(236, 98, 56, 0.07);
}

#char-count {
  position: absolute;
  left: 16px;
  bottom: 12px;
  color: #8a928e;
  font-size: 0.73rem;
}

.samples-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 24px;
  color: var(--muted);
  font-size: 0.78rem;
}

.sample-chip,
.ghost-btn,
.prompt-nav button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255,255,255,0.7);
  cursor: pointer;
}

.sample-chip {
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.sample-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(236, 98, 56, 0.55);
  color: var(--orange-dark);
  background: rgba(236, 98, 56, 0.09);
  box-shadow: 0 7px 16px rgba(204, 71, 36, 0.12);
}

.sample-chip.active,
.sample-chip[aria-pressed="true"] {
  border-color: var(--orange);
  color: #fff;
  background: var(--orange);
  box-shadow: 0 8px 20px rgba(204, 71, 36, 0.24);
}

.sample-chip.active:hover,
.sample-chip[aria-pressed="true"]:hover {
  border-color: var(--orange-dark);
  color: #fff;
  background: var(--orange-dark);
}

.ghost-btn:hover,
.prompt-nav button:hover {
  border-color: rgba(236, 98, 56, 0.45);
  color: var(--orange-dark);
}

.generate-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.primary-btn,
.secondary-btn,
.download-btn {
  border: 0;
  border-radius: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-btn {
  padding: 13px 22px;
  color: white;
  background: var(--orange);
  box-shadow: 0 12px 25px rgba(236, 98, 56, 0.2);
}

.primary-btn:hover,
.download-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(236, 98, 56, 0.22);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.record-btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.primary-btn.compact {
  padding: 10px 16px;
  font-size: 0.82rem;
}

.play-icon {
  display: inline-block;
  margin-left: 7px;
  font-size: 0.68rem;
}

.status-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.status-message.error {
  color: #a33f29;
}

.status-message.success {
  color: #35704b;
}

.format-badge,
.prompt-counter {
  min-width: 38px;
  padding: 7px 10px;
  color: var(--green);
  background: rgba(49, 94, 88, 0.08);
  border-radius: 999px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.prompt-counter,
#active-limit {
  direction: ltr;
}

.empty-wave {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.empty-wave span {
  width: 4px;
  height: 20px;
  border-radius: 5px;
  background: rgba(49, 94, 88, 0.18);
}

.empty-wave span:nth-child(3n) { height: 48px; }
.empty-wave span:nth-child(3n + 1) { height: 30px; }
.empty-wave span:nth-child(4n) { height: 62px; background: rgba(236, 98, 56, 0.3); }

.empty-wave.loading span {
  background: var(--orange);
  animation: wave 800ms ease-in-out infinite alternate;
}

.empty-wave.loading span:nth-child(2n) { animation-delay: -400ms; }
.empty-wave.loading span:nth-child(3n) { animation-delay: -200ms; }

@keyframes wave {
  from { transform: scaleY(0.35); opacity: 0.35; }
  to { transform: scaleY(1); opacity: 1; }
}

.empty-copy {
  margin: -15px 0 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

#audio-player,
#recorded-audio,
.sample-item audio {
  width: 100%;
}

.download-btn {
  margin-top: 12px;
  padding: 11px 16px;
  display: block;
  text-align: center;
  color: #fff;
  background: var(--green);
  text-decoration: none;
}

.tts-feedback {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.52);
}

.tts-feedback > p:first-child {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.6;
}

.tts-feedback > p strong {
  color: var(--ink);
}

.feedback-actions,
.correction-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

#feedback-status {
  min-height: 18px;
  margin-top: 9px;
}

.correction-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.correction-panel > p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.correction-panel blockquote {
  margin: 0 0 12px;
  padding: 11px 13px;
  color: var(--ink);
  background: rgba(49,94,88,0.07);
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.7;
}

.correction-panel .record-preview {
  margin-top: 11px;
}

.correction-panel > small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.6;
}

#correction-audio {
  width: 100%;
}

.tip-card,
.privacy-note {
  display: flex;
  gap: 12px;
  background: #edf0d9;
  border-radius: 16px;
}

.tip-card {
  margin-top: 24px;
  padding: 14px;
}

.tip-card > span,
.privacy-note > span {
  color: var(--orange);
}

.tip-card p,
.privacy-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.65;
}

.tip-card strong,
.privacy-note strong {
  display: block;
  color: var(--ink);
}

.training-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.7fr);
}

.privacy-note {
  margin: 22px 0;
  padding: 13px 15px;
  background: rgba(216, 226, 133, 0.24);
}

.prompt-card {
  padding: 22px;
  background: var(--green);
  color: white;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.prompt-card::after {
  content: "”";
  position: absolute;
  left: 20px;
  top: -42px;
  color: rgba(255,255,255,0.07);
  font-size: 9rem;
  font-family: Georgia, serif;
}

.prompt-card > p {
  margin-bottom: 8px;
  color: var(--lime);
  font-size: 0.72rem;
}

.prompt-card blockquote {
  min-height: 78px;
  margin: 0;
  font-family: "Alexandria", sans-serif;
  font-size: 1.14rem;
  line-height: 1.9;
  position: relative;
  z-index: 1;
}

.prompt-nav {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.prompt-nav button {
  width: 32px;
  height: 32px;
  border-color: rgba(255,255,255,0.18);
  color: white;
  background: rgba(255,255,255,0.08);
  border-radius: 9px;
}

.recorder-controls {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.record-btn,
.stop-btn {
  border: 0;
  cursor: pointer;
}

.record-btn {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(32,50,45,0.08);
}

.record-btn > span {
  width: 12px;
  height: 12px;
  background: var(--orange);
  border-radius: 50%;
}

.record-btn.recording > span {
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 8px rgba(236,98,56,0.16); }
}

.stop-btn {
  padding: 12px 18px;
  color: #fff;
  background: var(--orange);
  border-radius: 999px;
}

.stop-btn span {
  width: 10px;
  height: 10px;
  display: inline-block;
  background: white;
  border-radius: 2px;
}

.record-timer {
  min-width: 45px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}

.record-preview {
  padding: 14px;
  display: grid;
  gap: 11px;
  background: rgba(49,94,88,0.05);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.record-preview > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ghost-btn {
  padding: 9px 13px;
  border-radius: 11px;
}

.upload-section {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.upload-section summary {
  color: var(--green);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.upload-grid {
  padding-top: 14px;
  display: grid;
  gap: 11px;
}

.upload-grid label:not(.file-drop) {
  display: grid;
  gap: 5px;
}

.upload-grid textarea {
  min-height: 85px;
  padding: 12px;
}

.file-drop {
  padding: 18px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(49,94,88,0.28);
  border-radius: 14px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.77rem;
}

.file-drop input {
  max-width: 100%;
  margin-bottom: 7px;
}

.secondary-btn {
  padding: 11px 15px;
  color: white;
  background: var(--green);
}

.consent-check {
  margin-top: 17px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.consent-check input {
  margin-top: 3px;
  accent-color: var(--orange);
}

#record-status,
#lexicon-status {
  min-height: 20px;
  margin-top: 10px;
}

.card-intro {
  margin: 13px 0 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

.sample-list,
.lexicon-list {
  display: grid;
  gap: 10px;
  max-height: 480px;
  overflow: auto;
  padding-left: 3px;
}

.empty-list {
  padding: 36px 12px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 15px;
  text-align: center;
  font-size: 0.8rem;
}

.sample-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,0.58);
}

.sample-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sample-item p {
  margin: 0 0 8px;
  display: -webkit-box;
  color: var(--ink);
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.77rem;
  line-height: 1.55;
}

.sample-item small {
  color: var(--muted);
}

.sample-actions {
  display: flex;
  gap: 5px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
  cursor: pointer;
}

.icon-btn.danger:hover {
  color: #aa3b27;
  border-color: rgba(170,59,39,0.35);
}

.sample-item audio {
  height: 34px;
  margin-top: 9px;
}

.switch {
  width: 38px;
  height: 22px;
  padding: 3px;
  display: inline-flex;
  justify-content: flex-start;
  border: 0;
  border-radius: 999px;
  background: #cfd3cf;
  cursor: pointer;
}

.switch span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform 170ms ease;
}

.switch.on {
  background: var(--green);
}

.switch.on span {
  transform: translateX(-16px);
}

.lexicon-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.lexicon-form {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
}

.lexicon-form label {
  display: grid;
  gap: 6px;
}

.lexicon-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
}

.lexicon-form button {
  grid-column: 1 / -1;
  justify-self: start;
}

.arrow {
  padding-bottom: 12px;
  color: var(--orange);
}

.lexicon-example {
  margin-top: 26px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px dashed var(--line);
  border-radius: 15px;
}

.lexicon-example span {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(49,94,88,0.08);
  font-size: 0.7rem;
  font-weight: 700;
}

.lexicon-example p {
  margin: 0;
  direction: ltr;
  color: var(--muted);
}

.lexicon-example b {
  margin: 0 8px;
  color: var(--orange);
}

.lexicon-item {
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 10px;
  align-items: center;
  background: rgba(255,255,255,0.58);
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 0.82rem;
}

.lexicon-item .map-arrow {
  color: var(--orange);
}

.lexicon-item .spoken {
  color: var(--green);
  font-weight: 700;
}

footer {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.74rem;
}

footer p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

footer p span {
  display: inline-block;
  font-size: 0;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 43, 41, 0.58);
  backdrop-filter: blur(8px);
}

.admin-dialog {
  width: min(430px, 100%);
  padding: 30px;
  position: relative;
}

.admin-dialog > p:not(.eyebrow, .status-message) {
  margin: 12px 0 20px;
  color: var(--muted);
  line-height: 1.7;
}

.admin-dialog label {
  display: grid;
  gap: 7px;
}

.admin-dialog label span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.admin-dialog input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
}

.admin-dialog .primary-btn {
  width: 100%;
  margin-top: 12px;
}

.admin-dialog .status-message {
  min-height: 20px;
  margin: 10px 0 0;
  text-align: center;
}

.admin-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255,255,255,0.72);
  cursor: pointer;
  font-size: 1.25rem;
}

.hidden {
  display: none !important;
}

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

  .hero {
    gap: 30px;
    padding-bottom: 40px;
  }

  .profile-card {
    min-height: 220px;
  }

  .output-card {
    min-height: 290px;
  }
}

@media (max-width: 620px) {
  .topbar,
  .app-shell {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    height: 76px;
  }

  .app-shell {
    padding-top: 34px;
  }

  .local-pill {
    padding: 8px 10px;
    font-size: 0.67rem;
  }

  .brand small {
    display: none;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.6rem);
  }

  .profile-card {
    grid-template-columns: 115px 1fr;
    padding: 20px;
  }

  .score-ring {
    width: 112px;
    height: 112px;
  }

  .score-ring strong {
    font-size: 1.5rem;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    padding: 10px 7px;
    font-size: 0.73rem;
  }

  .tab-icon {
    display: none;
  }

  .editor-card,
  .recorder-card,
  .lexicon-form-card,
  .output-card,
  .samples-card,
  .dictionary-card {
    padding: 20px;
    border-radius: 21px;
  }

  .section-head {
    display: grid;
  }

  .select-wrap {
    justify-self: start;
  }

  .select-group {
    flex-wrap: wrap;
  }

  .generate-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .primary-btn:not(.compact) {
    width: 100%;
  }

  .lexicon-form {
    grid-template-columns: 1fr;
  }

  .arrow {
    display: none;
  }

  .lexicon-form button {
    width: 100%;
  }

  footer {
    padding: 20px 0;
    align-items: flex-start;
    flex-direction: column;
  }
}
