/* Rhymoe 面談予約システム 共通スタイル */
:root {
  --blue: #19a6f8;
  --blue-dark: #0b7fc7;
  --blue-pale: #e8f6ff;
  --ink: #2b3440;
  --ink-soft: #5d6876;
  --line: #dfe5ec;
  --bg: #f6f9fc;
  --card: #ffffff;
  --orange: #f39f57;
  --red: #d8423c;
  --red-pale: #fdecea;
  --green: #1f8f5f;
  --green-pale: #e6f6ee;
  --beige: #f7efd6;
  --brown: #7a6524;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-wrap: pretty;
  line-break: strict;
}
h1, h2, h3 { line-height: 1.4; margin: 0; text-wrap: balance; }
p { margin: 0 0 .8em; }
a { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 20px 16px 56px; }
.brand { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; color: var(--ink-soft); font-size: 14px; font-weight: 600; letter-spacing: .04em; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.menu-card { border-top: 5px solid var(--blue); }
.menu-name { font-size: 22px; font-weight: 800; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; background: var(--beige); color: var(--brown); border-radius: 5px; padding: 2px 10px; font-size: 13.5px; font-weight: 600; }
.tag-blue { background: var(--blue-pale); color: var(--blue-dark); }
.menu-desc { margin: 12px 0 0; color: var(--ink-soft); white-space: pre-wrap; font-size: 15px; }

.step-title { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 14px; flex: none; }
.muted { color: var(--ink-soft); font-size: 14px; }
.note { color: var(--ink-soft); font-size: 13.5px; margin-top: 10px; }

/* 日付ピッカー */
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { margin-bottom: 6px; font-size: 12.5px; color: var(--ink-soft); text-align: center; font-weight: 600; }
.cal-head .sun { color: #d0554f; } .cal-head .sat { color: #2f7fd1; }
.cal-month { grid-column: 1 / -1; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); margin: 6px 0 0; }
.day { aspect-ratio: 1 / 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; cursor: pointer; padding: 0; transition: background .12s, border-color .12s; }
.day:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-pale); }
.day:disabled { background: #f1f4f7; color: #b4bcc6; border-color: transparent; cursor: default; font-weight: 500; }
.day.out { visibility: hidden; }
.day.selected, .day.selected:hover:not(:disabled) { background: var(--blue); border-color: var(--blue); color: #fff; }
.day:focus-visible, .time:focus-visible, .btn:focus-visible { outline: 3px solid rgba(25,166,248,.45); outline-offset: 2px; }

.times-title { font-weight: 800; margin: 18px 0 4px; font-size: 16px; }
.time-group { font-size: 13px; color: var(--ink-soft); font-weight: 700; margin: 12px 0 6px; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.time { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 0; font-weight: 700; font-size: 16px; cursor: pointer; font-variant-numeric: tabular-nums; }
.time:hover { border-color: var(--blue); background: var(--blue-pale); }
.time.selected, .time.selected:hover { background: var(--blue); border-color: var(--blue); color: #fff; }

/* フォーム */
.form { display: grid; gap: 14px; }
.form label { display: block; font-weight: 700; font-size: 14.5px; }
.form label > input, .form label > select, .form label > textarea { display: block; margin-top: 5px; }
.form label > .help { display: block; margin-top: 4px; }
.form label > .help:first-of-type:not(:last-child) { display: inline; }
.req { color: var(--red); font-size: 12px; margin-left: 6px; font-weight: 700; }
.opt { color: var(--ink-soft); font-size: 12px; margin-left: 6px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=time], select, textarea, .form input:not([type]) {
  width: 100%; border: 1px solid #c9d2dc; border-radius: 10px; padding: 11px 12px; background: #fff; font-weight: 400; font-size: 16px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(25,166,248,.2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #c9d2dc; background: #fff; border-radius: 999px; padding: 11px 22px; font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink); font-size: 15.5px; line-height: 1.3; }
.btn:hover { border-color: var(--blue); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-danger { color: var(--red); border-color: #efc1be; }
.btn-danger:hover { background: var(--red-pale); border-color: var(--red); }
.btn-line { background: #06c755; border-color: #06c755; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn-row .btn-primary { flex: 1 1 200px; }

.summary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 15.5px; }
.summary dt { color: var(--ink-soft); font-size: 13.5px; padding-top: 2px; white-space: nowrap; }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.summary dd.big { font-size: 18px; font-weight: 800; }
.picked { background: var(--blue-pale); border-radius: 10px; padding: 10px 14px; font-weight: 800; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.alert { border-radius: 10px; padding: 11px 14px; font-size: 14.5px; margin: 0 0 14px; }
.alert-error { background: var(--red-pale); color: #a3271f; }
.alert-ok { background: var(--green-pale); color: #136a45; }
.alert-info { background: var(--blue-pale); color: #0a5f96; }
.alert-warn { background: #fff4e3; color: #8a5612; }
.done-mark { width: 54px; height: 54px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 28px; margin: 0 auto 10px; }
.center { text-align: center; }
.status-pill { display: inline-block; border-radius: 999px; padding: 2px 12px; font-size: 13px; font-weight: 700; }
.st-confirmed { background: var(--green-pale); color: #136a45; }
.st-cancelled { background: #eef0f3; color: #6b7480; }
.loading { text-align: center; color: var(--ink-soft); padding: 28px 0; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; margin: 0 auto 10px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.foot { text-align: center; color: var(--ink-soft); font-size: 12.5px; margin-top: 24px; }

/* ---------------- 管理画面 ---------------- */
.admin-body { background: var(--bg); }
.login-wrap { max-width: 420px; margin: 0 auto; padding: 48px 16px; }
.login-title { font-size: 20px; margin-bottom: 14px; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-in { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar .brand { margin: 0; flex: 1; }
.who { font-size: 13.5px; color: var(--ink-soft); }
.tabs { max-width: 1040px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--ink-soft); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; font-size: 15px; }
.tab.active { color: var(--blue-dark); border-bottom-color: var(--blue); }
.admin-main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 64px; }
.page-title { font-size: 20px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 3px; margin-bottom: 14px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.seg button.active { background: var(--blue); color: #fff; }
.list { display: grid; gap: 10px; }
.row { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; }
.row.clickable { cursor: pointer; }
.row.clickable:hover { border-color: var(--blue); }
.row-main { min-width: 0; }
.row-when { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.row-sub { color: var(--ink-soft); font-size: 14px; overflow-wrap: anywhere; }
.row-name { font-weight: 700; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.empty { text-align: center; color: var(--ink-soft); padding: 36px 0; background: #fff; border: 1px dashed var(--line); border-radius: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.section-title { font-size: 16px; font-weight: 800; margin: 0 0 12px; }
.help { font-weight: 400; color: var(--ink-soft); font-size: 13px; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 600 !important; }
.form label.check > input { width: 18px; height: 18px; flex: none; margin: 0; display: inline-block; }
.weekdays { display: flex; flex-wrap: wrap; gap: 6px; }
.weekdays label > input { display: inline-block !important; margin: 0 !important; width: auto; }
.weekdays label { display: inline-flex !important; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-weight: 600 !important; cursor: pointer; background: #fff; }
.url-box { display: flex; gap: 8px; align-items: center; background: var(--bg); border-radius: 8px; padding: 6px 6px 6px 10px; font-size: 13px; margin-top: 8px; min-width: 0; }
.url-box code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.modal-bg { position: fixed; inset: 0; background: rgba(30,40,55,.45); padding: 24px 12px; overflow-y: auto; overflow-x: hidden; z-index: 50; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 620px; margin: 0 auto; padding: 22px; min-width: 0; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal-title { font-size: 18px; font-weight: 800; }
.x { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink-soft); padding: 2px 8px; }
.diag-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.diag-item:last-child { border-bottom: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 7px; flex: none; background: #c3cad3; }
.dot.ok { background: var(--green); } .dot.ng { background: var(--red); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 14.5px; z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.banner { background: #fff4e3; color: #8a5612; font-size: 13.5px; text-align: center; padding: 6px 12px; }
.logs { font-size: 13px; color: var(--ink-soft); margin: 0; padding-left: 18px; }

@media (max-width: 640px) {
  .card { padding: 16px; }
  .menu-name { font-size: 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .row-actions { justify-content: flex-start; }
  .cal-head, .cal-grid { gap: 4px; }
  .day { border-radius: 10px; font-size: 15px; }
  .modal-bg { padding: 12px 8px; }
  .modal { padding: 18px 16px; border-radius: 14px; }
  .url-box { flex-wrap: wrap; padding: 8px 10px; }
  .url-box code { flex: 1 1 100%; }
  .url-box .btn { white-space: normal; }
  .modal .summary { grid-template-columns: 1fr; gap: 2px; }
  .modal .summary dt { padding-top: 8px; }
}

/* 日ごとの列のピッカー */
.wk-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.wk-month { font-weight: 800; font-size: 16px; text-align: center; flex: 1; }
.wk-head, .wk-list { display: grid; column-gap: 8px; }
.wk-head { position: sticky; top: 0; z-index: 3; background: #fff; padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.wk-day { text-align: center; line-height: 1.2; }
.wk-date { display: block; font-size: 20px; font-weight: 800; }
.wk-wd { display: block; font-size: 12.5px; color: var(--ink-soft); font-weight: 700; }
.wk-day.sun .wk-wd { color: #d0554f; } .wk-day.sat .wk-wd { color: #2f7fd1; }
.wk-day.closed .wk-date { color: #b4bcc6; }
.wk-list { margin-top: 10px; align-items: start; }
.wk-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wk-col.closed { background: #f1f4f7; border-radius: 10px; min-height: 120px; }
.wk-none { text-align: center; font-size: 12.5px; color: #9aa4b0; padding-top: 14px; }
.wk-slot { border: 0; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 700; font-size: 15px; line-height: 1.3; padding: 11px 6px; min-height: 48px; cursor: pointer; text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.wk-slot:hover { background: var(--blue-dark); }
.wk-slot.wk-taken, .wk-slot.wk-taken:hover { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; background: #eef1f4; color: #b4bcc6; box-shadow: none; cursor: default; font-weight: 600; }
.wk-slot.selected { background: var(--orange); color: #3a2208; outline: 3px solid rgba(243,159,87,.35); }
.wk-slot:focus-visible { outline: 3px solid rgba(25,166,248,.45); outline-offset: 1px; }
.wk-from, .wk-to { display: inline-block; white-space: nowrap; }
.wk-to { font-weight: 600; }
@media (max-width: 640px) {
  .wk-head, .wk-list { column-gap: 6px; }
  .wk-slot { font-size: 14px; padding: 8px 4px; }
}

/* 横幅を広げたページでも、入力欄や確認表示は読みやすい幅に */
.wrap .form, .wrap .summary, .wrap .picked, .wrap .menu-desc { max-width: 680px; }

/* 受付時間帯（曜日ごと） */
.wh { display: flex; flex-direction: column; gap: 8px; }
.wh-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.wh-row:first-child { border-top: 0; }
.wh-day { width: 2em; flex: none; font-weight: 700; padding-top: 7px; text-align: center; }
.wh-day.sun { color: #c0392b; } .wh-day.sat { color: #2471a3; }
.wh-ranges { flex: 1; display: flex; flex-wrap: wrap; gap: 6px 14px; min-width: 0; }
.wh-range { display: inline-flex; align-items: center; gap: 4px; }
.wh-range select { width: auto !important; padding: 6px 8px; }
.wh-none { color: var(--muted, #888); padding-top: 7px; }
.wh-del { border: 0; background: none; font-size: 18px; line-height: 1; color: #999; cursor: pointer; padding: 4px 6px; }
.wh-del:hover { color: #c0392b; }
.wh-row > .btn { flex: none; }
@media (max-width: 560px) {
  .wh-row { flex-wrap: wrap; row-gap: 6px; }
  .wh-ranges { flex-direction: column; gap: 6px; }
  .wh-row > .btn { flex-basis: auto; margin-left: calc(2em + 10px); }
  .wh-row > .btn { order: 3; }
  .wh-ranges { flex: 1 1 calc(100% - 2em - 10px); }
}

/* 予定登録 */
.ent-series { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.ent-first { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 600 !important; }
.ent-first input { width: 5em !important; }
.ent-head, .ent-row { display: grid; grid-template-columns: 2.2em 11.5em 7em 7em 1fr 2em; gap: 8px; align-items: center; }
.ent-head { font-size: 12.5px; color: var(--muted, #777); font-weight: 700; padding: 0 0 6px; border-bottom: 1px solid var(--line); }
.ent-row { padding: 7px 0; border-bottom: 1px solid var(--line); }
.ent-row input { width: 100% !important; padding: 6px 8px; }
.ent-no { text-align: center; font-weight: 700; color: var(--muted, #777); }
.ent-date { display: flex; align-items: center; gap: 4px; }
.ent-date em { font-style: normal; font-weight: 700; width: 1.2em; }
.ent-title { font-weight: 600; overflow-wrap: anywhere; }
.ent-warn { grid-column: 2 / -1; color: #b45309; font-size: 13px; }
.ent-paste { margin-top: 14px; }
.ent-paste summary { cursor: pointer; font-weight: 700; color: var(--blue, #1d9bf0); }
.ent-sub { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.ent-choices { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ent-confirm { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.ent-crow { padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ent-crow:last-child { border-bottom: 0; }
.ent-crow.is-skip { opacity: .55; }
@media (max-width: 640px) {
  .ent-head { display: none; }
  .ent-row { grid-template-columns: 2em 1fr 1fr 2em; }
  .ent-date { grid-column: 2 / 4; }
  .ent-row > input[data-k=start] { grid-column: 2; }
  .ent-row > input[data-k=end] { grid-column: 3; }
  .ent-title { grid-column: 2 / 4; font-size: 13.5px; }
  .ent-row .wh-del { grid-column: 4; grid-row: 1; }
}

.wh-range select.wh-lead { font-size: 13px; color: var(--muted, #555); }
@media (max-width: 560px) { .wh-range { flex-wrap: wrap; } }
