:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-soft: #fbfaf7;
  --text: #201b18;
  --muted: #6f6760;
  --line: #ded8cf;
  --brand: #a8342f;
  --brand-dark: #7d211e;
  --accent: #1f6f68;
  --danger: #9d2525;
  --shadow: 0 12px 28px rgba(31, 27, 24, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding-bottom: 92px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

button {
  cursor: pointer;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  background: #2b211d;
  color: #fff;
}

.eyebrow {
  margin: 0 0 2px;
  color: #f0c46a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.25;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.prototype-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  padding: 5px 10px;
  color: #ffe4a9;
  font-size: 12px;
  font-weight: 700;
}

.app-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.top-controls {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  gap: 7px;
  margin: -2px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 243, 238, 0.96);
  padding: 8px;
  box-shadow: 0 8px 18px rgba(31, 27, 24, 0.08);
  backdrop-filter: blur(8px);
}

.top-controls .top-month-control,
.top-controls .tabs,
.top-controls .notice {
  margin-bottom: 0;
}

.top-controls .top-month-control,
.top-staff-control {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
}

.top-staff-control {
  display: block;
}

.admin-auth-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(31, 111, 104, 0.28);
  border-radius: 8px;
  background: #f3fbf8;
  padding: 7px 8px;
}

.admin-auth-status span {
  color: #15534e;
  font-size: 13px;
  font-weight: 900;
}

.admin-auth-status .compact-button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-button,
.mode-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
}

.tab-button.is-active,
.mode-button.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.mode-switch {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.mode-switch > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.top-month-control {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.month-navigator {
  display: grid;
  grid-template-columns: minmax(74px, auto) 1fr minmax(74px, auto);
  gap: 7px;
  align-items: center;
}

.month-navigator strong {
  text-align: center;
  font-size: 17px;
  line-height: 1.2;
}

.month-navigator input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 14px;
}

.notice.is-dev-note {
  border-style: dashed;
  box-shadow: none;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.45;
}

.notice.is-dev-note strong {
  display: inline;
}

.notice strong {
  color: var(--text);
}

.form-panel {
  padding: 16px;
}

#shiftForm {
  padding-bottom: 18px;
}

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

.field-grid:empty {
  display: none;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-height: 42px;
  padding: 8px 10px;
}

textarea {
  min-height: 38px;
  resize: vertical;
}

input:disabled {
  background: #eee9e1;
  color: #92877d;
}

.section-heading {
  margin-top: 16px;
  margin-bottom: 10px;
}

.heading-month {
  color: var(--muted);
  font-size: 0.9em;
}

.heading-today {
  color: #7a5a32;
  font-size: 0.82em;
  font-weight: 500;
  white-space: nowrap;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.calendar-list,
.request-list {
  display: grid;
  gap: 8px;
}

.month-calendar {
  display: grid;
  gap: 6px;
}

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

.weekday-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar-blank {
  min-height: 50px;
}

.calendar-day {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 2px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 6px 4px;
  text-align: left;
}

.calendar-day.is-selected {
  outline: 3px solid rgba(31, 111, 104, 0.24);
  outline-offset: 1px;
  box-shadow: inset 0 0 0 2px rgba(31, 111, 104, 0.42);
}

.calendar-day.is-off {
  border-color: var(--line);
  background: #fff;
}

.calendar-day.is-work,
.calendar-day.is-early {
  border-color: var(--line);
  background: #fff;
}

.calendar-day.is-late {
  border-color: var(--line);
  background: #fff;
}

.calendar-day.is-either {
  border-color: var(--line);
  background: #fff;
}

.calendar-day-number {
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.calendar-day-status {
  justify-self: start;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
}

.admin-day-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
}

.calendar-day.is-off .calendar-day-status {
  background: #fff0ef;
  color: var(--brand-dark);
}

.calendar-day.is-work .calendar-day-status,
.calendar-day.is-early .calendar-day-status {
  background: #ecf8f5;
  color: #15534e;
}

.calendar-day.is-off .admin-day-count {
  color: var(--brand-dark);
}

.calendar-day.is-work .admin-day-count,
.calendar-day.is-early .admin-day-count {
  color: #15534e;
}

.calendar-day.is-late .calendar-day-status,
.calendar-day.is-late .admin-day-count {
  background: #eef4ff;
  color: #214c93;
}

.calendar-day.is-either .calendar-day-status,
.calendar-day.is-either .admin-day-count {
  background: #f5efff;
  color: #633199;
}

.calendar-day.is-store-closed {
  border-color: #e0aaa6;
  background: #fff1ef;
}

.calendar-day.is-store-closed.is-selected {
  border-color: var(--accent);
  background: #ffe8e5;
}

.admin-calendar .calendar-day {
  border-color: var(--line);
  background: #fff;
}

.admin-calendar .calendar-day.is-store-closed {
  border-color: #e0aaa6;
  background: #fff1ef;
}

.admin-calendar .calendar-day.is-selected,
.admin-request-calendar .calendar-day.is-selected {
  border-color: var(--accent);
  background: #f7fbfa;
}

.admin-calendar .calendar-day.is-store-closed.is-selected {
  border-color: var(--accent);
  background: #ffe8e5;
}

.admin-calendar .calendar-day.is-bulk-selected {
  border-color: var(--brand);
  background: #fff7f2;
  box-shadow: inset 0 0 0 2px rgba(168, 52, 47, 0.35);
}

.calendar-day.is-bulk-selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px rgba(168, 52, 47, 0.34);
}

