/* MIT HUB Support — the site's paper + ink palette, rules instead of shadows. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 300 600; font-display: swap; src: url(/assets/fonts/plex-sans-var.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/assets/fonts/plex-mono-500.woff2) format("woff2"); }

:root {
    --paper: #f3f1ec; --paper-2: #e9e6de; --card: #fbfaf7; --ink: #141413; --ink-2: #2b2a27; --muted: #6b6860; --rule: #d3cfc4;
    --accent: #08703a; --accent-ink: #054f28; --saffron: #fe7000; --saffron-ink: #b04d00; --red: #a3241a; --blue: #1d4a8a;
    --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif; --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 400 15px/1.55 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
h1 { font-size: 1.6rem; font-weight: 500; letter-spacing: -0.015em; line-height: 1.25; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
h2 { font-size: 1.02rem; font-weight: 600; margin-bottom: 10px; }
h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 16px 0; }
small { font-size: 0.82rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top bar */
.t-top { display: flex; align-items: center; gap: 20px; padding: 0 24px; min-height: 54px; background: var(--ink); color: #ecebe6; position: sticky; top: 0; z-index: 20; }
.t-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 500; white-space: nowrap; }
.t-brand img { background: #fff; border-radius: 3px; padding: 2px; }
.t-brand b { font-weight: 600; color: #9fd8b3; }
.t-navwrap { display: flex; align-items: center; gap: 16px; flex: 1; }
.t-nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.t-nav a, .t-me a { color: #c9c6bd; text-decoration: none; padding: 6px 10px; border-radius: 2px; }
.t-nav a:hover, .t-me a:hover { color: #fff; }
.t-nav a[aria-current], .t-me a[aria-current] { color: #fff; background: #2f2e2a; }
.t-me { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.t-me small { color: #8f8c83; margin-left: 4px; }
.t-linkbtn { background: none; border: 1px solid #45433d; color: #c9c6bd; font: inherit; font-size: 0.85rem; padding: 4px 10px; border-radius: 2px; cursor: pointer; }
.t-linkbtn:hover { color: #fff; border-color: #8f8c83; }
.t-menu { display: none; margin-left: auto; background: none; border: 1px solid #45433d; color: #fff; font: inherit; padding: 5px 12px; border-radius: 2px; cursor: pointer; }

.t-main { width: 100%; max-width: 1360px; margin: 0 auto; padding: 24px; flex: 1; }
.t-foot { text-align: center; color: var(--muted); font-size: 0.82rem; padding: 18px; border-top: 1px solid var(--rule); }
.t-foot a { color: var(--muted); }

/* page head */
.t-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 18px; }
.t-crumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 2px; }
.t-crumb a { color: var(--muted); }
.t-eyebrow { font: 500 0.75rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--saffron-ink); margin-bottom: 4px; }
.t-count { font: 500 0.9rem/1 var(--mono); color: var(--muted); background: var(--paper-2); padding: 4px 8px; border-radius: 2px; }
.t-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* utilities */
.t-muted { color: var(--muted); }
.t-small { font-size: 0.86rem; }
.t-mono { font-family: var(--mono); }
.t-nowrap { white-space: nowrap; }
.t-r { text-align: right !important; }
.t-mt { margin-top: 14px; }
.t-late { color: var(--red); font-weight: 500; }
.t-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.t-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.t-plain { list-style: none; display: grid; gap: 4px; }
.t-ref { font-family: var(--mono); font-weight: 500; white-space: nowrap; }
.t-note { padding: 10px 14px; background: var(--paper-2); border-left: 3px solid var(--muted); font-size: 0.9rem; }

/* buttons */
.t-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; font: 500 0.9rem/1.2 var(--sans); color: var(--ink); background: #fff; border: 1px solid #bdb8ab; border-radius: 2px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.t-btn:hover { border-color: var(--ink); }
.t-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.t-btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.t-btn-danger { color: var(--red); border-color: #d9a7a2; }
.t-btn-danger:hover { border-color: var(--red); }
.t-btn-block { width: 100%; }
.t-btn[disabled] { opacity: 0.6; cursor: wait; }

/* flash */
.t-flash { padding: 10px 14px; margin-bottom: 16px; border: 1px solid; border-left-width: 4px; background: #fff; }
.t-flash-ok { border-color: var(--accent); }
.t-flash-err { border-color: var(--red); background: #fff8f7; }
.t-flash-info { border-color: var(--blue); background: #f5f8fd; }

/* cards */
.t-card { background: var(--card); border: 1px solid var(--rule); padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.t-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.t-card-head h2 { margin: 0; }
.t-narrow { max-width: 520px; }
.t-wide { max-width: 980px; }
.t-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.t-split > .t-card, .t-split > div > .t-card:last-child { margin-bottom: 16px; }
.t-side { position: sticky; top: 70px; }
aside.t-side > .t-card { margin-bottom: 12px; }

/* stats */
.t-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.t-stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--ink); text-decoration: none; color: var(--ink); }
a.t-stat:hover { border-color: var(--ink); background: #fff; }
.t-stat-saffron { border-top-color: var(--saffron); }
.t-stat-red { border-top-color: var(--red); }
.t-stat-green { border-top-color: var(--accent); }
.t-stat-n { font: 500 2rem/1.1 var(--mono); }
.t-stat-n small { font-size: 0.9rem; color: var(--muted); margin-left: 2px; }
.t-stat-l { color: var(--muted); font-size: 0.9rem; }
.t-statusline { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.t-pill { display: inline-flex; gap: 6px; align-items: center; font-size: 0.8rem; padding: 3px 8px 3px 3px; border: 1px solid var(--rule); border-radius: 3px; color: var(--ink-2); text-decoration: none; background: #fff; }
.t-pill:hover { border-color: var(--ink); }
.t-pill b { font-family: var(--mono); font-weight: 500; }

/* badges */
.t-status { display: inline-block; font: 500 0.78rem/1.3 var(--sans); padding: 2px 8px; border-radius: 2px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; letter-spacing: 0; }
h1 .t-status { font-size: 0.85rem; }
.t-s-open { background: #fff1e5; color: var(--saffron-ink); }
.t-s-assigned { background: #e7eef9; color: var(--blue); }
.t-s-attended { background: #e6f1f4; color: #0f5566; }
.t-s-under-observation { background: #efe7f7; color: #5a2d8a; }
.t-s-pending { background: #fbf3d5; color: #7a5a00; }
.t-s-closed { background: #e3f2e8; color: var(--accent-ink); }
.t-s-rejected { background: #f6e3e1; color: var(--red); }
.t-urg { font-size: 0.85rem; white-space: nowrap; }
.t-urg::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--rule); vertical-align: 1px; }
.t-u-super { color: var(--red); font-weight: 600; }
.t-u-super::before { background: var(--red); }
.t-u-urgent { color: var(--saffron-ink); font-weight: 500; }
.t-u-urgent::before { background: var(--saffron); }
.t-tag { display: inline-block; font: 500 0.7rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 6px; border-radius: 2px; background: var(--paper-2); color: var(--ink-2); }
.t-tag-internal { background: #fff1e5; color: var(--saffron-ink); }
.t-reg-pending { background: #fbf3d5; color: #7a5a00; }
.t-reg-approved { background: #e3f2e8; color: var(--accent-ink); }
.t-reg-declined { background: #f6e3e1; color: var(--red); }

/* tables */
.t-tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--rule); margin-bottom: 16px; }
.t-card .t-tablewrap { border: 0; margin: 0 -20px; background: none; }
.t-card > .t-tablewrap:last-child, .t-card > .t-table:last-child { margin-bottom: -18px; }
.t-card > .t-table:last-child tr:last-child td { border-bottom: 0; }
.t-table { width: 100%; border-collapse: collapse; }
.t-table th { text-align: left; font: 500 0.72rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--ink); background: #fff; white-space: nowrap; }
.t-table td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.t-table tr:hover td { background: #fff; }
.t-card .t-table th:first-child, .t-card .t-table td:first-child { padding-left: 20px; }
.t-card .t-table th:last-child, .t-card .t-table td:last-child { padding-right: 20px; }
.t-table-compact td { padding: 6px 10px; }
.t-subject a { color: var(--ink); text-decoration: none; font-weight: 500; }
.t-subject a:hover { text-decoration: underline; }
.t-empty { text-align: center; color: var(--muted); padding: 28px !important; }
.t-row-off td { color: var(--muted); }
.t-pager { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.t-pager a { padding: 4px 10px; border: 1px solid var(--rule); background: #fff; text-decoration: none; }
.t-pager a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }
.t-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--ink); margin-bottom: 14px; }
.t-tabs a { padding: 8px 14px; text-decoration: none; color: var(--ink-2); border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.t-tabs a b { font: 500 0.8rem var(--mono); color: var(--muted); margin-left: 4px; }
.t-tabs a[aria-current] { background: var(--card); border-color: var(--ink); border-bottom: 1px solid var(--card); font-weight: 500; }

/* forms */
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #bdb8ab; border-radius: 2px; padding: 7px 10px; max-width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[disabled] { background: var(--paper-2); color: var(--muted); }
textarea { width: 100%; resize: vertical; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type=file] { border-style: dashed; background: var(--card); font-size: 0.88rem; }
.t-form { display: grid; gap: 12px; }
.t-field { display: grid; gap: 4px; font-size: 0.88rem; color: var(--ink-2); align-content: start; }
.t-field > span { font-weight: 500; }
.t-field input, .t-field select { width: 100%; }
.t-req { color: var(--red); font-weight: 500; }
.t-help { color: var(--muted); }
.t-err { color: var(--red); }
.has-err input, .has-err select, .has-err textarea { border-color: var(--red); background: #fff8f7; }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 14px; }
.t-fs { border: 1px solid var(--rule); padding: 12px 16px 16px; background: #fff; display: grid; gap: 12px; }
.t-fs legend { font-weight: 600; padding: 0 6px; }
.t-check { display: inline-flex; gap: 8px; align-items: center; font-size: 0.88rem; cursor: pointer; }
.t-num { width: 7em; }
.t-inline-field { display: inline-flex; grid-template-columns: none; align-items: center; gap: 8px; }
.t-inline-field input { width: 7em; }
.t-hp { position: absolute; left: -9999px; }
.t-challenge { background: var(--paper-2); padding: 12px 14px; max-width: 360px; }
.t-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.t-filters input[type=search] { flex: 1 1 260px; }
.t-date { width: 10.5em; }

/* ticket page */
.t-dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 14px; }
.t-dl dt { color: var(--muted); font-size: 0.86rem; padding-top: 1px; }
.t-dl-cols { grid-template-columns: 120px minmax(0, 1fr) 120px minmax(0, 1fr); margin-bottom: 14px; }
.t-body { border-top: 1px solid var(--rule); padding-top: 14px; font-size: 0.98rem; }
.t-files { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.t-files li { font-size: 0.85rem; background: #fff; border: 1px solid var(--rule); padding: 3px 9px; border-radius: 2px; }
.t-thread { list-style: none; display: grid; gap: 10px; margin-bottom: 14px; }
.t-msg { padding: 10px 14px; border: 1px solid var(--rule); background: #fff; border-left-width: 3px; }
.t-msg-customer { border-left-color: var(--ink-2); }
.t-msg-staff { border-left-color: var(--accent); background: #f6faf7; }
.t-msg-remark { border-left-style: dashed; }
.t-msg-internal { border-left-color: var(--saffron); background: #fffaf3; }
.t-msg-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 3px; }
.t-msg-meta b { color: var(--ink-2); font-weight: 600; }
.t-compose { border-top: 1px solid var(--rule); padding-top: 14px; }
.t-compose.is-internal textarea { background: #fffaf3; border-color: var(--saffron); }
.t-compose-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.t-compose-bar input[type=file] { flex: 1 1 220px; }
.t-compose-bar .t-btn { margin-left: auto; }
.t-log { list-style: none; display: grid; gap: 8px; }
.t-log li { border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
.t-timeline { list-style: none; display: grid; }
.t-timeline > li { padding: 6px 0 8px 16px; border-left: 2px solid var(--rule); position: relative; font-size: 0.9rem; }
.t-timeline > li::before { content: ""; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.t-timeline > li.t-s-closed::before { background: var(--accent); }
.t-timeline > li.t-s-rejected::before { background: var(--red); }
.t-timeline > li.t-s-open::before { background: var(--saffron); }
.t-timeline > li[class*="t-s-"] { background: none; color: inherit; }
.t-sla { margin-top: 12px; padding: 8px 12px; background: #e3f2e8; color: var(--accent-ink); font-size: 0.88rem; font-weight: 500; }
.t-sla.is-late { background: #f6e3e1; color: var(--red); }
details.t-action > summary { cursor: pointer; font-weight: 600; }
details.t-action[open] > summary { margin-bottom: 10px; }
.t-side select { width: 100%; }

/* reports */
.t-bars { display: flex; gap: 8px; align-items: stretch; height: 230px; padding-top: 22px; overflow-x: auto; }
.t-bar-col { flex: 1 0 44px; display: flex; flex-direction: column; gap: 6px; min-width: 44px; }
.t-bar-pair { flex: 1; display: flex; align-items: flex-end; gap: 3px; border-bottom: 1px solid var(--ink); }
.t-bar { flex: 1; min-height: 1px; position: relative; }
.t-bar b { position: absolute; top: -17px; left: 0; right: 0; text-align: center; font: 500 0.7rem var(--mono); color: var(--ink-2); }
.t-bar-recv, .t-key-recv { background: var(--ink-2); }
.t-bar-closed, .t-key-closed { background: var(--accent); }
.t-bar-l { font: 500 0.7rem var(--mono); color: var(--muted); text-align: center; white-space: nowrap; }
.t-legend { font-size: 0.8rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.t-legend i { display: inline-block; width: 10px; height: 10px; margin-left: 8px; }
details.t-card > summary { cursor: pointer; font-weight: 600; }

/* email log */
.t-mail { list-style: none; }
.t-mail .t-card { padding: 12px 16px; margin-bottom: 8px; }
.t-mail summary { cursor: pointer; }
.t-mstatus { font: 500 0.7rem/1 var(--mono); text-transform: uppercase; padding: 3px 6px; border-radius: 2px; margin-right: 6px; }
.t-m-sent { background: #e3f2e8; color: var(--accent-ink); }
.t-m-failed { background: #f6e3e1; color: var(--red); }
.t-m-not_configured, .t-m-pending { background: #fbf3d5; color: #7a5a00; }
.t-mailbody { white-space: pre-wrap; font: 0.86rem/1.5 var(--mono); background: #fff; border: 1px solid var(--rule); padding: 14px; margin-top: 10px; overflow-x: auto; }

/* sign-in and registration */
.t-auth { background: var(--paper); }
.t-auth-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--rule); font-size: 0.9rem; }
.t-auth-head a { color: var(--ink-2); text-decoration: none; }
.t-auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; }
.t-auth-main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 40px 24px; flex: 1; }
.t-auth-main > .t-card { margin-left: auto; margin-right: auto; }
.t-auth-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 400px); gap: 48px; align-items: center; }
.t-auth-intro h1 { font-size: 2.1rem; line-height: 1.15; margin-bottom: 18px; }
.t-ticks { list-style: none; display: grid; gap: 8px; margin-bottom: 18px; }
.t-ticks li { padding-left: 26px; position: relative; }
.t-ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 600; }
.t-auth-card { padding: 26px 28px; display: grid; gap: 12px; border-top: 3px solid var(--accent); }
.t-auth-card h2 { font-size: 1.3rem; font-weight: 500; margin: 0; }
.t-auth-card hr { margin: 4px 0; }

@media (max-width: 1050px) {
    .t-split { grid-template-columns: 1fr; }
    .t-side { position: static; }
    .t-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .t-menu { display: block; }
    .t-top { flex-wrap: wrap; padding: 8px 16px; }
    .t-navwrap { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 8px; padding: 6px 0 10px; }
    .t-navwrap.is-open { display: flex; }
    .t-nav { flex-direction: column; }
    .t-me { justify-content: space-between; border-top: 1px solid #2f2e2a; padding-top: 8px; }
    .t-auth-grid { grid-template-columns: 1fr; gap: 24px; }
    .t-auth-intro h1 { font-size: 1.6rem; }
}
@media (max-width: 640px) {
    .t-main, .t-auth-main { padding: 16px; }
    .t-auth-head { padding: 12px 16px; }
    .t-card { padding: 14px 16px; }
    .t-card .t-tablewrap { margin: 0 -16px; }
    .t-card .t-table th:first-child, .t-card .t-table td:first-child { padding-left: 16px; }
    .t-dl, .t-dl-cols { grid-template-columns: 1fr; gap: 0; }
    .t-dl dd { margin-bottom: 8px; }
    .t-cards { gap: 8px; }
    .t-stat { padding: 12px 14px; }
    .t-stat-n { font-size: 1.6rem; }
    h1 { font-size: 1.35rem; }
    .t-filters > * { flex: 1 1 140px; }
    .t-compose-bar .t-btn { margin-left: 0; width: 100%; }
}
