:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-soft: #eef6f4;
  --line: #d8e3e2;
  --text: #172326;
  --muted: #647376;
  --teal: #127c78;
  --teal-dark: #0d5f5c;
  --blue: #2f6fb2;
  --amber: #b7791f;
  --red: #b42318;
  --shadow: 0 12px 32px rgba(20, 46, 50, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  background: linear-gradient(120deg, #ecf5f2 0%, #f8fbfb 58%, #e7f0f4 100%);
}

.login-visual {
  padding: 64px;
  display: flex;
  align-items: center;
}

.login-copy {
  max-width: 680px;
}

.login-copy h1 {
  margin: 0 0 18px;
  line-height: 1.12;
}

.login-copy h1 span {
  display: block;
}

.login-title-company {
  color: #33474b;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.28;
}

.login-title-main {
  margin-top: 8px;
  color: var(--text);
  font-size: 58px;
  font-weight: 800;
  line-height: 1.04;
}

.login-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.login-panel {
  background: var(--surface);
  padding: 52px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow);
}

.login-panel h2 {
  width: 100%;
  max-width: 320px;
  margin: 0 0 24px;
  font-size: 23px;
}

.login-panel > p {
  width: 100%;
  max-width: 320px;
  margin: 0 0 18px;
}

.login-panel form {
  width: 100%;
  max-width: 320px;
}

.login-panel .field + .field {
  margin-top: 16px;
}

.login-panel .form-actions .button {
  width: 100%;
}

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

.sidebar {
  background: #123234;
  color: #fff;
  padding: 54px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a,
.nav button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.nav a:hover,
.nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.main {
  min-width: 0;
  padding: 34px;
}

.sidebar-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #d9e0e0;
  border-radius: 8px;
  background: #fff;
  color: #123234;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: #f2f6f6;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  display: none;
}

