/* =========================================================
   Kiyaku Shuttle - Global Styles (FULL REPLACEMENT)
   - Unifies form control heights (48px) including date inputs
   - Header is NON-STICKY on all breakpoints
   - Radio "chip" buttons for properties
   - Responsive grid rows
   - Fixed footer summary with safe-area
   - Minimal utility classes for cards/tables (admin basic)
   ========================================================= */

/* ---------- CSS Reset (light) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  -webkit-text-size-adjust: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
               "Hiragino Kaku Gothic ProN", "Yu Gothic", "Yu Gothic UI", Meiryo, sans-serif;
  color: #111;
  background: #fff;
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- Theme Tokens ---------- */
:root{
  --bg: #ffffff;
  --card: #f7f7f8;
  --text: #111111;
  --muted: #6b7280;
  --accent: #111111;
  --border: #e5e7eb;
  --focus: #005fcc;
  --shadow: 0 6px 24px rgba(0,0,0,.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Layout ---------- */
.container{ max-width: 980px; margin: 0 auto; padding: 24px; }
.header{ position: relative; top: auto; display:flex; align-items:center; justify-content: space-between; gap:12px; margin-bottom: 18px; }
.logo{ display:flex; align-items:center; gap:10px; font-weight:800; }
.badge{ display:inline-block; border:1px solid var(--text); border-radius:999px; padding:6px 10px; font-size:12px; }

.card{ background:#fff; border:1px solid var(--border); border-radius:14px; padding:18px; box-shadow: var(--shadow); }
h1,h2,h3{ line-height:1.3; margin: 0 0 12px; }
h2{ font-size:20px; font-weight:800; }
small{ color: var(--muted); display:block; margin-bottom:10px; }

/* ---------- Form ---------- */
label{ display:block; margin:10px 0 6px; font-weight:700; }
.req::after{ content:" *"; color:#b30000; }
.checkbox{ display:flex; align-items:center; gap:8px; }
.checkbox input{ width:auto; height:auto; }

/* Unified control size (including date/time) */
input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="time"],
select, textarea {
  width:100%;
  height:48px;
  line-height:48px;
  padding: 0 14px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--text);
  font-size:16px; /* prevent iOS zoom */
  outline:none;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
  -webkit-appearance: none;
}
textarea{ height:120px; line-height:1.6; padding:12px 14px; resize:vertical; }

input:focus, select:focus, textarea:focus{
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(0,95,204,.15);
}

/* iOS/WebKit pickers so they align inside 48px */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator{
  padding: 8px;
  margin: 0;
  width: 28px;
  height: 28px;
  opacity: .8;
  cursor: pointer;
}
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit{ padding: 0 2px; }

/* Row grid */
.row{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 740px){ .row{ grid-template-columns: 1fr; } }

/* Radio chip buttons for properties */
.radio-group{ display:flex; flex-wrap:wrap; gap:10px; }
.radio-group input[type="radio"]{ position:absolute; opacity:0; pointer-events:none; }
.radio-group .chip{
  display:inline-block; padding:10px 16px; border:1px solid var(--border);
  border-radius:999px; background:#fff; cursor:pointer; user-select:none; white-space:nowrap;
}
.radio-group input[type="radio"]:checked + .chip{
  background: var(--accent); color:#fff; border-color: var(--accent);
}

/* Buttons */
.btn{ display:inline-flex; align-items:center; justify-content:center;
  gap:8px; padding:12px 18px; border-radius:10px; border:1px solid transparent;
  font-weight:800; cursor:pointer; text-decoration:none; }
.btn-primary{ background:#111; color:#fff; }
.btn-ghost{ background:#fff; border-color:#111; color:#111; }
.btn:hover{ filter: brightness(.95); }
.btn-xs{ padding:8px 10px; font-size:12px; border-radius:8px; }

.center{ text-align:center; }

/* Table (admin basic) */
.table{ width:100%; border-collapse: collapse; }
.table th, .table td{ border-bottom:1px solid var(--border); padding:10px 12px; text-align:left; }
.table thead th{ position:sticky; top:0; background:#fafafa; z-index:1; }

/* Responsive table as cards (SP) */
.rtable-wrap{ overflow:auto; }
@media (max-width: 780px){
  .rtable{ display:block; }
  .rtable thead{ display:none; }
  .rtable tbody{ display:block; }
  .rtable tr{ display:block; border:1px solid var(--border); border-radius:12px; padding:10px; margin-bottom:10px; background:#fff; }
  .rtable td{ display:flex; gap:10px; justify-content:space-between; border:none; padding:6px 0; }
  .rtable td::before{ content: attr(data-label); color: var(--muted); font-weight:700; }
}

/* Badges for statuses (shared) */
.bad{ background:#fee2e2; color:#991b1b; padding:8px 10px; border-radius:8px; }
.good{ background:#ecfdf5; color:#065f46; padding:8px 10px; border-radius:8px; }
.badge.status{ display:inline-block; padding:4px 8px; border-radius:999px; font-weight:800; color:#fff; }
.status.st-new{ background:#1f2937; }
.status.st-confirm{ background:#f59e0b; color:#111; }
.status.st-paylink{ background:#2563eb; }
.status.st-await{ background:#eab308; color:#111; }
.status.st-paid{ background:#10b981; }
.status.st-assign{ background:#7c3aed; }
.status.st-done{ background:#6b7280; }
.status.st-cancel{ background:#ef4444; }

/* Status inline */
.status-inline{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.status-select{ font-size:16px; height:48px; line-height:48px; padding:0 12px; }

/* ---------- Footer Summary (fixed) ---------- */
.footer-summary{
  position: fixed; left:0; right:0; bottom:0;
  background:#fff; border-top:1px solid var(--border); box-shadow: 0 -6px 22px rgba(0,0,0,.08);
  padding: 10px 16px calc(12px + var(--safe-bottom));
  z-index: 50;
}
.fs-primary{ display:flex; justify-content:space-between; align-items:center; gap:12px; }
.fs-title{ font-weight:800; }
.fs-price{ font-size:20px; font-weight:900; letter-spacing:.02em; }
.fs-lines{ margin-top:4px; display:grid; gap:2px; font-size:13px; color: var(--muted); }
.fs-line b{ color:#111; margin-right:4px; }

/* Prevent overlap: add bottom padding for pages using footer-summary */
.container{ padding-bottom: 130px; }

/* ---------- Misc ---------- */
a{ color:#111; }
hr{ border:none; border-top:1px solid var(--border); margin:16px 0; }
.badge.small{ font-size:11px; padding:3px 8px; }


/* ===============================
   HEADER / FOOTER DESIGN
   - Header: NON-STICKY on all devices
================================= */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e2e2;
  padding: 12px 20px;
  position: static;   /* ← 常に非固定 */
  top: auto;
  z-index: 1;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111;
  margin: 0;
}

.header-controls select,
.header-controls button,
#langButton.status-select {
  height: 36px;
  line-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
  background: #fff;
  cursor: pointer;
}

.header-controls select:focus,
#langButton.status-select:focus {
  outline: 2px solid #007bff;
  outline-offset: 1px;
}

.site-footer {
  background: #f8f8f8;
  text-align: center;
  padding: 24px 12px;
  border-top: 1px solid #e2e2e2;
  margin-top: 60px;
}

.copyright {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
}


/* --- Language Modal (balanced grid) --- */
.lang-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.45);
  display:none; z-index:1000;
}
.lang-overlay.is-open{ display:block; }

.lang-dialog{
  width:min(560px, 92vw); background:#fff; border-radius:12px;
  margin:8vh auto; padding:20px 18px; box-shadow:0 20px 40px rgba(0,0,0,.18);
}
.lang-head{
  font-weight:700; font-size:18px; margin-bottom:8px; text-align:center;
}
.lang-sub{
  color:#666; font-size:12px; text-align:center; margin-bottom:14px;
}

.lang-grid{
  display:grid; gap:12px;
  grid-template-columns:repeat(2,minmax(0,1fr));
}
@media (min-width:560px){
  .lang-grid{ grid-template-columns:repeat(3,minmax(0,1fr)); }
}
.lang-btn{
  display:flex; align-items:center; justify-content:center;
  height:40px; border:1px solid #d9d9e3; border-radius:10px;
  background:#f9fafb; cursor:pointer; font-weight:600;
  transition:.15s ease;
}
.lang-btn:hover{ background:#f1f4f8; border-color:#c9c9d6; }
.lang-btn:active{ transform:translateY(1px); }

.lang-actions{
  display:flex; justify-content:center; gap:10px; margin-top:16px;
}
.lang-cancel, .lang-confirm{
  padding:10px 14px; border-radius:10px; border:1px solid #d9d9e3;
  background:#fff; font-weight:600; cursor:pointer;
}
.lang-confirm{ background:#2f6fed; color:#fff; border-color:#2f6fed; }
.lang-cancel:hover{ background:#f6f7fb; }
.lang-confirm:hover{ filter:brightness(1.05); }