:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-muted: #edf2f4;
  --line: #d9e1e5;
  --line-strong: #b9c7ce;
  --text: #172026;
  --muted: #5d6d76;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #d8f3ee;
  --danger: #b42318;
  --warning: #9a6700;
  --ok: #166534;
  --focus: #1d4ed8;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  min-height: 38px;
  padding: 0 0.9rem;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 72%);
  outline-offset: 2px;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary:hover {
  background: var(--accent-strong);
}

button.wide {
  width: 100%;
  margin-top: 0.65rem;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input[type="text"],
input[type="password"],
input[type="file"],
input[type="datetime-local"],
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  min-height: 38px;
  padding: 0.45rem 0.65rem;
}

label {
  color: var(--muted);
  display: block;
  font-size: 0.86rem;
  font-weight: 650;
  margin: 0.7rem 0 0.35rem;
}

.app-header {
  align-items: center;
  background: #102027;
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 92px;
  padding: 1.1rem clamp(1rem, 3vw, 2rem);
}

.eyebrow {
  color: #a8c6c3;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.brand-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #fff;
  display: grid;
  justify-items: start;
  min-height: auto;
  padding: 0.25rem 0.35rem;
  text-align: left;
}

.brand-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
}

.brand-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.15rem;
}

.brand-title {
  color: #fff;
  display: block;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.1;
  margin-top: 0;
}

.beta-badge {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  min-height: 22px;
  padding: 0.24rem 0.5rem;
  text-transform: uppercase;
}

.server-state {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #dbeafe;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
}

.header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.user-chip {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #eef9f7;
  font-size: 0.86rem;
  max-width: 280px;
  overflow: hidden;
  padding: 0.4rem 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.auth-screen {
  align-items: center;
  display: grid;
  min-height: calc(100vh - 92px);
  padding: 1.25rem;
  place-items: center;
}

.auth-screen[hidden],
.landing-screen[hidden],
.app-shell[hidden] {
  display: none;
}

.landing-screen {
  background: var(--bg);
  min-height: calc(100vh - 92px);
  padding: clamp(1rem, 3vw, 2rem);
}

.landing-inner {
  display: grid;
  gap: 1rem;
  margin: 0 auto;
  max-width: 1180px;
}

.landing-hero {
  background: #102027;
  border-radius: var(--radius);
  color: #fff;
  min-height: 300px;
  padding: clamp(1.5rem, 5vw, 3rem);
}

.landing-hero h1 {
  font-size: clamp(2.4rem, 7vw, 5rem);
  letter-spacing: 0;
  line-height: 0.98;
  margin: 0.45rem 0 0.9rem;
  max-width: 760px;
}

.hero-beta {
  font-size: 0.86rem;
  min-height: 24px;
  padding-inline: 0.55rem;
  vertical-align: middle;
}

.landing-hero p {
  color: #d7e7e4;
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
  max-width: 720px;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.35rem 0 0.85rem;
}

.landing-actions button {
  min-width: 150px;
}

.landing-state {
  color: #b8d5d0;
  font-size: 0.92rem;
}

.landing-steps {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-steps article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.landing-steps span {
  color: var(--accent);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.65rem;
}

.landing-steps h2 {
  font-size: 1.02rem;
  margin: 0 0 0.45rem;
}

.landing-steps p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 520px;
  padding: clamp(1.35rem, 4vw, 2rem);
  width: min(100%, 520px);
}

.auth-panel h2 {
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  letter-spacing: 0;
  line-height: 1.08;
  margin: 0.25rem 0 0.75rem;
}

.auth-beta {
  margin-left: 0.45rem;
  vertical-align: middle;
}

.auth-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.auth-button {
  font-size: 1rem;
  min-height: 46px;
  width: 100%;
}

.auth-state {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.9rem 0;
  padding: 0.75rem;
}

.auth-state.error {
  background: #fff1f0;
  border-color: #ffccc7;
  color: var(--danger);
}

.auth-legal {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0.75rem 0 0;
}

.auth-legal a {
  color: var(--accent-strong);
  font-weight: 750;
  text-decoration: none;
}

.auth-legal a:hover {
  text-decoration: underline;
}

.legal-page {
  background: var(--bg);
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 2.5rem);
}

