:root {
  --ink: #15232a;
  --ink-soft: #273a40;
  --paper: #ecece4;
  --paper-deep: #e1e2d9;
  --surface: #f9f9f4;
  --surface-alt: #f1f2eb;
  --line: #c4c9c1;
  --line-strong: #98a29a;
  --muted: #596760;
  --muted-soft: #77837c;
  --copper: #994824;
  --copper-dark: #7e371a;
  --copper-pale: #f4e3d8;
  --green: #146152;
  --green-pale: #dcece5;
  --blue: #235a72;
  --blue-pale: #dfeaf0;
  --warning: #805417;
  --warning-pale: #f5eacc;
  --danger: #9a3828;
  --danger-pale: #f5dfda;
  --shadow: 0 18px 48px rgb(17 31 34 / 18%);
  --font-ui: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --font-data: "SF Mono", "Cascadia Mono", "Noto Sans Mono CJK SC", monospace;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #dfe3db 0, var(--paper) 220px);
  color: var(--ink);
  line-height: 1.5;
}

body::selection {
  background: #b6d8cc;
  color: #10221d;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .52;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #0b7160;
  outline-offset: 3px;
}

[hidden],
.is-hidden {
  display: none !important;
}

.app-frame {
  min-height: 100vh;
}

.topbar {
  min-height: 80px;
  padding: 14px clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  gap: 20px;
  background: var(--ink);
  color: #f3f3ec;
  border-bottom: 1px solid #0e1a1e;
}

.wordmark {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.02em;
  text-decoration: none;
}

.wordmark b {
  margin-left: 5px;
  color: #d6a184;
  font-weight: 620;
}

.wordmark-mark,
.login-mark {
  width: 18px;
  height: 18px;
  position: relative;
  display: inline-block;
  transform: rotate(45deg);
  border: 2px solid #cb7952;
}

.wordmark-mark::after,
.login-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: #cb7952;
}

.topbar-status {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  color: #d7e0dc;
  font-size: 14px;
  white-space: nowrap;
}

.topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.refresh-stamp {
  max-width: 220px;
  overflow: hidden;
  color: #bac5c0;
  font-family: var(--font-data);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 clamp(20px, 4vw, 64px);
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  background: rgb(249 249 244 / 86%);
}

.nav-item,
.mobile-nav-item,
.filter-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 620;
  letter-spacing: -.01em;
}

.nav-item {
  position: relative;
  min-height: 56px;
  padding: 0 17px;
}

.nav-item::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: -1px;
  left: 16px;
  height: 3px;
  background: transparent;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--ink);
}

.nav-item.is-active::after {
  background: var(--copper);
}

.app-main {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 72px;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
  padding: 14px 16px 14px 18px;
  border: 1px solid #d0a078;
  background: #f7e9df;
  color: #572916;
}

.notice div {
  display: grid;
  gap: 2px;
}

.notice strong {
  font-weight: 750;
}

.notice span {
  font-size: 14px;
}

.health-notice {
  border-color: #c79b60;
  background: #f6ead4;
  color: #5f3c16;
}

.health-notice.is-critical {
  border-color: #b06452;
  background: var(--danger-pale);
  color: #602319;
}

.health-notice .button-quiet {
  border-color: currentColor;
  color: inherit;
}

.view {
  outline: 0;
}

.view-heading,
.section-heading,
.timeline-heading,
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.view-heading {
  margin-bottom: 28px;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  text-wrap: balance;
}

h1 {
  color: var(--ink);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: 1.1;
}

h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 730;
  letter-spacing: -.025em;
  line-height: 1.25;
}

.view-heading p,
.section-heading p,
.timeline-heading p,
.dialog-heading p {
  margin-top: 7px;
  max-width: 76ch;
  color: var(--muted);
  font-size: 14px;
  text-wrap: pretty;
}

.view-heading-actions {
  flex: none;
}

.button,
.text-button {
  min-height: 44px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -.01em;
  transition-property: background-color, border-color, color, transform;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(.2, 0, 0, 1);
}

.button:active,
.text-button:active,
.nav-item:active,
.filter-button:active,
.mobile-nav-item:active {
  transform: scale(.96);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
}

