:root {
    color-scheme: light;
    --navy: #142c48;
    --navy-dark: #0d2037;
    --ink: #20364b;
    --muted: #647184;
    --line: #dce3ea;
    --gold: #edbf67;
    --surface: #f5f7fa;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    -webkit-text-size-adjust: 100%;
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible {
    outline: 3px solid #316fa7;
    outline-offset: 4px;
}
.page-shell { width: min(1120px, calc(100% - 64px)); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 96px; padding: 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.site-link { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; font-size: 13px; font-weight: bold; letter-spacing: .2px; white-space: nowrap; }
.site-mark { display: grid; place-items: center; width: 32px; height: 32px; border: 1.5px solid var(--navy); border-radius: 8px; font-family: Arial, sans-serif; font-size: 23px; line-height: 1; }
.topbar-label { color: var(--muted); font-size: 12px; }
.account { display: flex; align-items: center; justify-content: flex-end; gap: 20px; min-width: 0; }
.account-email { color: #506176; font-size: 12px; overflow-wrap: anywhere; }
.logout-form { flex-shrink: 0; margin: 0; }
.logout-button { padding: 6px 0; border: 0; background: transparent; color: var(--navy); text-decoration: underline; text-underline-offset: 5px; font-size: 12px; }
main { flex: 1; }
main:focus { outline: none; }
.intro { text-align: center; padding: 66px 12px 44px; }
.eyebrow { margin: 0 0 17px; color: #617487; font-size: 12px; letter-spacing: .5px; }
.wordmark { margin: 0; font-family: Arial, "Segoe UI", sans-serif; color: var(--navy); font-size: clamp(52px, 7vw, 84px); line-height: 1.03; letter-spacing: -5px; font-weight: 800; }
.wordmark > span { font-weight: 300; }
.wordmark-dot { color: #b98125; font-weight: 800; }
.school-name { margin: 23px 0 6px; font-size: 21px; font-weight: bold; line-height: 1.65; }
.intro-text { margin: 0; font-size: 14px; color: var(--muted); }
.shorten-section { margin: 0; }
.shorten-form { display: flex; align-items: flex-end; gap: 14px; padding: 28px 30px 31px; background: var(--navy); border-radius: 8px; box-shadow: 0 10px 28px rgb(20 44 72 / 8%); }
.field { min-width: 0; }
.field-url { flex: 1 1 54%; }
.field-keyword { flex: 1 1 27%; }
.field label { display: block; margin: 0 0 9px; color: #fff; font-size: 13px; }
.label-note { font-size: 11px; color: #c7d3e0; white-space: nowrap; }
.field input { width: 100%; height: 49px; padding: 0 13px; border: 1px solid #d3dce7; border-radius: 4px; background: #fff; color: var(--ink); font-size: 14px; }
.field input::placeholder { color: #7b8491; opacity: 1; }
.field input:disabled { color: #5a6676; background: #e8edf3; border-color: #e8edf3; opacity: 1; }
.field input:focus-visible, .shorten-button:focus-visible { outline-color: var(--gold); outline-offset: 3px; }
.shorten-button { display: inline-flex; align-items: center; justify-content: center; gap: 15px; flex: 0 0 137px; height: 49px; padding: 0 18px; border: 1px solid var(--gold); border-radius: 4px; background: var(--gold); color: var(--navy-dark); font-size: 14px; font-weight: bold; white-space: nowrap; }
.shorten-button:hover:not(:disabled) { background: #f6cf89; border-color: #f6cf89; }
.shorten-button:disabled { color: #43516a; background: #d6bc8f; border-color: #d6bc8f; }
.shorten-button span { font-family: Arial, sans-serif; font-size: 23px; line-height: 1; }
.form-hint { padding: 0 3px; margin: 13px 0 0; color: #67768a; font-size: 11px; }
.signin-panel { margin: 38px auto 28px; text-align: center; }
.signin-panel h2 { margin: 0 0 8px; font-size: 18px; font-weight: bold; }
.signin-panel p { margin: 0; color: var(--muted); font-size: 13px; }
.signin-panel strong { color: var(--navy); font-weight: bold; }
.google-signin-wrap { display: flex; justify-content: center; min-height: 44px; margin: 22px 0 0; }
.signin-panel .auth-feedback { margin: 16px auto 0; max-width: 580px; }
.signin-panel .auth-feedback.is-error { color: #9b302e; }
.signin-panel .service-status { max-width: 460px; margin: 0 auto; color: var(--ink); }
.message { padding: 14px 18px; margin: 24px 0 0; border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; }
.message-error { color: #8e2929; border: 1px solid #e6c6c6; background: #fff4f3; }
.signin-panel .message { margin-top: 20px; }
.result-card { width: min(760px, 100%); margin: 33px auto 0; padding: 26px 28px; border: 1px solid #ceded7; border-radius: 8px; background: #fff; }
.result-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 21px; }
.success-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 35px; background: #e9f5ee; color: #276347; border-radius: 50%; font-family: Arial, sans-serif; font-size: 20px; font-weight: bold; }
.result-heading h2 { margin: 0; font-size: 17px; line-height: 1.6; }
.result-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.copy-row { display: flex; gap: 10px; }
.short-url { min-width: 0; flex: 1; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: #f7f9fb; color: var(--navy); font-size: 16px; }
.copy-button { flex: 0 0 auto; padding: 10px 17px; border: 1px solid var(--navy); border-radius: 4px; background: var(--navy); color: #fff; font-size: 13px; }
.copy-button:hover { background: #234462; }
.copy-feedback { margin: 8px 0 0; color: #276347; font-size: 12px; }
.copy-feedback:empty { display: none; }
.original-url { margin: 14px 0 0; color: var(--muted); overflow-wrap: anywhere; font-size: 11px; }
.original-url span { color: #46596c; font-weight: bold; margin-right: 5px; }
.staff-note { margin: 31px 0 24px; text-align: center; color: var(--muted); font-size: 12px; }
.footer { margin-top: 58px; padding: 25px 0 27px; border-top: 1px solid var(--line); text-align: center; color: #69788a; font-size: 11px; }
.footer p { margin: 0; }
.footer-dot { display: inline-block; padding: 0 6px; }
.footer .powered-by { margin-top: 5px; font-size: 10px; color: #718093; }
.powered-by a { text-decoration: underline; text-underline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: 10px; left: 12px; transform: translateY(-200%); z-index: 10; padding: 10px 16px; border-radius: 4px; background: #fff; color: var(--navy); }
.skip-link:focus { transform: translateY(0); }
[hidden] { display: none !important; }

@media (max-width: 820px) {
    .page-shell { width: calc(100% - 40px); }
    .shorten-form { flex-wrap: wrap; padding: 24px; }
    .field-url { flex: 1 0 100%; }
    .field-keyword { flex: 1 1 0; }
    .intro { padding-top: 53px; padding-bottom: 34px; }
    .account { gap: 12px; }
}

@media (max-width: 480px) {
    .page-shell { width: calc(100% - 32px); }
    .topbar { min-height: 78px; gap: 12px; padding: 16px 0; flex-wrap: wrap; }
    .site-link { font-size: 11px; }
    .topbar-label { font-size: 10px; }
    .account { flex: 1 0 100%; justify-content: space-between; }
    .account-email, .logout-button { font-size: 11px; }
    .intro { padding: 39px 0 30px; }
    .eyebrow { font-size: 11px; margin-bottom: 15px; }
    .wordmark { font-size: clamp(42px, 13vw, 62px); letter-spacing: -3px; }
    .school-name { margin-top: 20px; font-size: 18px; }
    .intro-text { font-size: 12px; }
    .shorten-form { padding: 22px 18px; gap: 17px; }
    .field-url, .field-keyword { flex: 1 0 100%; }
    .field input { font-size: 16px; }
    .shorten-button { flex: 1 0 100%; margin-top: 1px; }
    .form-hint { font-size: 10px; line-height: 1.8; }
    .signin-panel { margin-top: 30px; }
    .signin-panel h2 { font-size: 16px; }
    .signin-panel p { font-size: 12px; }
    .result-card { padding: 20px 16px; }
    .result-heading h2 { font-size: 15px; }
    .copy-row { flex-direction: column; }
    .copy-button { min-height: 44px; }
    .footer { margin-top: 36px; }
}
