:root {
  color-scheme: light;
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --line: #d8e1e8;
  --text: #17212b;
  --muted: #647386;
  --brand: #0f6f78;
  --brand-dark: #0d4d59;
  --brand-soft: #e7f3f4;
  --accent: #c7872a;
  --danger: #ba3636;
  --success: #237a4b;
  --shadow: 0 12px 26px rgba(23, 33, 43, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-x: none;
}
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: "Yu Gothic", "Meiryo", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  touch-action: manipulation;
}
button, input, select, textarea { font-family: inherit; }
input, select, textarea {
  font-size: 16px;
  max-width: 100%;
}
img, svg, video, canvas { max-width: 100%; }
button {
  font: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: .52;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(15, 111, 120, 0.35);
  outline-offset: 2px;
}

.login-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
}
.login-panel {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.brand-mark {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}
.login-panel h1 { margin: 18px 0 8px; font-size: 27px; }
.login-panel p { margin: 0 0 24px; color: var(--muted); line-height: 1.7; }
.login-form { display: grid; gap: 10px; }
.login-form label { font-weight: 700; }
.login-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}
.login-form button,
.upload-box button,
.secondary-button,
.small-button,
.primary-action-button,
.sidebar-feature-button,
.sidebar-link-button,
.sidebar-reset-button,
.top-logout-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: 0 16px;
}
.form-error { min-height: 22px; color: var(--danger); }
body.public-mode .logout-action { display: none; }