.legal-document {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 auto;
  max-width: 860px;
  padding: clamp(1.25rem, 4vw, 2.25rem);
}

.legal-document h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0.35rem 0 0.8rem;
}

.legal-document h2 {
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
  margin: 1.4rem 0 0.45rem;
  padding-top: 1rem;
}

.legal-document p,
.legal-document li {
  color: var(--muted);
  line-height: 1.65;
}

.legal-document ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.legal-document a {
  color: var(--accent-strong);
  font-weight: 750;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  min-height: calc(100vh - 92px);
}

.control-panel {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 1rem;
}

.panel-section {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0 1.1rem;
}

.panel-section:first-child {
  padding-top: 0;
}

.panel-section h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.upload-box {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 0.9rem;
}

.button-row {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr;
  margin-top: 0.75rem;
}

.helper {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.current-roster {
  background: #eef8f6;
  border: 1px solid #b9ddd6;
  border-radius: var(--radius);
  color: #0f5e56;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0.7rem 0 0;
  padding: 0.55rem 0.65rem;
}

code {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #25343b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  padding: 0.05rem 0.25rem;
}

.connection-card {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  display: flex;
  font-size: 0.9rem;
  font-weight: 700;
  justify-content: space-between;
  min-height: 42px;
  padding: 0.65rem 0.75rem;
}

.connection-card.connected {
  background: #ecfdf3;
  border-color: #a6e3bb;
  color: var(--ok);
}

.connection-card.warning {
  background: #fff8e1;
  border-color: #eed48a;
  color: #5f4200;
}

.developer-settings {
  border-top: 1px solid var(--line);
  margin-top: 0.9rem;
  padding-top: 0.75rem;
}

.developer-settings summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 750;
}

.segmented {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 0;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 0.25rem;
}

.segmented label,
.check-row {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: 0.45rem;
  margin: 0;
}

.segmented label {
  border-radius: 6px;
  justify-content: center;
  padding: 0.45rem;
}

.segmented label:has(input:checked) {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 750;
}

.check-row {
  font-size: 0.9rem;
  padding: 0.35rem 0;
}

.mapping-lock {
  background: var(--accent-soft);
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: var(--radius);
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 720;
  line-height: 1.4;
  margin-bottom: 0.8rem;
  padding: 0.7rem 0.75rem;
}

.workspace {
  min-width: 0;
  padding: 1rem clamp(1rem, 2vw, 1.6rem) 2rem;
}

.notice {
  background: #fff8e1;
  border: 1px solid #eed48a;
  border-radius: var(--radius);
  color: #5f4200;
  margin-bottom: 1rem;
  padding: 0.8rem 0.9rem;
}

.notice.error {
  background: #fff1f0;
  border-color: #ffccc7;
  color: var(--danger);
}

.notice.success {
  background: #ecfdf3;
  border-color: #a6e3bb;
  color: var(--ok);
}

.post-parse-backdrop {
  backdrop-filter: blur(3px);
  background: rgba(16, 32, 39, 0.48);
  inset: 0;
  position: fixed;
  z-index: 80;
}

.post-parse-backdrop[hidden] {
  display: none;
}

.post-parse-panel {
  align-items: start;
  background: var(--surface);
  border: 1px solid rgba(15, 118, 110, 0.32);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 22px 60px rgba(16, 32, 39, 0.28);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  justify-content: start;
  left: 50%;
  margin: 0;
  max-height: calc(100vh - 8rem);
  max-width: 680px;
  overflow: auto;
  padding: 1.1rem;
  position: fixed;
  top: clamp(6rem, 12vh, 8rem);
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 2rem));
  z-index: 81;
}

.post-parse-panel[hidden] {
  display: none;
}

.post-parse-copy {
  min-width: 0;
}

.post-parse-kicker {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0;
  margin: 0 0 0.2rem;
  text-transform: uppercase;
}

.post-parse-panel h2 {
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.25;
  margin: 0;
}

.post-parse-panel p {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.post-parse-actions {
  align-items: stretch;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 360px);
}

.post-parse-actions button {
  white-space: nowrap;
  width: 100%;
}

