/* ミーティング予約システム – ビジネストーン */
:root {
  --navy: #14305a;
  --navy-2: #1f4277;
  --accent: #2a6db5;
  --accent-weak: #eaf2fb;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --line: #d7dee7;
  --line-2: #e9edf2;
  --text: #1d2733;
  --muted: #627285;
  --danger: #b42318;
  --danger-weak: #fdeceb;
  --warn: #8a5a00;
  --warn-weak: #fff5d9;
  --ok: #18794e;
  --ok-weak: #e6f4ed;
  --sun: #c0392b;
  --sat: #2a6db5;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", YuGothic, Meiryo, "Noto Sans JP", sans-serif;
  font-size: 15px; line-height: 1.75; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); }
[hidden] { display: none !important; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; width: 100%; }
.main { flex: 1; padding-top: 32px; padding-bottom: 64px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; letter-spacing: .02em; }
.nowrap { white-space: nowrap; }
.mt8 { margin-top: 8px; }
.mb16 { margin: 0 0 16px; }
@media (max-width: 640px) { .pc { display: none; } }

/* ---------- Header / Footer ---------- */
.site-header { background: var(--navy); color: #fff; border-bottom: 3px solid var(--accent); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 62px; gap: 12px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .06em; display: flex; align-items: center; gap: 12px; font-size: 16px; }
.brand-mark { width: 6px; height: 24px; background: linear-gradient(var(--accent) 0 60%, #7fb2e5 60% 100%); display: inline-block; }
.header-sub { font-size: 11px; letter-spacing: .22em; opacity: .75; }
.site-footer { background: #fff; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 18px 0; text-align: center; }

/* ---------- Page head ---------- */
.page-head { margin-bottom: 8px; }
.eyebrow { margin: 0; font-size: 11px; letter-spacing: .24em; color: var(--accent); font-weight: 700; text-transform: uppercase; }
.page-head h1 { font-size: 26px; margin: 4px 0 8px; color: var(--navy); letter-spacing: .05em; }
.lead { margin: 0; color: var(--muted); }

/* ---------- Steps ---------- */
.steps { list-style: none; display: flex; margin: 24px 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.steps li { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 8px; font-size: 13.5px; color: var(--muted); border-right: 1px solid var(--line-2); }
.steps li:last-child { border-right: 0; }
.steps .num { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: #fff; }
.steps li.is-active { color: var(--navy); font-weight: 700; background: var(--accent-weak); box-shadow: inset 0 -3px 0 var(--navy); }
.steps li.is-active .num { background: var(--navy); border-color: var(--navy); color: #fff; }
.steps li.is-done { color: var(--text); }
.steps li.is-done .num { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 640px) {
  .steps li { gap: 6px; padding: 10px 4px; }
  .steps .lbl { display: none; }
  .steps li.is-active { flex: 2.2; }
  .steps li.is-active .lbl { display: inline; font-size: 12px; white-space: nowrap; }
  .header-sub { display: none; }
  .brand { font-size: 15px; }
  .page-head h1 { font-size: 22px; }
}

/* ---------- Panel ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 22px; }
.panel-head h2 { margin: 0; font-size: 17px; color: var(--navy); padding-left: 12px; border-left: 4px solid var(--navy); line-height: 1.35; }
.panel-note { margin: 0; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .panel { padding: 20px 16px; } }

/* ---------- Calendar ---------- */
.picker { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; }
@media (max-width: 820px) { .picker { grid-template-columns: 1fr; gap: 24px; } }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-size: 18px; font-weight: 700; color: var(--navy); letter-spacing: .06em; }
.btn-icon { width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); font-size: 22px; line-height: 1; cursor: pointer; color: var(--navy); }
.btn-icon:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-weak); }
.btn-icon:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-grid.is-loading { opacity: .45; pointer-events: none; }
.cal-week div { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; font-weight: 700; }
.cal-week .sun { color: var(--sun); }
.cal-week .sat { color: var(--sat); }
.cal-cell { min-height: 58px; border: 1px solid var(--line-2); background: #f8f9fb; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: inherit; color: #a3adb9; padding: 4px 2px; }
.cal-cell.is-empty { border: 0; background: none; }
.cal-cell .d { font-size: 14px; font-weight: 600; line-height: 1.2; }
.cal-cell .mark { font-size: 12px; line-height: 1.2; }
.cal-cell.is-open { background: #fff; border-color: var(--line); color: var(--text); cursor: pointer; transition: background .12s, border-color .12s; }
.cal-cell.is-open .mark { color: var(--accent); font-weight: 700; font-size: 14px; }
.cal-cell.is-open.sun .d { color: var(--sun); }
.cal-cell.is-open.sat .d { color: var(--sat); }
.cal-cell.is-open:hover { border-color: var(--accent); background: var(--accent-weak); }
.cal-cell.is-selected, .cal-cell.is-selected:hover { background: var(--navy); border-color: var(--navy); }
.cal-cell.is-selected .d, .cal-cell.is-selected .mark { color: #fff !important; }
.cal-cell:focus-visible, .time-btn:focus-visible, .btn:focus-visible { outline: 3px solid rgba(42, 109, 181, .35); outline-offset: 2px; }
.cal-legend { margin-top: 12px; font-size: 12px; color: var(--muted); }
.cal-legend .lg { display: inline-block; width: 16px; text-align: center; }
.cal-legend .lg-open { color: var(--accent); font-weight: 700; }
.cal-error { grid-column: 1 / -1; padding: 24px; text-align: center; color: var(--danger); }

.times { border-left: 1px solid var(--line-2); padding-left: 28px; }
@media (max-width: 820px) { .times { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-2); padding-top: 20px; } }
.times-title { margin: 6px 0 14px; font-size: 15px; color: var(--navy); }
.time-list { display: grid; gap: 8px; }
.time-btn { display: block; width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; text-align: left; position: relative; letter-spacing: .04em; }
.time-btn::after { content: "選択 ›"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--accent); font-weight: 600; }
.time-btn:hover { border-color: var(--accent); background: var(--accent-weak); }

/* ---------- Form ---------- */
.selected-slot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--accent-weak); border: 1px solid #cfe0f3; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 24px; }
.selected-slot strong { color: var(--navy); font-size: 15.5px; }
.tag { background: var(--navy); color: #fff; font-size: 11.5px; padding: 2px 10px; border-radius: 3px; letter-spacing: .06em; }
.link-btn { margin-left: auto; background: none; border: 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }

.form-table { border-top: 1px solid var(--line); }
.form-table .row { display: grid; grid-template-columns: 220px 1fr; border-bottom: 1px solid var(--line); }
.form-table .th { background: #f6f8fb; padding: 16px 18px; font-weight: 600; font-size: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; color: var(--navy); }
.form-table .td { padding: 12px 18px; }
@media (max-width: 720px) {
  .form-table .row { grid-template-columns: 1fr; }
  .form-table .th { padding: 12px 14px 6px; background: none; justify-content: flex-start; }
  .form-table .td { padding: 0 14px 14px; }
}
.req, .opt { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 3px; font-weight: 600; white-space: nowrap; margin-top: 2px; }
.req { background: var(--danger); color: #fff; }
.opt { background: #e4e8ee; color: var(--muted); }

input[type=text], input:not([type]), input[type=email], input[type=tel], input[type=search], input[type=password],
input[type=date], input[type=time], select, textarea {
  width: 100%; max-width: 560px; font: inherit; color: var(--text); background: #fff;
  border: 1px solid #c4cdd8; border-radius: 4px; padding: 9px 12px; line-height: 1.5;
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42, 109, 181, .15); }
.has-error input:not([type=radio]):not([type=checkbox]), .has-error select, .has-error textarea { border-color: var(--danger); background: #fffafa; }
.err { color: var(--danger); font-size: 12.5px; margin: 4px 0 0; min-height: 0; }
.err:empty { display: none; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.radio-group { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 4px; }
.radio, .check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.radio input, .check input { width: 17px; height: 17px; accent-color: var(--navy); margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.privacy { margin-top: 28px; background: #f8f9fb; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.privacy h3 { margin: 0 0 6px; font-size: 14px; color: var(--navy); }
.privacy p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.privacy .check { font-weight: 600; }
.privacy p.err { color: var(--danger); margin: 6px 0 0; font-size: 12.5px; }

/* ---------- Buttons ---------- */
.actions { display: flex; justify-content: center; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; margin-top: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 200px; padding: 13px 28px; font: inherit; font-weight: 700; letter-spacing: .06em; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, color .12s; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-primary:disabled { background: #8c9bb0; cursor: wait; }
.btn-secondary { background: #fff; color: var(--navy); border-color: #b8c3d1; }
.btn-secondary:hover { border-color: var(--navy); background: #f6f8fb; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #912018; }
.btn-danger-outline { background: #fff; color: var(--danger); border-color: #e6b4b0; }
.btn-danger-outline:hover { background: var(--danger-weak); border-color: var(--danger); }
.btn-sm { min-width: 0; padding: 5px 12px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.btn-block { width: 100%; }
@media (max-width: 640px) { .actions .btn { flex: 1; min-width: 0; } }

/* ---------- Confirm / Complete ---------- */
.confirm-table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--line); }
.confirm-table th, .confirm-table td { border-bottom: 1px solid var(--line); padding: 14px 18px; text-align: left; vertical-align: top; }
.confirm-table th { width: 220px; background: #f6f8fb; color: var(--navy); font-weight: 600; font-size: 14px; }
.confirm-table td { white-space: pre-wrap; word-break: break-word; }
@media (max-width: 640px) { .confirm-table th, .confirm-table td { display: block; width: auto; } .confirm-table th { border-bottom: 0; padding-bottom: 4px; } .confirm-table td { padding-top: 4px; } }

.complete { text-align: center; padding: 48px 32px; }
.complete h1 { color: var(--navy); font-size: 22px; margin: 12px 0; letter-spacing: .05em; }
.complete-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--ok-weak); color: var(--ok); font-size: 30px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #b6dcc8; }
.complete-info { max-width: 520px; margin: 28px auto; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.complete-info div { display: grid; grid-template-columns: 120px 1fr; border-bottom: 1px solid var(--line); }
.complete-info div:last-child { border-bottom: 0; }
.complete-info dt { background: #f6f8fb; padding: 12px 16px; font-weight: 600; color: var(--navy); font-size: 13.5px; }
.complete-info dd { margin: 0; padding: 12px 16px; }
.complete-info .no { font-family: Consolas, Menlo, monospace; font-size: 17px; font-weight: 700; letter-spacing: .06em; color: var(--navy); }
.actions.center { justify-content: center; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius); padding: 12px 16px; margin: 0 0 18px; font-size: 14px; border: 1px solid; }
.alert-success { background: var(--ok-weak); border-color: #b6dcc8; color: #0f5134; }
.alert-error { background: var(--danger-weak); border-color: #f1c0bb; color: #7a1a12; }
.alert-warn { background: var(--warn-weak); border-color: #f0dc9e; color: var(--warn); }
.alert-info { background: var(--accent-weak); border-color: #cfe0f3; color: var(--navy); }

/* ============================================================
   Admin
   ============================================================ */
.header-admin { display: flex; align-items: center; gap: 14px; }
.header-admin form { margin: 0; }
.badge-admin { font-size: 11px; letter-spacing: .12em; border: 1px solid rgba(255,255,255,.5); border-radius: 3px; padding: 2px 8px; }
.btn-ghost { background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; font: inherit; font-size: 12.5px; border-radius: 4px; padding: 4px 12px; cursor: pointer; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.subnav { background: #fff; border-bottom: 1px solid var(--line); }
.subnav .container { display: flex; gap: 4px; overflow-x: auto; }
.subnav a { padding: 12px 16px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap; }
.subnav a:hover { color: var(--navy); }
.subnav a.is-active { color: var(--navy); border-bottom-color: var(--navy); }
.subnav a:last-child { margin-left: auto; font-weight: 500; font-size: 13px; }
body.admin .container { max-width: 1240px; }
.admin-head { margin-bottom: 20px; }
.admin-head h1 { font-size: 22px; color: var(--navy); margin: 0 0 4px; }
.admin-head p { margin: 0; font-size: 13.5px; }
.back-link { font-size: 13px; text-decoration: none; }

.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-side { position: sticky; top: 16px; }
.admin-side .panel { padding: 22px; }
.a-cell { cursor: pointer; background: #fff; border-color: var(--line); color: var(--text); min-height: 74px; justify-content: flex-start; padding-top: 8px; }
.a-cell:hover { border-color: var(--accent); background: var(--accent-weak); }
.a-cell.sun .d { color: var(--sun); }
.a-cell.sat .d { color: var(--sat); }
.a-cell.is-past { background: #f4f6f8; color: #a3adb9; }
.a-cell.is-past .d { color: #a3adb9 !important; }
.a-cell.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.a-cell.is-selected .chip { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.4); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.chip { font-size: 11px; line-height: 1.5; padding: 0 6px; border-radius: 3px; border: 1px solid; font-weight: 600; }
.chip-open { color: var(--accent); background: var(--accent-weak); border-color: #c9dcf1; }
.chip-booked { color: #8a3c00; background: #fff1e5; border-color: #f3ccaa; }

.slot-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.slot { display: grid; grid-template-columns: 120px 70px 1fr auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line-2); }
.slot .time { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.status { font-size: 11.5px; font-weight: 700; text-align: center; padding: 2px 0; border-radius: 3px; }
.st-open { background: var(--accent-weak); color: var(--accent); }
.st-booked { background: #fff1e5; color: #8a3c00; }
@media (max-width: 640px) { .slot { grid-template-columns: 1fr auto; } .slot .who { grid-column: 1 / -1; } }

.form-stack { display: grid; gap: 14px; }
.stack { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--navy); }
.inline-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.is-disabled { opacity: .4; pointer-events: none; }
.preview { background: #f8f9fb; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.preview-head { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.preview-head strong { color: var(--navy); font-size: 15px; }
.preview-list { display: flex; flex-wrap: wrap; gap: 4px; }
.pv { font-size: 11.5px; background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; font-variant-numeric: tabular-nums; }
.target { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 14px; margin: 0; display: grid; gap: 8px; }
.target legend { font-size: 13px; font-weight: 700; color: var(--navy); padding: 0 6px; }
.range-box { display: grid; gap: 10px; padding-top: 4px; }
.weekdays { display: flex; gap: 4px; }
.wd { flex: 1; }
.wd input { position: absolute; opacity: 0; pointer-events: none; }
.wd span { display: block; text-align: center; padding: 5px 0; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; cursor: pointer; background: #fff; }
.wd input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }
.wd input:focus-visible + span { outline: 3px solid rgba(42,109,181,.35); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tab { padding: 7px 16px; text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 600; border-right: 1px solid var(--line); background: #fff; }
.tab:last-child { border-right: 0; }
.tab.is-active { background: var(--navy); color: #fff; }
.search { display: flex; gap: 8px; }
.search input { width: 280px; padding: 6px 10px; }
.count { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { background: #f6f8fb; color: var(--navy); text-align: left; font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12.5px; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: #fafbfd; }
.data-table .op { text-align: right; }
.data-table form.inline { display: inline; margin-left: 4px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 280px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.danger-zone { border-color: #f1c0bb; }
.danger-zone .panel-head h2 { border-left-color: var(--danger); color: var(--danger); }

.login-panel { max-width: 400px; margin: 40px auto; }
.login-panel h1 { font-size: 19px; color: var(--navy); margin: 0 0 20px; text-align: center; }
.login-panel form { display: grid; gap: 16px; }
.login-panel input { max-width: none; }