.calendar-day.is-bulk-selected:not(.is-store-closed) {
  background: #fffaf5;
}

.admin-request-calendar .calendar-day {
  border-color: var(--line);
  background: #fff;
}

.calendar-day.is-sunday-or-holiday:not(.is-store-closed),
.admin-calendar .calendar-day.is-sunday-or-holiday:not(.is-store-closed),
.admin-request-calendar .calendar-day.is-sunday-or-holiday:not(.is-store-closed) {
  background: #fff4d6;
}

.admin-request-calendar .calendar-day.is-store-closed {
  border-color: #e0aaa6;
  background: #fff1ef;
}

.admin-request-calendar .calendar-day.is-store-closed.is-selected {
  border-color: var(--accent);
  background: #ffe8e5;
}

.late-request-notice {
  border: 1px solid #e6c36a;
  border-radius: 8px;
  background: #fff9e8;
  color: #6f4f00;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 900;
}

.shift-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.shift-choice {
  min-height: 48px;
  padding: 7px 5px;
}

.shift-choice[data-request-choice="empty"] {
  grid-column: 1 / -1;
  min-height: 42px;
  color: var(--muted);
  font-size: 14px;
}

.choice-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  white-space: nowrap;
}

.shift-choice.is-selected-choice.is-empty {
  border-color: #8d857c;
  background: #f3f0ea;
}

.shift-choice.is-selected-choice.is-off {
  border-color: var(--brand);
  background: #fff1ef;
  color: var(--brand-dark);
}

.shift-choice.is-selected-choice.is-early {
  border-color: var(--accent);
  background: #eef8f6;
  color: #15534e;
}

.shift-choice.is-selected-choice.is-late {
  border-color: #3367b8;
  background: #eef4ff;
  color: #214c93;
}

.shift-choice.is-selected-choice.is-either {
  border-color: #8150bc;
  background: #f5efff;
  color: #633199;
}

.admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  min-height: 18px;
}

.support-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  min-height: 16px;
}

.request-mini-chip,
.more-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 2px 5px;
  background: #f3f0ea;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.request-mini-chip.is-night {
  border-style: solid;
  border-radius: 2px;
  font-weight: 400;
}

.request-mini-chip.is-either,
.request-mini-chip.is-both {
  border-style: solid;
  border-width: 1px;
  border-radius: 0;
  font-weight: 400;
  box-shadow: inset 0 0 0 1px currentColor;
}

.request-mini-chip.is-off {
  border: 2px solid #a9a19a;
  border-radius: 999px;
  background: #fff;
  color: #555555;
  font-weight: 400;
}

.late-request-label {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border-radius: 999px;
  background: #fff0c2;
  color: #7a5200;
  padding: 1px 6px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.confirmed-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 3px;
  align-items: center;
  min-height: 18px;
}

.staff-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  padding: 0 5px;
}

.staff-chip.chip-default {
  background: #5e5852;
}

.staff-chip.request-chip {
  width: auto;
  min-width: 28px;
}

.confirmed-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 1px 5px;
  color: #fff;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.confirmed-chip.pending {
  background: #5e5852;
}

.confirmed-chip.is-night {
  border: 1px solid;
  border-radius: 2px;
  font-weight: 400;
  letter-spacing: 0;
}

.confirmed-chip.is-off {
  border: 2px solid #a9a19a;
  border-radius: 999px;
  background: #fff;
  color: #555555;
  font-weight: 400;
}

