:root {
  --ink: #173f42;
  --text: #344b4d;
  --muted: #607773;
  --brand: #117c75;
  --brand-dark: #096860;
  --mint: #44a181;
  --mint-soft: #eaf7f3;
  --mint-pale: #f6fbf9;
  --line: #cfe3dd;
  --line-soft: #e3eeea;
  --surface: #ffffff;
  --canvas: #f4f8f7;
  --warning: #b87519;
  --warning-bg: #fff7e5;
  --danger: #b85450;
  --danger-bg: #fff1ef;
  --blue: #47748d;
  --shadow: 0 14px 38px rgba(23, 63, 66, .08);
  --radius: 16px;
  --sidebar: 244px;
}

.recurring-table td.is-inactive {
  background: #f4f7f6;
}

.recurring-table td.is-inactive select,
.recurring-table td.is-inactive input {
  color: #899795;
  background: #edf2f1;
  cursor: not-allowed;
}

.recurring-preview {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #bcded5;
  border-radius: 14px;
  background: #f4fbf8;
}

.recurring-preview > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recurring-preview ul {
  margin: 12px 0 0;
  padding-left: 1.35em;
}

.recurring-preview li + li {
  margin-top: 7px;
}

@media (max-width: 760px) {
  .ai-note {
    padding: 15px;
  }

  .recurring-preview > div {
    align-items: flex-start;
  }
}

