:root {
  color-scheme: light;
  --sidebar: #19222e;
  --selected: #163441;
  --page: #f4f6f8;
  --paper: #fff;
  --teal: #0d7d8c;
  --teal-dark: #096874;
  --ink: #202b39;
  --muted: #566678;
  --line: #d7dce1;
  --focus: #086a86;
  --amber: #b8640e;
  --rust: #9d3a2b;
  --font: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font: 15px/1.5 var(--font);
  color: var(--ink);
  background: var(--page);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: inherit; }
p, h1, h2, h3, dl, dd, fieldset { margin: 0; }
svg { flex: none; vertical-align: middle; }
.boot, .load-error { padding: 48px; }
.load-error a { margin-top: 18px; }
.muted { color: var(--muted); }
.button { border: 1px solid transparent; text-decoration: none; min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 8px 17px; border-radius: 5px; font-weight: 600; white-space: nowrap; }
.button svg { width: 17px; height: 17px; }
.primary { background: var(--teal); color: white; border-color: var(--teal); }
.primary:hover:not(:disabled) { background: var(--teal-dark); }
.secondary { background: var(--paper); border-color: var(--line); color: var(--ink); }
.secondary:hover { background: #f1f6f7; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; background: none; color: var(--teal-dark); border: 0; padding: 6px 5px; border-radius: 4px; font-weight: 600; }
.text-button:hover { background: #e5f2f4; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 5px; display: inline-grid; place-items: center; color: var(--ink); background: var(--paper); }
.icon-button:hover { background: var(--page); }
input:not([type="checkbox"]), select, textarea { width: 100%; min-width: 0; border: 1px solid #cfd6dc; border-radius: 5px; background: var(--paper); color: var(--ink); padding: 9px 11px; min-height: 41px; }
input::placeholder, textarea::placeholder { color: #627184; opacity: 1; }
textarea { resize: vertical; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 46px 24px; }
.login-frame { width: min(100%, 900px); display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; }
.login-cover { min-height: 520px; display: flex; flex-direction: column; background: var(--sidebar); color: #f2f7fb; padding: 28px 36px 25px; }
.brand { display: flex; align-items: center; gap: 11px; color: #edf3f7; font-weight: 750; }
.brand > svg { width: 36px; height: 36px; padding: 7px; background: #153744; border-radius: 5px; color: #55b5c6; }
.cover-copy { margin: 46px 0 25px; }
.cover-copy h1 { font-size: clamp(31px, 3.7vw, 48px); line-height: 1.16; font-weight: 800; overflow-wrap: anywhere; }
.cover-copy h1 span { color: #7ac3ce; }
.cover-copy p { color: #c3d2df; margin-top: 14px; }
.cover-map { width: 100%; height: auto; max-height: 140px; color: #8bb0bc; margin: auto 0 19px; }
.cover-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #c8d7e0; border-top: 1px solid #425564; padding-top: 13px; font-size: 12px; }
.cover-foot svg, .login-hint svg { width: 16px; height: 16px; }
.login-panel { display: grid; place-items: center; padding: 30px clamp(26px, 5vw, 61px); }
.login-form { width: min(100%, 340px); }
.login-symbol { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 6px; background: #e4f2f4; color: var(--teal-dark); margin-bottom: 12px; }
.login-form h2 { font-size: 26px; }
.login-form > p.muted { margin: 6px 0 23px; }
.login-form label + label { margin-top: 13px; }
.login-submit { width: 100%; justify-content: space-between; min-height: 45px; }
.login-hint { margin-top: 18px; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.login-exit { margin-top: 9px; }

.workspace { min-height: 100vh; display: grid; grid-template-columns: clamp(190px, 17.5vw, 260px) minmax(0, 1fr); }
.sidebar { background: var(--sidebar); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar-scroll { min-height: 0; overflow-y: auto; }
.sidebar > :not(.sidebar-scroll) { flex-shrink: 0; }
.sidebar-brand { padding: 17px 16px; min-height: 72px; border-bottom: 1px solid #303b49; margin-bottom: 13px; font-size: 15px; }
.sidebar-brand strong { min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
.sidebar nav { display: grid; gap: 4px; padding: 0 12px; }
.nav-caption { display: block; color: #a1b2c3; font-size: 11px; font-weight: 650; letter-spacing: .07em; padding: 0 10px 3px; }
.sidebar .event-tree { margin: 12px 12px 0; padding: 12px 0 10px; border-top: 1px solid #303b49; }
.event-branch { min-width: 0; }
.event-toggle.nav-item { gap: 7px; justify-content: flex-start; font-size: 13px; padding: 9px 8px; white-space: normal; }
.event-toggle span { min-width: 0; overflow-wrap: anywhere; line-height: 1.4; flex: 1; }
.event-toggle svg:last-child { width: 13px; height: 13px; }
.event-branch.expanded > .event-toggle { color: #ecf7fa; background: #223843; }
.event-pages { display: grid; gap: 1px; margin: 4px 0 7px 16px; padding-left: 6px; border-left: 1px solid #3b5260; }
.event-pages .nav-item { font-size: 13px; padding-block: 8px; }
.event-pages .nav-item.selected { box-shadow: inset 2px 0 #67bfcc; }
.event-pages svg { width: 16px; height: 16px; }
.nav-item { color: #b6c4d1; background: none; border: 0; border-radius: 5px; display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 13px; text-align: left; font-weight: 600; white-space: nowrap; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item.selected { background: var(--selected); color: #f7fbfe; }
.nav-item:hover { background: #24404d; }
:is(.nav-item, .profile, .signout):focus-visible { outline-color: #77c3cf; outline-offset: -2px; }
.side-account { display: flex; align-items: center; gap: 4px; padding: 14px 12px 8px; margin-top: auto; }
.profile { display: flex; align-items: center; gap: 7px; text-align: left; padding: 5px 6px; background: none; border: 1px solid transparent; border-radius: 5px; color: #edf2f8; min-width: 0; flex: 1; }
.profile:hover { background: #284251; }
.profile-text { min-width: 0; flex: 1; }
.profile-text strong, .profile-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-text strong { font-size: 13px; }
.profile-text small { font-size: 11px; color: #b6c8d6; }
.profile > svg { width: 14px; height: 14px; color: #b6c8d6; }
.avatar { background: #244c59; border-radius: 5px; color: #e1f6f6; display: inline-grid; place-items: center; width: 33px; height: 33px; font-size: 12px; font-weight: 750; flex: none; }
.signout { min-height: 35px; padding: 5px 7px; gap: 4px; font-size: 12px; color: #f2f7fa; background: #243644; border-color: #526775; flex: none; }
.signout:hover { background: #284251; }
.signout svg { width: 16px; height: 16px; }
.side-foot { display: flex; gap: 7px; align-items: center; padding: 13px 19px; border-top: 1px solid #303b49; color: #a6b8c8; font-size: 12px; }
.local-dot { width: 6px; height: 6px; background: #53b9c5; border-radius: 50%; }
.content { max-width: 1660px; margin: 0 auto; padding: 30px clamp(20px, 2.6vw, 48px) 36px; }
.view-dashboard { max-width: 1440px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(26px, 2.4vw, 35px); letter-spacing: -.025em; line-height: 1.2; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 15px; }
.activity-context { display: flex; align-items: center; gap: 7px; margin: -7px 0 10px; min-width: 0; font-size: 13px; color: var(--muted); }
.activity-context .text-button { padding-left: 0; flex: none; }
.activity-context svg { width: 15px; height: 15px; }
.activity-context strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.menu-settings-button { margin-inline-start: auto; min-height: 34px; padding: 5px 9px; font-size: 12px; }
.menu-settings-help { color: var(--muted); margin-bottom: 12px; font-size: 14px; }
.menu-order { margin: 0 0 10px; padding-inline-start: 29px; }
.menu-order li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.menu-order li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.menu-order li > div { display: flex; gap: 6px; justify-content: space-between; align-items: center; }
.menu-order li > div > span { display: inline-flex; gap: 7px; align-items: center; min-width: 0; }
.menu-order li > div > span svg { width: 17px; height: 17px; color: var(--teal-dark); }
.order-buttons { display: flex; gap: 4px; flex: none; }
.order-button { min-height: 34px; padding: 4px 6px; gap: 3px; font-size: 12px; }
.order-button svg { width: 13px; height: 13px; }
.order-button:disabled, .guide-add:disabled { cursor: default; }
.directory-panel { max-width: 920px; border: 1px solid var(--line); border-radius: 8px; background: white; overflow: hidden; }
.directory-heading { display: flex; justify-content: space-between; align-items: center; padding: 12px 17px; background: #edf2f5; color: var(--muted); font-size: 13px; }
.directory-heading h2 { font-size: inherit; }
.directory-list { margin: 0; padding: 0; list-style: none; }
.directory-list li { display: flex; align-items: center; gap: 5px; padding: 0 14px 0 8px; border-top: 1px solid var(--line); }
.directory-list li:hover { background: #f9fcfc; }
.directory-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; min-height: 69px; background: none; border: 0; border-radius: 5px; padding: 10px 8px; color: var(--ink); text-align: left; }
.directory-open strong { overflow-wrap: anywhere; flex: 1; }
.directory-open-label { flex: none; color: var(--teal-dark); font-size: 13px; }
.directory-open:hover strong { color: var(--teal-dark); }
.directory-open > svg { width: 16px; height: 16px; color: var(--muted); }
.folder-tile { display: grid; width: 39px; height: 39px; place-items: center; background: #e7f3f5; color: var(--teal-dark); border-radius: 6px; flex: none; }
.rename-event { min-height: 34px; padding: 5px 9px; font-size: 12px; }
.rename-event svg { width: 14px; height: 14px; }
.account-events { min-width: 140px; max-width: 310px; overflow-wrap: anywhere; }
.membership-form { margin-top: 15px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px 10px; min-width: 0; }
.membership-form legend { font-size: 14px; font-weight: 700; padding: 0 4px; }
.membership-form p { color: var(--muted); font-size: 13px; }
.membership-options { max-height: 200px; overflow: auto; margin-top: 7px; }
.membership-options .check-field { margin-bottom: 2px; padding: 3px 4px; min-height: 32px; }
.membership-options .check-field:hover { background: #eef6f7; }
.membership-options input { flex: none; }
.membership-options span { overflow-wrap: anywhere; }

.filter-panel { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)) minmax(120px,1.15fr) minmax(72px,.75fr); align-items: end; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: white; margin-bottom: 20px; }
.filter-panel label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 13px; }
.filter-panel input, .filter-panel select { font-size: 14px; }
.search-control { display: flex; align-items: center; gap: 6px; padding-left: 9px; min-width: 0; border: 1px solid #cfd6dc; border-radius: 5px; color: var(--muted); }
.search-control > svg { width: 15px; height: 15px; }
.search-control input { border: 0; background: transparent; padding-left: 1px; min-height: 39px; }
.search-control:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.search-control input:focus { outline: none; }
.filter-panel .reset { padding-inline: 8px; }
.data-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 11px; padding: 15px 17px; }
.panel-heading > div { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.panel-heading h2 { font-size: 17px; }
.panel-heading > span { font-size: 13px; white-space: nowrap; }
.scope { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 1px solid #d7e2e5; border-radius: 4px; color: #4a6471; background: #f1f7f8; font-size: 11px; }
.scope svg { width: 12px; height: 12px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 600px; text-align: left; font-size: 14px; }
th { font-size: 13px; color: #526274; font-weight: 700; background: #f0f3f6; white-space: nowrap; }
:is(th, td) { padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
:is(th, td):first-child { padding-left: 16px; }
:is(th, td):last-child { padding-right: 16px; }
tbody tr:last-child td { border-bottom: 0; }
tr:hover td { background: #f9fbfc; }
td small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.client-table { min-width: 930px; }
.client-table th { height: 51px; }
.client-table td { height: 74px; }
.client-table .serial { width: 57px; color: var(--muted); font-variant-numeric: tabular-nums; }
.client-table .customer { width: 20%; min-width: 145px; }
.client-table .received, .client-table .next { white-space: nowrap; font-variant-numeric: tabular-nums; }
.client-table .row-action { position: sticky; right: 0; min-width: 84px; text-align: center; box-shadow: -4px 0 6px #29374409; }
.client-table td.row-action { background: var(--paper); }
.client-table tr:hover td.row-action { background: #f9fbfc; }
.company { border: 0; background: none; color: var(--ink); font-weight: 730; text-align: left; padding: 0; overflow-wrap: anywhere; }
.company:hover { color: var(--teal-dark); text-decoration: underline; }
.demo { display: inline-block; margin-left: 6px; padding: 0 4px; border: 1px solid #cad6dd; border-radius: 4px; color: #526678; font-size: 10px; white-space: nowrap; vertical-align: .12em; }
.grade, .deal, .stage { display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; color: #465469; background: #ecf0f3; padding: 2px 7px; font-size: 12px; font-weight: 640; border-radius: 4px; }
.grade { border-left: 3px solid #8693a5; }
.grade-A { color: #854605; border-color: #dd861c; background: #fff1dc; }
.grade-B { color: #065e6b; border-color: #0b8497; background: #e2f2f5; }
.grade-C { color: #495a6c; border-color: #7b8b9f; background: #ebeff2; }
.grade-none { background: #f3f5f6; border-color: #b4bdc5; }
.deal-open { background: #edf1f5; color: #35465a; }
.deal-won, .stage-won { color: #236143; background: #e5f4eb; }
.deal-closed, .stage-closed { color: #8b3830; background: #f8eae8; }
.stage span:not(:empty) { display: none; }
.stage span:empty { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.late-date { color: var(--rust); font-weight: 680; }
.view-link { white-space: nowrap; padding: 5px 2px; font-size: 13px; }
.view-link svg { width: 14px; height: 14px; }
.panel-foot { display: flex; align-items: center; gap: 9px; min-height: 41px; padding: 5px 15px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.panel-foot button { margin-left: auto; white-space: nowrap; }
.empty { text-align: center; padding: 43px 13px; }
.empty > svg { color: var(--teal); width: 28px; height: 28px; }
.empty h3 { margin-top: 5px; }
.empty p { color: var(--muted); font-size: 14px; margin-top: 3px; }
.empty button { margin-top: 12px; }
.no-activities .empty { padding: 42px 18px 45px; }
.no-activities h2 { margin: 7px 0 9px; font-size: 22px; }
.no-activities p { max-width: 58ch; margin: 6px auto 0; overflow-wrap: anywhere; }
.no-activities p strong { color: var(--ink); }
.empty-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.empty-actions .button { margin: 0; }

.register-form, .guide-sections { display: grid; gap: 20px; }
.form-section { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 19px; }
.form-section h2 { font-size: 19px; margin-bottom: 16px; }
.form-section h2 svg { color: var(--teal); margin-right: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.form-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label, .login-form label { display: grid; align-content: start; gap: 4px; font-size: 14px; color: var(--ink); }
.form-grid small { color: var(--muted); font-size: 12px; }
.required { color: #af3a2d; margin-left: 3px; }
.assignment-inline { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 5px 10px; background: #f3f7f8; border-radius: 5px; padding: 6px 10px; color: var(--muted); font-size: 13px; }
.assignment-inline strong { color: var(--ink); }
.assignment-hint { color: var(--muted); font-size: 13px; margin-top: 11px; }
.milestone-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.milestone { min-width: 0; background: #f5f7f8; border: 1px solid var(--line); border-radius: 6px; padding: 8px 11px 11px; }
.milestone legend { font-weight: 680; padding: 0 4px; }
.check-field { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; min-height: 30px; font-size: 14px; }
.check-field input { accent-color: var(--teal); width: 17px; height: 17px; margin: 0; }
.milestone textarea { display: block; }
.register-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: -13px; }
.entry-error:empty { display: none; }
.form-error { min-height: 20px; font-size: 13px; margin: 5px 0; color: #9b302a; overflow-wrap: anywhere; }
.entry-error:not(:empty) { font-size: 14px; padding: 9px 11px; background: #f9ebea; border-radius: 5px; }

.rating-guide { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.rating-guide article { padding: 14px; border: 1px solid var(--rating-border); border-left: 4px solid var(--rating-accent); border-radius: 7px; background: var(--rating-bg); }
.rating-A { --rating-border: #e7c79f; --rating-accent: #c97716; --rating-bg: #fff6e8; --rating-text: #884900; }
.rating-B { --rating-border: #b3d1da; --rating-accent: #0d7d8c; --rating-bg: #eaf4f6; --rating-text: #085f6e; }
.rating-C { --rating-border: #cdd5de; --rating-accent: #788a9e; --rating-bg: #f0f3f5; --rating-text: #46586c; }
.rating-guide h3 { color: var(--rating-text); font-size: 17px; }
.rating-guide h3 span { display: inline-block; padding: 2px 8px; border: 1px solid var(--rating-border); border-radius: 5px; margin-right: 3px; }
.rating-guide ul { padding-left: 17px; margin: 9px 0 11px; font-size: 14px; }
.rating-guide li { margin-bottom: 5px; }
.rating-guide p { padding: 8px 9px; border: 1px dashed var(--rating-border); border-radius: 4px; font-size: 13px; color: var(--rating-text); }
.guide-timeline { list-style: none; padding: 0; margin: 0; }
.guide-timeline li { position: relative; padding: 0 0 18px 43px; }
.guide-timeline li::before { content: ''; position: absolute; width: 1px; height: 100%; background: #cfdce1; left: 13px; top: 9px; }
.guide-timeline li:last-child { padding-bottom: 0; }
.guide-timeline li:last-child::before { content: none; }
.time-mark { position: absolute; left: 0; top: 0; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-dark); color: white; }
.time-mark svg { width: 14px; height: 14px; }
.guide-timeline h3, .guide-fields dt { font-size: 15px; font-weight: 720; }
.guide-timeline p, .guide-fields dd { color: var(--muted); font-size: 14px; margin-top: 3px; }
.guide-fields { display: grid; gap: 7px; }
.guide-fields div { padding: 10px 12px; background: #f4f6f8; border-radius: 4px; border-left: 3px solid #aacdd3; }
.guide-callout { border: 1px dashed #e7c899; border-radius: 5px; background: #fff7e9; padding: 9px 12px; font-size: 13px; margin-top: 14px; }
.guide-callout strong { color: #8b4903; }
.guide-sections :is(h2, h3, p, li, dd, dt) { overflow-wrap: anywhere; }
.guide-sections :is(p, dd) { white-space: pre-wrap; }
.guide-editor { display: grid; gap: 15px; }
.guide-rating-edit { margin-top: 14px; }
.guide-rating-edit fieldset { min-width: 0; border: 1px solid var(--rating-border); border-left: 4px solid var(--rating-accent); border-radius: 6px; background: var(--rating-bg); color: var(--rating-text); padding: 8px 11px 12px; }
.guide-editor legend { font-size: 14px; font-weight: 700; padding: 0 4px; }
.guide-rating-edit .form-grid, .guide-edit-entry .form-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
.guide-edit-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.guide-edit-entry { min-width: 0; padding: 6px 11px 11px; border: 1px solid var(--line); border-radius: 6px; background: #f6f8fa; }
.guide-entry-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.guide-entry-controls .danger { font-size: 12px; }
.guide-add { margin-top: 10px; }
.guide-editor-footer { position: sticky; bottom: 0; z-index: 1; border: 1px solid var(--line); border-radius: 5px 5px 0 0; background: var(--paper); padding: 9px 12px; }
.guide-editor-footer > div { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.view-guide .page-head h1 { overflow-wrap: anywhere; }

.metric-row, .chart-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 15px; }
.metric, .chart-panel { border: 1px solid var(--line); border-radius: 7px; background: white; padding: 14px 16px; }
.metric > div { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; gap: 3px; }
.metric-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 4px; background: #e5f3f5; color: var(--teal-dark); flex: none; }
.metric-icon svg { width: 16px; height: 16px; }
.metric-A, .metric-rate { color: #8b4c08; background: #fff0dd; }
.metric-won { color: #246944; background: #e6f3ea; }
.metric > strong { display: block; font: 650 28px/1.2 "Bahnschrift", "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; margin: 4px 0 5px; }
.metric p { font-size: 12px; color: var(--muted); }
.chart-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
.chart-panel h2 { font-size: 17px; }
.chart-body { display: grid; grid-template-columns: minmax(120px,1fr) minmax(110px,.8fr); align-items: center; gap: 9px; min-height: 205px; }
.donut { display: block; width: min(100%, 206px); justify-self: center; }
.ring-mark, .ring-track { fill: none; stroke-width: 19; }
.ring-track { stroke: #edf1f3; }
.ring-mark { stroke: var(--series); }
.ring-mark:hover { stroke-width: 22; }
.ring-total, .ring-unit { text-anchor: middle; fill: var(--ink); }
.ring-total { font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-unit { fill: var(--muted); font-size: 9px; }
.series-A { --series: #c97716; }
.series-B { --series: #008da5; }
.series-C { --series: #475093; }
.series-none { --series: #a3a9b3; }
.series-open { --series: #687487; }
.series-won { --series: #287348; }
.series-closed { --series: #ad483c; }
.chart-legend { list-style: none; margin: 0; padding: 0; }
.chart-legend button { display: grid; grid-template-columns: 9px 1fr auto auto; align-items: center; gap: 5px; width: 100%; border: 0; background: none; text-align: left; color: var(--ink); border-radius: 4px; font-size: 12px; padding: 6px 3px; white-space: nowrap; }
.chart-legend button:hover { background: #eef5f6; }
.chart-legend small { min-width: 4.5em; text-align: right; color: var(--muted); font: inherit; font-variant-numeric: tabular-nums; }
.chart-key { width: 9px; height: 9px; border-radius: 2px; background: var(--series); }
.statistics th { border-top: 1px solid var(--line); }

.ticket { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid #bdd3d8; border-radius: 7px; background: #e9f3f5; margin-bottom: 12px; }
.ticket-info { flex: 1; }
.ticket-label { font-size: 12px; color: var(--teal-dark); font-weight: 700; }
.ticket-label svg { width: 15px; height: 15px; }
.ticket h2 { font-size: 19px; margin: 3px 0; }
.ticket p { color: var(--muted); font-size: 13px; }
.ticket-counts { display: flex; }
.ticket-counts button { min-width: 63px; border: 0; border-radius: 4px; color: var(--ink); background: transparent; display: grid; padding: 4px 6px; }
.ticket-counts button:hover { background: #d6eaee; }
.ticket-counts strong { font-size: 22px; }
.ticket-counts span { font-size: 11px; }
.ticket-counts .urgent { color: var(--rust); }
.ticket-date { border-left: 1px dashed #9bbec6; padding-left: 14px; text-align: center; }
.ticket-date > * { display: block; font-size: 12px; }
.ticket-date > strong { font-size: 21px; white-space: nowrap; }
.due-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.due-switch button { background: white; border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px; color: var(--ink); }
.due-switch button.current { background: #e2f1f4; border-color: #9abdca; font-weight: 700; }
.role-guide { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #c4dbe0; border-radius: 7px; background: #eaf5f7; margin-bottom: 16px; }
.role-guide section { padding: 11px 14px; }
.role-guide section + section { border-left: 1px solid #c4dbe0; }
.role-guide p { color: var(--muted); font-size: 13px; margin-top: 2px; }

#dialog { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(100vw, 575px); height: 100%; max-width: 100vw; max-height: 100%; overflow: auto; overscroll-behavior: contain; border: 0; border-left: 1px solid var(--line); color: var(--ink); background: var(--paper); padding: 0; }
#dialog::backdrop { background: #19222e73; }
.drawer-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 18px 22px 15px; border-bottom: 1px solid var(--line); background: #f2f6f8; }
.drawer-head h2 { font-size: 22px; overflow-wrap: anywhere; }
.drawer-head p { color: var(--muted); font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }
.drawer-back { margin: 8px 17px 0; }
.drawer-form, .detail { padding: 18px 22px 22px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.detail-top { display: flex; align-items: center; gap: 7px; }
.detail-top button { margin-left: auto; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 13px; margin: 14px 0; }
.detail-grid div { border-top: 1px solid var(--line); padding-top: 6px; }
.detail-grid dt { font-size: 12px; color: var(--muted); }
.detail-grid dd { overflow-wrap: anywhere; }
.detail-assignment { margin: 0 0 12px; }
.note { background: var(--page); padding: 9px 12px; border-radius: 5px; margin: 7px 0; }
.note h3, .history-heading h3, .detail-milestone-heading { font-size: 16px; }
.note p, .timeline p, .detail-milestones p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.detail-milestone-heading { margin-top: 15px; }
.detail-milestones { display: grid; gap: 5px; margin-top: 7px; }
.detail-milestones div { background: #f1f7f8; padding: 6px 8px; border-radius: 4px; }
.detail-milestones span { color: var(--muted); margin-left: 7px; font-size: 12px; }
.history-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; }
.history-empty { color: var(--muted); padding: 12px 0; }
.timeline { list-style: none; padding: 0 0 0 7px; margin: 10px 0; }
.timeline li { border-left: 1px solid #9abfc4; position: relative; padding: 4px 8px 11px 13px; }
.timeline li::before { content: ''; position: absolute; left: -4px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.timeline span { padding-left: 7px; color: var(--muted); font-size: 12px; }
.detail-footer { margin-top: 12px; padding-top: 5px; border-top: 1px solid var(--line); }
.danger { color: #a22f2b; }
.danger:hover { background: #f9eaea; }
.confirm-message { margin-bottom: 10px; }
#toast { position: fixed; z-index: 5; right: 15px; bottom: 15px; padding: 8px 12px; border-radius: 5px; background: var(--sidebar); color: white; max-width: calc(100vw - 30px); display: none; }
#toast.visible { display: block; }
#toast.error { background: #8c322d; }

@media (max-width: 1200px) {
  .filter-panel { gap: 9px; }
  .client-table { min-width: 865px; }
  .client-table .next { white-space: normal; }
  .client-table :is(th, td) { padding-inline: 8px; }
}
@media (max-width: 1030px) {
  .filter-panel { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .chart-body { grid-template-columns: minmax(90px,1fr) minmax(103px,.85fr); }
  .chart-legend button { grid-template-columns: 8px 1fr auto; gap: 4px; }
  .chart-legend small { display: none; }
}
@media (max-width: 760px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; overflow: visible; padding: 9px 10px 7px; display: grid; grid-template-columns: minmax(0,1fr) auto; }
  .sidebar-scroll { grid-column: 1 / -1; overflow: visible; }
  .sidebar-brand { border: 0; min-height: 0; padding: 0 4px 6px; margin: 0; font-size: 14px; }
  .brand > svg { width: 29px; height: 29px; padding: 5px; }
  .sidebar .root-nav, .sidebar .event-tree { grid-column: 1 / -1; padding: 0; gap: 3px; }
  .sidebar .root-nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .root-nav .nav-caption { display: none; }
  .sidebar .event-tree { margin: 4px 0 0; padding: 4px 0 0; }
  .event-tree .nav-caption { padding-block: 2px; }
  .event-toggle.nav-item { padding-block: 6px; }
  .event-pages { grid-template-columns: repeat(5,minmax(0,1fr)); margin: 0 0 3px; border-left: 0; padding-left: 0; }
  .event-pages .nav-item { padding: 6px 2px; font-size: 11px; }
  .event-pages svg { display: none; }
  .nav-item { justify-content: center; padding: 6px 2px; font-size: 12px; gap: 4px; }
  .nav-item svg { width: 14px; height: 14px; }
  .side-account { grid-column: 2; grid-row: 1; padding: 0 0 5px 2px; margin: 0; }
  .profile { max-width: 114px; padding: 2px; }
  .avatar { width: 28px; height: 28px; }
  .signout { min-height: 34px; padding: 4px 6px; }
  .signout svg { width: 14px; height: 14px; }
  .profile-text small, .side-foot { display: none; }
  .content { padding-top: 20px; }
  .activity-context { flex-wrap: wrap; }
  .activity-context strong { flex: 1 1 100px; }
  .menu-settings-button { min-height: 32px; }
  .guide-rating-edit, .guide-edit-list { grid-template-columns: 1fr; }
  .guide-editor-footer .button { min-height: 38px; padding-inline: 9px; font-size: 13px; }
  .page-head { margin-bottom: 15px; }
  .page-head p { font-size: 13px; }
  .page-head .button { font-size: 13px; padding-inline: 9px; min-height: 38px; }
  .client-table { min-width: 0; table-layout: fixed; }
  .client-table :is(.serial,.region,.job,.assignee,.received,.next,.row-action) { display: none; }
  .client-table .customer { width: 50%; }
  .view-due .client-table .next { display: table-cell; }
  .view-due .client-table .customer { width: 37%; }
}
@media (max-width: 520px) {
  .login-shell { padding: 13px; }
  .login-frame { grid-template-columns: 1fr; }
  .login-cover { min-height: 0; padding: 14px 16px 18px; }
  .cover-copy { margin: 13px 0 0; }
  .cover-copy h1 { font-size: 31px; }
  .cover-copy h1 br, .cover-map, .cover-foot { display: none; }
  .cover-copy p { margin-top: 3px; font-size: 13px; }
  .login-panel { padding: 19px 16px 23px; }
  .content { padding-inline: 12px; }
  .directory-open-label { display: none; }
  .directory-list li { padding-right: 8px; }
  .directory-open { gap: 6px; }
  .folder-tile { width: 31px; height: 31px; }
  .event-pages .nav-item { font-size: 11px; }
  .filter-panel { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 10px; gap: 8px; margin-bottom: 12px; }
  .filter-panel .reset { min-height: 40px; }
  .form-section { padding: 12px; }
  .form-grid { gap: 10px; }
  .form-grid.form-three, .milestone-grid, .rating-guide, .chart-row, .role-guide { grid-template-columns: 1fr; }
  .metric-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chart-body { min-height: 170px; }
  .role-guide section + section { border-left: 0; border-top: 1px solid #c4dbe0; }
  .ticket { flex-wrap: wrap; gap: 4px; padding: 10px; }
  .ticket-info { flex-basis: 100%; }
  .ticket-date { display: none; }
  .drawer-head, .drawer-form, .detail { padding-inline: 13px; }
}
@media (forced-colors: active) {
  .ring-track, .ring-mark { stroke: CanvasText; }
  .ring-track { opacity: .18; }
  .chart-key { border: 1px solid CanvasText; }
}