.memo-dot {
  justify-self: start;
  border-radius: 999px;
  background: #2b211d;
  color: #fff;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
}

.day-editor {
  border: 2px solid rgba(31, 111, 104, 0.22);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.admin-day-detail {
  display: grid;
  gap: 8px;
  border: 2px solid rgba(31, 111, 104, 0.22);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.compact-detail {
  gap: 7px;
  padding: 10px;
}

.compact-detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compact-detail-title span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 800;
}

.store-closed-control,
.store-closed-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 7px;
}

.store-closed-control.is-closed,
.store-closed-notice {
  border-color: #d7a6a6;
  background: #fff1ef;
}

.store-closed-control .compact-button {
  min-height: 36px;
  padding: 6px 10px;
  white-space: nowrap;
}

.compact-shift-list {
  display: grid;
  gap: 4px;
}

.staff-confirmed-detail {
  margin-top: 8px;
}

.staff-confirmed-list {
  display: grid;
  gap: 5px;
}

.staff-confirmed-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(110px, auto);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 7px;
}

.staff-confirmed-statuses {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.staff-confirmed-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.staff-confirmed-status.is-night {
  border: 1px solid;
  border-radius: 3px;
}

.staff-confirmed-status.is-off {
  border: 1px dashed #a9a19a;
  background: #f1f0ee;
  color: #6f6760;
}

.staff-confirmed-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  background: #f1f0ee;
  color: var(--muted);
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.compact-shift-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(210px, 1.5fr);
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 7px;
}

.compact-staff-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.compact-staff-cell > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.compact-staff-cell small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.compact-request-cell {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.confirm-choice-group {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.confirm-choice {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 900;
}

.confirm-choice.is-active {
  border-color: var(--accent);
  background: #eaf7f4;
  color: #15534e;
  box-shadow: inset 0 0 0 1px rgba(31, 111, 104, 0.28);
}

.confirm-choice.is-bulk-candidate {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(168, 52, 47, 0.16);
}

.compact-readonly {
  min-height: 38px;
}

.compact-detail-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 2px;
}

.compact-detail-actions .primary-button,
.compact-detail-actions .secondary-button {
  min-height: 42px;
  padding: 8px;
}

.admin-work-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.admin-work-note p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-detail-section {
  display: grid;
  gap: 8px;
}

.confirmed-builder {
  display: grid;
  gap: 10px;
}

.confirmed-bucket {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.confirmed-bucket-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 180px);
  gap: 10px;
  align-items: end;
}

.confirmed-bucket-header select {
  min-height: 44px;
  font-weight: 800;
}

.confirmed-assigned-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
  align-items: center;
}

