:root {
    color-scheme: light;
    --bg: #f7f9fc;
    --surface: #ffffff;
    --text: #172033;
    --muted: #657085;
    --line: #dce3ee;
    --blue: #1a73e8;
    --green: #188038;
    --yellow: #f9ab00;
    --red: #d93025;
    --shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
}

.site-header {
    width: min(1120px, calc(100% - 32px));
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto;
}

.brand {
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-nav a {
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
    background: #e8f0fe;
    color: var(--blue);
}

.nav-form {
    margin: 0;
}

.nav-form button {
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}

.nav-form button:hover {
    background: #e8f0fe;
    color: var(--blue);
}

main {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 56px;
}

.login-shell {
    min-height: calc(100vh - 180px);
    display: grid;
    align-items: center;
}

.login-panel {
    width: min(420px, 100%);
    margin: 0 auto;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 32px;
    align-items: center;
    padding: 32px 0;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--blue);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(2.25rem, 4.5vw, 4.3rem);
    line-height: 1;
}

.lead {
    max-width: 680px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.7;
}

.narrow {
    max-width: 620px;
}

.button {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    margin-top: 24px;
    border-radius: 8px;
    padding: 0 16px;
    background: var(--blue);
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
}

.button:hover {
    background: #1558b0;
}

button.button,
button.ghost-button {
    appearance: none;
}

.text-link,
.table-link {
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
}

.text-link {
    margin-top: auto;
}

.text-link:hover,
.table-link:hover {
    text-decoration: underline;
}

.status-panel,
.table-shell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.status-panel {
    padding: 24px;
}

.status-panel h2 {
    margin: 0 0 18px;
    font-size: 1rem;
}

.status-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.status-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.status-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.pill {
    display: inline-flex;
    flex: 0 0 auto;
    border: 1px solid #fadf99;
    border-radius: 999px;
    padding: 5px 10px;
    background: #fff8e1;
    color: #8a5a00;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.pill-error {
    border-color: #f4c7c3;
    background: #fff1f0;
    color: var(--red);
}

.tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 32px;
}

.tool {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
}

.icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-weight: 800;
}

.tool:nth-child(1) .icon {
    background: var(--red);
}

.tool:nth-child(2) .icon {
    background: var(--green);
}

.tool:nth-child(3) .icon {
    background: var(--blue);
}

.tool:nth-child(4) .icon {
    background: var(--yellow);
    color: #3c2a00;
}

.tool h2 {
    margin: 0;
    font-size: 1.2rem;
}

.tool p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.page-section {
    padding: 32px 0;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.8rem;
}

.table-shell {
    overflow-x: auto;
    margin-top: 28px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.error-page {
    min-height: 58vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.youtube-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 32px;
    align-items: center;
    padding: 32px 0;
}

.youtube-eyebrow {
    color: var(--red);
}

.youtube-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
    box-shadow: var(--shadow);
}

.youtube-summary div {
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    background: var(--surface);
    padding: 18px;
}

.youtube-summary span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.youtube-summary strong {
    font-size: 1.55rem;
}

.youtube-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.youtube-tool {
    min-height: 230px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--red);
    border-radius: 8px;
    background: var(--surface);
    padding: 20px;
}

.tool-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.youtube-tag {
    color: var(--red);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.youtube-tool h3 {
    margin: 0;
    font-size: 1.15rem;
}

.youtube-tool p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.ghost-button {
    width: fit-content;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    margin-top: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    background: #f2f5f9;
    color: var(--text);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.ghost-button:hover {
    border-color: #f4b4ad;
    background: #fff4f3;
    color: var(--red);
}

.ghost-button:disabled,
.ghost-button[disabled] {
    color: var(--muted);
    cursor: not-allowed;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.report-card {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 20px;
    box-shadow: var(--shadow);
}

.report-card h3 {
    margin: 8px 0 0;
    font-size: 1.25rem;
}

.report-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.report-card h4 {
    margin: 0;
    font-size: 0.95rem;
}

.report-card ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.5;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.compact-button {
    width: fit-content;
    margin-top: auto;
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    padding: 18px;
    font-weight: 700;
}

.form-panel {
    display: grid;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 20px;
    box-shadow: var(--shadow);
}

.form-panel label {
    display: grid;
    gap: 8px;
}

.form-panel span {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 800;
}

.form-panel input[type="text"],
.form-panel input[type="file"],
.form-panel textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    padding: 11px 12px;
}

.form-panel textarea {
    resize: vertical;
}

.form-button {
    width: fit-content;
    border: 0;
    cursor: pointer;
}

.notice {
    border-radius: 8px;
    margin: 16px 0 0;
    padding: 14px 16px;
    font-weight: 800;
}

.notice span {
    display: block;
    margin-top: 6px;
    font-weight: 700;
}

.notice.success {
    border: 1px solid #cce6d4;
    background: #eef8f1;
    color: var(--green);
}

.notice.error {
    border: 1px solid #f4c7c3;
    background: #fff1f0;
    color: var(--red);
}

.status-detail {
    max-width: 420px;
    margin-top: 8px;
}

.status-detail summary {
    cursor: pointer;
    color: var(--red);
    font-size: 0.82rem;
    font-weight: 800;
}

.status-detail p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.analysis-row-note {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.row-processing {
    background: #f8fbff;
}

.row-complete {
    background: #f7fcf8;
}

.row-error {
    background: #fffafa;
}

.analysis-progress {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    margin: 0 0 18px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.analysis-progress[hidden] {
    display: none;
}

.analysis-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.analysis-progress-header span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.analysis-progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef7;
}

.analysis-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
    transition: width 0.2s ease;
}

.analysis-progress-track span.analysis-progress-waiting {
    background: repeating-linear-gradient(
        45deg,
        var(--blue),
        var(--blue) 10px,
        #4f93ff 10px,
        #4f93ff 20px
    );
}

.analysis-log {
    max-height: 180px;
    overflow: auto;
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 22px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.analysis-log-success {
    color: var(--green);
}

.analysis-log-error {
    color: var(--red);
}

.action-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 0 20px;
}

.action-strip .button,
.action-strip .ghost-button {
    margin-top: 0;
}

.wide-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.place-card {
    min-height: auto;
}

.place-card details {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.place-card summary {
    cursor: pointer;
    color: var(--red);
    font-weight: 800;
}

.evidence-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.evidence-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.embed-toggle {
    min-height: 32px;
    border: 1px solid #cde1d3;
    border-radius: 8px;
    padding: 0 10px;
    background: #eef7f0;
    color: var(--green);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
}

.embed-toggle[aria-expanded="true"] {
    border-color: #f4c7c3;
    background: #fff1f0;
    color: var(--red);
}

.embed-slot {
    width: 100%;
    margin-top: 10px;
}

.video-frame {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 8px;
    background: #111827;
}

@media (max-width: 860px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 18px 0;
    }

    .hero,
    .tools,
    .youtube-hero,
    .youtube-tools {
        grid-template-columns: 1fr;
    }

    .youtube-summary {
        grid-template-columns: 1fr;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    main {
        padding-top: 12px;
    }
}
