:root {
  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI",
    "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 14px;
  color: #171a1f;
  background: #f7f8fa;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-subtle: #f2f4f6;
  --text: #171a1f;
  --muted: #68717b;
  --muted-strong: #4d5660;
  --line: #d9dee5;
  --line-dark: #c5cbd3;
  --green: #18864b;
  --green-soft: #eaf6ef;
  --blue: #2f6da4;
  --blue-soft: #edf4fa;
  --amber: #a86814;
  --amber-soft: #fff6e8;
  --red: #bc3840;
  --red-soft: #fff0f1;
  --shadow: 0 8px 24px rgb(23 26 31 / 7%);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  background: var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgb(47 109 164 / 25%);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.boot-screen,
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-screen {
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--text);
  border-radius: 5px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-panel {
  width: min(100%, 430px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

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

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

.auth-panel h1 {
  margin-bottom: 8px;
  font-size: 23px;
  letter-spacing: 0;
}

.auth-panel > p {
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.7;
}

.form-stack {
  display: grid;
  gap: 16px;
}

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

.field > span,
.field label {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.65;
}

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

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

.error-box,
.notice-box {
  padding: 11px 12px;
  border-radius: 4px;
  line-height: 1.5;
}

.error-box {
  border: 1px solid #efc6c9;
  background: var(--red-soft);
  color: #8e252c;
}

.notice-box {
  border: 1px solid #efdbb9;
  background: var(--amber-soft);
  color: #775019;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  border-color: #aab2bc;
  background: #fafbfc;
}

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

.button.primary:hover {
  background: #14743f;
}

.button.danger {
  border-color: #edc5c8;
  color: var(--red);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
}

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

.button.icon {
  width: 40px;
  padding: 0;
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-head {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.sidebar-head strong {
  display: block;
  font-size: 14px;
}

.sidebar-head span {
  color: var(--muted);
  font-size: 11px;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 14px 12px 8px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-subtle);
}

.role-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 700;
}

.role-switch button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgb(23 26 31 / 10%);
}

.sidebar-label {
  margin: 16px 16px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-nav,
.support-nav {
  display: grid;
  gap: 3px;
  padding: 0 8px;
}

.nav-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.nav-item:hover {
  background: var(--surface-subtle);
}

.nav-item.active {
  background: #edf2ef;
  color: #115f35;
}

.nav-item .nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8c949d;
}

.nav-item .nav-dot.green {
  background: var(--green);
}

.nav-item .nav-dot.amber {
  background: #e9a421;
}

.nav-item .nav-dot.blue {
  background: var(--blue);
}

.nav-item .nav-copy {
  min-width: 0;
}

.nav-item .nav-copy strong,
.nav-item .nav-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item .nav-copy strong {
  font-size: 13px;
}

.nav-item .nav-copy span,
.nav-item .nav-meta {
  color: var(--muted);
  font-size: 10px;
}

.support-nav .nav-item {
  grid-template-columns: 20px minmax(0, 1fr) auto;
}

.nav-icon {
  color: var(--muted-strong);
  font-size: 15px;
  text-align: center;
}

.count {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 800;
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid var(--line);
}

.sync-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.sync-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.sync-pulse.offline {
  background: var(--amber);
}

.main {
  min-width: 0;
}

.mobile-head {
  display: none;
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 24px;
  border-bottom: 1px solid var(--line);
  background: rgb(247 248 250 / 94%);
}

.topbar-copy {
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.topbar p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 20px 24px 40px;
}

.alert-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 14px;
  border: 1px solid #e7c58c;
  border-left: 4px solid var(--amber);
  border-radius: 4px;
  background: var(--amber-soft);
}

.alert-strip strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.alert-strip p {
  margin: 0;
  color: #72501b;
  font-size: 12px;
}

.status-overview {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.55fr;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.status-cell {
  min-width: 0;
  padding: 14px 16px;
}

.status-cell + .status-cell {
  border-left: 1px solid var(--line);
}

.status-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.status-value {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 800;
}

.badge.green {
  border-color: #8fc8a9;
  background: var(--green-soft);
  color: #126839;
}

.badge.amber {
  border-color: #ebc47e;
  background: var(--amber-soft);
  color: #775019;
}

.badge.red {
  border-color: #edb7bc;
  background: var(--red-soft);
  color: #962a31;
}

.badge.blue {
  border-color: #b3cce1;
  background: var(--blue-soft);
  color: #23577f;
}

.phase-panel {
  margin-bottom: 16px;
  padding: 16px 18px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  overflow-x: auto;
}

.phase-track {
  position: relative;
  display: flex;
  min-width: 620px;
}

.phase-track::before {
  position: absolute;
  top: 16px;
  right: 8%;
  left: 8%;
  height: 1px;
  background: var(--line-dark);
  content: "";
}

.phase {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 100px;
  flex: 1 1 0;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.phase-number {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted-strong);
  font-weight: 800;
}

.phase.current {
  color: var(--green);
  font-weight: 800;
}

.phase.current .phase-number,
.phase.complete .phase-number {
  border-color: var(--green);
}

.phase.current .phase-number {
  background: var(--green-soft);
  color: var(--green);
  box-shadow: 0 0 0 3px var(--surface);
}

.phase.complete .phase-number {
  background: var(--green);
  color: #fff;
}

.phase-name {
  max-width: 120px;
  font-size: 11px;
  line-height: 1.4;
}

.return-note {
  margin: 12px auto 0;
  color: var(--green);
  font-size: 11px;
  text-align: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  align-items: start;
}

.detail-main,
.detail-side {
  display: grid;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.panel-head {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.panel-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel-body {
  padding: 16px;
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.task-list,
.context-list,
.material-list,
.review-list,
.timeline {
  display: grid;
}

.task-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid #edf0f3;
}

.task-row:first-child {
  padding-top: 0;
}

.task-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.task-row input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.task-copy strong,
.task-copy span {
  display: block;
}

.task-copy strong {
  font-size: 12px;
  line-height: 1.5;
}

.task-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.task-row.done .task-copy strong {
  color: var(--muted);
  text-decoration: line-through;
}

.context-list {
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.context-list li {
  position: relative;
  padding-left: 14px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.6;
}

.context-list li::before {
  position: absolute;
  top: 0.68em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

.timeline-item {
  display: grid;
  grid-template-columns: 80px 14px minmax(0, 1fr) 85px;
  min-height: 74px;
  padding: 12px 16px;
  border-bottom: 1px solid #edf0f3;
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-date,
.timeline-author {
  color: var(--muted);
  font-size: 10px;
}

.timeline-dot {
  position: relative;
}

.timeline-dot::before {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8c949d;
  content: "";
}

.timeline-dot::after {
  position: absolute;
  top: 14px;
  bottom: -15px;
  left: 6px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-item:last-child .timeline-dot::after {
  display: none;
}

.timeline-copy {
  min-width: 0;
  padding-right: 12px;
}

.timeline-copy strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.timeline-copy p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 11px;
  line-height: 1.6;
}

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

.memo-cell {
  min-height: 112px;
  padding: 14px 16px;
}

.memo-cell:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.memo-cell:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

.memo-cell dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.memo-cell dd {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.material-row,
.review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #edf0f3;
}

.material-row:first-child,
.review-row:first-child {
  padding-top: 0;
}

.material-row:last-child,
.review-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.material-copy strong,
.material-copy span,
.review-copy strong,
.review-copy span {
  display: block;
}

.material-copy strong,
.review-copy strong {
  font-size: 12px;
  line-height: 1.5;
}

.material-copy span,
.review-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 16px;
  align-items: start;
}

.metric-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.metric {
  padding: 15px 16px;
}

.metric + .metric {
  border-left: 1px solid var(--line);
}

.metric span,
.metric strong {
  display: block;
}

.metric span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.metric strong {
  font-size: 22px;
}

.case-table {
  width: 100%;
  border-collapse: collapse;
}

.case-table th,
.case-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f3;
  text-align: left;
  vertical-align: middle;
}

.case-table th {
  color: var(--muted);
  font-size: 10px;
}

.case-table td {
  font-size: 12px;
}

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

.case-link {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  text-align: left;
}

.reminder-card {
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.reminder-card:last-child {
  border-bottom: 0;
}

.reminder-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.reminder-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.reminder-card p {
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.7;
}

.reminder-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.reminder-meta div {
  padding: 9px 10px;
  background: var(--surface-subtle);
}

.reminder-meta span,
.reminder-meta strong {
  display: block;
}

.reminder-meta span {
  color: var(--muted);
  font-size: 9px;
}

.reminder-meta strong {
  margin-top: 3px;
  font-size: 11px;
}

.draft-box {
  margin: 12px 0;
  padding: 12px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  color: #244a68;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sync-list {
  display: grid;
}

.sync-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid #edf0f3;
}

.sync-row:last-child {
  border-bottom: 0;
}

.sync-row strong,
.sync-row span {
  display: block;
}

.sync-row strong {
  margin-bottom: 4px;
  font-size: 12px;
}

.sync-row span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.workflow-stage {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f3;
}

.workflow-stage:last-child {
  border-bottom: 0;
}

.workflow-stage.inactive {
  color: var(--muted);
}

.workflow-stage.inactive strong {
  font-size: 12px;
  font-weight: 700;
}

.stage-order {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.workflow-stage input {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.stage-actions {
  display: flex;
  gap: 4px;
}

.workflow-history {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.history-row {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf0f3;
  color: var(--muted-strong);
  font-size: 11px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #edf0f3;
}

.account-row:last-child {
  border-bottom: 0;
}

.account-row strong,
.account-row span {
  display: block;
}

.account-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.modal-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgb(23 26 31 / 38%);
}

.modal {
  width: min(100%, 670px);
  max-height: min(90vh, 850px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgb(23 26 31 / 22%);
}

.modal-head,
.modal-footer {
  position: sticky;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: var(--surface);
}

.modal-head {
  top: 0;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
}

.modal-footer {
  bottom: 0;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.modal-body {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.section-title {
  margin: 4px 0 -4px;
  font-size: 13px;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.55;
}

.checkbox-line input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
  accent-color: var(--green);
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: 360px;
  padding: 11px 13px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: var(--text);
  box-shadow: var(--shadow);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
}

.toast.error {
  background: #8f292f;
}

.mobile-overlay {
  display: none;
}

@media (max-width: 1050px) {
  .detail-grid,
  .page-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    width: min(86vw, 300px);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 16px 0 40px rgb(23 26 31 / 18%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-overlay {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: block;
    border: 0;
    background: rgb(23 26 31 / 32%);
  }

  .mobile-head {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }

  .mobile-head strong {
    font-size: 13px;
  }

  .topbar {
    min-height: auto;
    align-items: flex-start;
    padding: 15px 16px 13px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .topbar-actions .button:not(.mobile-keep) {
    display: none;
  }

  .content {
    padding: 14px 14px 32px;
  }

  .status-overview,
  .metric-band {
    grid-template-columns: 1fr 1fr;
  }

  .phase-panel {
    padding-right: 8px;
    padding-left: 8px;
  }

  .phase-track {
    min-width: 320px;
  }

  .phase-track::before {
    right: 9%;
    left: 9%;
  }

  .phase {
    min-width: 62px;
  }

  .phase-name {
    max-width: 66px;
    font-size: 9px;
  }

  .status-cell + .status-cell,
  .metric + .metric {
    border-left: 0;
  }

  .status-cell:nth-child(even),
  .metric:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .status-cell:nth-child(n + 3),
  .metric:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .detail-side,
  .form-grid,
  .memo-grid {
    grid-template-columns: 1fr;
  }

  .memo-cell:nth-child(odd) {
    border-right: 0;
  }

  .memo-cell:nth-child(n + 2) {
    border-top: 1px solid var(--line);
  }

  .timeline-item {
    grid-template-columns: 70px 14px minmax(0, 1fr);
  }

  .timeline-author {
    grid-column: 3;
    margin-top: 5px;
  }

  .case-table th:nth-child(3),
  .case-table td:nth-child(3),
  .case-table th:nth-child(4),
  .case-table td:nth-child(4) {
    display: none;
  }

  .archive-table th:nth-child(4),
  .archive-table td:nth-child(4) {
    display: table-cell;
  }

  .alert-strip {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .alert-strip .actions {
    grid-column: 1 / -1;
  }

  .reminder-meta {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 6px 6px 0 0;
  }

  .auth-panel {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