.assigned-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 4px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.empty-inline {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.save-confirmed-button {
  margin-top: 2px;
}

.confirmed-readonly-groups {
  display: grid;
  gap: 8px;
}

.confirmed-readonly-group {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.request-overview {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.request-overview h3 {
  margin: 0;
  font-size: 14px;
}

.request-overview.is-admin-view {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.request-summary-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 7px;
  font-size: 13px;
}

.request-summary-row small {
  grid-column: 2 / -1;
  color: var(--muted);
}

.admin-reply-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.admin-reply-editor.is-admin-note-only {
  background: #fbfaf7;
}

.admin-reply-editor label {
  display: grid;
  gap: 4px;
}

.admin-reply-memo {
  display: grid;
  gap: 3px;
}

.admin-reply-memo span,
.admin-reply-editor label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-reply-memo p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-reply-editor textarea {
  min-height: 54px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.45;
}

.admin-reply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.reply-checked-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  border-radius: 999px;
  background: #edf6f2;
  color: #2f6a52;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.staff-reply-text {
  display: block;
  margin-top: 2px;
  color: #2f6a52;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.day-editor-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.day-editor-title span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.day-card,
.request-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.day-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 800;
}

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

.day-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 8px;
}

.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.choice.shift-choice {
  padding-right: 4px;
  padding-left: 4px;
  font-size: 14px;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.choice.is-selected-off,
.choice:has(input[value="off"]:checked) {
  border-color: var(--brand);
  background: #fff1ef;
  color: var(--brand-dark);
}

.choice.is-selected-work,
.choice:has(input[value="work"]:checked) {
  border-color: var(--accent);
  background: #eef8f6;
  color: #15534e;
}

.choice:focus-within {
  outline: 3px solid rgba(31, 111, 104, 0.2);
  outline-offset: 2px;
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 8px;
}

.sticky-actions {
  margin-top: 12px;
  background: transparent;
  padding: 0;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  background: var(--brand);
  color: #fff;
}

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

.danger-button {
  background: #fff;
  color: var(--danger);
  border: 1px solid #d7a6a6;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.summary {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.today-shift-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  position: relative;
  overflow: hidden;
  width: 100%;
  margin: 0 0 14px;
  border: 1px solid rgba(255, 229, 178, 0.34);
  border-radius: 14px;
  background:
    radial-gradient(circle at 88% 10%, rgba(240, 196, 106, 0.28), transparent 24%),
    linear-gradient(135deg, rgba(255, 218, 145, 0.16), rgba(255, 255, 255, 0) 44%),
    linear-gradient(160deg, #30211c 0%, #17110f 54%, #3a2821 100%);
  min-height: 164px;
  padding: clamp(16px, 3vw, 24px);
  box-shadow:
    0 24px 48px rgba(31, 27, 24, 0.34),
    0 8px 18px rgba(31, 27, 24, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.today-shift-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(240, 196, 106, 0.2), transparent 34%);
}

.today-shift-title {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  padding-bottom: 10px;
}

.today-shift-title strong {
  color: #fff;
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1.15;
  letter-spacing: 0;
}

.today-shift-title span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(240, 196, 106, 0.18);
  color: #ffe1a3;
  padding: 5px 10px;
  font-size: clamp(13px, 2.2vw, 16px);
  font-weight: 800;
}

.today-shift-group {
  position: relative;
  display: grid;
  gap: 5px;
  align-self: start;
}

.today-shift-group h3 {
  margin: 0;
  color: #f0c46a;
  font-size: clamp(14px, 2.4vw, 17px);
}

.today-shift-staff-list {
  display: grid;
  gap: 5px;
}

.today-shift-staff {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  padding: 7px 9px;
  backdrop-filter: blur(4px);
}

.today-shift-staff-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.today-shift-staff-name strong {
  min-width: 0;
  color: #fff;
  font-size: clamp(14px, 2.5vw, 17px);
  overflow-wrap: anywhere;
}

.today-shift-staff small {
  color: #cfeee2;
  font-size: clamp(12px, 2.2vw, 14px);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.today-shift-empty {
  position: relative;
  align-self: center;
  margin: 0;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 22px 14px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(14px, 2.5vw, 17px);
  text-align: center;
}

.month-status-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.month-status-panel > div:first-child {
  display: grid;
  gap: 2px;
}

.month-status-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.month-status-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.month-confirm-button {
  grid-column: 1 / -1;
}

.line-message-button {
  background: #06c755;
  color: #fff;
}

.line-message-button:disabled {
  background: #d8ded8;
  color: #7c867c;
}

.csv-export-button {
  background: #2563eb;
  color: #fff;
}

.dev-clear-button {
  grid-column: 1 / -1;
}

.line-message-preview {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.line-preview-heading {
  display: grid;
  gap: 2px;
}

.line-preview-heading span {
  color: var(--muted);
  font-size: 13px;
}

.line-chat-preview {
  display: flex;
  justify-content: flex-start;
  border-radius: 8px;
  background: #eef5ea;
  padding: 10px;
}

.line-flex-preview-card {
  overflow: hidden;
  width: min(330px, 100%);
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 27, 24, 0.08);
}

.line-flex-preview-body {
  display: grid;
  gap: 8px;
  padding: 13px 14px;
}

.line-flex-preview-body strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.line-flex-preview-body p {
  margin: 0;
  color: #555;
  font-size: 13px;
  line-height: 1.5;
}

.line-flex-preview-footer {
  border-top: 1px solid var(--line);
  padding: 10px 14px 12px;
}

.line-flex-preview-footer span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  background: #06c755;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.line-preview-meta {
  display: grid;
  gap: 6px;
  margin: 0;
}

.line-preview-meta > div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid rgba(31, 111, 104, 0.14);
  border-radius: 8px;
  background: #fff;
  padding: 7px;
}

.line-preview-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.line-preview-meta dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.line-message-preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.line-message-preview-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 900;
}

.month-bottom-actions {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.month-bottom-actions > div:first-child {
  display: grid;
  gap: 2px;
}

.month-bottom-actions span {
  color: var(--muted);
  font-size: 13px;
}

.month-bottom-actions p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.month-bottom-actions .primary-button,
.month-bottom-actions .secondary-button,
.month-bottom-actions .danger-button {
  min-height: 44px;
  padding: 8px 10px;
}

.url-share-panel {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.url-share-title {
  display: grid;
  gap: 2px;
}

.url-share-title span {
  color: var(--muted);
  font-size: 13px;
}

.url-share-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, auto);
  gap: 7px;
  align-items: end;
}

