:root {
    --bg: #f5f5f7;
    --card-bg: #ffffff;
    --text: #1d1d1f;
    --text-muted: #6e6e73;
    --border: #e5e5ea;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }

.site-header {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.site-header__inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand { font-weight: 600; font-size: 17px; color: var(--text); }
.link-muted { color: var(--text-muted); font-size: 14px; }

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
h1 { font-size: 28px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 600; margin: 28px 0 10px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
h4 { font-size: 14px; font-weight: 600; margin: 16px 0 6px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 980px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #e8e8ed; color: var(--text); }
.btn-secondary:hover { background: #dcdce1; }
.btn-block { width: 100%; justify-content: center; }

.input {
    width: 100%;
    font-size: 15px;
    font-family: inherit;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,0.15); }
textarea.input { resize: vertical; line-height: 1.5; }

/* Login */
.login-wrap { display: flex; justify-content: center; padding-top: 10vh; }
.login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.login-title { text-align: center; margin: 0; }
.login-sub { text-align: center; color: var(--text-muted); margin: 0 0 8px; font-size: 14px; }
.form-error { color: #d70015; font-size: 13px; margin: 0; }

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.interview-card {
    display: block;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    color: var(--text);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.interview-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.06), 0 16px 32px rgba(0,0,0,0.08); }
.interview-card__top { display: flex; justify-content: space-between; align-items: flex-start; }
.interview-card__company { font-weight: 600; font-size: 17px; }
.interview-card__role { color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.interview-card__meta { color: var(--text-muted); font-size: 13px; margin-top: 8px; }
.interview-card__date { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.badge-recording { font-size: 16px; }

.empty-state { color: var(--text-muted); font-size: 14px; }

/* Interview detail */
.interview-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.interview-head__sub { color: var(--text-muted); margin: 0; }

.tabs {
    display: flex;
    gap: 4px;
    background: #e8e8ed;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
}
.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 9px;
    cursor: pointer;
    color: var(--text-muted);
    white-space: nowrap;
}
.tab-btn.is-active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.prose { line-height: 1.6; font-size: 15px; white-space: pre-line; }

.person-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 14px;
}
.person-card__role { color: var(--text-muted); font-size: 13px; margin: 0 0 8px; }

.subnav { display: flex; gap: 8px; margin-bottom: 16px; }
.subnav-btn {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 980px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-muted);
}
.subnav-btn.is-active { background: var(--text); color: #fff; border-color: var(--text); }
.subnav-panel { display: none; }
.subnav-panel.is-active { display: block; }

.accordion-item {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 8px;
    overflow: hidden;
}
.accordion-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
}
.accordion-caret { transition: transform 0.15s ease; color: var(--text-muted); }
.accordion-item.is-open .accordion-caret { transform: rotate(180deg); }
.accordion-answer { display: none; padding: 0 16px 16px; }
.accordion-item.is-open .accordion-answer { display: block; }

/* Upload / recordings */
.upload-form { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.upload-label input { display: block; }
.hint { color: var(--text-muted); font-size: 12px; margin: 0; flex-basis: 100%; }

.recording-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 12px; }
.recording-card__head { display: flex; justify-content: space-between; align-items: center; }
.recording-card__meta { color: var(--text-muted); font-size: 12px; margin: 4px 0 10px; }
.badge { border-radius: 980px; padding: 3px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-status--uploaded { background: #fff3cd; color: #856404; }
.badge-status--transcribing { background: #cfe2ff; color: #084298; }
.badge-status--done { background: #d1e7dd; color: #0f5132; }
.badge-status--error { background: #f8d7da; color: #842029; }
.transcript-details { margin-top: 10px; }
.transcript-details summary { cursor: pointer; font-size: 13px; color: var(--accent); }

/* Admin edit form */
.paste-box { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 24px; }
.paste-box summary { cursor: pointer; font-weight: 500; }
.paste-form { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); }

.repeatable-row { background: var(--card-bg); border-radius: 10px; box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.repeatable-row__remove { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; }
.form-actions { margin-top: 28px; }

@media (max-width: 600px) {
    .field-grid { grid-template-columns: 1fr; }
    .tabs { flex-wrap: nowrap; }
}
