:root {
  --ink: #18332f;
  --muted: #6d7b77;
  --paper: #f4f0e8;
  --card: #fffdf8;
  --accent: #f0784b;
  --accent-soft: #fbe4d8;
  --sage: #a9c6b7;
  --line: #dedbd2;
  --danger: #b6473d;
  --shadow: 0 14px 40px rgba(25, 50, 45, .09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto 80px; position: relative; }
.panel { background: var(--card); border: 1px solid rgba(222, 219, 210, .8); border-radius: 18px; box-shadow: var(--shadow); }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, select { min-height: 40px; padding: 8px 11px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; outline: none; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.primary { min-height: 42px; padding: 9px 18px; color: #fff; background: var(--accent); border: 0; border-radius: 10px; font-weight: 800; }
.secondary { min-height: 40px; padding: 8px 14px; color: var(--ink); background: #fff; border: 1px solid var(--sage); border-radius: 10px; font-size: 12px; font-weight: 800; }
.calendar-scroll { margin-top: 18px; overflow-x: auto; padding-bottom: 5px; }
.weekday { padding: 8px; color: var(--muted); text-align: center; font-size: 12px; font-weight: 700; }
.weekday.sun { color: var(--danger); }
.weekday.sat { color: #416f92; }
.toast { position: fixed; inset: auto 22px 22px auto; z-index: 9999; max-width: calc(100% - 24px); padding: 12px 18px; color: white; background: var(--ink); border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

.request-page { padding-bottom: 24px; }
.request-main { padding-top: 24px; }
.request-controls { padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.request-controls h1 { min-width: 0; margin: 0 auto 0 0; overflow: hidden; font-size: clamp(18px, 3vw, 26px); text-overflow: ellipsis; white-space: nowrap; }
.request-controls input { width: 150px; flex: 0 0 150px; }
.request-calendar { min-width: 820px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.request-day { min-height: 108px; padding: 9px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.request-day.blank { visibility: hidden; }
.request-day-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.request-day-head strong { font-family: Georgia, serif; font-size: 16px; }
.request-day-head small { color: var(--muted); }
.request-select { width: 100%; min-height: 36px; padding: 6px; font-size: 11px; font-weight: 700; }
.request-select.request-shift { color: #a95d24; border-color: #ecc39f; background: #fff7ed; }
.request-select.request-off { color: #727976; background: #eee; }
.public-error { margin-top: 18px; padding: 24px; color: var(--danger); }

.daily-page { min-height: 100vh; }
.daily-main { width: min(760px, calc(100% - 24px)); margin: 0 auto 50px; padding-top: 20px; }
.daily-header { padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.daily-header small { color: var(--accent); font-size: 11px; font-weight: 800; }
.daily-header h1 { margin: 3px 0 0; font-size: 25px; }
.daily-header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.daily-form { margin-top: 12px; padding: 18px 20px; }
.daily-form-head { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.daily-form-head span { color: var(--muted); font-size: 9px; }
.daily-form-head span:empty { display: none; }
.daily-rows { display: grid; gap: 8px; }
.daily-row { padding: 10px; display: grid; grid-template-columns: minmax(120px, .9fr) 90px minmax(170px, 1.4fr) 34px; align-items: end; gap: 8px; background: #f4f1ea; border-radius: 10px; }
.daily-row input { width: 100%; min-width: 0; }
.daily-remove { width: 34px; height: 40px; color: var(--danger); background: #fff; border: 1px solid #e6c4bf; border-radius: 8px; }
.daily-empty { margin: 0; padding: 25px 10px; color: var(--muted); text-align: center; font-size: 11px; }
.daily-add { width: 100%; margin-top: 9px; }

@media (max-width: 600px) {
  main { width: calc(100% - 12px); margin-bottom: 50px; }
  .panel { border-radius: 12px; box-shadow: 0 8px 22px rgba(25, 50, 45, .07); }
  label { gap: 4px; font-size: 10px; }
  input, select { min-height: 35px; padding: 6px 8px; border-radius: 8px; font-size: 12px; }
  .calendar-scroll { margin-top: 9px; overflow-x: visible; }
  .request-calendar { width: 100%; min-width: 0; gap: 2px; }
  .request-calendar .weekday { padding: 3px 0; font-size: 9px; }
  .request-day { min-width: 0; min-height: 54px; padding: 3px; border-radius: 7px; }
  .request-day-head { margin-bottom: 3px; }
  .request-day-head strong { font-size: 12px; }
  .request-day-head small { display: none; }
  .request-select { width: 100%; min-width: 0; min-height: 28px; padding: 2px 0; appearance: none; font-size: 8px; text-align: center; text-align-last: center; }
  .request-main { padding-top: 8px; }
  .request-controls { padding: 8px; gap: 6px; }
  .request-controls h1 { font-size: 14px; }
  .request-controls input { width: 122px; min-height: 34px; flex-basis: 122px; padding-inline: 6px; font-size: 11px; }
  .request-controls .primary { min-height: 34px; padding: 6px 10px; font-size: 11px; }
  .daily-main { width: calc(100% - 12px); margin-bottom: 30px; padding-top: 7px; }
  .daily-header { padding: 12px; }
  .daily-header h1 { font-size: 20px; }
  .daily-header .primary { min-height: 36px; padding: 7px 12px; }
  .daily-form { margin-top: 8px; padding: 12px; }
  .daily-row { grid-template-columns: minmax(0, 1fr) 82px 34px; gap: 7px; }
  .daily-row label:nth-child(3) { grid-column: 1 / 3; }
  .daily-row .daily-remove { grid-column: 3; grid-row: 1 / 3; height: 100%; }
}
