:root {
    --bg: #f6f3ee;
    --surface: #ffffff;
    --ink: #17211c;
    --muted: #647069;
    --line: #dce2dd;
    --brand: #145c47;
    --brand-dark: #0b3c2e;
    --accent: #e7a93d;
    --danger: #b3261e;
    --shadow: 0 18px 50px rgba(29, 48, 39, .09);
    --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px clamp(18px, 4vw, 60px);
    background: rgba(246, 243, 238, .94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(220, 226, 221, .8);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; text-decoration: none; }
.brand-mark {
    display: grid; place-items: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--brand);
    color: white;
    font-size: .86rem;
}
.top-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.top-nav a { text-decoration: none; font-weight: 700; }
.primary-link { color: white !important; background: var(--brand); padding: 10px 16px; border-radius: 999px; }

.public-shell, .app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 80px;
}
.narrow { width: min(760px, calc(100% - 32px)); }

.hero {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    gap: 48px;
    min-height: 66vh;
}
.eyebrow { color: var(--brand); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 900; }
h1, h2, h3 { line-height: 1.12; }
h1 { font-size: clamp(2.35rem, 5vw, 5rem); margin: .25em 0; letter-spacing: -.045em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
.lead { font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--muted); max-width: 760px; }

.hero-card, .panel, .auth-card, .contact-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(22px, 4vw, 40px);
}
.sentence-demo { font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 850; margin-bottom: 22px; }
.sentence-demo span { background: #e8f3ee; border-radius: 10px; padding: 2px 8px; }
.big-play { width: 100%; padding: 18px; border: 0; border-radius: 16px; background: var(--brand); color: white; font-weight: 900; font-size: 1.05rem; opacity: 1; }

.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 14px; padding: 12px 18px;
    text-decoration: none; font-weight: 850;
}
.button.primary { background: var(--brand); color: white; }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { background: #edf1ee; color: var(--ink); }
.button.danger { background: var(--danger); color: white; }
.button.voice-button { background: var(--accent); color: #241b0b; font-size: 1.1rem; padding: 18px 24px; }
.button.huge { min-height: 62px; font-size: 1.2rem; }
.button.text-danger { color: var(--danger); background: transparent; padding: 8px; }

.section { padding: 55px 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.feature-grid, .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}
.feature-card, .dashboard-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
}
.dashboard-card { min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; transition: .2s ease; }
.dashboard-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.dashboard-card strong { font-size: 1.25rem; }
.dashboard-card span { color: var(--muted); }
.dashboard-card.accent { background: var(--brand); color: white; }
.dashboard-card.accent span { color: #d6ece4; }

.dashboard-head, .page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 32px;
}
.dashboard-head h1, .page-head h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
.dashboard-head p, .page-head p { color: var(--muted); }

.auth-card { width: min(520px, 100%); margin: 50px auto; }
.form-stack, .form-grid { display: grid; gap: 18px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; font-weight: 750; }
input, textarea, select {
    width: 100%;
    border: 1px solid #c9d2cc;
    border-radius: 13px;
    padding: 13px 14px;
    background: white;
    color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(20, 92, 71, .18); border-color: var(--brand); }

.flash { padding: 14px 16px; border-radius: 14px; margin: 0 0 18px; }
.flash.success { background: #def3e9; color: #0e5b3f; }
.flash.error { background: #fde5e3; color: #8e1d17; }

.recording-panel { display: grid; gap: 22px; }
.recorder-status { display: flex; align-items: center; gap: 12px; background: #f3f6f4; border-radius: 16px; padding: 18px; }
.recording-dot { width: 14px; height: 14px; border-radius: 50%; background: #9aa5a0; }
.recording-dot.live { background: var(--danger); box-shadow: 0 0 0 8px rgba(179,38,30,.12); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.15); } }
#recordingTime { margin-left: auto; font-variant-numeric: tabular-nums; }
.quality-box { background: #f7faf8; border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.quality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quality-grid > div { background: white; border-radius: 12px; padding: 14px; display: grid; gap: 4px; }
.quality-grid span, .muted { color: var(--muted); }
.inline-message, .speak-message { min-height: 28px; font-weight: 700; }

.list-stack { display: grid; gap: 18px; }
.recording-card, .review-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px;
}
.recording-card { display: grid; grid-template-columns: 1fr auto auto; gap: 20px; align-items: center; }
.recording-main { display: grid; grid-template-columns: 1fr minmax(220px, 360px); gap: 20px; align-items: center; }
.review-card audio { width: 100%; margin: 14px 0 22px; }
.spoken-quote { font-size: 1.2rem; color: var(--muted); }
.status { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: .75rem; font-weight: 900; background: #e8ece9; }
.status.approved, .status.active { background: #dcf4e8; color: #17613f; }
.status.re_record, .status.rejected { background: #fde4e1; color: #912019; }
.status.manual_review { background: #fff0cf; color: #704b00; }

.empty-state { padding: 28px; background: #eef2ef; border-radius: 16px; color: var(--muted); }
.chip-list { display: grid; gap: 12px; margin-top: 24px; }
.text-chip { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 15px 18px; display: flex; justify-content: space-between; align-items: center; }
.text-chip div { display: grid; gap: 3px; }
.text-chip small { color: var(--muted); }
.icon-button { border: 0; background: #f4ecea; color: var(--danger); width: 36px; height: 36px; border-radius: 50%; font-size: 1.4rem; }

.picture-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; margin-top: 24px; }
.picture-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.picture-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; }

.voice-workspace { max-width: 1200px; margin: 0 auto; }
.voice-topbar { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; }
.voice-topbar h1 { font-size: clamp(2rem, 4vw, 3.6rem); margin: 0; }
.emergency-button {
    width: 96px; height: 96px; border-radius: 50%; border: 7px solid #ffd5d1;
    background: var(--danger); color: white; font-size: 1.25rem; font-weight: 950;
    box-shadow: 0 10px 25px rgba(179,38,30,.24);
}
.sentence-builder { background: white; border: 2px solid var(--brand); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.sentence-builder textarea { font-size: clamp(1.35rem, 3vw, 2.2rem); font-weight: 750; min-height: 130px; }
.sentence-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.tabs { display: flex; gap: 8px; margin: 26px 0 14px; overflow-x: auto; }
.tab { border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 850; background: #e9eeeb; }
.tab.active { background: var(--brand); color: white; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.choice-card, .picture-choice {
    background: white; border: 1px solid var(--line); border-radius: 18px; padding: 18px; text-align: left;
}
.choice-card strong { display: block; font-size: 1.05rem; }
.choice-card small { color: var(--muted); }
.picture-choice { text-align: center; }
.picture-choice img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 14px; margin-bottom: 10px; }
.picture-choice strong, .picture-choice span { display: block; }
.picture-choice span { color: var(--muted); font-size: .9rem; }

.invite-result { margin-top: 24px; padding: 18px; background: #eef6f2; border-radius: 15px; }
.invite-result input { margin-top: 8px; }
.check-label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.check-label input { width: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
.site-footer { padding: 30px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
    .hero, .split { grid-template-columns: 1fr; }
    .feature-grid, .dashboard-grid, .picture-grid, .choice-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .recording-card, .recording-main { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .site-header { align-items: flex-start; }
    .top-nav { justify-content: flex-end; gap: 10px; font-size: .9rem; }
    .top-nav a:not(.primary-link) { display: none; }
    .public-shell, .app-shell { width: min(100% - 20px, 1180px); padding-top: 22px; }
    .feature-grid, .dashboard-grid, .picture-grid, .choice-grid, .form-grid.two, .quality-grid { grid-template-columns: 1fr; }
    .dashboard-head, .page-head { align-items: stretch; flex-direction: column; }
    .voice-topbar { align-items: flex-start; }
    .emergency-button { width: 78px; height: 78px; font-size: 1rem; flex: 0 0 auto; }
}