.button-primary {
  background: var(--ink);
  color: #fffdf7;
}

.button-primary:hover {
  background: #283b41;
}

.button-copper {
  background: var(--copper);
  color: #fffaf5;
}

.button-copper:hover {
  background: var(--copper-dark);
}

.button-danger {
  background: var(--danger);
  color: #fff9f8;
}

.button-danger:hover {
  background: #7d291d;
}

.button-quiet {
  border-color: transparent;
  background: transparent;
  color: inherit;
}

.button-quiet:hover {
  border-color: currentColor;
  background: rgb(255 255 255 / 8%);
}

.app-main .button-quiet,
.dialog .button-quiet {
  color: var(--ink-soft);
}

.app-main .button-quiet:hover,
.dialog .button-quiet:hover {
  border-color: var(--line-strong);
  background: var(--surface-alt);
}

.text-button {
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--copper-dark);
  text-decoration: none;
}

.text-button:hover {
  color: var(--copper);
}

.timeline-panel,
.boss-board,
.watch-panel,
.operations-panel,
.settings-section,
.account-detail {
  background: var(--surface);
  border: 1px solid var(--line);
}

.timeline-panel {
  padding: 25px clamp(18px, 3vw, 34px) 22px;
}

.timeline-heading {
  margin-bottom: 24px;
}