.url-share-list input {
  color: var(--muted);
  font-size: 13px;
}

.url-share-list .secondary-button {
  min-height: 42px;
  padding: 8px 10px;
}

.staff-settings-panel {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.staff-settings-title {
  display: grid;
  gap: 2px;
}

.staff-settings-title span {
  color: var(--muted);
  font-size: 13px;
}

.staff-settings-list {
  display: grid;
  gap: 7px;
}

.staff-settings-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(82px, 110px) 58px auto minmax(96px, auto);
  gap: 7px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 7px;
}

.staff-settings-row input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

.staff-remove-button {
  min-height: 42px;
  padding: 8px 10px;
  white-space: nowrap;
}

.staff-active-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  color: var(--muted);
  font-weight: 800;
}

.staff-active-toggle input {
  width: auto;
  min-height: auto;
}

.staff-settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bulk-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 5px;
}

.bulk-toolbar.is-active {
  border-color: var(--accent);
  background: #f4fbf7;
}

.bulk-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bulk-toolbar .compact-button {
  width: 100%;
  min-height: 30px;
  padding: 4px 5px;
  font-size: 12px;
  white-space: nowrap;
}

.bulk-toolbar .compact-button.is-active {
  border-color: var(--accent);
  background: #e6f4eb;
}

.staff-bulk-toolbar {
  display: grid;
  grid-template-columns: minmax(98px, auto) 1fr minmax(82px, auto);
  gap: 5px;
  align-items: center;
  margin: 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 5px;
}

.staff-bulk-toolbar.is-active {
  border-color: var(--accent);
  background: #f7fbfa;
}

.staff-bulk-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.staff-bulk-toolbar small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.staff-bulk-toolbar .compact-button {
  width: 100%;
  min-height: 30px;
  padding: 4px 6px;
  font-size: 12px;
  white-space: nowrap;
}

.staff-bulk-toolbar .compact-button.is-active {
  border-color: var(--accent);
  background: #e6f4eb;
}

.admin-auth-panel {
  display: grid;
  max-width: 520px;
  margin: 20px auto;
}

.admin-token-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 9px;
}

.admin-token-panel > div:first-child {
  display: grid;
  gap: 2px;
}

.admin-token-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-token-panel.has-token {
  border-color: rgba(31, 111, 104, 0.32);
  background: #f3fbf8;
}

.admin-token-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: end;
}

.admin-token-actions input {
  min-height: 36px;
}

.bulk-candidate {
  color: var(--text) !important;
}

.store-closed-bulk-button {
  background: #f5eee8;
  color: #69554a;
}

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

.request-card {
  display: grid;
  gap: 4px;
}

.request-card strong {
  font-size: 16px;
}

.confirm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 160px);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.confirm-main {
  display: grid;
  gap: 4px;
}

.confirm-staff {
  display: flex;
  align-items: center;
  gap: 7px;
}

