/* DAYS 定期マイページ。色はDAYS公式HP(days-refined.css)のトークンに合わせる */
:root {
  --ink: #191a18;
  --text: #292b28;
  --muted: #666963;
  --mist: #f3f4f1;
  --paper: #ffffff;
  --quiet: #eceee9;
  --line: #dfe1dc;
  --line-strong: #c9ccc5;
  --green: #335a42;
  --green-soft: #eaf1ec;
  --warn: #8a2a2a;
  --warn-soft: #f8ecea;
  --amber: #6b5500;
  --amber-soft: #f7f1d8;
  --r: 14px;
  --r-s: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--mist); color: var(--text);
  font-family: "Helvetica Neue", "Hiragino Sans", "Yu Gothic", YuGothic, Arial, sans-serif;
  font-size: 16px; line-height: 1.7;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--ink); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 720px; margin: 0 auto; }
.logo { height: 24px; width: auto; }
.who { font-size: 14px; color: var(--muted); text-align: right; }
.demo-banner { max-width: 720px; margin: 0 auto 8px; padding: 8px 16px; background: var(--amber-soft); color: var(--amber); font-size: 14px; }

main { max-width: 720px; margin: 0 auto; padding: 0 16px 24px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
h1 { font-size: 24px; line-height: 1.4; margin: 8px 0 16px; color: var(--ink); }
h2 { font-size: 20px; line-height: 1.4; margin: 28px 0 12px; color: var(--ink); }
h3 { font-size: 16px; margin: 0 0 4px; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 12px; }
.card.alert { border-color: #e2c3bf; background: var(--warn-soft); }
.card.ok { border-color: #c9dccf; background: var(--green-soft); }
.label { font-size: 14px; color: var(--muted); margin: 0 0 2px; }
.big { font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1.3; letter-spacing: .01em; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row.wrap { flex-wrap: wrap; }

.bar { height: 10px; background: var(--quiet); border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 999px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-s); border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn.sub { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn.danger { background: var(--warn); border-color: var(--warn); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btns { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 12px; }
.link { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--ink); text-decoration: underline; cursor: pointer; }

.chip { display: inline-block; font-size: 14px; line-height: 1.5; padding: 1px 8px; border-radius: 999px; background: var(--quiet); color: var(--text); white-space: nowrap; }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }

.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 12px; }
.month-nav strong { font-size: 20px; color: var(--ink); }
.month-nav button { min-width: 48px; min-height: 44px; border: 1px solid var(--line-strong); background: var(--paper); border-radius: var(--r-s); cursor: pointer; }

.ev { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.ev .date { text-align: center; line-height: 1.2; }
.ev .date b { display: block; font-size: 24px; color: var(--ink); }
.ev .date span { font-size: 14px; color: var(--muted); }
.ev.past { opacity: .55; }
.ev .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ev .acts .btn { min-height: 44px; padding: 0 14px; font-size: 14px; }

.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines td { padding: 6px 0; border-top: 1px solid var(--line); vertical-align: top; }
.lines td.n { text-align: right; white-space: nowrap; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(8px);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60px; font-size: 14px; text-decoration: none; color: var(--muted); }
.tabs a .ico { font-size: 20px; line-height: 1.1; }
.tabs a.on { color: var(--ink); font-weight: 700; }

.sheet-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(25, 26, 24, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; background: var(--paper); border-radius: 18px 18px 0 0; padding: 0 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet-head { position: sticky; top: 0; background: var(--paper); display: flex; align-items: center; justify-content: space-between; padding: 14px 0 8px; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.x { width: 44px; height: 44px; border: 0; background: var(--quiet); border-radius: 999px; font-size: 22px; cursor: pointer; }
@media (min-width: 768px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 18px; } }

.field { display: grid; gap: 4px; margin: 0 0 14px; }
.field > span { font-size: 14px; font-weight: 700; color: var(--ink); }
.field input, .field select { min-height: 48px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: #fff; width: 100%; }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; }
.seg button, .times button {
  min-height: 44px; border: 1px solid var(--line-strong); background: #fff; border-radius: var(--r-s); cursor: pointer; padding: 4px 6px; line-height: 1.3;
}
.seg button.on, .times button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.times small { display: block; font-size: 12px; opacity: .8; }
.note { font-size: 14px; color: var(--muted); background: var(--mist); border-radius: var(--r-s); padding: 10px 12px; margin: 12px 0; }
.occ { list-style: none; padding: 0; margin: 8px 0; }
.occ li { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.copy { display: flex; gap: 8px; align-items: center; }
.copy code { flex: 1; font-family: inherit; background: var(--mist); padding: 10px 12px; border-radius: var(--r-s); font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; max-width: calc(100% - 32px); }
.err { color: var(--warn); font-size: 14px; margin: 8px 0; }

/* 空き状況カレンダー */
.small-nav { margin: 4px 0 8px; }
.small-nav strong { font-size: 16px; }
.month-nav button[disabled] { opacity: .35; cursor: not-allowed; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .w { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }
.cal .d {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  min-height: 48px; padding: 2px 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; line-height: 1.2;
}
.cal .d b { font-size: 14px; font-weight: 700; color: var(--ink); }
.cal .d i { font-style: normal; font-size: 14px; }
.cal .d.ok i { color: var(--green); }
.cal .d.few i { color: var(--amber); }
.cal .d.none { background: var(--quiet); cursor: not-allowed; }
.cal .d.none i, .cal .d.none b { color: var(--muted); }
.cal .d.past { background: transparent; border-color: transparent; cursor: default; }
.cal .d.past b { color: var(--line-strong); font-weight: 400; }
.cal .d.past i { color: transparent; }
.cal .d.on { background: var(--ink); border-color: var(--ink); }
.cal .d.on b, .cal .d.on i { color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; border: 1px solid var(--line-strong); }

/* その日の空き状況の帯 */
.tl { position: relative; height: 28px; border-radius: 8px; background: var(--green-soft); border: 1px solid #c9dccf; overflow: hidden; }
.tl .busy, .sw.busy { background: repeating-linear-gradient(135deg, #c9ccc5 0 6px, #dfe1dc 6px 12px); }
.tl .busy { position: absolute; top: 0; bottom: 0; }
.sw.free { background: var(--green-soft); border-color: #c9dccf; }
.tl .pick, .sw.pick { background: var(--ink); }
.tl .pick { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; }
.tl-ticks { position: relative; height: 18px; font-size: 12px; color: var(--muted); }
.tl-ticks span { position: absolute; transform: translateX(-50%); }
.tl-ticks span:first-child { transform: none; }
.tl-ticks span:last-child { transform: translateX(-100%); }

.tl .cur { position: absolute; top: 2px; bottom: 2px; border: 2px dashed var(--ink); border-radius: 6px; }
.sw.cur { border: 2px dashed var(--ink); background: transparent; }
