:root {
  --usf-green: #006747;
  --evergreen: #005432;
  --deep-green: #003f2d;
  --gold: #cfc493;
  --sand: #edebd1;
  --paper: #f8f5e9;
  --ink: #12342b;
  --muted: #55635e;
  --line: rgba(0, 84, 50, .16);
  --danger: #b42318;
  --warning: #8a5a00;
  --display: Bahnschrift, "Arial Narrow", "Franklin Gothic Medium", Arial, sans-serif;
  --body: Aptos, "Segoe UI", Arial, sans-serif;
  --gutter: clamp(1rem, 3vw, 2.5rem);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--usf-green); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: .6rem; left: .6rem; padding: .6rem .9rem; color: white; background: var(--deep-green); border-radius: .4rem; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

/* ----- Top bar ----- */
.topbar { color: white; background: var(--evergreen); border-top: 6px solid var(--gold); }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; width: min(100% - 2 * var(--gutter), 1320px); min-height: 66px; margin-inline: auto; }
.brand { display: grid; color: white; text-decoration: none; }
.brand-university { font-family: var(--display); font-size: .95rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.brand-program { font-size: .9rem; opacity: .92; }
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .9rem; }
.topnav a, .link-button { min-height: 44px; display: inline-flex; align-items: center; padding: 0 .35rem; color: white; background: none; border: 0; font-weight: 700; text-decoration: none; cursor: pointer; }
.topnav a[aria-current="page"] { box-shadow: inset 0 -3px var(--gold); }
.whoami { color: #e5efe9; font-size: .88rem; }

.env-banner { margin: 0; padding: .55rem var(--gutter); color: #3d2c00; background: #ffd666; border-bottom: 2px solid #b7791f; font-weight: 800; text-align: center; }
.mail-preview { width: 100%; min-height: 420px; border: 1px solid var(--line); border-radius: .5rem; background: white; }
.app { width: min(100% - 2 * var(--gutter), 1320px); margin: 0 auto; padding: 1.6rem 0 4rem; outline: none; }
.loading { color: var(--muted); }

/* ----- Typography and layout ----- */
h1, h2, h3 { margin: 0; color: var(--evergreen); font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
.eyebrow { margin: 0 0 .35rem; color: var(--usf-green); font-size: .74rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.page-head p { margin: .35rem 0 0; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.stack > * + * { margin-top: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

.card { background: white; border: 1px solid var(--line); border-radius: .9rem; box-shadow: 0 10px 26px rgba(0, 63, 45, .06); }
.card-pad { padding: 1.1rem 1.2rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .85rem 1.2rem; background: var(--sand); border-bottom: 1px solid var(--line); border-radius: .9rem .9rem 0 0; }

/* ----- Buttons ----- */
.btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .45rem 1rem; color: white; background: var(--usf-green); border: 2px solid var(--usf-green); border-radius: 999px; font-weight: 800; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--evergreen); border-color: var(--evergreen); }
.btn-secondary { color: var(--evergreen); background: white; }
.btn-secondary:hover { color: var(--evergreen); background: #e7f2ec; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #8f1c13; border-color: #8f1c13; }
.btn-small { min-height: 36px; padding: .25rem .75rem; font-size: .86rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.link-danger { min-height: 36px; padding: 0 .3rem; color: var(--danger); background: none; border: 0; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ----- Forms ----- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: .9rem 1.2rem; }
.field { display: grid; gap: .3rem; }
.field-wide { grid-column: 1 / -1; }
.field > span:first-child, .field > label { font-weight: 750; font-size: .92rem; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, .search input {
  width: 100%; min-height: 44px; padding: .5rem .7rem; background: white; border: 2px solid #8a9a93; border-radius: .5rem;
}
.field textarea { min-height: 5rem; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .search input:focus-visible { border-color: var(--usf-green); }
.hint { color: var(--muted); font-size: .84rem; }
.check { display: flex; align-items: flex-start; gap: .55rem; min-height: 36px; font-weight: 600; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .12rem; accent-color: var(--usf-green); flex: 0 0 auto; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: .4rem; font-weight: 800; }
.radio-row { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.error-box { padding: .7rem .9rem; color: #7a1a12; background: #fff6f5; border: 1px solid #e5a29b; border-radius: .5rem; }
.success-box { padding: .7rem .9rem; color: var(--deep-green); background: #e7f2ec; border: 1px solid #9cc9b2; border-radius: .5rem; }
.warning-box { padding: .7rem .9rem; color: #5a3d00; background: #fff7df; border: 1px solid #e3c77a; border-radius: .5rem; }

/* ----- Login ----- */
.login-wrap { display: grid; min-height: 60vh; place-items: center; }
.login-card { width: min(100%, 420px); padding: 1.6rem; border-top: 6px solid var(--gold); }
.login-card h1 { margin-bottom: .4rem; }
.login-card form { display: grid; gap: .9rem; margin-top: 1.1rem; }
.password-help { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.password-help summary { min-height: 44px; display: flex; align-items: center; color: var(--usf-green); font-weight: 800; cursor: pointer; }

/* ----- Events list ----- */
.event-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1rem; }
.event-card { display: grid; gap: .7rem; padding: 1.1rem 1.2rem; color: inherit; text-decoration: none; transition: box-shadow 200ms ease, transform 200ms ease; }
.event-card:hover { box-shadow: 0 16px 34px rgba(0, 63, 45, .13); transform: translateY(-2px); }
.event-card h2 { font-size: 1.2rem; }

.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 .6rem; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.badge-open { color: white; background: var(--usf-green); }
.badge-closed { color: #5a3d00; background: #f3e3ad; }
.badge-draft { color: var(--ink); background: #e3e7e4; }
.badge-archived { color: white; background: #6b7873; }
.badge-failed { color: white; background: var(--danger); }
.badge-pending, .badge-sending { color: #5a3d00; background: #f3e3ad; }
.badge-sent { color: var(--deep-green); background: #d7ebe0; }
.badge-skipped { color: var(--ink); background: #e3e7e4; }

meter { width: 100%; height: .8rem; }
meter::-webkit-meter-bar { background: #e3e7e4; border: 0; border-radius: 999px; }
meter::-webkit-meter-optimum-value { background: var(--usf-green); border-radius: 999px; }
meter::-webkit-meter-suboptimum-value { background: #c9a227; border-radius: 999px; }
meter::-moz-meter-bar { background: var(--usf-green); border-radius: 999px; }

/* ----- Event detail ----- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.stat { padding: .85rem 1rem; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.stat-value { margin-top: .15rem; color: var(--evergreen); font-family: var(--display); font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-alert .stat-value { color: var(--danger); }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .5rem; }
.share code { padding: .3rem .55rem; background: white; border: 1px solid var(--line); border-radius: .4rem; font-size: .88rem; word-break: break-all; }

.tabs { display: flex; flex-wrap: wrap; gap: .2rem; margin: 0 0 1rem; border-bottom: 2px solid var(--line); }
.tab { min-height: 44px; padding: .4rem 1rem; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; font-weight: 800; text-decoration: none; }
.tab[aria-current="page"] { color: var(--evergreen); border-bottom-color: var(--usf-green); }
.tab .count { display: inline-block; min-width: 1.4rem; margin-left: .3rem; padding: 0 .35rem; color: white; background: var(--danger); border-radius: 999px; font-size: .75rem; text-align: center; }

.day-block + .day-block { margin-top: 1.2rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(0, 84, 50, .1); }
th { color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.shift-time { font-weight: 800; white-space: nowrap; }
.fill { display: grid; gap: .25rem; min-width: 120px; }
.fill-text { font-size: .86rem; font-weight: 700; }
.fill-full { color: var(--usf-green); }
.fill-open { color: var(--warning); }
.capacity-form { display: flex; align-items: center; gap: .35rem; }
.capacity-form input { width: 4.2rem; min-height: 36px; padding: .25rem .4rem; border: 2px solid #8a9a93; border-radius: .4rem; text-align: center; }
.people { margin: 0; padding: 0; list-style: none; }
.people li { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; padding: .1rem 0; }
.people .email { color: var(--muted); font-size: .84rem; }
.empty { color: var(--muted); font-style: italic; }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.search { flex: 1 1 280px; max-width: 460px; }
.shift-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.shift-chips li { padding: .1rem .5rem; background: #eef2e9; border-radius: .35rem; font-size: .82rem; white-space: nowrap; }
.hours { font-weight: 800; color: var(--evergreen); }

.settings-section + .settings-section { margin-top: 1.2rem; }
.settings-section h2 { margin-bottom: .8rem; }

/* ----- Dialog and toast ----- */
.dialog { width: min(100% - 2rem, 560px); max-height: calc(100vh - 2rem); padding: 0; color: var(--ink); border: 0; border-top: 6px solid var(--gold); border-radius: .9rem; box-shadow: 0 30px 80px rgba(0, 30, 20, .35); }
.dialog::backdrop { background: rgba(0, 40, 25, .55); }
.dialog-body { padding: 1.3rem; }
.dialog-body h2 { margin-bottom: .6rem; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: 1.1rem; }
.dialog input[readonly], .copy-area { width: 100%; min-height: 44px; padding: .5rem .7rem; background: white; border: 2px solid #8a9a93; border-radius: .5rem; font-size: .88rem; }
.success-box > * { margin: 0; }
.check-list { display: grid; gap: .2rem; max-height: 45vh; overflow: auto; padding: .2rem; }

.toast { position: fixed; z-index: 50; right: 1rem; bottom: 1rem; max-width: min(92vw, 420px); padding: .8rem 1rem; color: white; background: var(--deep-green); border-left: 5px solid var(--gold); border-radius: .6rem; box-shadow: 0 16px 36px rgba(0, 30, 20, .3); }
.toast.is-error { background: #7a1a12; border-left-color: #f2b8b1; }

/* ----- Dev mailbox ----- */
.mailbox-main { width: min(100% - 2rem, 900px); margin: 2rem auto; }
.mail-item { margin: 1rem 0; padding: 1rem; background: white; border: 1px solid var(--line); border-radius: .7rem; }
.mail-item pre { white-space: pre-wrap; }

@media (max-width: 720px) {
  .responsive-table thead { display: none; }
  .responsive-table tr { display: block; padding: .6rem 0; border-bottom: 1px solid rgba(0, 84, 50, .14); }
  .responsive-table td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .5rem; padding: .3rem .9rem; border: 0; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .responsive-table td.actions-cell::before { content: ""; }
}

@media (prefers-reduced-motion: reduce) {
  .event-card { transition: none; }
}

/* Program inquiries: keep the question's line breaks. */
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 32rem; }

/* Program inquiries: filters, program tags, delivery status */
.inquiry-filters { display: grid; gap: .8rem; margin-bottom: 1rem; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: .7rem 1rem; }
.filter-grid .field { margin: 0; }
.filter-grid .field-wide { grid-column: span 2; }
.program-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 .6rem; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.program-onlinema { color: white; background: var(--usf-green); }
.program-phd { color: #5a3d00; background: #f3e3ad; }
.delivery-line { margin-bottom: .3rem; }
.strong { font-weight: 800; }
@media (max-width: 640px) { .filter-grid .field-wide { grid-column: auto; } }

/* Chatbot question review */
.chat-history-list { display: grid; gap: 1rem; }
.chat-history-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .9rem; }
.chat-history-entry h2, .chat-history-entry h3 { font-size: .9rem; margin: .9rem 0 .3rem; }
.chat-history-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.chat-history-sources { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; margin-top: 1rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.chat-history-sources a { overflow-wrap: anywhere; }
.chat-history-pages { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
/* Contributor workspace */
.app { max-width: 1120px; min-height: 72vh; }
.portal-footer { display:flex; flex-wrap:wrap; justify-content:center; gap:.5rem 2rem; padding:1.5rem var(--gutter); border-top:1px solid var(--line); color:var(--muted); }
.portal-intro { padding:clamp(1.4rem,4vw,3rem) 0; max-width:760px; }
.portal-intro h1 { font-size:clamp(2.2rem,5vw,3.6rem); max-width:15ch; }
.portal-intro .lead { font-size:1.12rem; max-width:64ch; }
.access-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:1.2rem; align-items:start; }
.access-grid .card { padding:1.5rem; border-top:5px solid var(--gold); }
.article-list { display:grid; gap:.8rem; }
.article-link { display:flex; flex-wrap:wrap; gap:1rem; align-items:center; justify-content:space-between; padding:1.2rem; text-decoration:none; color:var(--ink); }
.article-link:hover { border-color:var(--usf-green); }
.article-link h3 { margin-bottom:.4rem; }
.article-meta { display:flex; flex-wrap:wrap; gap:.4rem 1rem; color:var(--muted); font-size:.86rem; }
.editor-grid { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:1.2rem; align-items:start; }
.editor-main { min-width:0; }
.editor-form { display:grid; gap:1rem; }
.editor-form textarea[name="body"] { min-height:28rem; font-size:1rem; line-height:1.65; }
.editor-aside { display:grid; gap:1rem; }
.editor-aside ul { padding-left:1.2rem; }
.editor-actions { position:sticky; bottom:0; padding:.8rem; background:var(--sand); border:1px solid var(--line); border-radius:.7rem; }
.review-card { padding:1rem; background:white; border-left:4px solid var(--gold); }
.review-card h3 { line-height:1.4; }
.review-comments, .article-copy { white-space:pre-wrap; overflow-wrap:anywhere; }
.article-copy { font-size:1.05rem; line-height:1.8; }
.article-preview { max-width:78ch; }
.recipient-list { overflow-wrap:anywhere; padding-left:1.2rem; }
.badge-approved,.badge-ready,.badge-published { color:var(--deep-green); background:#d7ebe0; }
.badge-in_review,.badge-needs_revision { color:#5a3d00; background:#f3e3ad; }
.badge-rejected { color:#7a1a12; background:#fff0ee; }
.article-status { display:flex; flex-wrap:wrap; gap:.7rem; align-items:center; }
@media(max-width:800px) { .access-grid,.editor-grid { grid-template-columns:1fr; } .editor-aside { grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); } .topbar-inner { padding-block:.7rem; } }
