:root {
    color-scheme: light;
    --bg: #f3f4ef;
    --paper: #fffefa;
    --ink: #1d2924;
    --muted: #53635b;
    --line: #dce2d9;
    --deep: #173229;
    --accent: #26624e;
    --accent-hover: #1b4e3d;
    --green-soft: #e5efe7;
    --danger: #993833;
    --danger-soft: #f9eae6;
    --radius: 10px;
    --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --mono: Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid #a75f1f; outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(27px, 3.4vw, 42px); letter-spacing: -.035em; line-height: 1.18; overflow-wrap: anywhere; }
h2 { font-size: 19px; line-height: 1.35; }
h3 { font-size: 16px; }
.skip-link { position: fixed; z-index: 5; top: 8px; left: 8px; padding: 10px 16px; border-radius: 6px; background: var(--paper); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.topbar { color: #f7f8ef; background: var(--deep); }
.topbar-inner, .container { width: min(100% - 64px, 1360px); margin-inline: auto; }
.topbar-inner { min-height: 68px; display: flex; align-items: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; color: inherit; text-decoration: none; }
a.brand:hover { color: white; }
.brand strong { display: block; letter-spacing: .09em; font-size: 16px; }
.brand small, .account-name small { display: block; color: #c0d0c5; font-size: 11px; }
.brand-mark { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 7px; background: #d6e9a5; color: var(--deep); }
.brand-mark::before, .brand-mark::after, .brand-mark span { position: absolute; content: ""; border: 2px solid currentColor; }
.brand-mark::before { width: 20px; height: 7px; border-width: 2px 0; top: 13px; }
.brand-mark::after { width: 12px; height: 19px; border-width: 0 2px; top: 8px; }
.brand-mark span { width: 3px; height: 3px; background: currentColor; top: 8px; left: 19px; }
.main-nav { display: flex; gap: 4px; align-self: stretch; }
.main-nav a { color: #c9d8ce; text-decoration: none; white-space: nowrap; display: grid; align-content: center; position: relative; padding: 0 13px; }
.main-nav a:hover, .main-nav a[aria-current] { color: white; background: #234337; }
.main-nav a[aria-current]::after { content: ""; position: absolute; inset: auto 12px 0; height: 3px; background: #d6e9a5; }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-name { text-align: right; overflow-wrap: anywhere; max-width: 160px; font-size: 13px; }
.topbar .button-quiet { color: #eff6ee; border-color: #607a6d; }
.topbar .button-quiet:hover { background: #2c4a3e; }
.container { padding-block: 38px 56px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 14px 24px; margin-bottom: 26px; }
.page-head > div { min-width: 0; }
.page-head > .button { flex: none; }
.eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .09em; font-weight: 700; margin-bottom: 8px; }
.lede { color: var(--muted); margin-top: 10px; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px; border-radius: 7px; border: 1px solid transparent; padding: 8px 14px; font-weight: 700; text-decoration: none; line-height: 1.25; white-space: nowrap; }
.button-primary { color: white; background: var(--accent); border-color: var(--accent); }
.button-primary:hover { color: white; background: var(--accent-hover); border-color: var(--accent-hover); }
.button-secondary { color: var(--deep); background: var(--paper); border-color: #9eaea4; }
.button-secondary:hover { background: var(--green-soft); color: var(--deep); }
.button-quiet { color: var(--muted); background: transparent; }
.button-quiet:hover { color: var(--deep); background: var(--green-soft); }
.queue-views { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.queue-view { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; border-right: 1px solid var(--line); color: var(--muted); padding: 13px 15px; text-decoration: none; font-size: 13px; }
.queue-view:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.queue-view:last-child { border-right: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.queue-view strong { color: var(--ink); font: 700 23px/1.2 var(--mono); overflow-wrap: anywhere; }
.queue-view:hover, .queue-view[aria-current] { background: var(--green-soft); color: var(--deep); }
.queue-view[aria-current]::after { content: ""; position: absolute; inset: auto 12px 0; height: 3px; background: var(--accent); }
.queue-overdue strong { color: var(--danger); }
.queue-overdue[aria-current] { background: var(--danger-soft); }
.queue-overdue[aria-current]::after { background: var(--danger); }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-top p { margin-top: 3px; }
.muted { color: var(--muted); font-size: 13px; }
.timezone { color: var(--muted); font: 12px/1.5 var(--mono); white-space: nowrap; }
.filters { display: grid; grid-template-columns: minmax(150px, 2fr) minmax(120px, 1fr) minmax(120px, 1fr) auto; align-items: end; gap: 12px; padding: 14px 20px; background: #f8f9f4; border-bottom: 1px solid var(--line); }
label { min-width: 0; display: grid; gap: 5px; }
label > span { font-size: 13px; font-weight: 700; }
input:not([type="checkbox"]):not([type="hidden"]), select, textarea { width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid #aab7ae; border-radius: 7px; color: var(--ink); background: white; }
textarea { min-height: 85px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #637169; opacity: 1; }
.filter-actions, .form-actions, .head-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.head-tags { margin-top: 12px; }
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
.mobile-field { display: none; }
table { width: 100%; min-width: 735px; border-collapse: collapse; text-align: left; }
.member-table table { min-width: 365px; }
th, td { border-bottom: 1px solid var(--line); padding: 13px 12px; vertical-align: middle; overflow-wrap: anywhere; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
thead th { color: var(--muted); font-size: 12px; background: #f8f9f4; white-space: nowrap; }
tbody th { font-weight: 700; min-width: 200px; }
.member-table tbody th { min-width: 0; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: #f6f9f3; }
.ticket-link { font-size: 15px; overflow-wrap: anywhere; }
.ticket-id { color: var(--muted); font: 12px var(--mono); white-space: nowrap; }
.table-sub { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 4px; }
.badge, .overdue-label { display: inline-block; border-radius: 5px; background: #edf0ed; color: #3e5147; padding: 3px 7px; font-size: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.tone-new, .tone-high, .tone-internal { background: #f8edda; color: #714b18; }
.tone-assigned, .tone-agent { background: #e6eef1; color: #325263; }
.tone-in_progress, .tone-admin { background: #e7eedc; color: #3e552a; }
.tone-resolved { background: var(--green-soft); color: #235741; }
.tone-urgent, .overdue-label { background: var(--danger-soft); color: var(--danger); }
.deadline time, .key-values time, .event-head time { font: 12px/1.55 var(--mono); white-space: nowrap; }
.deadline .overdue-label { display: table; margin-top: 4px; }
.empty { padding: 40px 20px; text-align: center; }
.empty p { color: var(--muted); margin-block: 6px 12px; }
.notice { border: 1px solid var(--line); border-radius: 8px; padding: 11px 15px; margin-bottom: 14px; overflow-wrap: anywhere; }
.notice-success { background: var(--green-soft); border-color: #aabcad; }
.notice-error { color: #7b2725; background: var(--danger-soft); border-color: #d6a59e; }
.form-panel { max-width: 740px; }
.form-body { padding: 18px 20px; }
.form-stack, .stack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.form-stack > .button { justify-self: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr); gap: 18px; align-items: start; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline { margin: 0; padding: 16px 20px 5px 35px; list-style: none; }
.timeline li { position: relative; border-left: 1px solid #becdc2; padding: 0 0 17px 13px; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.timeline li:last-child { border-left-color: transparent; }
.event-head { display: flex; flex-wrap: wrap; gap: 5px 9px; align-items: center; overflow-wrap: anywhere; }
.event-head small { color: var(--muted); }
.timeline p { margin-top: 4px; }
.comment-form { border-top: 1px solid var(--line); }
.check { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.key-values { display: grid; grid-template-columns: minmax(70px, auto) minmax(0, 1fr); gap: 9px 15px; padding: 18px 20px; }
.key-values dt { color: var(--muted); font-size: 13px; }
.key-values dd { overflow-wrap: anywhere; }
.rule-row { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(170px, 2fr) auto; align-items: end; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.rule-row:last-child { border-bottom: 0; }
.account-handle { font-family: var(--mono); }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-wrap { width: min(100%, 820px); }
.login-card { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.login-intro, .login-form { padding: clamp(24px, 5vw, 49px); }
.login-intro { background: var(--deep); color: #f7f8ef; display: grid; align-content: space-between; gap: 34px; }
.login-intro .eyebrow { color: #d6e9a5; }
.login-intro h2 { font-size: clamp(24px, 3.5vw, 33px); }
.login-intro h2 + p { color: #c0d0c5; margin-top: 9px; }
.login-steps { display: flex; flex-wrap: wrap; gap: 7px; color: #d6e9a5; font-size: 12px; }
.login-steps span:not(:last-child)::after { content: " →"; margin-left: 6px; }
.login-form h1 { font-size: 29px; }
.login-form > p { margin-block: 7px 20px; }
.login-form .button { justify-self: stretch; }
@media (max-width: 900px) {
    .topbar-inner, .container { width: calc(100% - 36px); }
    .topbar-inner { gap: 16px; }
    .queue-view { padding-inline: 10px; }
    .detail-grid { grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); }
}
@media (max-width: 780px) {
    .topbar-inner, .container { width: calc(100% - 24px); }
    .topbar-inner { flex-wrap: wrap; gap: 2px 12px; padding-top: 8px; }
    .main-nav { order: 3; width: 100%; overflow-x: auto; }
    .main-nav a { min-height: 44px; padding-inline: 10px; font-size: 13px; }
    .account-name { max-width: 110px; }
    .container { padding-block: 23px 28px; }
    .page-head { align-items: start; flex-direction: column; margin-bottom: 16px; }
    .queue-views { display: flex; overflow-x: auto; margin-bottom: 14px; }
    .queue-view { flex: 1 0 78px; min-height: 59px; padding-block: 8px; }
    .queue-view strong { font-size: 19px; }
    .panel-top, .filters, .form-body, .key-values, .rule-row { padding-inline: 13px; }
    .filters { grid-template-columns: 1fr 1fr; }
    .filters > label:first-of-type, .filter-actions { grid-column: 1 / -1; }
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .button, input:not([type="checkbox"]):not([type="hidden"]), select { min-height: 44px; }
    input:not([type="checkbox"]):not([type="hidden"]), select, textarea { font-size: 16px; }
    .check { min-height: 44px; }
    .queue-table table, .queue-table tbody { display: block; min-width: 0; }
    .queue-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .queue-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px 14px; padding: 13px; border-bottom: 1px solid var(--line); }
    .queue-table tbody tr:last-child { border-bottom: 0; }
    .queue-table tbody tr > * { display: block; min-width: 0; border: 0; padding: 0; }
    .queue-table tbody th, .queue-table .deadline { grid-column: 1 / -1; }
    .queue-table .deadline .overdue-label { display: inline-block; margin: 0 0 0 6px; }
    .mobile-field { display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; }
    .table-wrap.member-table table { min-width: 340px; }
    th:first-child, td:first-child { padding-left: 13px; }
    th:last-child, td:last-child { padding-right: 13px; }
    .login-card { grid-template-columns: 1fr; }
    .login-intro { gap: 15px; }
    .login-steps { display: none; }
}
@media (max-width: 410px) {
    .rule-row { grid-template-columns: minmax(0, 1fr) auto; }
    .rule-row > div { grid-column: 1 / -1; }
    .rule-row .button { padding-inline: 8px; }
}