.sync-status {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 10px;
  box-sizing: border-box;
  box-shadow: 0 18px 45px rgba(16, 32, 39, 0.18);
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 58px minmax(0, 1fr);
  height: 200px;
  overflow: hidden;
  padding: 1rem;
  position: fixed;
  right: clamp(1rem, 2vw, 1.6rem);
  top: calc(92px + 1rem);
  width: min(480px, calc(100vw - 2rem));
  z-index: 30;
}

.sync-status[hidden] {
  display: none;
}

.sync-status-icon {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 1.2rem;
  font-weight: 850;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.sync-status-icon::before {
  content: "";
}

.sync-status.syncing .sync-status-icon::before {
  animation: sync-spin 0.9s linear infinite;
  border: 3px solid rgba(15, 118, 110, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  content: "";
  height: 20px;
  width: 20px;
}

.sync-status.success {
  border-left-color: var(--ok);
}

.sync-status.success .sync-status-icon {
  background: #dcfce7;
  border-color: #86efac;
  color: var(--ok);
}

.sync-status.success .sync-status-icon::before {
  content: "✓";
}

.sync-status.error {
  border-left-color: var(--danger);
}

.sync-status.error .sync-status-icon {
  background: #fee2e2;
  border-color: #fecaca;
  color: var(--danger);
}

.sync-status.error .sync-status-icon::before {
  content: "!";
}

.sync-status-copy {
  min-width: 0;
}

.sync-status-label,
.sync-status-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.sync-status h2 {
  color: var(--text);
  font-size: 1.08rem;
  letter-spacing: 0;
  line-height: 1.25;
  margin: 0.15rem 0 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-status p {
  margin: 0;
}

#syncStatusDetail {
  color: var(--muted);
  display: -webkit-box;
  height: 2.9rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
  overflow: hidden;
}

.sync-progress {
  background: var(--surface-muted);
  border-radius: 999px;
  height: 8px;
  margin: 0.85rem 0 0.45rem;
  overflow: hidden;
}

.sync-progress span {
  background: var(--accent);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 180ms ease;
  width: 0%;
}

.sync-status.success .sync-progress span {
  background: var(--ok);
}

.sync-status.error .sync-progress span {
  background: var(--danger);
}

#syncGoogleButton.is-syncing {
  position: relative;
}

#syncGoogleButton.is-syncing::before {
  animation: sync-spin 0.9s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 14px;
  margin-right: 0.5rem;
  vertical-align: -2px;
  width: 14px;
}

@keyframes sync-spin {
  to {
    transform: rotate(360deg);
  }
}

.summary-band {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  margin-bottom: 1rem;
  overflow: hidden;
}

.metric {
  border-right: 1px solid var(--line);
  padding: 0.9rem;
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 730;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  font-size: 1.35rem;
  margin-top: 0.25rem;
}

.tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.tab {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  min-width: 96px;
}

.tab.active {
  border-bottom-color: var(--accent);
  color: var(--text);
  font-weight: 760;
}

.tab-content {
  min-width: 0;
}

.empty-state {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  min-height: 340px;
  place-content: center;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 0.35rem;
}

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

table {
  border-collapse: collapse;
  min-width: 920px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-muted);
  color: #314149;
  font-size: 0.78rem;
  letter-spacing: 0;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}

tr:last-child td {
  border-bottom: 0;
}

td input[type="text"],
td input[type="datetime-local"] {
  min-width: 110px;
}

.status-pill {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 760;
  padding: 0.2rem 0.48rem;
}

.status-pill.ok {
  background: #dcfce7;
  color: var(--ok);
}

.status-pill.warn {
  background: #fef3c7;
  color: var(--warning);
}

.section-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin: 0 0 0.75rem;
}

.section-heading h2 {
  font-size: 1.05rem;
  margin: 0;
}

.section-heading p {
  color: var(--muted);
  margin: 0;
}

.event-list {
  display: grid;
  gap: 0.65rem;
}

.event-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
}

.event-row h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.event-row p {
  color: var(--muted);
  margin: 0.2rem 0;
}

.calendar-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
}

.calendar-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-width: 920px;
  padding: 1rem;
}

.calendar-kicker {
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 820;
  letter-spacing: 0;
  margin: 0 0 0.15rem;
  text-transform: uppercase;
}

