:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #747b86;
  --line: #e5e7eb;
  --line-soft: #eef0f2;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --green: #16845b;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }
html { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
button { font: inherit; }

.app-header {
  height: 64px;
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.app-header > div { display: flex; align-items: center; gap: 10px; }
.app-header h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.app-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: var(--text); color: white; font-size: 13px; font-weight: 700; }
.clock { text-align: right; }
.clock > span:last-child { display: block; }
.clock b { display: block; font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; }
.clock small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.app-shell { width: min(1120px, calc(100% - 48px)); margin: 32px auto 64px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 20px; align-items: start; }
.today-panel, .teams-panel, .schedule-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.today-panel { grid-column: 1; }
.teams-panel { grid-column: 2; grid-row: 1; }
.schedule-panel { grid-column: 1 / -1; }
.panel-heading { min-height: 76px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.panel-heading h2 { margin: 3px 0 0; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.section-label, .field-label, .subtle { display: block; color: var(--muted); font-size: 11px; }
.today-badge { padding: 5px 9px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 600; }
.today-content { min-height: 142px; padding: 24px 22px; display: grid; grid-template-columns: minmax(0, 1fr) 170px; align-items: center; gap: 30px; }
.today-people { margin-top: 12px; display: flex; gap: 12px; }
.tomorrow-person { min-width: 0; flex: 1; max-width: 210px; display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; }
.tomorrow-person strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.reporter-block { padding-left: 24px; border-left: 1px solid var(--line); }
.reporter-block strong { display: block; margin-top: 9px; font-size: 15px; font-weight: 600; }
.avatar { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--avatar, #64748b); font-size: 11px; font-weight: 700; }

.compact-heading { min-height: 76px; }
.compact-heading h2, .schedule-heading h2 { margin: 0 0 5px; font-size: 15px; }
.team-list { padding: 8px 18px 12px; }
.team-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line-soft); }
.team-row:last-child { border-bottom: 0; }
.team-number { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.team-row > div { min-width: 0; }
.team-row > div > small { display: block; color: var(--muted); font-size: 9px; margin-bottom: 5px; }
.team-row > div > span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.person-chip { display: flex; align-items: center; gap: 7px; min-width: 0; }
.team-row .person-chip .avatar { width: 23px; height: 23px; font-size: 9px; }
.person-chip strong { max-width: 112px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 600; }
.team-row .person-chip strong { max-width: 67px; font-size: 10px; }
.team-row i { color: #b0b5bc; font-size: 9px; font-style: normal; }

.schedule-heading { min-height: 72px; }
.cycle-label { padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 10px; }
.table-wrap { overflow: hidden; border-radius: 0 0 10px 10px; }
.table-head, .schedule-row { display: grid; grid-template-columns: 1fr 2.2fr 1.3fr .6fr; align-items: center; }
.table-head { min-height: 39px; padding: 0 22px; background: #fafafa; color: var(--muted); font-size: 10px; border-bottom: 1px solid var(--line); }
.schedule-row { min-height: 70px; padding: 10px 22px; border-bottom: 1px solid var(--line-soft); }
.schedule-row:last-child { border-bottom: 0; }
.schedule-row.today { background: #f8fbff; box-shadow: inset 3px 0 var(--blue); }
.date-cell { display: flex; align-items: center; gap: 10px; }
.day-number { width: 30px; font-size: 19px; font-weight: 550; font-variant-numeric: tabular-nums; }
.date-cell small { display: block; color: var(--muted); font-size: 9px; }
.date-cell strong { display: block; font-size: 11px; font-weight: 600; margin-top: 2px; }
.today-chip { margin-left: 5px; padding: 2px 4px; border-radius: 3px; background: var(--blue); color: white; font-size: 8px; font-style: normal; font-weight: 500; }
.people-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.pair-plus { color: #abb0b7; font-size: 11px; }
.report-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.report-symbol { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 6px; background: #f0f2f5; color: #5f6875; font-size: 11px; }
.report-cell strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 600; }
.state-cell { justify-self: end; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.state-cell i { width: 5px; height: 5px; border-radius: 50%; background: #c3c7cd; }
.state-cell.active { color: var(--blue); font-weight: 600; }
.state-cell.active i { background: var(--blue); }

@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .today-panel, .teams-panel, .schedule-panel { grid-column: 1; grid-row: auto; }
  .teams-panel { order: 2; }
  .schedule-panel { order: 3; }
  .team-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
  .team-row { border-bottom: 0; }
}

@media (max-width: 600px) {
  .app-header { height: 58px; padding: 0 16px; }
  .app-shell { width: calc(100% - 24px); margin: 16px auto 36px; gap: 12px; }
  .panel-heading { padding: 15px 16px; }
  .today-content { grid-template-columns: 1fr; gap: 20px; padding: 18px 16px; }
  .reporter-block { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .today-people { flex-direction: column; }
  .tomorrow-person { max-width: none; }
  .team-list { grid-template-columns: 1fr; gap: 0; padding: 6px 16px 10px; }
  .team-row { border-bottom: 1px solid var(--line-soft); }
  .team-row:last-child { border-bottom: 0; }
  .table-head { display: none; }
  .schedule-row { grid-template-columns: 74px minmax(0, 1fr) auto; grid-template-areas: "date people state" "date report state"; gap: 7px 8px; min-height: 82px; padding: 11px 13px; }
  .date-cell { grid-area: date; gap: 5px; }
  .people-cell { grid-area: people; }
  .report-cell { grid-area: report; }
  .state-cell { grid-area: state; }
  .people-cell .person-chip strong { max-width: 66px; font-size: 10px; }
  .people-cell .avatar { width: 26px; height: 26px; font-size: 9px; }
}