.confirm-memo {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.confirm-row select {
  min-height: 46px;
  font-weight: 800;
}

.confirmed-readonly {
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px 9px;
}

.confirmed-readonly span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.request-meta {
  color: var(--muted);
  font-size: 14px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: calc(100% - 32px);
  border-radius: 8px;
  background: #201b18;
  color: #fff;
  padding: 10px 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.18s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 680px) {
  .app-header {
    padding: 14px 12px;
  }

  h1 {
    font-size: 18px;
  }

  .app-shell {
    padding: 10px;
  }

  .top-month-control,
  .mode-switch,
  .notice,
  .form-panel {
    border-radius: 8px;
  }

  .top-month-control,
  .mode-switch {
    margin-bottom: 8px;
    padding: 8px;
  }

  .tabs {
    gap: 6px;
    margin-bottom: 8px;
  }

  .tab-button,
  .mode-button {
    min-height: 42px;
    padding: 8px 6px;
    font-size: 14px;
  }

  .month-navigator {
    grid-template-columns: minmax(58px, auto) 1fr minmax(58px, auto);
    gap: 5px;
  }

  .month-navigator strong {
    font-size: 15px;
  }

  .notice {
    margin-bottom: 10px;
    padding: 10px;
    font-size: 13px;
  }

  .section-heading {
    margin-top: 10px;
    margin-bottom: 8px;
  }

  .section-heading h2 {
    font-size: 17px;
  }

  .section-heading p {
    font-size: 13px;
  }

  .field-grid,
  .mode-buttons,
  .admin-actions {
    grid-template-columns: 1fr;
  }

  .compact-shift-row {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 6px;
  }

  .staff-confirmed-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    padding: 6px;
  }

  .staff-confirmed-statuses {
    gap: 3px;
  }

  .staff-confirmed-status,
  .staff-confirmed-empty {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 12px;
  }

  .confirm-choice-group {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
  }

  .confirm-choice {
    min-height: 38px;
    font-size: 11px;
    padding: 5px 3px;
  }

  .compact-detail-actions {
    grid-template-columns: 1fr;
  }

  .store-closed-control,
  .store-closed-notice {
    grid-template-columns: 1fr;
  }

  .month-status-actions {
    grid-template-columns: 1fr;
  }

  .line-preview-meta > div,
  .line-message-preview-actions {
    grid-template-columns: 1fr;
  }

  .admin-token-actions {
    grid-template-columns: 1fr;
  }

  .url-share-list {
    grid-template-columns: 1fr;
  }

  .staff-settings-row,
  .staff-settings-actions {
    grid-template-columns: 1fr;
  }

  .staff-settings-row {
    gap: 6px;
    padding: 7px;
  }

  .staff-settings-row input,
  .staff-settings-row select {
    min-height: 40px;
  }

  .staff-remove-button {
    min-height: 40px;
  }

  .bulk-toolbar {
    gap: 4px;
  }

  .bulk-toolbar .compact-button {
    min-height: 30px;
    padding: 4px 3px;
    font-size: 11px;
  }

  .staff-bulk-toolbar {
    grid-template-columns: minmax(82px, auto) 1fr minmax(70px, auto);
    gap: 4px;
    padding: 4px;
  }

  .staff-bulk-toolbar .compact-button {
    min-height: 30px;
    padding: 4px 3px;
    font-size: 11px;
  }

  .staff-bulk-toolbar span {
    font-size: 12px;
  }

  .confirm-row {
    grid-template-columns: 1fr;
  }

  .confirmed-bucket-header {
    grid-template-columns: 1fr;
  }

  .weekday-row,
  .calendar-grid {
    gap: 3px;
  }

  .calendar-blank,
  .calendar-day {
    min-height: 56px;
  }

  .calendar-day {
    border-radius: 7px;
    padding: 5px 3px;
  }

  .calendar-day-number {
    font-size: 15px;
  }

  .calendar-day-status,
  .admin-day-count,
  .memo-dot {
    font-size: 9px;
  }

  .calendar-day-status {
    padding: 2px 5px;
  }

  .staff-chip {
    min-width: 19px;
    height: 18px;
    font-size: 10px;
    padding: 0 4px;
  }

  .request-mini-chip,
  .confirmed-chip,
  .more-chip {
    min-height: 18px;
    font-size: 10px;
    padding: 2px 4px;
  }

  .support-chip-row,
  .confirmed-chip-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: min-content;
    gap: 2px;
    width: 100%;
    align-items: start;
    align-content: start;
    justify-items: start;
    justify-content: stretch;
  }

  .confirmed-chip {
    width: auto;
    max-width: 100%;
    min-width: 0;
    min-height: 15px;
    height: auto;
    align-self: start;
    justify-self: start;
    padding: 1px 2px;
    font-size: 8px;
    line-height: 1;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    overflow: hidden;
  }

  .request-mini-chip {
    width: auto;
    min-width: 0;
    max-width: 100%;
    min-height: 16px;
    height: auto;
    align-self: start;
    justify-self: start;
    box-sizing: border-box;
    padding: 2px 3px;
    font-size: 8.5px;
    line-height: 1;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    overflow: hidden;
  }

  .support-chip-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    justify-items: start;
    justify-content: stretch;
  }

  .confirmed-chip.is-night {
    border-radius: 2px;
  }

  .form-panel {
    padding: 10px;
  }

  .day-card {
    padding: 9px;
  }

  .day-title {
    margin-bottom: 7px;
  }

  .weekday {
    font-size: 12px;
  }

  .choice {
    min-height: 46px;
    font-size: 15px;
  }

  .choice.shift-choice {
    padding-right: 3px;
    padding-left: 3px;
    font-size: 13px;
  }

  .sticky-actions {
    padding: 0;
  }
}
