:root {
    color-scheme: light;
    --bg: #f3f5f7;
    --card: #ffffff;
    --ink: #15212c;
    --muted: #617080;
    --line: #dce3e8;
    --brand: #0c6e65;
    --brand-dark: #07534d;
    --danger: #a12828;
    --warning: #805c00;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 72px; }
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.hero__identity { min-width: 0; }
.hero h1 { margin: 0 0 8px; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: 0; }
.hero p { margin: 0; color: var(--muted); max-width: 760px; }
.app-version {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 0;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--brand) !important;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .01em;
}
.app-version--persistent {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 5px 18px rgba(24, 42, 57, .16);
    pointer-events: none;
}
.oauth-page { min-height: 100vh; padding: 32px 16px 72px; }
.eyebrow { color: var(--brand) !important; font-weight: 800; text-transform: uppercase; letter-spacing: 0; font-size: .78rem; margin-bottom: 8px !important; }
.card, .stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 30px rgba(24, 42, 57, .055); }
.card { padding: 24px; margin-bottom: 20px; }
.card.narrow { max-width: 560px; margin-inline: auto; }
.card h2 { margin-top: 0; }
.card h3 { margin-bottom: 10px; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid.two .card { margin: 0 0 20px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 18px; }
.stat span { display: block; color: var(--muted); font-size: .82rem; margin-bottom: 8px; }
.stat strong { font-size: 1.5rem; }
.queue-dashboard__heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.queue-dashboard__heading h2 { margin-bottom: 0; }
.queue-dashboard__percent {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: #e0f5ed;
    color: #0b684f;
    font-size: 1rem;
    white-space: nowrap;
}
.queue-dashboard__progress-summary {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 22px 0 9px;
    color: var(--muted);
    font-size: .9rem;
}
.queue-dashboard__progress-summary strong { color: var(--ink); font-size: 1.08rem; }
.queue-dashboard__progress {
    display: block;
    width: 100%;
    height: 14px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: #e6ecef;
    color: var(--brand);
    appearance: none;
}
.queue-dashboard__progress::-webkit-progress-bar { border-radius: 999px; background: #e6ecef; }
.queue-dashboard__progress::-webkit-progress-value { border-radius: 999px; background: var(--brand); }
.queue-dashboard__progress::-moz-progress-bar { border-radius: 999px; background: var(--brand); }
.queue-dashboard__section { margin-top: 20px; }
.queue-dashboard__section h3 { margin: 0 0 9px; font-size: .92rem; }
.queue-dashboard__metrics { display: grid; gap: 8px; }
.queue-dashboard__metrics--queue { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.queue-dashboard__metrics--throughput { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.queue-dashboard__metrics > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #f8fafb;
}
.queue-dashboard__metrics span {
    display: block;
    min-height: 2.5em;
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.25;
}
.queue-dashboard__metrics strong { display: block; margin-top: 6px; font-size: 1.25rem; }
.queue-dashboard__automation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 24px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.queue-dashboard__automation > div { min-width: 0; }
.queue-dashboard__automation span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .78rem;
}
.queue-dashboard__automation code { display: inline-block; max-width: 100%; font-size: .82rem; }
.diagnostic-history__summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
}
.diagnostic-history__summary > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #f8fafb;
}
.diagnostic-history__summary span {
    display: block;
    min-height: 2.5em;
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.25;
}
.diagnostic-history__summary strong {
    display: block;
    margin-top: 6px;
    font-size: 1.2rem;
}
.diagnostic-history__table-wrap {
    width: 100%;
    margin-top: 20px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 11px;
}
.diagnostic-history__table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    background: #fff;
    font-size: .83rem;
}
.diagnostic-history__table th,
.diagnostic-history__table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    white-space: nowrap;
}
.diagnostic-history__table thead th {
    color: var(--muted);
    background: #f8fafb;
    font-size: .74rem;
}
.diagnostic-history__table th:first-child,
.diagnostic-history__table td:first-child { text-align: left; }
.diagnostic-history__table tbody tr:last-child th,
.diagnostic-history__table tbody tr:last-child td { border-bottom: 0; }
.diagnostic-history__details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 22px;
}
.diagnostic-history__details > div { min-width: 0; }
.diagnostic-history__details h3 { margin-top: 0; }
.diagnostic-history__details dl { grid-template-columns: minmax(135px, .7fr) 1fr; }
.diagnostic-history__events {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.diagnostic-history__events summary {
    cursor: pointer;
    font-weight: 800;
}
.diagnostic-history__events .diagnostic-history__table-wrap { margin-top: 14px; }
.diagnostic-history__events .diagnostic-history__table {
    min-width: 940px;
}
.diagnostic-history__events .diagnostic-history__table th,
.diagnostic-history__events .diagnostic-history__table td {
    max-width: 420px;
    text-align: left;
    white-space: normal;
    vertical-align: top;
}
label { display: block; font-weight: 700; margin: 14px 0; }
input[type="password"], input[type="email"], input[type="file"], input[type="text"], input[type="url"], textarea { width: 100%; margin-top: 7px; padding: 12px; border: 1px solid #c7d1d8; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; }
textarea { resize: vertical; min-height: 52px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.checkbox input { margin-top: 4px; }
button, .button { border: 0; border-radius: 10px; background: var(--brand); color: #fff; padding: 11px 16px; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
button:hover { background: var(--brand-dark); }
button.secondary, .button.secondary { background: #e8eef1; color: var(--ink); }
button.secondary:hover, .button.secondary:hover { background: #d7e1e6; }
button.large, .button.large { font-size: 1.1rem; padding: 14px 24px; }
.button.primary { background: var(--brand); color: #fff; }
.button.primary:hover { background: var(--brand-dark); }
.full { width: 100%; }
.actions, .credential-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.section-heading h2 { margin-bottom: 0; }
.status-pill { display: inline-block; padding: 8px 11px; border-radius: 999px; white-space: nowrap; font-size: .8rem; }
.status-pill--success { background: #e0f5ed; color: #0b684f; }
.status-pill--warning { background: #fff3c9; color: #725200; }
.status-pill--error { background: #ffebeb; color: #972828; }
.connection-details { margin: 18px 0; }
.installation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.installation-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.installation-card--current { border-color: #9fcfc5; background: #eff9f6; }
.installation-card span, .installation-card strong, .installation-card code, .installation-card small { display: block; }
.installation-card span { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.installation-card strong { margin-top: 4px; font-size: 1.05rem; }
.installation-card code { margin-top: 9px; }
.installation-card small { margin-top: 10px; color: var(--muted); line-height: 1.45; }
.transfer-origin { margin: 12px 0 0; }
.google-actions { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.google-guide { margin-top: 24px; border-top: 1px solid var(--line); }
.google-guide__intro { padding: 22px 0 10px; }
.google-guide__intro h3 { margin: 0 0 8px; font-size: 1.16rem; }
.google-guide__intro p { margin: 0; color: var(--muted); line-height: 1.55; max-width: 900px; }
.google-guide__steps { list-style: none; padding: 0; margin: 0; counter-reset: google-step; }
.google-guide__steps > li {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 14px;
    padding: 20px 0;
    border-top: 1px solid var(--line);
    counter-increment: google-step;
}
.google-guide__steps > li::before {
    content: counter(google-step);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
}
.google-guide__steps h3 { margin: 4px 0 8px; font-size: 1.02rem; }
.google-guide__steps p { margin: 0; line-height: 1.58; }
.google-guide__steps p + p { margin-top: 9px; }
.guide-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 13px; }
.guide-links > a:not(.button) { color: var(--brand-dark); font-weight: 750; text-underline-offset: 3px; }
.google-config-form { margin-top: 12px; }
.inline-test-form { margin-top: 14px; }
.transfer-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.transfer-paths article { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.transfer-paths article strong { display: block; margin-bottom: 7px; }
.transfer-paths article p { color: var(--muted); font-size: .92rem; }
.handoff-box { margin-top: 14px; padding: 16px; border: 1px solid #b8e2d4; border-radius: 12px; background: #eff9f6; }
.handoff-box form { margin-top: 13px; }
.google-package-form { margin-top: 16px; padding-top: 4px; }
.service-email { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 13px; }
.service-email code { flex: 0 1 auto; max-width: 100%; font-size: .9rem; }
.service-email button { padding: 8px 12px; }
.google-access-fix { border-left: 7px solid #c43a3a; }
.google-access-fix > p:not(.eyebrow) { max-width: 920px; line-height: 1.55; }
.repair-steps { margin: 22px 0; padding-left: 24px; }
.repair-steps li { padding: 0 0 15px 6px; margin-bottom: 15px; border-bottom: 1px solid var(--line); line-height: 1.5; }
.repair-steps li:last-child { margin-bottom: 0; }
.repair-steps li > strong { display: block; margin-bottom: 3px; }
.repair-steps li > p { margin: 0; color: var(--muted); }
.repair-steps .service-email { margin-top: 10px; }
.google-access-fix .actions form { margin: 0; }
.notice { border-radius: 12px; padding: 14px 16px; margin: 0 0 18px; }
.notice.success { background: #e6f5ef; color: #0b594a; border: 1px solid #b8e2d4; }
.notice.error { background: #fff0f0; color: var(--danger); border: 1px solid #efcaca; }
.notice.warning { background: #fff7dc; color: var(--warning); border: 1px solid #eadba5; }
.notice ul { margin: 8px 0 0; }
.notice p { margin: 8px 0 0; }
.cron-alert { border-width: 2px; }
.cron-health { border-left-width: 7px; }
.cron-health--success { border-left-color: #15936f; }
.cron-health--warning { border-left-color: #d39a12; }
.cron-health--error { border-left-color: #c43a3a; }
.cron-health__heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.cron-health__heading h2 { margin-bottom: 0; }
.cron-badge { display: inline-block; border-radius: 999px; padding: 9px 13px; background: #e8eef1; white-space: nowrap; }
.cron-health--success .cron-badge { background: #e0f5ed; color: #0b684f; }
.cron-health--warning .cron-badge { background: #fff3c9; color: #725200; }
.cron-health--error .cron-badge { background: #ffebeb; color: #972828; }
.cron-schedule {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 18px 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.cron-schedule > div { min-width: 0; padding: 12px 8px; text-align: center; border-left: 1px solid var(--line); }
.cron-schedule > div:first-child { border-left: 0; }
.cron-schedule span { display: block; min-height: 2.4em; color: var(--muted); font-size: .76rem; line-height: 1.2; }
.cron-schedule strong { display: block; margin-top: 7px; font: 900 1.35rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cron-output textarea { line-height: 1.45; }
.cron-directadmin .notice { margin-top: 18px; }
.cron-directadmin .actions form { margin: 0; }
.requirements { display: grid; gap: 8px; margin: 20px 0; }
.requirements div { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.wizard { border-top: 6px solid var(--brand); }
.step-label { color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.readiness { display: flex; align-items: center; gap: 12px; padding: 13px 15px; margin: 20px 0; border-radius: 12px; background: #e6f5ef; color: #0b594a; border: 1px solid #b8e2d4; }
.readiness > span { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 999px; color: #fff; background: #15936f; font-weight: 900; }
.readiness strong, .readiness small { display: block; }
.readiness small { margin-top: 2px; }
.technical { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); }
.technical summary { cursor: pointer; font-weight: 800; color: var(--ink); }
.wizard-list { padding-left: 22px; }
.wizard-list li { margin: 12px 0; line-height: 1.55; }
.helper { color: var(--muted); font-size: .92rem; line-height: 1.5; }
#local-run-summary:empty { display: none; }
.copy-inline { margin-top: 7px; padding: 8px 12px; }
.password-form { max-width: 560px; }
.deployment-note { margin-top: 22px; }
.secret-card { border-color: #d4b24f; background: #fffdf5; }
.secret-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; }
dt { color: var(--muted); }
dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
code { background: #eef2f4; border-radius: 6px; padding: 3px 6px; overflow-wrap: anywhere; }
.code-list { display: grid; gap: 9px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
@media (max-width: 900px) {
    .grid.two, .secret-grid, .installation-grid, .transfer-paths { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .queue-dashboard__metrics--throughput { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .diagnostic-history__summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .container { width: min(100% - 20px, 1160px); padding-top: 20px; }
    .hero { display: block; }
    .hero form { margin-top: 14px; }
    .stats { grid-template-columns: 1fr; }
    .card { padding: 18px; border-radius: 14px; }
    dl { grid-template-columns: 1fr; }
    .queue-dashboard__heading { display: block; }
    .queue-dashboard__percent { margin-top: 12px; }
    .queue-dashboard__metrics--queue,
    .queue-dashboard__metrics--throughput,
    .queue-dashboard__automation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .diagnostic-history__summary,
    .diagnostic-history__details { grid-template-columns: 1fr; }
    .cron-health__heading { display: block; }
    .section-heading { display: block; }
    .status-pill { margin-top: 12px; white-space: normal; }
    .cron-badge { margin-top: 14px; white-space: normal; }
    .cron-schedule { grid-template-columns: 1fr; }
    .cron-schedule > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 12px; text-align: left; border-top: 1px solid var(--line); border-left: 0; }
    .cron-schedule > div:first-child { border-top: 0; }
    .cron-schedule span { min-height: 0; font-size: .82rem; }
    .cron-schedule strong { margin-top: 0; }
    .cron-output .actions > *, .cron-directadmin .actions > * { width: 100%; }
    .cron-directadmin .actions form button { width: 100%; }
    #cron-url, #generated-cron-url { min-height: 108px; }
    #cron-command, #generated-cron-command { min-height: 146px; }
    .google-guide__steps > li { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
    .google-guide__steps > li::before { width: 30px; height: 30px; }
    .guide-links .button { width: 100%; }
    .service-email { align-items: stretch; }
    .service-email code, .service-email button { width: 100%; }
    .google-access-fix .actions > *, .google-access-fix .actions form button { width: 100%; }
}