body.sidebar-collapsed .main {
  padding-left: 64px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 30px;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

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

.button.danger {
  background: #fff4f2;
  color: var(--red);
  border-color: #ffd2ca;
}

.button.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.panel,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-title h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.panel-title p {
  margin: 0;
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  padding: 18px;
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
}

.kpi-value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

.data-table th {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.table-input {
  width: 100%;
  min-width: 96px;
  max-width: 160px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.store-no-input {
  font-variant-numeric: tabular-nums;
}

.number {
  text-align: right;
}

.muted {
  color: var(--muted);
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-soft);
  color: var(--teal-dark);
}

.status.draft {
  background: #eef2f7;
  color: #46576f;
}

.status.published {
  background: #e6f5ef;
  color: #0f684f;
}

.status.archived {
  background: #f7efe3;
  color: #85590f;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
label.field {
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 10px 11px;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.service-item-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.service-item-options.readonly {
  grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
  max-height: none;
}

.service-item-chip {
  display: inline-flex;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: #e6f5ef;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.check-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 5px;
  background: #f8fbfb;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.check-option input {
  width: auto;
  margin-top: 2px;
  flex: 0 0 auto;
}

.check-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.report-page {
  min-height: 100vh;
  background: #f5f8f8;
}

.report-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.report-brand strong {
  display: block;
  font-size: 18px;
}

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

.report-main {
  padding: 28px;
  max-width: 1280px;
  margin: 0 auto;
}

.report-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  margin-bottom: 18px;
}

.report-control {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.control-step {
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.control-step.neutral {
  width: auto;
  min-width: 42px;
  padding: 0 7px;
  border-radius: 5px;
  background: #54666a;
}

.control-copy small,
.control-copy strong {
  display: block;
}

.control-copy small {
  color: var(--muted);
  font-size: 11px;
}

.control-copy strong {
  margin-top: 2px;
  font-size: 14px;
}

.report-control select {
  grid-column: 1 / -1;
  margin-top: 7px;
}

.report-control-submit {
  align-self: stretch;
  min-width: 108px;
}

.comparison-guide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #edf3f8;
  border: 1px solid #d7e2ee;
  border-radius: 6px;
}

.comparison-guide.active {
  background: #fff7e9;
  border-color: #ecd6a9;
}

.comparison-guide strong {
  white-space: nowrap;
}

.comparison-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.comparison-guide a {
  margin-left: auto;
  color: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}

.report-hero {
  padding: 28px;
  background: #113b3f;
  color: #fff;
  border-radius: 8px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.report-hero h1 {
  margin: 0 0 8px;
  font-size: 34px;
}

.report-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.report-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #a9d7d1;
  font-size: 12px;
  font-weight: 800;
}

.compare-badge {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.period-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.period-context > div {
  padding: 16px;
  background: var(--surface);
}

.period-context span,
.period-context strong {
  display: block;
}

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

.period-context strong {
  margin-top: 4px;
}

.period-context p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.period-context .compare-context {
  background: #fff8e9;
}

.analysis-toolbar {
  margin: 22px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.analysis-heading h2 {
  margin: 0;
  font-size: 22px;
}

.analysis-heading p {
  margin: 5px 0 0;
  color: var(--muted);
}

.analysis-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
  padding-bottom: 8px;
  overflow-x: auto;
}

.analysis-tab {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.analysis-tab.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.span-4 {
  grid-column: span 4;
}

.span-6 {
  grid-column: span 6;
}

.span-12 {
  grid-column: span 12;
}

.chart {
  height: 320px;
}

.heatmap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.heatmap-table th,
.heatmap-table td {
  border: 1px solid var(--line);
  padding: 6px;
  text-align: center;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.heatmap-table td strong,
.heatmap-table td small {
  display: block;
}

.heatmap-table td small {
  min-height: 14px;
  margin-top: 2px;
  opacity: 0.72;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-head {
  padding: 4px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.calendar-day {
  min-height: 82px;
  padding: 9px;
  border: 1px solid rgba(24, 52, 54, 0.08);
  border-radius: 5px;
}

.calendar-day span,
.calendar-day strong,
.calendar-day small,
.year-month span,
.year-month strong,
.year-month small {
  display: block;
}

.calendar-day strong {
  margin-top: 7px;
}

.calendar-day small,
.year-month small {
  margin-top: 3px;
  opacity: 0.72;
}

.year-highlights,
.busy-summary,
.import-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.year-highlights > div,
.busy-summary > div,
.import-summary-grid > div {
  padding: 14px;
  background: var(--surface);
}

.year-highlights span,
.year-highlights strong,
.year-highlights small,
.busy-summary span,
.busy-summary strong,
.busy-summary small,
.import-summary-grid span,
.import-summary-grid strong {
  display: block;
}

.year-highlights span,
.busy-summary span,
.import-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.year-highlights strong,
.busy-summary strong,
.import-summary-grid strong {
  margin-top: 6px;
  font-size: 18px;
}

.year-highlights small,
.busy-summary small {
  margin-top: 4px;
  color: var(--muted);
}

.year-month-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.year-month {
  min-height: 94px;
  padding: 11px;
  border: 1px solid rgba(24, 52, 54, 0.08);
  border-radius: 5px;
}

.year-month strong {
  margin-top: 10px;
  font-size: 18px;
}

.busy-summary {
  margin-top: 16px;
  margin-bottom: 0;
}

.heat-none,
.empty-data {
  background: #f1f4f5;
  color: #94a1a3;
}

.heat-low { background: #e8f3f1; color: #245c58; }
.heat-calm { background: #d8e9f3; color: #315d7b; }
.heat-medium { background: #f2e8c8; color: #745b1e; }
.heat-high { background: #eccda9; color: #764719; }
.heat-peak { background: #c86e5d; color: #fff; }

.distribution-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: center;
}

.distribution-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.distribution-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
}

.distribution-list small {
  min-width: 48px;
  color: var(--muted);
  text-align: right;
}

.report-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.report-details summary {
  padding: 14px 0;
  cursor: pointer;
  font-weight: 800;
}

.kpi-value small {
  font-size: 14px;
}

.kpi-delta {
  margin-top: 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.kpi-delta.up {
  color: var(--red);
}

.upload-rows {
  display: grid;
  gap: 12px;
}

.upload-row {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfb;
}

.upload-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.upload-row legend {
  padding: 0;
  font-weight: 800;
}

.upload-row-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px minmax(240px, 1.3fr);
  gap: 12px;
}

.upload-actions {
  justify-content: space-between;
}

.upload-result {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid #bee1d4;
  border-radius: 6px;
  background: #eff9f5;
}

.upload-result.partial,
.upload-result.error {
  border-color: #efcf9a;
  background: #fff8eb;
}

.upload-result ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.form-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.import-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.exclusion-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.exclusion-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.report-print-meta {
  display: none;
}

[hidden] {
  display: none !important;
}

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

  .sidebar {
    position: static;
  }

  .login-visual {
    padding: 34px;
  }

  .login-title-company {
    font-size: 24px;
  }

  .login-title-main {
    font-size: 36px;
  }

  .report-header {
    padding: 12px 16px;
    align-items: flex-start;
  }

  .report-header .actions {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .report-main {
    padding: 28px 16px;
  }

  .report-hero h1 {
    font-size: 28px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .kpi-grid,
  .form-grid,
  .report-controls {
    grid-template-columns: 1fr;
  }

  .report-control-submit,
  .comparison-guide {
    grid-column: 1;
  }

  .comparison-guide {
    align-items: flex-start;
    flex-direction: column;
  }

  .comparison-guide a {
    margin-left: 0;
  }

  .period-context,
  .year-highlights,
  .busy-summary,
  .import-summary-grid,
  .distribution-layout,
  .upload-row-grid,
  .exclusion-list {
    grid-template-columns: 1fr;
  }

  .analysis-tabs {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
  }

  .year-month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-day {
    min-height: 70px;
    padding: 6px;
  }

  .span-4,
  .span-6,
  .span-12 {
    grid-column: span 12;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body,
  .report-page {
    background: #fff;
  }

  .no-print,
  .sidebar {
    display: none !important;
  }

  .report-main {
    max-width: none;
    padding: 0;
  }

  .report-print-meta {
    display: block;
    margin-bottom: 10mm;
    padding-bottom: 5mm;
    border-bottom: 2px solid #173f42;
  }

  .report-print-meta > span {
    color: #4f6669;
    font-size: 10pt;
    font-weight: 800;
  }

  .report-print-meta h1 {
    margin: 2mm 0 4mm;
    font-size: 22pt;
  }

  .report-print-meta dl {
    display: flex;
    gap: 12mm;
    margin: 0;
  }

  .report-print-meta dl div {
    display: flex;
    gap: 3mm;
  }

  .report-print-meta dt {
    color: #657578;
  }

  .report-print-meta dd {
    margin: 0;
    font-weight: 800;
  }

  .report-hero {
    padding: 8mm;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .panel,
  .card,
  .period-context {
    box-shadow: none;
    break-inside: avoid;
  }

  .report-grid {
    display: block;
  }

  .report-grid > .panel {
    margin-bottom: 8mm;
  }

  .chart {
    height: 120mm;
  }

  .heat-low,
  .heat-calm,
  .heat-medium,
  .heat-high,
  .heat-peak,
  .heat-none {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* Analyst workspace */
.analyst-workspace {
  --workspace-teal: #006c66;
  --workspace-teal-dark: #07514e;
  --workspace-blue: #4a90e2;
  --workspace-amber: #d39a1f;
  --workspace-ink: #183035;
  --workspace-muted: #66777a;
  --workspace-line: #dbe3e4;
  --workspace-soft: #f5f8f8;
  min-width: 0;
  background: #f3f6f7;
  color: var(--workspace-ink);
}

.workspace-header {
  height: 64px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid var(--workspace-line);
  background: #ffffff;
}

.workspace-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-right: 1px solid var(--workspace-line);
  color: var(--workspace-teal-dark);
}

.workspace-brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.workspace-brand-mark img {
  width: 32px;
  height: 32px;
}

.workspace-brand strong,
.workspace-brand small {
  display: block;
  line-height: 1;
}

.workspace-brand strong {
  font-size: 13px;
  letter-spacing: 0.08em;
}

.workspace-brand small {
  margin-top: 4px;
  color: #778789;
  font-size: 9px;
  letter-spacing: 0.18em;
}

.workspace-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
}

.workspace-title > div {
  min-width: 0;
}

.workspace-title span,
.workspace-title h1 {
  display: block;
}

.workspace-title > div > span {
  margin-bottom: 3px;
  color: var(--workspace-muted);
  font-size: 10px;
}

.workspace-title h1 {
  max-width: 430px;
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-period {
  padding-left: 18px;
  border-left: 1px solid var(--workspace-line);
  color: #3f5559;
  font-size: 13px;
  white-space: nowrap;
}

.workspace-compare-chip {
  width: max-content;
  padding: 5px 8px;
  border: 1px solid #e5ce99;
  border-radius: 4px;
  background: #fff8e8;
  color: #7a5712;
  font-size: 11px;
  font-weight: 700;
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
}

.workspace-button,
.icon-text-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid #cfdadb;
  border-radius: 4px;
  background: #ffffff;
  color: #2c4549;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.workspace-button:hover,
.icon-text-button:hover {
  border-color: var(--workspace-teal);
  color: var(--workspace-teal);
}

.workspace-button.primary {
  border-color: var(--workspace-teal);
  background: var(--workspace-teal);
  color: #ffffff;
}

.workspace-filterbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 7px 20px;
  border-bottom: 1px solid var(--workspace-line);
  background: #fbfcfc;
}

.workspace-filterbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.workspace-filterbar label > span {
  color: var(--workspace-muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.workspace-filterbar select {
  height: 32px;
  min-width: 138px;
  padding: 0 28px 0 9px;
  border: 1px solid #ccd7d8;
  border-radius: 4px;
  background-color: #ffffff;
  color: #293f43;
  font-size: 12px;
  font-weight: 700;
}

.workspace-filterbar select:disabled {
  color: #899698;
  background: #f0f3f3;
}

.workspace-filterbar .scope-filter select {
  min-width: 210px;
  border-color: #9fc4c0;
  color: var(--workspace-teal-dark);
}

.filter-status {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: var(--workspace-muted);
  font-size: 11px;
}

.filter-status svg {
  flex: 0 0 auto;
  color: var(--workspace-teal);
}

.filter-status span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-status.active {
  color: #755513;
}

.filter-status a {
  flex: 0 0 auto;
  color: var(--workspace-blue);
  font-weight: 700;
}

.workspace-body {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 16px 20px 28px;
}

.workspace-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--workspace-line);
  border-radius: 5px;
  background: #ffffff;
}

.workspace-kpi {
  min-width: 0;
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-right: 1px solid var(--workspace-line);
}

.workspace-kpi:last-child {
  border-right: 0;
}

.workspace-kpi-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #e8f3f1;
  color: var(--workspace-teal);
}

.workspace-kpi-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.workspace-kpi > div {
  min-width: 0;
}

.workspace-kpi > div > span,
.workspace-kpi strong,
.workspace-kpi em {
  display: block;
}

.workspace-kpi > div > span {
  color: var(--workspace-muted);
  font-size: 10px;
  font-weight: 700;
}

.workspace-kpi strong {
  margin-top: 4px;
  overflow: hidden;
  font-size: 23px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-kpi strong small {
  font-size: 11px;
  font-weight: 700;
}

.workspace-kpi em {
  margin-top: 6px;
  color: #839093;
  font-size: 9px;
  font-style: normal;
}

.workspace-kpi em.up {
  color: #b05540;
}

.workspace-kpi em.down {
  color: var(--workspace-teal);
}

.workspace-kpi em.kpi-sub {
  font-size: 11px;
  color: #5f6f70;
}

.heading-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.trend-toggle {
  display: inline-flex;
  border: 1px solid #d7e0e1;
  border-radius: 8px;
  overflow: hidden;
}

.trend-toggle button {
  border: 0;
  background: #fff;
  color: #5e6c70;
  font-size: 11px;
  padding: 5px 11px;
  cursor: pointer;
}

.trend-toggle button + button {
  border-left: 1px solid #d7e0e1;
}

.trend-toggle button.active {
  background: #006c66;
  color: #fff;
}

.workspace-overview {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(180px, 0.72fr) minmax(230px, 0.82fr);
  gap: 12px;
  margin-top: 12px;
}

.trend-workspace,
.insight-rail,
.comparison-panel,
.workspace-panel {
  min-width: 0;
  border: 1px solid var(--workspace-line);
  border-radius: 5px;
  background: #ffffff;
}

.trend-workspace {
  padding: 14px 16px 8px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

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

.section-heading > div {
  min-width: 0;
}

.section-heading span,
.comparison-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--workspace-teal);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.section-heading h2,
.comparison-panel h2 {
  margin: 0;
  color: var(--workspace-ink);
  font-size: 15px;
  line-height: 1.35;
}

.section-heading h2 svg {
  margin-right: 6px;
  vertical-align: -3px;
}

.section-heading p {
  margin: 3px 0 0;
  color: var(--workspace-muted);
  font-size: 10px;
  line-height: 1.45;
}

.icon-text-button {
  min-height: 29px;
  flex: 0 0 auto;
  padding: 5px 8px;
  font-size: 10px;
}

.workspace-chart {
  height: 270px;
}

.insight-rail,
.comparison-panel {
  min-height: 342px;
  padding: 14px;
}

.insight-rail dl {
  margin: 0;
}

.insight-rail dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 65px;
  padding: 8px 0;
  border-bottom: 1px solid #edf1f2;
}

.insight-rail dl > div:last-child {
  border-bottom: 0;
}

.insight-note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--workspace-muted);
}

.insight-rail dt {
  color: var(--workspace-muted);
  font-size: 10px;
}

.insight-rail dd {
  margin: 0;
  color: #213a3e;
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}

.insight-rail dd small {
  display: block;
  margin-top: 3px;
  color: var(--workspace-muted);
  font-size: 9px;
  font-weight: 400;
}

.comparison-panel {
  position: relative;
  overflow: hidden;
  background: #f7faf9;
}

.comparison-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  background: var(--workspace-teal);
}

.comparison-panel.active::before {
  background: var(--workspace-amber);
}

.comparison-panel p {
  margin: 13px 0 0;
  color: var(--workspace-muted);
  font-size: 11px;
  line-height: 1.7;
}

.comparison-panel ol {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.comparison-panel li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #43585c;
  font-size: 11px;
}

.comparison-panel li span {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 1px solid #b8cecb;
  border-radius: 50%;
  color: var(--workspace-teal);
  font-size: 9px;
  font-weight: 800;
}

.comparison-periods {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 7px;
  align-items: center;
  margin-top: 16px;
}

.comparison-periods strong {
  padding: 8px 5px;
  border: 1px solid var(--workspace-line);
  border-radius: 4px;
  background: #ffffff;
  font-size: 10px;
  text-align: center;
}

.comparison-periods span {
  color: var(--workspace-muted);
  font-size: 9px;
}

.comparison-panel > a {
  display: inline-block;
  margin-top: 15px;
  color: var(--workspace-blue);
  font-size: 10px;
  font-weight: 700;
}

.workspace-tabs {
  min-height: 47px;
  display: flex;
  align-items: stretch;
  gap: 18px;
  margin-top: 12px;
  border: 1px solid var(--workspace-line);
  border-radius: 5px 5px 0 0;
  background: #ffffff;
}

.workspace-tab-list {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
}

.workspace-tab-list button {
  min-width: 92px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid #edf1f2;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--workspace-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.workspace-tab-list button.active {
  border-bottom-color: var(--workspace-teal);
  color: var(--workspace-teal);
  background: #f4f9f8;
}

.workspace-tabs > p {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 0 auto;
  overflow: hidden;
  color: var(--workspace-muted);
  font-size: 10px;
  white-space: nowrap;
}

.workspace-tabs > p strong {
  color: #2f474b;
}

.workspace-tabs > p span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-details {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--workspace-line);
  border-top: 0;
  border-radius: 0 0 5px 5px;
  background: #ffffff;
}

.workspace-details > .report-section {
  flex: 1 1 100%;
  padding: 14px 16px;
  border: 1px solid var(--workspace-line);
  border-radius: 8px;
  background: #ffffff;
}

.workspace-details > .report-col {
  flex: 1 1 calc(50% - 8px);
  min-width: 300px;
}

.report-col .distribution-layout {
  grid-template-columns: 1fr;
  gap: 14px;
}

.store-metric strong {
  display: block;
  font-size: 12px;
}

.store-bar-track {
  display: block;
  height: 6px;
  margin-top: 5px;
  border-radius: 3px;
  background: #eef2f3;
  overflow: hidden;
}

.store-bar {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: #006c66;
}

.store-bar.amber {
  background: #d39a1f;
}

.store-table td {
  vertical-align: middle;
}

.store-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.ticket-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--workspace-line);
  border-radius: 8px;
}

.ticket-heading {
  align-items: center;
}

.ticket-filter {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.ticket-filter label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ticket-filter label span {
  display: inline;
  margin: 0;
  color: var(--workspace-muted);
  font-size: 11px;
  letter-spacing: 0;
}

.ticket-filter select {
  min-width: 104px;
  padding: 7px 28px 7px 10px;
  border: 1px solid var(--workspace-line);
  border-radius: 6px;
  background: #fff;
  color: var(--foreground);
  font: inherit;
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.ticket-table th,
.ticket-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #eef2f3;
  text-align: left;
}

.ticket-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f7f7;
  color: #5f7073;
  border-bottom: 1px solid #dde6e6;
}

.ticket-table tbody tr:hover td {
  background: #f8fafa;
}

.ticket-excluded td {
  color: #aab4b5;
  background: #f4f6f6;
}

.preview-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.preview-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.preview-check.warn {
  border-color: #f0c9a0;
  background: #fdf4ea;
}

.preview-check-mark {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.preview-check.ok .preview-check-mark {
  background: #2e9e6f;
}

.preview-check.warn .preview-check-mark {
  background: #d98324;
}

.preview-check.unknown .preview-check-mark {
  background: #9aa7a9;
}

.preview-check-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.preview-check-label {
  font-size: 11px;
  color: var(--muted);
}

.preview-check-body strong {
  font-size: 14px;
  word-break: break-word;
}

.preview-check-body small {
  font-size: 11px;
  color: var(--muted);
}

.row-filter {
  min-width: 220px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
}

.row-filter:focus {
  outline: none;
  border-color: #1f7d72;
  box-shadow: 0 0 0 3px rgba(31, 125, 114, 0.12);
}

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}

.sort-header:hover {
  color: #1f7d72;
}

.sort-header .sort-idle {
  opacity: 0.35;
}

.is-selected-row td {
  background: #eef5f3;
}

.combobox {
  position: relative;
}

.combobox-input {
  width: 100%;
}

.combobox-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  max-height: 240px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.combobox-list button {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.combobox-list button:hover {
  background: #eef5f3;
}

.combobox-empty {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 38, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal {
  width: min(940px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0 0 4px;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-body {
  overflow: auto;
}

.batch-table {
  font-size: 12px;
}

.batch-table th {
  position: sticky;
  top: 0;
  background: #f1f6f5;
  z-index: 1;
}

.batch-index {
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.batch-warn td {
  background: #fdf5ea;
}

.batch-skip td {
  background: #f5f7f7;
  color: #9aa7a9;
}

.batch-flag {
  display: block;
  margin-top: 2px;
  color: #c9772a;
  font-size: 10px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}

.modal-foot form {
  margin: 0;
}

.dup-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.dup-list li {
  border-bottom: 1px solid var(--line);
}

.dup-list li:last-child {
  border-bottom: 0;
}

.dup-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  cursor: pointer;
}

.dup-list label span {
  flex: 1;
  font-size: 14px;
}

.dup-list label small {
  color: var(--muted);
  font-size: 12px;
}

.file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  font-size: 13px;
}

.file-list li > svg {
  flex: none;
  color: #1f7d72;
}

.file-list-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list-remove {
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: #e7eeec;
  color: #4a5b5c;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.file-list-remove:hover {
  background: #d8e3e0;
}

.batch-unchecked td {
  opacity: 0.5;
}

.auto-import {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-hint {
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  margin-left: 6px;
}

.combobox-input {
  padding-right: 30px;
}

.combobox-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #e1e8e6;
  color: #4a5b5c;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.combobox-clear:hover {
  background: #d2dcd9;
}

.combobox-list button.is-selected {
  background: #e8f4f0;
  font-weight: 600;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 26px 20px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: #f8fbfa;
  color: #5f6f70;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: #1f7d72;
  background: #f1f8f6;
  outline: none;
}

.dropzone.is-dragging {
  border-color: #1f7d72;
  background: #e8f4f0;
}

.dropzone svg {
  color: #1f7d72;
}

.dropzone strong {
  font-size: 14px;
  color: #1c2b2c;
}

.dropzone span {
  font-size: 12px;
}

.dropzone u {
  color: #1f7d72;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.app-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(18, 38, 42, 0.5);
  display: grid;
  place-items: center;
  padding: 24px;
}

.app-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 240px;
  padding: 28px 36px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.app-overlay-card strong {
  font-size: 15px;
  color: #1c2b2c;
}

.app-overlay-card span {
  font-size: 13px;
  color: #5f6f70;
}

.app-overlay-card .button {
  margin-top: 8px;
}

.app-overlay-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #d8e3e0;
  border-top-color: #1f7d72;
  border-radius: 50%;
  animation: app-spin 0.8s linear infinite;
}

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

@media (max-width: 760px) {
  .preview-checks {
    grid-template-columns: 1fr;
  }
}

.workspace-panel {
  padding: 16px;
  border: 0;
  border-radius: 0 0 5px 5px;
}

.year-matrix-wrap,
.trend-table-wrap {
  overflow-x: auto;
}

.year-matrix,
.trend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.year-matrix th,
.year-matrix td,
.trend-table th,
.trend-table td {
  height: 38px;
  padding: 6px 8px;
  border: 1px solid #e4eaeb;
  text-align: center;
  white-space: nowrap;
}

.year-matrix th,
.trend-table th {
  background: #f6f8f8;
  color: #5f7073;
  font-weight: 700;
}

.year-matrix tbody th {
  min-width: 104px;
  text-align: left;
}

.year-matrix td strong {
  font-size: 11px;
}

.compact-calendar {
  max-width: 720px;
  margin: 0 auto;
  gap: 5px;
}

.compact-calendar .calendar-day {
  min-height: 52px;
  padding: 6px 8px;
  border-radius: 6px;
}

.compact-calendar .calendar-day strong {
  margin-top: 4px;
  font-size: 11px;
}

.detail-chart {
  height: 310px;
}

.compact-distribution {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.trend-table-wrap {
  max-height: 380px;
  max-width: 560px;
  margin: 0 auto;
}

.trend-table {
  font-size: 12px;
}

.trend-table th,
.trend-table td {
  height: 34px;
  padding: 7px 14px;
  border: none;
  border-bottom: 1px solid #eef2f3;
  text-align: right;
}

.trend-table th:first-child,
.trend-table td:first-child {
  text-align: left;
}

.trend-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f7f7;
  color: #5f7073;
  border-bottom: 1px solid #dde6e6;
}

.trend-table tbody tr:nth-child(even) td {
  background: #fafbfb;
}

.data-table .store-no-data {
  color: #899698;
  background: #f7f9f9;
}

.data-table .store-no-data td:first-child small {
  display: block;
  margin-top: 3px;
  color: #9aa5a7;
  font-size: 9px;
}

.quality-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--workspace-line);
}

.quality-strip > div {
  padding: 13px;
  border-right: 1px solid var(--workspace-line);
}

.quality-strip > div:last-child {
  border-right: 0;
}

.quality-strip span,
.quality-strip strong {
  display: block;
}

.quality-strip span {
  color: var(--workspace-muted);
  font-size: 10px;
}

.quality-strip strong {
  margin-top: 5px;
  font-size: 18px;
}

.quality-reasons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.quality-reasons > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid #e0e7e8;
  border-radius: 4px;
  font-size: 11px;
}

.quality-reasons p {
  color: var(--workspace-muted);
  font-size: 11px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1080px) {
  .workspace-header {
    grid-template-columns: 184px minmax(0, 1fr) auto;
  }

  .workspace-brand {
    padding: 0 12px;
  }

  .workspace-title {
    gap: 10px;
    padding: 0 13px;
  }

  .workspace-overview {
    grid-template-columns: minmax(0, 1.7fr) minmax(180px, 0.72fr);
  }

  .comparison-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .comparison-panel ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace-filterbar {
    gap: 10px;
  }

  .workspace-filterbar label > span {
    display: none;
  }
}

@media (max-width: 760px) {
  .workspace-header {
    height: auto;
    min-height: 58px;
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }

  .workspace-brand {
    justify-content: center;
    padding: 0 8px;
  }

  .workspace-brand > span:last-child,
  .workspace-period,
  .workspace-compare-chip {
    display: none;
  }

  .workspace-title {
    padding: 8px 10px;
  }

  .workspace-title h1 {
    max-width: none;
    font-size: 14px;
  }

  .workspace-actions {
    gap: 4px;
    padding: 0 8px;
  }

  .workspace-button {
    width: 34px;
    padding: 6px;
    font-size: 0;
  }

  .workspace-button svg {
    width: 16px;
    height: 16px;
  }

  .workspace-filterbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 7px 8px;
  }

  .workspace-filterbar label,
  .workspace-filterbar select {
    width: 100%;
    min-width: 0;
  }

  .workspace-filterbar.has-scope {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-filterbar .scope-filter select {
    min-width: 0;
  }

  .filter-status {
    grid-column: 1 / -1;
    margin: 0;
  }

  .workspace-body {
    padding: 10px 8px 20px;
  }

  .workspace-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-kpi {
    min-height: 78px;
    padding: 10px;
    border-bottom: 1px solid var(--workspace-line);
  }

  .workspace-kpi:nth-child(2n) {
    border-right: 0;
  }

  .workspace-kpi:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .workspace-kpi strong {
    font-size: 19px;
  }

  .workspace-overview {
    grid-template-columns: 1fr;
  }

  .workspace-chart {
    height: 245px;
  }

  .insight-rail,
  .comparison-panel {
    min-height: auto;
  }

  .insight-rail dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insight-rail dl > div {
    display: block;
    min-height: 74px;
    padding: 10px;
    border: 1px solid #edf1f2;
  }

  .insight-rail dd {
    margin-top: 6px;
    text-align: left;
  }

  .comparison-panel ol {
    grid-template-columns: 1fr;
  }

  .workspace-tabs {
    display: block;
  }

  .workspace-tab-list button {
    min-height: 45px;
    min-width: 96px;
  }

  .workspace-tabs > p {
    min-height: 36px;
    margin: 0;
    padding: 0 12px;
    border-top: 1px solid #edf1f2;
  }

  .workspace-panel {
    padding: 12px;
  }

  .quality-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quality-strip > div:nth-child(2) {
    border-right: 0;
  }

  .quality-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--workspace-line);
  }

  .quality-reasons,
  .compact-distribution {
    grid-template-columns: 1fr;
  }

  .compact-calendar .calendar-day {
    min-height: 54px;
    padding: 5px;
  }

  .compact-calendar .calendar-day small {
    font-size: 8px;
  }
}

@media print {
  .analyst-workspace {
    background: #ffffff;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .workspace-body {
    width: 100%;
    padding: 0;
  }

  /* Keep each card intact, but let the container flow across pages. */
  .workspace-kpis,
  .workspace-overview,
  .workspace-panel,
  .workspace-details > .report-section,
  .workspace-details > .report-col {
    break-inside: avoid;
  }

  /* Stack the overview so the wide trend chart spans the full page width and
     cannot overlap the panel beside it in the PDF. */
  .workspace-overview {
    display: block;
    margin-bottom: 6mm;
  }

  .workspace-overview > * + * {
    margin-top: 6mm;
  }

  /* No active comparison: drop the "how to compare" guide from the PDF. */
  .comparison-panel:not(.active) {
    display: none;
  }

  /* Lay the data-overview items out as a compact full-width strip. */
  .insight-rail dl {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--workspace-line);
    border-radius: 4px;
    overflow: hidden;
  }

  .insight-rail dl > div {
    display: block;
    min-height: 0;
    border-bottom: 0;
    border-left: 1px solid #edf1f2;
    padding: 3mm;
  }

  .insight-rail dl > div:first-child {
    border-left: 0;
  }

  .insight-rail dd {
    margin-top: 1mm;
    text-align: left;
  }

  /* Day-by-day heatmap: its own page in the PDF, kept on a single page. */
  .report-details {
    display: block;
    break-before: page;
    break-inside: avoid;
    margin-top: 0;
  }

  .report-details summary {
    list-style: none;
    font-size: 8.5pt;
    font-weight: 700;
    margin-bottom: 2mm;
    cursor: default;
  }

  .report-details summary::-webkit-details-marker {
    display: none;
  }

  .report-details .details-body {
    display: block;
  }

  /* Shrink wide heatmap tables so the columns fit one page width. */
  .heatmap-table {
    font-size: 6.4pt;
    width: 100%;
  }

  .heatmap-table th,
  .heatmap-table td {
    padding: 0.5mm;
    word-break: break-all;
    overflow: hidden;
  }

  .heatmap-table td small {
    min-height: 0;
    margin-top: 0;
  }

  .heatmap-table tr {
    break-inside: avoid;
  }

  /* The ticket list is a screen view; the Excel export is its print form. */
  .ticket-section {
    display: none;
  }

  .workspace-chart {
    height: 80mm;
  }

  .insight-rail,
  .comparison-panel {
    min-height: 0;
  }

  .workspace-panel {
    padding: 5mm;
    border: 1px solid var(--workspace-line);
    margin-bottom: 6mm;
  }

  .workspace-details {
    display: block;
    padding: 0;
    border: 0;
  }

  .workspace-details > .report-section,
  .workspace-details > .report-col {
    flex: none;
    min-width: 0;
    padding: 5mm;
    border: 1px solid var(--workspace-line);
    margin-bottom: 6mm;
  }

  .detail-chart {
    height: 72mm;
  }

  .trend-table-wrap {
    max-height: none;
    max-width: none;
  }

  .report-col .distribution-layout {
    grid-template-columns: minmax(0, 1fr) 62mm;
  }
}