.window-state {
  display: flex;
  flex: none;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  font-family: var(--font-data);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.timeline {
  --now: 50%;
  position: relative;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  height: 104px;
  overflow: hidden;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: #e4e6df;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--now);
  z-index: 3;
  width: 2px;
  background: var(--copper);
}

.timeline::after {
  content: "现在";
  position: absolute;
  top: 8px;
  left: calc(var(--now) + 6px);
  z-index: 4;
  padding: 1px 5px;
  background: var(--copper);
  color: #fffaf5;
  font-size: 11px;
  line-height: 1.5;
}

.timeline-hour {
  position: relative;
  border-left: 1px solid rgb(106 121 112 / 35%);
}

.timeline-hour:first-child {
  border-left: 0;
}

.timeline-hour span {
  position: absolute;
  right: 4px;
  bottom: 5px;
  color: #526058;
  font-family: var(--font-data);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.timeline-window {
  position: absolute;
  top: 23px;
  bottom: 26px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 38px;
  padding: 0 4px;
  overflow: hidden;
  border: 1px solid #5e887a;
  background: #bcd6ca;
  color: #143b32;
  font-family: var(--font-data);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timeline-window.is-active {
  border-color: var(--copper-dark);
  background: #e2a27f;
  color: #43200f;
}

.timeline-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.timeline-foot b {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.command-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(268px, 330px);
  gap: 20px;
  margin-top: 20px;
}

.boss-board {
  padding: 25px clamp(18px, 3vw, 34px) 30px;
}

.watch-panel {
  padding: 25px 22px;
  background: #f3f1e9;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading.compact {
  margin-bottom: 17px;
}

.data-label {
  color: var(--muted-soft);
  font-family: var(--font-data);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.boss-instances {
  display: grid;
  gap: 18px;
}

.instance-row {
  display: grid;
  grid-template-columns: minmax(165px, 1fr) minmax(230px, 2fr) minmax(145px, .78fr);
  align-items: center;
  gap: 24px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}

.instance-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.instance-name {
  display: grid;
  gap: 5px;
}

.instance-name strong {
  font-size: 16px;
  letter-spacing: -.02em;
}

.instance-name span,
.instance-time {
  color: var(--muted);
  font-family: var(--font-data);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.coverage-track {
  position: relative;
  height: 16px;
  overflow: hidden;
  display: flex;
  background: #d9ddd7;
  border-radius: 2px;
}

.coverage-track span {
  min-width: 0;
}

.coverage-participated { background: var(--green); }
.coverage-ready { background: var(--copper); }
.coverage-notReady { background: #d3b766; }
.coverage-blocked { background: var(--danger); }
.coverage-unobserved { background: #82919b; }
.coverage-exhausted { background: #87766a; }

.coverage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.coverage-legend button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.coverage-legend button:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.coverage-key {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.coverage-key.participated { color: var(--green); }
.coverage-key.ready { color: var(--copper); }
.coverage-key.notReady { color: #a78018; }
.coverage-key.blocked { color: var(--danger); }
.coverage-key.unobserved { color: #6f818c; }
.coverage-key.exhausted { color: #67594f; }

.instance-summary {
  display: grid;
  gap: 4px;
  text-align: right;
}

.instance-summary strong {
  font-family: var(--font-data);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.06em;
  line-height: 1;
}

.instance-summary span {
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 28px 4px;
  color: var(--muted);
  font-size: 14px;
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
}

.watch-list {
  display: grid;
}

.watch-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.watch-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.watch-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
  letter-spacing: -.01em;
}

.watch-item p {
  color: var(--muted);
  font-size: 12px;
}

.watch-count {
  flex: none;
  color: var(--ink);
  font-family: var(--font-data);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.06em;
  line-height: 1;
}

.watch-item button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.watch-item button:hover strong {
  color: var(--copper-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.operations-panel {
  margin-top: 20px;
  padding: 25px clamp(18px, 3vw, 34px) 30px;
}

.operations-grid {
  display: grid;
  grid-template-columns: minmax(260px, .86fr) minmax(0, 1.7fr);
  gap: 34px;
}

.operation-facts {
  display: grid;
  align-content: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}

.operation-facts div {
  padding: 14px 12px 12px 0;
  border-bottom: 1px solid var(--line);
}

.operation-facts div:nth-child(odd) {
  border-right: 1px solid var(--line);
  padding-right: 12px;
}

.operation-facts div:nth-child(even) {
  padding-left: 12px;
}

.operation-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.operation-facts dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: var(--font-data);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}

.event-feed {
  border-top: 1px solid var(--line);
}

.feed-event {
  display: grid;
  grid-template-columns: 114px 125px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.feed-event time,
.feed-event .feed-account {
  font-family: var(--font-data);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.feed-event .feed-action {
  color: var(--ink-soft);
}

.state-chip {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.state-chip.good { background: var(--green-pale); color: #104f42; }
.state-chip.ready { background: var(--copper-pale); color: #733115; }
.state-chip.warn { background: var(--warning-pale); color: #67430f; }
.state-chip.danger { background: var(--danger-pale); color: #7d2519; }
.state-chip.neutral { background: #e1e7e3; color: #4e5c55; }
.state-chip.info { background: var(--blue-pale); color: #194a61; }

.bot-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
}

.bot-status::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.bot-status.good { color: #6fceae; }
.bot-status.warn { color: #e7bf6a; }
.bot-status.danger { color: #f29d8e; }
.bot-status.neutral { color: #bac5c0; }

.account-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 19px;
  padding: 16px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 680;
}

.field > span {
  letter-spacing: -.01em;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.compact-field {
  min-width: 138px;
}

.compact-field:first-child {
  min-width: min(100%, 235px);
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  transition-property: border-color, background-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(.2, 0, 0, 1);
}

input::placeholder {
  color: #737d77;
  opacity: 1;
}

input:hover,
select:hover {
  border-color: #738078;
}

input:focus,
select:focus {
  border-color: #0b7160;
  background: #fffefa;
}

.accounts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
  gap: 20px;
  align-items: start;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

.table-wrap::-webkit-scrollbar {
  height: 12px;
}

.table-wrap::-webkit-scrollbar-track {
  background: var(--paper-deep);
}

.table-wrap::-webkit-scrollbar-thumb {
  border: 3px solid var(--paper-deep);
  border-radius: 999px;
  background: #7c8981;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink-soft);
  font-size: 13px;
}

.accounts-table {
  min-width: 925px;
}

.events-table {
  min-width: 760px;
}

.data-table th,
.data-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #e8e9e1;
  color: #4b5b54;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td.number,
.data-table th.number {
  text-align: right;
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr {
  transition-property: background-color;
  transition-duration: 120ms;
  transition-timing-function: ease-out;
}

.data-table tbody tr:hover {
  background: #f0f3ed;
}

.data-table tbody tr.is-selected {
  background: #e3eee8;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.account-row-button {
  width: 100%;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #174b55;
  font-family: var(--font-data);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.account-row-button:hover {
  color: var(--copper-dark);
  text-decoration-color: currentColor;
}

.table-muted {
  color: var(--muted);
  font-size: 12px;
}

.account-detail {
  position: sticky;
  top: 20px;
  min-height: 355px;
  padding: 22px;
}

.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-heading h2 {
  margin-bottom: 5px;
  font-family: var(--font-data);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.detail-close,
.dialog-close {
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
  transition-property: background-color, color, transform;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(.2, 0, 0, 1);
}

.detail-close:hover,
.dialog-close:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.detail-close:active,
.dialog-close:active {
  transform: scale(.96);
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.detail-facts div {
  padding: 12px 0;
}

.detail-facts dt {
  color: var(--muted);
  font-size: 11px;
}

.detail-facts dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 690;
  word-break: break-word;
}

.detail-facts dd.data {
  font-family: var(--font-data);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.detail-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-section h3 {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -.01em;
}

.growth-chart {
  width: 100%;
  height: 106px;
  display: block;
  overflow: visible;
}

.growth-chart .axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.growth-chart .line {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.3;
  vector-effect: non-scaling-stroke;
}

.growth-chart .point {
  fill: var(--surface);
  stroke: var(--green);
  stroke-width: 2;
}

.growth-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--font-data);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.detail-list {
  display: grid;
  gap: 0;
}

.detail-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid #dce0d9;
  color: var(--muted);
  font-size: 12px;
}

.detail-list-item:first-child {
  border-top: 0;
}

.detail-list-item strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 680;
}

.detail-list-item span:last-child {
  font-family: var(--font-data);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.event-filter-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

.filter-button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  transition-property: border-color, background-color, color, transform;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(.2, 0, 0, 1);
}

.filter-button:hover,
.filter-button.is-active {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.event-summary {
  max-width: 50ch;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-wrap: pretty;
}

.event-time {
  font-family: var(--font-data);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.settings-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.settings-section {
  min-height: 240px;
  padding: 24px;
}

.settings-section h2 {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.feature-list,
.window-list {
  display: grid;
  margin-top: 7px;
}

.feature-row,
.window-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid #dce0d9;
  color: var(--ink-soft);
  font-size: 13px;
}

.feature-row:last-child,
.window-row:last-child,
.logging-row:last-child {
  border-bottom: 0;
}

.feature-row span:last-child,
.window-row span:last-child {
  font-family: var(--font-data);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.logging-policy {
  display: grid;
  gap: 0;
  margin-top: 7px;
  border-top: 1px solid var(--line);
}

.logging-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid #dce0d9;
  color: var(--muted);
  font-size: 13px;
}

.logging-row strong {
  color: var(--ink);
  font-family: var(--font-data);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.settings-copy {
  margin-top: 15px;
  color: var(--muted);
  font-size: 14px;
  text-wrap: pretty;
}

.control-row {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-password {
  margin-top: 24px;
}

.mobile-nav {
  display: none;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(145deg, #193036 0%, #15232a 51%, #253a36 100%);
  color: #f4f2ea;
}

.login-panel {
  width: min(100%, 408px);
  padding: 42px;
  background: #f5f4ed;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.login-mark {
  display: block;
  margin: 2px 0 25px;
}

.login-product {
  color: var(--copper-dark);
  font-family: var(--font-data);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-panel h1 {
  margin-top: 4px;
  font-size: 40px;
}

.login-panel > p:not(.login-product):not(.form-message) {
  margin: 13px 0 28px;
  color: var(--muted);
  font-size: 14px;
  text-wrap: pretty;
}

.form-message {
  min-height: 21px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.login-submit {
  width: 100%;
  margin-top: 6px;
}

.dialog {
  width: min(calc(100% - 32px), 490px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgb(12 25 28 / 58%);
  backdrop-filter: blur(2px);
}

.dialog-panel {
  display: grid;
  gap: 18px;
  padding: 26px;
  background: var(--surface);
}

.dialog-heading {
  gap: 12px;
}

.dialog-heading p {
  max-width: 38ch;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.toast-region {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 50%;
  width: min(calc(100% - 32px), 500px);
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
  padding: 13px 15px;
  border: 1px solid #96aaa0;
  background: #f8faf5;
  color: #203b33;
  box-shadow: 0 10px 26px rgb(17 31 34 / 18%);
  font-size: 14px;
  opacity: 0;
  transform: translateY(-8px);
  transition-property: opacity, transform;
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(.16, 1, .3, 1);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.danger {
  border-color: #c88f84;
  background: #fff6f4;
  color: #6d2118;
}

.toast button {
  min-width: 32px;
  min-height: 32px;
  margin: -7px -8px -7px 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.toast button:hover {
  background: rgb(0 0 0 / 7%);
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .topbar-status {
    display: none;
  }

  .topbar-actions {
    min-width: 0;
  }

  .command-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .watch-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .watch-item {
    padding: 0;
    border-top: 0;
    border-left: 1px solid var(--line);
    padding-left: 16px;
  }

  .watch-item:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .settings-section {
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .accounts-layout {
    grid-template-columns: 1fr;
  }

  .account-detail {
    position: static;
  }

  .operations-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 720px) {
  body {
    background: var(--paper);
  }

  .topbar {
    min-height: 64px;
    padding: 10px 16px;
    grid-template-columns: 1fr auto;
  }

  .wordmark {
    font-size: 15px;
  }

  .wordmark-mark {
    width: 15px;
    height: 15px;
  }

  .wordmark-mark::after {
    inset: 3px;
  }

  .refresh-stamp,
  .topbar-actions .button-quiet:last-child {
    display: none;
  }

  .topbar-actions .button {
    min-height: 40px;
    padding: 0 10px;
    color: #f3f3ec;
  }

  .primary-nav {
    display: none;
  }

  .app-main {
    width: min(100% - 28px, 1500px);
    padding: 25px 0 calc(92px + env(safe-area-inset-bottom));
  }

  .notice {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 24px;
  }

  .view-heading,
  .section-heading,
  .timeline-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .view-heading {
    margin-bottom: 22px;
  }

  h1 {
    font-size: 30px;
  }

  .timeline-panel,
  .boss-board,
  .watch-panel,
  .operations-panel,
  .settings-section,
  .account-detail {
    padding: 19px;
  }

  .timeline {
    height: 90px;
  }

  .timeline-hour:nth-child(odd) span {
    display: none;
  }

  .timeline-window {
    font-size: 10px;
  }

  .command-layout {
    gap: 14px;
    margin-top: 14px;
  }

  .instance-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 0;
  }

  .instance-summary {
    grid-template-columns: auto 1fr;
    align-items: baseline;
    text-align: left;
  }

  .watch-list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .watch-item,
  .watch-item:first-child {
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .watch-item:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .operations-panel {
    margin-top: 14px;
  }

  .feed-event {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .feed-event .feed-action {
    grid-column: 2;
  }

  .account-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-field,
  .compact-field:first-child {
    min-width: 0;
  }

  .account-controls .button {
    width: 100%;
  }

  .event-filter-bar {
    width: 100%;
  }

  .filter-button {
    min-height: 44px;
    flex: 1 1 auto;
  }

  .mobile-nav {
    position: fixed;
    z-index: 8;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid #425158;
    background: var(--ink);
  }

  .mobile-nav-item {
    min-height: 48px;
    border-radius: 7px;
    color: #bcc8c3;
    font-size: 12px;
  }

  .mobile-nav-item.is-active {
    background: #2b4144;
    color: #fffaf5;
  }

  .login-shell {
    padding: 18px;
  }

  .login-panel {
    padding: 31px 25px;
  }

  .dialog {
    width: min(calc(100% - 20px), 490px);
  }

  .dialog-panel {
    padding: 22px;
  }
}

@media (max-width: 430px) {
  .account-controls {
    grid-template-columns: 1fr;
  }

  .operation-facts {
    grid-template-columns: 1fr;
  }

  .operation-facts div,
  .operation-facts div:nth-child(odd),
  .operation-facts div:nth-child(even) {
    padding: 12px 0;
    border-right: 0;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