.app-shell {
  min-height: 100dvh;
  display: block;
  padding-bottom: calc(224px + env(safe-area-inset-bottom));
}
.sidebar {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 22px rgba(23, 33, 43, 0.1);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
.sidebar-brand,
.ghost-button { display: none; }
.nav-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  width: min(720px, 100%);
  max-width: 720px;
  margin: 0 auto;
}
.nav-item {
  width: 100%;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 4px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.nav-item.active,
.nav-item:hover {
  background: var(--brand-soft);
  border-color: #bbdadd;
  color: var(--brand-dark);
}
.sidebar-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-width: 720px;
  margin: 6px auto 0;
}
.sidebar-link-button,
.sidebar-feature-button,
.sidebar-reset-button {
  min-height: 38px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
.sidebar-feature-button {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid #b7d8dc;
}
.sidebar-feature-button.active,
.sidebar-feature-button:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.sidebar-link-button {
  background: #fff;
  color: var(--brand-dark);
  border: 1px solid #b7d8dc;
}
.sidebar-reset-button {
  background: #fff5f0;
  color: #9a4f0e;
  border: 1px solid #e5b47f;
}

.main {
  width: min(720px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 14px 16px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin: 0 -14px 12px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 12px;
  background: rgba(238, 243, 247, 0.96);
  border-bottom: 1px solid rgba(216, 225, 232, 0.8);
}
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.topbar h1 { margin: 0; font-size: 24px; line-height: 1.2; }
.topbar-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex: 1 1 190px;
  min-width: 0;
}
.top-logout-button {
  min-height: 36px;
  padding: 0 10px;
  background: #dce6ec;
  color: var(--text);
  font-size: 12px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 0 11px;
  font-size: 13px;
  white-space: nowrap;
}
.status-pill.ok { color: var(--success); border-color: #9fd5b8; }
.status-pill.warn { color: var(--danger); border-color: #dfb0b0; }
.month-pill {
  border-color: #b7d8dc;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 800;
}

.view { display: none; }
.view.active { display: block; }
.dashboard-context {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 10px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.metric-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.metric-card {
  min-height: 92px;
  padding: 14px;
}
.metric-card span { display: block; color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin-top: 8px; font-size: 23px; line-height: 1.15; overflow-wrap: anywhere; }
.tappable-card {
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.tappable-card:hover,
.tappable-card:focus-visible {
  border-color: #72b8c0;
  box-shadow: 0 8px 20px rgba(15, 111, 120, .14);
  outline: 0;
}
.tappable-card:active {
  transform: translateY(1px);
}
.tappable-card::after {
  content: "開く";
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.panel { padding: 16px; margin-bottom: 12px; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.panel-heading > * { min-width: 0; }
.panel h2 { margin: 0; font-size: 18px; line-height: 1.35; }
.panel-note { margin: 8px 0 16px; color: var(--muted); line-height: 1.7; }
.compact-note { margin-bottom: 0; }
.small-button { min-height: 38px; background: var(--brand-dark); }
.secondary-button { background: var(--accent); }
.primary-action-row { align-items: stretch; }
.primary-action-button {
  width: 100%;
  min-height: 56px;
  font-size: 17px;
}
.secondary-action-button {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-weight: 800;
  padding: 0 14px;
}
.quick-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.data-list,
.list-empty { display: grid; gap: 8px; color: var(--muted); }
.link-hub-panel {
  max-width: 980px;
}
.link-resource-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.link-resource-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-content: space-between;
  min-height: 148px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.link-resource-card-muted {
  background: #fbfcfd;
}
.link-resource-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.linkage-status {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}
.status-ready {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid #b7d8dc;
}
.status-optional {
  color: #7b520a;
  background: #fff6df;
  border: 1px solid #ebce88;
}
.link-resource-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}
.link-resource-card p,
.artifact-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.resource-open-button,
.resource-unavailable {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid #b7d8dc;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}
.resource-open-button:hover,
.resource-open-button:focus-visible {
  background: var(--brand-soft);
}
.resource-unavailable {
  color: var(--muted);
  border-color: var(--line);
  background: #f2f5f7;
}
.artifact-panel {
  max-width: 980px;
}
.artifact-toolbar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.artifact-toolbar input,
.artifact-toolbar .inline-status {
  grid-column: 1 / -1;
}
.artifact-toolbar .small-button {
  width: 100%;
  padding-left: 10px;
  padding-right: 10px;
}
.artifact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.artifact-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 170px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.artifact-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}
.artifact-card .resource-open-button {
  margin-top: auto;
}
.guide-panel {
  max-width: 980px;
}
.guide-callout {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid #b7d8dc;
  border-radius: 8px;
  background: var(--brand-soft);
}
.guide-callout strong {
  color: var(--brand-dark);
  font-size: 15px;
}
.guide-callout p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.guide-step-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.guide-step-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 12px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.guide-step-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}
.guide-step-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.guide-step-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}
.guide-step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.guide-step-card .resource-open-button {
  grid-column: 2;
}
.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.list-row strong { overflow-wrap: anywhere; }
.list-row span { color: var(--muted); font-size: 13px; }
.upload-box {
  display: grid;
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
}
.upload-box input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 9px;
  width: 100%;
}
.action-row { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inline-status { color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.sync-preview {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.sync-preview-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.sync-preview-heading strong {
  color: var(--brand-dark);
}
.sync-preview-heading span {
  color: var(--muted);
  font-size: 13px;
}
.sync-product-list {
  display: grid;
  max-height: 340px;
  overflow: auto;
}
.sync-product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.sync-product-row:last-child {
  border-bottom: 0;
}
.sync-product-row strong,
.sync-product-row span {
  overflow-wrap: anywhere;
}
.sync-product-row span {
  color: var(--muted);
  font-size: 13px;
}
.secondary-tools {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.secondary-tools summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  color: var(--brand-dark);
  font-weight: 700;
}
.secondary-tools .secondary-button { margin-top: 10px; width: 100%; }
.order-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.order-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}
.order-form input,
.order-form select,
.order-form textarea,
.month-toolbar input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}
.order-form textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.6;
}
.wide-field { grid-column: 1 / -1; }
.form-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.month-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.month-toolbar-extended {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.month-toolbar-extended input {
  grid-column: 1 / -1;
  max-width: none;
}
.month-toolbar-extended .small-button {
  width: 100%;
  padding-left: 10px;
  padding-right: 10px;
}
.month-toolbar .status-pill { grid-column: 1 / -1; justify-self: start; }
.month-toolbar .inline-status { grid-column: 1 / -1; }
.month-toolbar-extended .inline-status {
  grid-column: 1 / -1;
}
.confirm-button {
  background: var(--success);
}
.muted-button {
  background: #52616f;
}
.closure-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}
.closure-panel div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.closure-panel strong {
  color: var(--brand-dark);
  font-size: 17px;
}
.closure-panel span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.closure-panel b {
  color: var(--text);
}
.closure-panel.closed {
  border-color: #9fd5b8;
  background: #f5fbf7;
}
.closure-panel.open {
  border-color: #e0c28d;
  background: #fffaf0;
}
.compact-metrics {
  margin-top: 12px;
  margin-bottom: 12px;
}
#invoicePrepSummary .metric-card:first-child {
  grid-column: 1 / -1;
}
.issue-section {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 2px;
}
.section-jump-target {
  scroll-margin-top: calc(92px + env(safe-area-inset-top));
  border-radius: 8px;
}
.section-jump-target:focus { outline: 0; }
.section-jump-target.jump-highlight {
  box-shadow: 0 0 0 3px rgba(199, 135, 42, 0.26);
  transition: box-shadow .2s ease;
}
.field-jump-highlight {
  border-color: #c7872a !important;
  box-shadow: 0 0 0 3px rgba(199, 135, 42, 0.24);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.subsection-heading h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}
.work-list {
  display: grid;
  gap: 10px;
}
.work-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.issue-resolve-card {
  cursor: pointer;
  border-color: #d9c38e;
  background: #fffdf7;
}
.issue-source-card {
  cursor: pointer;
}
.issue-resolve-card:hover,
.issue-resolve-card:focus-visible,
.issue-source-card:hover,
.issue-source-card:focus-visible {
  border-color: #c7872a;
  box-shadow: 0 8px 20px rgba(199, 135, 42, .14);
  outline: 0;
}
.issue-resolve-card:active,
.issue-source-card:active { transform: translateY(1px); }
.issue-action {
  color: var(--brand-dark);
  font-weight: 800;
}
.issue-source-note {
  color: var(--muted);
  font-size: 12px;
}
.table-action-button {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}
.secondary-table-action {
  background: var(--accent);
}
.work-card-main,
.work-card-side {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.work-card-main strong,
.work-card-side b {
  overflow-wrap: anywhere;
}
.work-card-main span,
.work-card-side span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.work-card-side {
  align-content: start;
}
.canceled-card {
  border-color: #dfb0b0;
  background: #fff7f7;
}
.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.order-actions .small-button {
  min-height: 34px;
  padding: 0 12px;
}
.danger-button {
  background: var(--danger);
}
.outline-danger-button {
  background: #fff;
  color: var(--danger);
  border: 1px solid #dfb0b0;
}
.danger-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.attachment-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid #b9d6dc;
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.attachment-list a,
.attachment-chip button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 100%;
  color: var(--brand-dark);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.attachment-chip button {
  border: 0;
  border-left: 1px solid #e0eaed;
  background: #fff7f7;
  color: var(--danger);
}
.event-note {
  font-size: 12px;
}
.ok-text { color: var(--success); }
.warn-text { color: var(--danger); }
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
table { width: 100%; border-collapse: collapse; min-width: 620px; background: #fff; }
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}
th { background: var(--surface-soft); color: var(--muted); font-weight: 700; }
td { overflow-wrap: anywhere; }
.empty-table-cell {
  color: var(--muted);
  text-align: center;
}
.settings-grid { display: grid; gap: 12px; }
.settings-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.settings-grid span { display: block; color: var(--muted); font-size: 13px; }
.settings-grid strong { display: block; margin-top: 4px; overflow-wrap: anywhere; }

@media (max-width: 390px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .topbar { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .sidebar { padding-left: 6px; padding-right: 6px; }
  .nav-list { gap: 3px; }
  .nav-item { font-size: 10px; min-height: 52px; padding-left: 1px; padding-right: 1px; }
  .sidebar-actions { gap: 4px; }
  .sidebar-link-button,
  .sidebar-feature-button,
  .sidebar-reset-button { font-size: 11px; padding-left: 4px; padding-right: 4px; }
  .metric-card { padding: 12px; }
  .link-resource-card { min-height: auto; }
  .guide-step-card .resource-open-button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
  .metric-card strong { font-size: 21px; }
  #syncStatus { max-width: 116px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 720px) {
  .month-toolbar,
  .month-toolbar:not(.month-toolbar-extended) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .month-toolbar-extended { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .month-toolbar input,
  .month-toolbar .status-pill,
  .month-toolbar .inline-status {
    grid-column: 1 / -1;
  }
  .month-toolbar .small-button {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
  }
  .closure-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 980px) {
  .app-shell {
    display: grid;
    grid-template-columns: 248px 1fr;
    padding-bottom: 0;
  }
  .sidebar {
    position: static;
    min-height: 100vh;
    background: #16252f;
    color: #fff;
    border-top: 0;
    box-shadow: none;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
  .sidebar-brand {
    display: block;
    border-bottom: 1px solid rgba(255,255,255,.16);
    padding-bottom: 18px;
  }
  .sidebar-brand strong { display: block; font-size: 24px; }
  .sidebar-brand span { color: rgba(255,255,255,.72); }
  .nav-list {
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
    max-width: none;
  }
  .nav-item,
  .ghost-button {
    min-height: 42px;
    text-align: left;
    color: #fff;
    padding: 0 12px;
    font-size: 15px;
    background: transparent;
  }
  .nav-item.active,
  .nav-item:hover { background: rgba(255,255,255,.13); color: #fff; border-color: transparent; }
  .sidebar-actions {
    grid-template-columns: 1fr;
    gap: 8px;
    max-width: none;
    margin: -6px 0 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.16);
  }
  .sidebar-link-button,
  .sidebar-feature-button,
  .sidebar-reset-button {
    width: 100%;
    justify-content: flex-start;
    min-height: 42px;
    padding: 0 12px;
    font-size: 15px;
    text-align: left;
  }
  .sidebar-link-button {
    background: rgba(255,255,255,.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,.22);
  }
  .sidebar-link-button:hover { background: rgba(255,255,255,.13); }
  .sidebar-feature-button {
    background: rgba(15,111,120,.26);
    color: #d7fbff;
    border: 1px solid rgba(183,216,220,.38);
  }
  .sidebar-feature-button.active,
  .sidebar-feature-button:hover {
    background: rgba(255,255,255,.16);
    color: #fff;
    border-color: rgba(255,255,255,.34);
  }
  .sidebar-reset-button {
    background: rgba(199,135,42,.16);
    color: #ffe1b8;
    border: 1px solid rgba(229,180,127,.45);
  }
  .sidebar-reset-button:hover { background: rgba(199,135,42,.24); }
  .ghost-button {
    display: block;
    margin-top: auto;
    border: 1px solid rgba(255,255,255,.22);
  }
  body.public-mode .ghost-button { display: none; }
  .top-logout-button { display: none; }
  .topbar-actions { flex: 0 1 auto; }
  .main { width: auto; max-width: none; padding: 24px; }
  .topbar {
    position: static;
    margin: 0 0 20px;
    padding: 0;
    background: transparent;
    border-bottom: 0;
  }
  .topbar h1 { font-size: 28px; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
  .metric-card strong { font-size: 28px; }
  .link-resource-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .artifact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .guide-step-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }
  .guide-step-card .resource-open-button {
    grid-column: auto;
    justify-self: end;
  }
  .artifact-toolbar {
    grid-template-columns: 220px max-content minmax(220px, 1fr);
  }
  .artifact-toolbar input,
  .artifact-toolbar .inline-status {
    grid-column: auto;
  }
  .artifact-toolbar .small-button {
    width: auto;
    white-space: nowrap;
  }
  .link-resource-card {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 136px;
    align-items: start;
  }
  #closingSummary.compact-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #invoicePrepSummary.compact-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  #invoicePrepSummary .metric-card:first-child { grid-column: auto; }
  .dashboard-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 14px; }
  .panel { padding: 18px; }
  .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 180px); align-items: stretch; }
  .month-toolbar { grid-template-columns: 220px auto auto minmax(0, 1fr); }
  .month-toolbar.artifact-toolbar {
    grid-template-columns: 220px max-content minmax(220px, 1fr);
  }
  .month-toolbar .status-pill { grid-column: auto; justify-self: end; }
  .month-toolbar .inline-status { grid-column: auto; }
  .work-card { grid-template-columns: minmax(0, 1fr) minmax(150px, auto); align-items: start; }
  .work-card-side { justify-items: end; text-align: right; }
  .list-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
  .upload-box { display: flex; flex-wrap: wrap; align-items: center; }
  .upload-box input { flex: 1 1 320px; width: auto; }
  .secondary-tools .secondary-button { width: auto; }
  .sync-product-row { grid-template-columns: minmax(0, 1fr) minmax(160px, auto); align-items: center; }
  .sync-product-row span { text-align: right; }
  table { min-width: 720px; }
}