* { box-sizing: border-box; }
html { height: 100%; scroll-behavior: smooth; }
.visually-hidden,
.sr-only {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(17, 124, 117, .23);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.appbar {
  position: relative;
  z-index: 10;
  min-height: 70px;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 10px 20px 10px 0;
  background: rgba(255, 255, 255, .98);
  border-top: 4px solid #78d6c5;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(23, 63, 66, .05);
}
.app-brand {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding-left: 22px;
  text-decoration: none;
}
.app-brand__mark {
  color: #63d2c4;
  font-size: 29px;
  font-weight: 900;
  letter-spacing: -.08em;
}
.app-brand__leaf {
  width: 11px;
  height: 18px;
  margin-left: -6px;
  background: #a5e9c6;
  border-radius: 100% 0 100% 0;
  transform: rotate(18deg);
}
.app-brand__product {
  padding-left: 11px;
  color: var(--ink);
  border-left: 1px solid #d9e9e4;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}
.project-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.project-name label { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 800; }
.project-name input {
  width: min(460px, 100%);
  height: 40px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--mint-pale);
  border: 1px solid #bddbd2;
  border-radius: 10px;
  font-weight: 750;
}
.char-count { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.app-actions { display: flex; align-items: center; gap: 7px; }
.save-state { margin-right: 3px; color: var(--muted); font-size: 10px; white-space: nowrap; }

.shell {
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}
.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #f8fcfa;
  border-right: 1px solid var(--line);
}
.sidebar__context {
  padding: 18px 18px 14px;
  background: linear-gradient(140deg, #edf9f5, #f8fcfa);
  border-bottom: 1px solid var(--line-soft);
}
.context-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.context-month { display: block; color: var(--ink); font-size: 17px; font-weight: 850; }
.context-meta { display: flex; gap: 6px; margin-top: 8px; }
.sidebar__label { margin: 18px 18px 8px; color: #72908a; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.nav-list { margin: 0; padding: 0 10px; list-style: none; }
.nav-button {
  width: 100%;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  padding: 10px 9px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
}
.nav-button:hover { background: #fff; }
.nav-button[aria-selected="true"] {
  color: var(--brand-dark);
  background: #fff;
  border-color: #bfe0d6;
  box-shadow: 0 7px 18px rgba(23, 63, 66, .07);
}
.nav-button__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: #e3f3ee;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 900;
}
.nav-button[aria-selected="true"] .nav-button__icon { color: #fff; background: var(--brand); }
.nav-button__copy strong { display: block; color: var(--ink); font-size: 13px; }
.nav-button__copy small { display: block; margin-top: 1px; color: var(--muted); font-size: 9px; }
.nav-button__state { color: var(--mint); font-size: 11px; font-weight: 900; }
.sidebar__privacy {
  margin: auto 13px 14px;
  padding: 12px;
  color: #41655f;
  background: #edf8f4;
  border: 1px solid #cae5dc;
  border-radius: 12px;
  font-size: 10px;
}
.sidebar__privacy strong { display: block; margin-bottom: 3px; color: var(--brand-dark); font-size: 11px; }

.main {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background:
    radial-gradient(circle at 100% 4%, rgba(68, 161, 129, .07) 0 90px, transparent 91px),
    var(--canvas);
}
.main__inner { width: min(1360px, calc(100% - 42px)); margin: 0 auto; padding: 26px 0 62px; }
.screen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 17px;
}
.screen-header__eyebrow { margin: 0 0 3px; color: var(--brand); font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.screen-header h1 { margin: 0; color: var(--ink); font-size: clamp(23px, 3vw, 31px); line-height: 1.3; }
.screen-header p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.screen-progress { flex: 0 0 auto; min-width: 190px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.screen-progress__top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.progress-track { height: 7px; margin-top: 7px; overflow: hidden; background: #e6efec; border-radius: 999px; }
.progress-track i { display: block; width: 68%; height: 100%; background: linear-gradient(90deg, #4eb79b, #7ed6c3); border-radius: inherit; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 17px;
  padding: 12px 14px;
  color: #3e625c;
  background: #f2faf7;
  border-left: 4px solid var(--mint);
  border-radius: 6px 12px 12px 6px;
  font-size: 11px;
}
.notice__icon { color: var(--brand); font-weight: 900; }
.notice--warning { background: var(--warning-bg); border-left-color: #d49a39; }
.notice--warning .notice__icon { color: var(--warning); }

.subnav {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
  padding: 5px;
  overflow-x: auto;
  background: #e9f2ef;
  border-radius: 12px;
}
.subnav button {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 7px 14px;
  color: #52716b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}
.subnav button:hover { color: var(--brand-dark); }
.subnav button[aria-selected="true"] { color: var(--brand-dark); background: #fff; border-color: #c4ddd6; box-shadow: 0 4px 12px rgba(23, 63, 66, .06); }

.workspace-card {
  margin-bottom: 17px;
  padding: 21px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 7px 24px rgba(23, 63, 66, .04);
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h2, .card-head h3 { margin: 0; color: var(--ink); font-size: 16px; line-height: 1.4; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.card-head__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.section-title { margin: 25px 0 12px; padding-left: 10px; color: var(--ink); border-left: 4px solid var(--mint); font-size: 14px; }
.section-title:first-child { margin-top: 0; }
.section-note { margin: -6px 0 12px; color: var(--muted); font-size: 10px; }

.grid { display: grid; gap: 13px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 5px; color: var(--ink); font-size: 10px; font-weight: 850; }
.field label small { margin-left: 4px; color: var(--muted); font-weight: 500; }
.required { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid #bdd6cf;
  border-radius: 8px;
  font-size: 11px;
}
.field textarea { min-height: 88px; resize: vertical; }
.field-help { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 9px; align-items: end; }
.inline-fields .field { flex: 1 1 120px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 17px; }
.check-option { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-size: 11px; }
.check-option input { accent-color: var(--brand); }

.table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.data-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; background: #fff; font-size: 10px; }
.data-table--wide { min-width: 1120px; }
.data-table th, .data-table td { min-height: 42px; padding: 9px 9px; text-align: left; border-right: 1px solid #e2ece9; border-bottom: 1px solid #e2ece9; white-space: nowrap; }
.data-table th:last-child, .data-table td:last-child { border-right: 0; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table th { position: sticky; top: 0; z-index: 1; color: #3c605a; background: #f0f7f5; font-size: 9px; font-weight: 850; }
.data-table tbody tr:hover { background: #f9fcfb; }
.data-table input, .data-table select { min-width: 78px; max-width: 180px; height: 30px; padding: 4px 7px; border: 1px solid #c3d9d3; border-radius: 6px; font-size: 10px; }
.data-table input[type="checkbox"] { min-width: auto; accent-color: var(--brand); }
.data-table .name { color: var(--ink); font-weight: 850; }
.row-check { width: 30px; text-align: center !important; }
.table-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.table-foot small { color: var(--muted); font-size: 9px; }

.btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid #a9d0c5;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.btn:hover { background: #f1f9f6; }
.btn--primary { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 6px 15px rgba(17, 124, 117, .14); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--soft { color: #805613; background: #fff5da; border-color: #e5ca8c; }
.btn--danger { color: var(--danger); background: #fff; border-color: #e5b9b5; }
.btn--ghost { color: var(--muted); background: transparent; border-color: transparent; }
.btn--small { min-height: 29px; padding: 4px 8px; font-size: 9px; }
.btn--icon { width: 36px; padding: 0; }
.btn[disabled] { opacity: .55; cursor: wait; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 999px; font-size: 8px; font-weight: 850; white-space: nowrap; }
.chip--mint { color: #26675a; background: #def3ec; }
.chip--blue { color: #45687b; background: #e7f0f5; }
.chip--gold { color: #825a1a; background: #fff0c9; }
.chip--red { color: #914a45; background: #fae6e4; }
.chip--outline { color: var(--brand-dark); background: #fff; border: 1px solid #b6d8ce; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.summary-card { padding: 13px; background: #f8fcfa; border: 1px solid #d4e6e0; border-radius: 11px; }
.summary-card small { display: block; color: var(--muted); font-size: 8px; }
.summary-card strong { display: block; margin-top: 2px; color: var(--ink); font-size: 18px; }

.accordion-list { display: grid; gap: 10px; }
.accordion {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.accordion summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; color: var(--ink); cursor: pointer; list-style: none; font-size: 12px; font-weight: 850; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; color: var(--brand); font-size: 17px; }
.accordion[open] summary::after { content: "−"; }
.accordion__body { padding: 0 15px 15px; border-top: 1px solid var(--line-soft); }

.calendar-wrap { overflow-x: auto; }
.calendar { min-width: 840px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; overflow: hidden; background: #dce9e5; border: 1px solid #dce9e5; border-radius: 12px; }
.calendar__head { padding: 7px; color: #4d6d67; text-align: center; background: #eff6f4; font-size: 9px; font-weight: 850; }
.calendar__day { min-height: 82px; padding: 7px; background: #fff; }
.calendar__day strong { color: var(--ink); font-size: 10px; }
.calendar__day--muted { background: #f7f9f8; }
.event { display: block; margin-top: 4px; padding: 3px 5px; overflow: hidden; color: #256457; background: #e3f4ee; border-radius: 5px; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.event--leave { color: #8e504b; background: #fbe9e7; }
.event--meeting { color: #536c8b; background: #e9eff8; }

.rule-list { display: grid; gap: 9px; }
.rule-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; background: #fbfefd; border: 1px solid #d4e6e0; border-radius: 11px; }
.rule-card__icon { width: 35px; height: 35px; display: grid; place-items: center; color: var(--brand); background: var(--mint-soft); border-radius: 9px; font-size: 10px; font-weight: 900; }
.rule-card strong { display: block; color: var(--ink); font-size: 11px; }
.rule-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }

.result-status { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px; background: #f4fbf8; border: 1px solid #c9e2da; border-radius: 13px; }
.result-status__icon { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: var(--brand); border-radius: 50%; font-weight: 900; }
.result-status h3 { margin: 0; color: var(--ink); font-size: 15px; }
.result-status p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.result-status[data-status="success"] { background: #f1faf6; border-color: #b8ddcf; }
.result-status[data-status="success"] .result-status__icon { background: var(--brand); }
.result-status[data-status="warning"] { background: var(--warning-bg); border-color: #ead29d; }
.result-status[data-status="warning"] .result-status__icon { background: var(--warning); }
.result-status[data-status="error"] { background: var(--danger-bg); border-color: #e6bbb6; }
.result-status[data-status="error"] .result-status__icon { background: var(--danger); }
.result-status[data-status="timeout"] { background: #eef4f7; border-color: #c6d6de; }
.result-status[data-status="timeout"] .result-status__icon { background: var(--blue); }
.result-metrics { display: flex; gap: 7px; }
.result-metrics span { min-width: 64px; padding: 7px; text-align: center; background: #fff; border: 1px solid #d6e7e2; border-radius: 8px; }
.result-metrics strong { display: block; color: var(--ink); font-size: 15px; }
.result-metrics small { color: var(--muted); font-size: 7px; }

.shift-wrap { max-width: 100%; overflow: auto; border: 1px solid #c8dfd8; border-radius: 12px; }
.shift-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; font-size: 9px; }
.shift-table th, .shift-table td { min-width: 43px; height: 40px; padding: 5px; text-align: center; border-right: 1px solid #e1ebe8; border-bottom: 1px solid #e1ebe8; }
.shift-table thead th { position: sticky; top: 0; z-index: 3; color: #46645f; background: #eff7f4; }
.shift-table th:first-child, .shift-table td:first-child { min-width: 114px; position: sticky; left: 0; z-index: 4; text-align: left; background: #fff; box-shadow: 3px 0 7px rgba(23, 63, 66, .05); }
.shift-table thead th:first-child { background: #e8f3ef; }
.shift-table .summary-col { min-width: 66px; max-width: 104px; background: #fafcfb; }
.shift-table .summary-col span,
.shift-table tfoot th span { display: block; line-height: 1.35; }
.shift-table .summary-col small,
.shift-table tfoot th small { display: block; margin-top: 2px; color: #69807b; font-size: .82em; font-weight: 700; line-height: 1.3; }
.shift-table .summary-col--unknown,
.shift-table .breakdown-row--unknown > * { color: #805d1f; background: #fff8e8; }
.shift-table td:first-child { color: var(--ink); font-weight: 850; }
.shift-table tfoot th, .shift-table tfoot td { position: sticky; bottom: 0; z-index: 2; color: #3d625b; background: #eef7f4; font-weight: 850; }
.shift-cell { position: relative; cursor: pointer; user-select: none; }
.shift-cell:hover { background: #f3faf7; }
.shift-cell.is-selected { box-shadow: inset 0 0 0 2px var(--brand); }
.shift-cell.is-locked::after { content: "\1F512"; position: absolute; top: 1px; right: 2px; font-size: 7px; }
.shift-code { width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 6px; font-weight: 900; }
.code-day { color: #236659; background: #def2eb; }
.code-early { color: #466b88; background: #e6eff7; }
.code-late { color: #8e5b20; background: #fff0d8; }
.code-night { color: #645080; background: #eee8f7; }
.code-after { color: #76507e; background: #f2e8f4; }
.code-off { color: #715f59; background: #f0edeb; }
.code-paid { color: #994f4a; background: #fae7e5; }

.preview-box { min-height: 180px; padding: 14px; overflow: auto; color: #31504b; background: #f5f9f8; border: 1px solid #c8ddd7; border-radius: 10px; font-family: Consolas, "Courier New", monospace; font-size: 9px; white-space: pre-wrap; }
.export-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.export-card { display: flex; flex-direction: column; min-height: 180px; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.export-card__icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--brand); background: var(--mint-soft); border-radius: 9px; font-size: 10px; font-weight: 900; }
.export-card h3 { margin: 11px 0 4px; color: var(--ink); font-size: 13px; }
.export-card p { margin: 0 0 12px; color: var(--muted); font-size: 9px; }
.export-card .btn { margin-top: auto; }

.bottom-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.bottom-actions__right { display: flex; flex-wrap: wrap; gap: 7px; margin-left: auto; }
.toast { max-width: min(430px, calc(100% - 28px)); position: fixed; right: 18px; bottom: 18px; z-index: 50; padding: 12px 15px; color: #fff; background: var(--ink); border-radius: 10px; box-shadow: 0 14px 35px rgba(23, 63, 66, .24); font-size: 10px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.is-show { opacity: 1; transform: none; }
.loading::after { content: ""; animation: dots 1.1s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }

@media (max-width: 1100px) {
  :root { --sidebar: 210px; }
  .appbar { grid-template-columns: var(--sidebar) minmax(180px, 1fr) auto; }
  .app-brand__product { display: none; }
  .app-actions .btn span { display: none; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .export-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  .app { min-height: auto; }
  .appbar { position: sticky; top: 0; grid-template-columns: auto minmax(0, 1fr) auto; padding-left: 10px; }
  .app-brand { padding-left: 0; }
  .app-brand__mark { font-size: 24px; }
  .project-name label, .char-count, .save-state { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 70px; z-index: 8; display: block; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar__context, .sidebar__label, .sidebar__privacy { display: none; }
  .nav-list { display: flex; gap: 4px; width: max-content; padding: 7px 10px; }
  .nav-button { width: auto; grid-template-columns: 28px auto; margin: 0; padding: 6px 9px; }
  .nav-button__icon { width: 28px; height: 28px; }
  .nav-button__copy strong { font-size: 10px; white-space: nowrap; }
  .nav-button__copy small, .nav-button__state { display: none; }
  .main { overflow: visible; }
  .main__inner { width: min(100% - 24px, 1360px); padding-top: 18px; }
  .screen-header { align-items: stretch; flex-direction: column; }
  .screen-progress { width: 100%; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-status { grid-template-columns: auto 1fr; }
  .result-metrics { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .appbar { grid-template-columns: auto minmax(0, 1fr); gap: 7px; padding: 8px; }
  .app-brand__leaf { display: none; }
  .project-name input { padding: 7px 8px; font-size: 10px; }
  .app-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .app-actions .btn { min-height: 29px; padding: 4px 7px; font-size: 9px; }
  .workspace-card { padding: 15px 12px; }
  .card-head { align-items: stretch; flex-direction: column; }
  .grid--2, .grid--3, .grid--4, .export-grid { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .rule-card { grid-template-columns: 32px minmax(0, 1fr); }
  .rule-card > :last-child { grid-column: 2; justify-self: start; }
  .bottom-actions, .bottom-actions__right { width: 100%; align-items: stretch; flex-direction: column; }
  .bottom-actions__right { margin-left: 0; }
  .bottom-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
/* 職員ごとの勤務可能コード設定 */
.allowed-code-inline {
  display: grid;
  grid-template-columns: minmax(8.5rem, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  min-width: 14rem;
}

.allowed-codes-summary[readonly] {
  min-width: 0;
  background: #f4faf8;
  color: #2d5e59;
  cursor: default;
}

.allowed-code-picker-button {
  white-space: nowrap;
}

.allowed-code-dialog {
  width: min(42rem, calc(100vw - 2rem));
  max-height: min(44rem, calc(100vh - 2rem));
  padding: 0;
  border: 0;
  border-radius: 1.25rem;
  background: transparent;
  color: #123f3b;
  box-shadow: 0 1.5rem 4rem rgba(14, 69, 63, 0.22);
}

.allowed-code-dialog::backdrop {
  background: rgba(9, 44, 41, 0.38);
  backdrop-filter: blur(2px);
}

.allowed-code-dialog__panel {
  padding: 1.35rem;
  border: 1px solid #b9ddd5;
  border-radius: inherit;
  background: #fff;
}

.allowed-code-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #d9e9e5;
}

.allowed-code-dialog__header h2 {
  margin: 0.15rem 0 0;
  font-size: 1.25rem;
}

.allowed-code-dialog__close {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  place-items: center;
  border: 1px solid #c9ddd8;
  border-radius: 999px;
  background: #f5faf8;
  color: #345f5a;
  font: inherit;
  font-size: 1.35rem;
  cursor: pointer;
}

.allowed-code-dialog__panel > p {
  margin: 0.85rem 0;
  color: #5a7470;
}

.allowed-code-dialog__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  max-height: min(24rem, 50vh);
  padding: 0.15rem;
  overflow: auto;
}

.allowed-code-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-height: 4.25rem;
  padding: 0.75rem;
  border: 1px solid #c5e2dc;
  border-radius: 0.85rem;
  background: #f5fbf9;
  cursor: pointer;
}

.allowed-code-option:has(input:checked) {
  border-color: #178f83;
  background: #e8f7f2;
  box-shadow: 0 0 0 2px rgba(23, 143, 131, 0.1);
}

.allowed-code-option input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #158f84;
}

.allowed-code-option__code {
  display: grid;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.35rem;
  place-items: center;
  border-radius: 0.65rem;
  background: #fff;
  color: #08766c;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px #c6e1dc;
}

.allowed-code-option__body strong,
.allowed-code-option__body small {
  display: block;
}

.allowed-code-option__body small {
  margin-top: 0.15rem;
  color: #68817d;
}

.allowed-code-option__state {
  color: #187d73;
  font-size: 0.78rem;
  font-weight: 800;
}

.allowed-code-option.is-disabled {
  border-color: #e0e6e4;
  background: #f4f5f5;
  color: #858e8c;
  cursor: not-allowed;
}

.allowed-code-option.is-disabled .allowed-code-option__code {
  color: #8d9694;
}

.allowed-code-option.is-disabled .allowed-code-option__state {
  color: #9a7167;
}

.allowed-code-dialog__note {
  min-height: 1.4rem;
  font-size: 0.85rem;
}

.allowed-code-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 1rem;
  border-top: 1px solid #d9e9e5;
}

.allowed-code-matrix {
  min-width: 720px;
}

.allowed-code-matrix th,
.allowed-code-matrix td {
  text-align: center;
  vertical-align: middle;
}

.allowed-code-matrix th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 9rem;
  text-align: left;
  background: #f7fbfa;
  box-shadow: 1px 0 0 #d9e8e4;
}

.allowed-code-name {
  display: block;
  white-space: nowrap;
}

.allowed-code-matrix thead small {
  display: block;
  margin-top: 0.18rem;
  color: #64807c;
  font-weight: 600;
}

.matrix-check {
  display: inline-flex;
  min-width: 3.25rem;
  min-height: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.48rem;
  border: 1px solid #bcded6;
  border-radius: 0.65rem;
  background: #f4fbf8;
  color: #126e67;
  font-weight: 700;
  cursor: pointer;
}

.matrix-check input {
  width: 1rem;
  height: 1rem;
  accent-color: #158f84;
}

.matrix-check.is-disabled {
  border-color: #e1e5e4;
  background: #f4f5f5;
  color: #89918f;
  cursor: not-allowed;
}

.night-state {
  display: inline-flex;
  min-width: 2.9rem;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-weight: 800;
}

.night-state.is-allowed {
  background: #e1f5ef;
  color: #08766c;
}

.night-state.is-denied {
  background: #f2f3f3;
  color: #6f7775;
}

.empty-state {
  margin: 0;
  padding: 1.25rem;
  color: #56706c;
  text-align: center;
}

@media (max-width: 640px) {
  .allowed-code-dialog__options { grid-template-columns: 1fr; }
  .allowed-code-dialog__actions { flex-direction: column-reverse; }
  .allowed-code-dialog__actions .btn { width: 100%; }
}

/* 操作性調整：実入力を中心に、文字・操作面積・スクロール範囲を統一 */
body { font-size: 14px; }
.app { height: 100vh; height: 100dvh; min-height: 0; }
.appbar { grid-template-columns: var(--sidebar) minmax(180px, 1fr) auto; gap: 12px; }
.app-brand__product { font-size: 12px; }
.project-name { flex-wrap: wrap; gap: 4px 8px; }
.project-name label { width: 100%; font-size: 12px; }
.project-name input { min-width: 0; flex: 1; width: auto; font-size: 14px; }
.char-count { font-size: 11px; }
.app-actions { flex-wrap: wrap; justify-content: flex-end; }
.save-state { width: 100%; margin: 0 0 2px; text-align: right; font-size: 11px; }
.save-state.is-dirty { color: #986314; }
.context-label, .sidebar__label { font-size: 11px; }
.context-month { font-size: 21px; }
.nav-button__copy strong { font-size: 14px; }
.nav-button__copy small { font-size: 11px; }
.nav-button__icon { font-size: 14px; }
.sidebar__privacy { margin-top: 28px; font-size: 11px; }
.sidebar__privacy strong { font-size: 12px; }
.main__inner { width: min(1240px, calc(100% - 48px)); padding: 22px 0 36px; }
.mock-note { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 10px; margin: 0 0 22px; color: #687873; font-size: 12px; }
.mock-note > span { padding: 2px 8px; color: #785b25; background: #fff2d9; border: 1px solid #eddbb6; border-radius: 5px; font-size: 11px; font-weight: 700; }
.screen-header { margin-bottom: 22px; }
.screen-header p { font-size: 14px; line-height: 1.7; }
.screen-header .screen-header__eyebrow { font-size: 11px; letter-spacing: .12em; }
.screen-header h1 { font-size: clamp(26px, 2.4vw, 32px); }
.notice, .section-note { font-size: 13px; line-height: 1.8; }
.subnav { gap: 6px; margin-bottom: 20px; scrollbar-width: thin; }
.subnav button { min-height: 44px; padding: 9px 16px; font-size: 14px; }
.workspace-card { padding: 24px; margin-bottom: 20px; box-shadow: 0 5px 18px rgba(23, 63, 66, .035); }
.card-head { flex-wrap: wrap; align-items: center; padding-bottom: 16px; margin-bottom: 20px; }
.card-head h2, .card-head h3 { font-size: 18px; }
.card-head p { font-size: 13px; line-height: 1.7; margin-top: 6px; }
.card-head__actions { flex: 0 1 auto; gap: 8px; }
.monthly-settings { border-top: 3px solid var(--mint); }
.grid { gap: 22px; }
.field label { font-size: 14px; margin-bottom: 8px; }
.field input, .field select, .field textarea { min-height: 46px; padding: 10px 12px; font-size: 16px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }
.field input:user-invalid { border-color: var(--danger); background: #fffafa; }
.field-help { margin-top: 8px; font-size: 12px; line-height: 1.7; }
.required { display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 3px; background: #fff1ef; font-size: 11px; vertical-align: 1px; }
.input-unit { position: relative; }
.input-unit input { padding-right: 86px; }
.input-unit span { position: absolute; right: 32px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: 13px; }
.settings-tip { margin: 24px 0 0; padding: 12px 14px; color: #416b61; background: var(--mint-pale); border-radius: 8px; font-size: 13px; }
.btn, .btn--small { min-height: 40px; font-size: 13px; padding: 8px 13px; }
.btn--primary { min-height: 44px; }
.btn[disabled] { cursor: not-allowed; opacity: .48; box-shadow: none; }
.chip { font-size: 11px; padding: 4px 9px; }
.table-guide { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.table-guide strong { color: var(--ink); font-weight: 600; }
.table-wrap { max-height: 60vh; scrollbar-color: #83b8ab #edf4f1; scrollbar-width: auto; }
.table-wrap:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.data-table { font-size: 13px; }
.data-table th { font-size: 12px; padding: 12px 10px; z-index: 3; }
.data-table td { padding: 9px 10px; }
.data-table input, .data-table select { height: 40px; min-width: 100px; max-width: 220px; font-size: 14px; padding: 7px 9px; }
.data-table input[type="number"] { min-width: 75px; width: 90px; }
.data-table input[type="checkbox"] { width: 20px; min-width: 20px; height: 20px; vertical-align: middle; margin: 6px; cursor: pointer; }
.data-table input[type="checkbox"]:disabled { cursor: not-allowed; }
.day-scope-control,
.coverage-time-fields {
  display: flex;
  align-items: center;
  gap: 8px;
}
.day-scope-control .day-scope-date { min-width: 150px; }
.day-scope-control .day-scope-weekday { min-width: 108px; }
.level-requirement-fields {
  display: grid;
  grid-template-columns: auto minmax(64px, .7fr) auto minmax(104px, 1.3fr);
  align-items: center;
  gap: 7px;
  min-width: 270px;
}
.level-requirement-prefix,
.level-requirement-suffix { white-space: nowrap; font-size: .78rem; font-weight: 800; color: var(--muted); }
.level-requirement-fields .minimum-level-value,
.level-requirement-fields .minimum-level-count-mode { min-width: 0; width: 100%; }
.placement-priority-notice { margin-bottom: 16px; }
.monthly-night-panel .data-table { min-width: 880px; }
.monthly-night-panel .day-scope-select { display: none; }
.monthly-night-empty { color: var(--muted); padding: 16px 0; }
.monthly-night-pair-card { margin-top: 22px; }
.monthly-night-pair-table { min-width: 1120px; }
.monthly-night-pair-table td:nth-child(5) { min-width: 245px; }
.night-pair-condition { display: grid; gap: 8px; }
.night-pair-condition select { width: 100%; min-width: 205px; }
.night-pair-level-field,
.night-pair-staff-field { display: block; }
.night-pair-level-field[hidden],
.night-pair-staff-field[hidden] { display: none; }
.monthly-night-pair-empty { color: var(--muted); padding: 16px 0 0; }
.nav-group-label { padding: 18px 10px 6px; color: var(--muted); font-size: .75rem; font-weight: 700; list-style: none; }
.coverage-table .coverage-target { min-width: 250px; }
.coverage-time-fields .time-slot-select { min-width: 96px; }
.coverage-shift-field .work-code-select { min-width: 180px; }
.temporary-work-codes-select {
  min-width: 180px;
  height: auto !important;
  min-height: 108px;
  padding: 4px;
}
.temporary-work-codes-select option { padding: 6px 8px; }
.coverage-table td:nth-child(4) { min-width: 270px; }
.data-table :is(input, select):invalid { border-color: #d56a5f; background: #fff8f7; }
.linked-condition { display: grid; grid-template-columns: minmax(92px, 1fr) 76px auto; align-items: center; gap: 6px; min-width: 200px; }
.linked-staffing-row.is-inactive > td:not(:first-child) { background: #f7faf9; color: #70827f; }
.linked-staffing-row.is-inactive .linked-rule-note { opacity: .72; }
.editable-table th:first-child, .editable-table td:first-child { position: sticky; left: 0; min-width: 54px; width: 54px; z-index: 2; background: #fff; }
.editable-table th:nth-child(2), .editable-table td:nth-child(2) { position: sticky; left: 54px; z-index: 2; background: #fff; box-shadow: 2px 0 0 #d6e6df; }
.editable-table thead th:first-child, .editable-table thead th:nth-child(2) { z-index: 4; background: #f0f7f5; }
.editable-table .is-row-selected td { background: #eaf7f2; }
.table-foot small, .check-option { font-size: 13px; }
.section-title { font-size: 17px; }
.summary-card small, .rule-card small { font-size: 12px; }
.summary-card strong { font-size: 22px; }
.rule-card strong, .accordion summary { font-size: 14px; }
.result-status p, .result-metrics small { font-size: 12px; }
.result-status h3 { font-size: 17px; }
.shift-wrap { max-height: 65vh; }
.shift-table { font-size: 13px; }
.shift-table th, .shift-table td { min-width: 46px; height: 44px; }
.shift-table th:first-child, .shift-table td:first-child { min-width: 140px; }
.shift-table tfoot th, .shift-table tfoot td { position: static; }
.shift-code { width: 30px; height: 30px; }
.preview-box { font-size: 13px; }
.export-card { padding: 20px; }
.export-card h3 { font-size: 17px; }
.export-card p { font-size: 13px; line-height: 1.8; }
.toast { font-size: 14px; bottom: 24px; }
.workflow-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding: 22px 0 4px; border-top: 1px solid var(--line); }
.workflow-footer__position strong { display: block; color: var(--ink); font-size: 13px; }
.workflow-footer__position span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.workflow-footer__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.workflow-footer .btn { min-height: 46px; white-space: normal; text-align: center; }

.special-rules { border-top: 3px solid var(--mint); }
.special-rule-list { display: grid; gap: 14px; }
.special-rule-card { overflow: hidden; border: 1px solid #cfe3dc; border-radius: 12px; background: #fcfffe; box-shadow: 0 4px 14px rgba(23, 63, 66, .035); }
.special-rule-card__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; background: #edf8f4; border-bottom: 1px solid #d7e9e3; }
.special-rule-card__head > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; }
.special-rule-card__head strong { color: var(--ink); font-size: 15px; }
.special-rule-card .field > span { display: block; margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
.special-rule-card .field > span small { color: var(--muted); font-size: 11px; font-weight: 500; }
.special-rule-number { padding: 3px 8px; color: #287f6e; background: #fff; border: 1px solid #bcded4; border-radius: 999px; font-size: 11px; font-weight: 700; }
.special-rule-card__actions { display: flex; align-items: center; gap: 8px; }
.special-rule-priority.is-required { color: #7c361f; background: #fff0ea; border-color: #f0c0ae; }
.special-rule-priority.is-preferred { color: #735612; background: #fff8dc; border-color: #ead794; }
.special-rule-grid { display: grid; grid-template-columns: minmax(150px, .9fr) minmax(220px, 1.4fr) minmax(150px, .9fr) minmax(230px, 1.2fr); gap: 14px; padding: 16px 16px 0; }
.special-time-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.special-rule-detail { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 14px; margin: 14px 16px 0; padding: 14px; background: #f5faf8; border: 1px solid #dbeae5; border-radius: 9px; }
.special-rule-detail[data-types="minimum_skill_count"], .special-rule-detail[data-types="fixed_assignment prohibited_assignment"], .special-rule-detail[data-types="same_assignment separate_assignment"] { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
.special-rule-note { margin: 14px 16px 16px; }
.special-rule-empty { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px; color: var(--muted); background: #f8fbfa; border: 1px dashed #bad7cf; border-radius: 10px; }
.special-rule-empty strong { color: var(--ink); font-size: 14px; }
.special-rule-empty span { font-size: 12px; }
.special-rule-summary { margin-top: 16px; padding: 16px 18px; color: #315c53; background: #f2f9f7; border: 1px solid #cce3dc; border-radius: 11px; }
.special-rule-summary__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.special-rule-summary__head > div { display: flex; align-items: center; gap: 9px; }
.special-rule-summary__icon { display: grid; place-items: center; width: 25px; height: 25px; color: #fff; background: var(--brand); border-radius: 50%; font-size: 13px; font-weight: 800; }
.special-rule-summary ul { display: grid; gap: 7px; margin: 13px 0 0; padding: 0; list-style: none; }
.special-rule-summary li { position: relative; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.special-rule-summary li::before { position: absolute; left: 1px; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); content: ''; }
.special-rule-summary li.is-preferred::before { background: #d0a336; }
.special-rule-summary li.is-empty { color: var(--muted); }
.special-rule-summary li.is-empty::before { background: #9fb9b2; }

/* 操作対象の説明。マウス操作に加えて、キーボードフォーカスでも同じ案内を表示する。 */
.context-tooltip {
  position: fixed;
  z-index: 5000;
  width: max-content;
  max-width: min(340px, calc(100vw - 20px));
  padding: 10px 13px;
  color: #fff;
  background: #173f42;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(10, 42, 44, .22);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
  letter-spacing: .01em;
  pointer-events: none;
}
.context-tooltip[hidden] { display: none; }
.context-tooltip::after {
  position: absolute;
  left: 50%;
  width: 9px;
  height: 9px;
  background: #173f42;
  content: '';
  transform: translateX(-50%) rotate(45deg);
}
.context-tooltip[data-placement="bottom"]::after { top: -5px; border-left: 1px solid rgba(255, 255, 255, .18); border-top: 1px solid rgba(255, 255, 255, .18); }
.context-tooltip[data-placement="top"]::after { bottom: -5px; border-bottom: 1px solid rgba(255, 255, 255, .18); border-right: 1px solid rgba(255, 255, 255, .18); }
#shiftApp label { cursor: help; }
#shiftApp button:focus-visible,
#shiftApp input:focus-visible,
#shiftApp select:focus-visible,
#shiftApp textarea:focus-visible,
#shiftApp summary:focus-visible,
#shiftApp a:focus-visible { scroll-margin: 90px; }
/* AIだけに渡す入力は、ロジック共通欄と混同しない黄色系で示す。 */
.ai-note { margin-top: 20px; padding: 18px; border: 1px solid #e6c66f; border-radius: 14px; background: linear-gradient(135deg, #fffdf4 0%, #fff5cf 100%); box-shadow: 0 8px 20px rgba(151, 111, 20, .08); }
.ai-note label { color: #704f00; }
.ai-note textarea { min-height: 104px; border-color: #d9b554; background: rgba(255, 255, 255, .9); }
.ai-note textarea:focus { border-color: #b98400; box-shadow: 0 0 0 3px rgba(225, 180, 59, .18); }
.ai-note .field-help { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: #745c1a; }

/* Allocation preferences are presented as an ordered, opt-in rule set. */
.allocation-rule-card { border-top: 3px solid var(--mint); }
.allocation-rule-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0 0 16px; color: #41645e; font-size: 12px; }
.allocation-rule-legend span { display: inline-flex; align-items: center; gap: 7px; }
.allocation-rule-legend i { display: grid; place-items: center; width: 24px; height: 24px; color: #fff; background: var(--brand); border-radius: 50%; font-size: 11px; font-style: normal; font-weight: 800; }
.allocation-rule-table { min-width: 1060px; }
.allocation-rule-table td { vertical-align: middle; }
.allocation-rule-table :is(input, select) { max-width: none; width: 100%; }
.allocation-rule-table td:nth-child(1) { width: 48px; }
.allocation-rule-table td:nth-child(2) { width: 74px; }
.allocation-rule-table td:nth-child(3) { width: 78px; }
.allocation-rule-table td:nth-child(7) { width: 88px; }
.rule-enable { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-size: 12px; font-weight: 750; cursor: pointer !important; }
.rule-order { display: inline-flex; padding: 5px 8px; color: #226f62; background: #e6f6f1; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.rule-move { display: flex; gap: 5px; }
.rule-move .btn { min-width: 34px; padding: 5px 8px; }
.code-order-controls { display: inline-flex; flex-direction: column; gap: 2px; margin-left: 5px; vertical-align: middle; }
.code-order-button { display: inline-grid; width: 23px; height: 20px; padding: 0; place-items: center; border: 1px solid #9fcfc4; border-radius: 5px; background: #fff; color: #087d75; font: inherit; font-size: 12px; line-height: 1; cursor: pointer; }
.code-order-button:hover:not(:disabled), .code-order-button:focus-visible { border-color: #07877e; background: #e6f6f2; outline: 2px solid rgba(8, 135, 126, .18); outline-offset: 1px; }
.code-order-button:disabled { opacity: .35; cursor: default; }
@media (max-width: 640px) {
  .code-order-controls { flex-direction: row; margin: 0 0 0 10px; }
  .code-order-button { width: 42px; height: 36px; font-size: 16px; }
}
.rule-conflict { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 8px; color: #536d68; background: #eef5f3; border-radius: 999px; font-size: 10px; font-weight: 750; line-height: 1.4; white-space: normal; }
.rule-conflict[data-conflict="active"] { color: #176758; background: #daf3ea; }
.rule-conflict[data-conflict="shadowed"] { color: #8a431b; background: #fff0e4; }
.rule-conflict[data-conflict="overlap"] { color: #735612; background: #fff6d8; }
[data-allocation-rule].is-rule-disabled td { background: #fbfcfc; }
[data-allocation-rule].is-rule-disabled td > :not(.rule-enable, [data-rule-order], [data-rule-conflict]) { opacity: .72; }
.allocation-rule-summary { margin: 14px 0 0; padding: 11px 14px; color: #315c53; background: #f1f8f6; border-left: 3px solid var(--brand); border-radius: 6px; font-size: 12px; line-height: 1.7; }
.advanced-rule-settings { padding: 0; overflow: hidden; }
.advanced-rule-settings > summary { padding: 17px 20px; color: var(--ink); background: #f4f9f7; cursor: pointer; font-size: 14px; font-weight: 800; }
.advanced-rule-settings[open] > summary { border-bottom: 1px solid var(--line); }
.advanced-rule-settings__body { padding: 20px; }

@media (min-width: 0px) {
  .allocation-rule-wrap { overflow: visible; border: 0; border-radius: 0; }
  .allocation-rule-table { display: block; min-width: 0; background: transparent; }
  .allocation-rule-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .allocation-rule-table tbody { display: grid; gap: 14px; }
  .allocation-rule-table tbody tr { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0; overflow: hidden; border: 1px solid #cee2dc; border-radius: 12px; background: #fff; box-shadow: 0 4px 12px rgba(23, 63, 66, .04); }
  .allocation-rule-table tbody td { position: static !important; display: flex; min-width: 0; width: auto !important; padding: 10px 12px; flex-direction: column; align-items: stretch; gap: 7px; border-right: 1px solid #e2ece9; border-bottom: 1px solid #e2ece9; box-shadow: none !important; white-space: normal; }
  .allocation-rule-table tbody td::before { color: #58736e; content: attr(data-label); font-size: 10px; font-weight: 800; }
  .allocation-rule-table tbody td:nth-child(1) { grid-column: span 1; }
  .allocation-rule-table tbody td:nth-child(2) { grid-column: span 2; }
  .allocation-rule-table tbody td:nth-child(3) { grid-column: span 2; }
  .allocation-rule-table tbody td:nth-child(8) { grid-column: span 7; border-right: 0; }
  .allocation-rule-table tbody td:nth-child(4),
  .allocation-rule-table tbody td:nth-child(5),
  .allocation-rule-table tbody td:nth-child(6) { grid-column: span 4; }
  .allocation-rule-table tbody td:nth-child(7) { grid-column: span 3; border-bottom: 0; }
  .allocation-rule-table tbody td:nth-child(9) { grid-column: span 9; border-right: 0; border-bottom: 0; }
  .allocation-rule-table .rule-enable { min-height: 40px; }
  .allocation-rule-table .rule-order, .allocation-rule-table .rule-conflict { align-self: flex-start; }
}

@media (max-width: 620px) {
  .allocation-rule-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .allocation-rule-table tbody td:nth-child(n) { grid-column: span 1; border-bottom: 1px solid #e2ece9; }
  .allocation-rule-table tbody td:nth-child(8), .allocation-rule-table tbody td:nth-child(9) { grid-column: 1 / -1; }
  .allocation-rule-table tbody td:last-child { border-bottom: 0; }
  .allocation-rule-legend { display: grid; }
  .advanced-rule-settings__body { padding: 14px; }
}

@media (max-width: 1100px) {
  .appbar { grid-template-columns: 160px minmax(160px, 1fr) auto; }
  .app-actions { max-width: 330px; gap: 5px; }
  .main__inner { width: calc(100% - 36px); }
  .workspace-card { padding: 20px; }
  .special-rule-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 820px) {
  .app { height: auto; min-height: 100vh; }
  .appbar { position: relative; grid-template-columns: auto minmax(0, 1fr); padding: 12px; }
  .app-actions { grid-column: 1 / -1; max-width: none; }
  .save-state { display: block; width: auto; margin-right: auto; text-align: left; }
  .project-name label { display: block; }
  .sidebar { top: 0; }
  .nav-button__copy strong { font-size: 13px; }
  .main__inner { width: calc(100% - 28px); padding-top: 18px; }
  .screen-header { gap: 10px; }
  .editable-table th:nth-child(2), .editable-table td:nth-child(2) { position: static; }
  .table-wrap { max-height: 65vh; }
  .card-head { align-items: flex-start; }
  .special-rule-card__head { align-items: flex-start; }
  .special-rule-grid, .special-rule-detail, .special-rule-detail[data-types] { grid-template-columns: 1fr; }
  .mock-note { font-size: 11px; }
}
@media (max-width: 560px) {
  .project-name input { font-size: 16px; }
  .app-actions .btn { min-height: 40px; padding: 7px 10px; font-size: 12px; }
  .save-state { width: 100%; font-size: 11px; }
  .main__inner { width: calc(100% - 24px); }
  .workspace-card { padding: 18px 14px; }
  .card-head { gap: 12px; flex-direction: row; }
  .card-head__actions { width: 100%; }
  .subnav button { font-size: 13px; padding: 8px 12px; }
  .table-guide { font-size: 11px; }
  .data-table input, .data-table select { font-size: 16px; }
  .workflow-footer { gap: 16px; }
  .workflow-footer__actions { width: 100%; margin: 0; flex-direction: column-reverse; }
  .workflow-footer__actions .btn { width: 100%; }
  .special-rule-card__head, .special-rule-empty { align-items: stretch; flex-direction: column; }
  .special-rule-card__actions { justify-content: space-between; }
  .special-rule-grid { padding: 14px 12px 0; }
  .special-rule-detail { margin: 12px 12px 0; padding: 12px; }
  .special-rule-note { margin: 12px; }
}
.is-unresolved-reference { border-color: #c74444 !important; background: #fff4ef !important; }
.night-pair-warning { background: #fff4d8; border-left-color: #c88a19; color: #76520e; margin: 1rem 0 0; }
.context-help-toggle[aria-pressed="true"] { background: #fff0bd; border-color: #d3a44b; color: #664500; }
.shift-cell:focus-visible { outline: 3px solid #b77916; outline-offset: -3px; }
