:root {
  color-scheme: light;
  --ink: #172a27;
  --muted: #617570;
  --line: #dce7e2;
  --paper: #f6f8f4;
  --white: #fff;
  --forest: #174d3b;
  --forest-dark: #10392d;
  --mint: #e7f2e8;
  --amber: #f6eed9;
  --error: #8b3a32;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #a7852f; outline-offset: 3px; }
.shell { width: min(100% - 32px, 1180px); margin-inline: auto; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 77px; }
.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; font-size: 16px; line-height: 1.16; font-weight: 750; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 550; letter-spacing: .01em; }
.brand-mark { display: inline-grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: var(--forest); font-family: Georgia, serif; font-size: 22px; }
.logout { margin: 0; }
.text-button { border: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 10px 0; white-space: nowrap; }
.site-footer { padding-block: 38px; color: var(--muted); font-size: 12px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding-block: 38px 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.12; letter-spacing: -.045em; margin-bottom: 7px; }
h2 { font-size: 24px; line-height: 1.2; letter-spacing: -.025em; margin-bottom: 0; }
h3 { font-size: 17px; letter-spacing: -.01em; margin-block: 28px 12px; }
.eyebrow { color: var(--forest); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.intro, .small-note { color: var(--muted); }
.intro { margin-bottom: 0; }
.small-note { font-size: 13px; line-height: 1.6; }
.month-nav { display: flex; gap: 8px; }
.month-nav a { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); text-decoration: none; font-size: 27px; line-height: 1; }
.month-nav a:hover { border-color: var(--forest); color: var(--forest); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 8px 28px rgba(18,49,38,.035); }
.calendar-panel { padding: 20px; }
.weekday, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.weekday { margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 800; text-align: center; }
.day { min-width: 0; min-height: 112px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; overflow: hidden; }
.day.empty { background: #fbfcf9; }
.day.muted { background: transparent; border-color: transparent; }
.day.today { border-color: #a7852f; }
.day.occupied { display: flex; flex-direction: column; background: var(--mint); border-color: #b6d6bc; transition: border-color .15s, transform .15s; }
.day.occupied:hover { border-color: var(--forest); transform: translateY(-2px); }
.day-number { font-size: 12px; font-weight: 750; color: var(--muted); }
.day-action { color: var(--forest); margin-top: 7px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.day-topic { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 12px; line-height: 1.25; margin-top: 3px; }
.day-state { margin-top: auto; padding-top: 6px; font-size: 10px; font-weight: 700; color: var(--forest); }
.queue-panel, .stats-panel, .changes-panel { margin-top: 18px; padding: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.count { min-width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--forest); font-size: 13px; font-weight: 800; }
.queue-list, .steps, .change-list { padding: 0; margin: 0; list-style: none; }
.queue-list li + li { border-top: 1px solid var(--line); }
.queue-list a { display: flex; align-items: center; gap: 16px; padding: 15px 0; text-decoration: none; }
.queue-list a:hover strong { color: var(--forest); text-decoration: underline; }
.queue-rank { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--paper); font-weight: 800; color: var(--forest); }
.queue-list strong { font-size: 15px; }
.queue-list small { display: block; margin-top: 3px; color: var(--muted); }
.arrow { margin-left: auto; font-size: 18px; color: var(--muted); }
.empty-message { padding: 14px 0; color: var(--muted); }
.back-link { display: inline-block; margin-top: 30px; text-decoration: none; color: var(--forest); font-weight: 700; font-size: 13px; }
.back-link:hover { text-decoration: underline; }
.item-heading { padding-top: 18px; align-items: start; }
.state-pill { border-radius: 100px; padding: 8px 13px; background: var(--amber); color: #705b22; font-size: 12px; white-space: nowrap; font-weight: 750; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .75fr); gap: 18px; }
.detail-grid > .panel { padding: 24px; }
.step { display: flex; align-items: center; gap: 13px; padding-block: 11px; font-size: 14px; }
.step + .step { border-top: 1px solid var(--line); }
.step-symbol { display: grid; place-items: center; flex: 0 0 26px; height: 26px; border-radius: 50%; font-weight: 900; }
.step-symbol.done { background: var(--mint); color: var(--forest); }
.step-symbol.running { background: var(--amber); color: #866b1e; }
.step-symbol.todo { background: #f2f4f1; color: #7b8983; }
.step-symbol.blocked { background: #f9eae7; color: var(--error); }
.step-status { margin-left: auto; white-space: nowrap; font-size: 12px; }
.step-status.done { color: var(--forest); }
.step-status.running { color: #866b1e; }
.step-status.todo { color: #7b8983; }
.step-status.blocked { color: var(--error); }
.links-panel h2 { margin-bottom: 18px; }
.link-stack { display: grid; align-items: start; gap: 10px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; border-radius: 12px; border: 1px solid transparent; padding: 10px 15px; font-weight: 750; font-size: 13px; line-height: 1.3; text-align: center; text-decoration: none; }
.button.primary { background: var(--forest); color: #fff; }
.button.primary:hover { background: var(--forest-dark); }
.button.secondary { border-color: var(--line); color: var(--forest); background: var(--white); }
.button.secondary:hover { border-color: var(--forest); }
.button:disabled { opacity: .5; }
.approval-panel { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 18px; padding: 24px; }
.approval-panel p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.approval-panel form { margin: 0; }
.stats-panel > .small-note { margin-top: 14px; }
.metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.metric-card { min-width: 0; padding: 15px; background: var(--paper); border-radius: 12px; }
.metric-card span { display: block; min-height: 36px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.metric-card strong { display: block; margin-top: 8px; font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.history-entry { border-top: 1px solid var(--line); }
.history-entry summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 48px; font-weight: 750; cursor: pointer; }
.history-entry .metrics-grid { margin-block: 4px 16px; }
.history-key { color: var(--muted); font-size: 12px; font-weight: 500; }
.table-scroll { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 12px; }
caption { text-align: left; color: var(--muted); margin-bottom: 6px; }
th, td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; }
th { font-weight: 750; }
td { white-space: nowrap; }
.change-list li { display: flex; gap: 15px; padding-block: 13px; border-top: 1px solid var(--line); }
.change-list time { flex: 0 0 94px; color: var(--muted); font-size: 13px; }
.change-list strong { font-size: 14px; font-weight: 550; }
.login-panel { max-width: 460px; margin: 70px auto 0; padding: 30px; }
.login-panel h1 { font-size: 33px; }
.login-form { display: grid; gap: 18px; margin-top: 24px; }
.login-form label { display: grid; gap: 7px; font-weight: 700; font-size: 13px; }
.login-form input { min-height: 46px; border: 1px solid #aabbb3; border-radius: 10px; padding: 10px 12px; font-size: 16px; background: #fff; }
.login-form button { margin-top: 3px; }
.form-error { color: var(--error); font-size: 13px; }

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: 68px; }
  .brand { font-size: 14px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .text-button { font-size: 11px; }
  .page-heading { padding-top: 26px; }
  .calendar-panel { padding: 9px; border-radius: 16px; }
  .weekday, .calendar-grid { gap: 3px; }
  .weekday { font-size: 10px; }
  .day { min-height: 68px; padding: 5px; border-radius: 7px; }
  .day.occupied { background: var(--mint); }
  .day-number { font-size: 10px; }
  .day-action { margin-top: 3px; font-size: 8px; letter-spacing: 0; }
  .day-topic { font-size: 9px; -webkit-line-clamp: 2; }
  .day-state { display: none; }
  .queue-panel, .stats-panel, .changes-panel { padding: 18px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid > .panel { padding: 18px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-card { padding: 12px; }
  .metric-card strong { font-size: 17px; }
  .item-heading { display: block; }
  .state-pill { display: inline-flex; margin-top: 14px; }
  .approval-panel { align-items: stretch; flex-direction: column; }
  .approval-panel button { width: 100%; }
}

@media (max-width: 380px) {
  .day { min-height: 60px; }
  .day-topic { -webkit-line-clamp: 1; }
  .brand small { display: none; }
  .step-status { font-size: 11px; }
}