.calendar-toolbar h2 {
  font-size: 1.35rem;
  margin: 0;
}

.calendar-toolbar p {
  color: var(--muted);
  margin: 0.2rem 0 0;
}

.calendar-nav {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 0.45rem;
}

.calendar-nav button {
  min-width: 42px;
  white-space: nowrap;
}

.calendar-nav button[data-kind="calendar-prev"],
.calendar-nav button[data-kind="calendar-next"] {
  font-size: 1.35rem;
  font-weight: 760;
  padding-inline: 0.7rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  min-width: 920px;
}

.calendar-weekday {
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: #314149;
  font-size: 0.76rem;
  font-weight: 820;
  padding: 0.55rem 0.65rem;
  text-transform: uppercase;
}

.calendar-grid > *:nth-child(7n) {
  border-right: 0;
}

.calendar-day {
  background: #fff;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 148px;
  padding: 0.55rem;
}

.calendar-day.outside {
  background: #f8fafb;
  color: var(--muted);
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--focus), transparent 62%);
}

.calendar-date {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 24px;
}

.calendar-date span {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 760;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding-inline: 0.2rem;
}

.calendar-date small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
  text-transform: uppercase;
}

.calendar-day.today .calendar-date span {
  background: var(--focus);
  color: #fff;
}

.calendar-events {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.calendar-event {
  align-items: center;
  border-left: 4px solid var(--line-strong);
  border-radius: 6px;
  display: flex;
  font-size: 0.78rem;
  font-weight: 720;
  height: 26px;
  min-width: 0;
  overflow: hidden;
  padding: 0 0.42rem;
}

.calendar-event span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event.flight {
  background: #dbeafe;
  border-left-color: #2563eb;
  color: #1e3a8a;
}

.calendar-event.check-in {
  background: #fef3c7;
  border-left-color: #d97706;
  color: #713f12;
}

.calendar-event.check-out {
  background: #e0e7ff;
  border-left-color: #4f46e5;
  color: #312e81;
}

.calendar-event.hotel {
  background: #dcfce7;
  border-left-color: #16a34a;
  color: #14532d;
}

.calendar-event.activity {
  background: #f1f5f9;
  border-left-color: #64748b;
  color: #334155;
}

.calendar-event.standby {
  background: #e0f2fe;
  border-left-color: #0284c7;
  color: #075985;
}

.calendar-event.off-leave {
  background: #f3e8ff;
  border-left-color: #9333ea;
  color: #581c87;
}

.calendar-more {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 720;
  padding: 0.1rem 0.42rem;
}

.history-layout {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
}

.history-list {
  display: grid;
  gap: 0.65rem;
}

.history-item {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 0.85rem;
  justify-content: space-between;
  padding: 0.85rem;
}

.history-item.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.history-item h3,
.history-detail h3 {
  font-size: 1rem;
  margin: 0;
}

.history-item h3 span {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-block;
  font-size: 0.72rem;
  margin-left: 0.4rem;
  padding: 0.1rem 0.42rem;
  vertical-align: middle;
}

.history-item p,
.history-detail p {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.history-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.history-deltas {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1rem 0 0;
}

.history-deltas div {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem;
}

.history-deltas dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
  text-transform: uppercase;
}

.history-deltas dd {
  font-size: 1.2rem;
  font-weight: 760;
  margin: 0.15rem 0 0;
}

.change-list {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 0.85rem;
}

.change-list h4 {
  font-size: 0.9rem;
  margin: 0 0 0.45rem;
}

.change-list ul {
  color: var(--muted);
  margin: 0;
  padding-left: 1.1rem;
}

.sync-log {
  background: #0b1418;
  border-radius: var(--radius);
  color: #d7f5ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  max-height: 220px;
  overflow: auto;
  padding: 0.85rem;
  white-space: pre-wrap;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .control-panel {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .summary-band {
    grid-template-columns: repeat(3, 1fr);
  }

  .history-layout {
    grid-template-columns: 1fr;
  }

  .landing-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .button-row,
  .summary-band {
    grid-template-columns: 1fr;
  }

  .post-parse-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .post-parse-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sync-status {
    bottom: 1rem;
    right: 1rem;
    top: auto;
  }
}
