:root {
  color-scheme: light;
  --navy: #0b3d5c;
  --navy-deep: #072a40;
  --teal: #0e7490;
  --sand: #f4efe6;
  --accent: #e85d04;
  --accent-hover: #c2410c;
  --ink: #1f2937;
  --muted: #64748b;
  --line: #dbe2ea;
  --card: #fff;
  --font: "Noto Sans JP", "Segoe UI", sans-serif;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: #f6f8fb;
  color: var(--ink);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

.public-body {
  background: var(--sand);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #22d3ee, #0e7490);
  display: grid;
  place-items: center;
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

.logo-mark.has-icon-image {
  color: transparent;
  background: #e2e8f0;
}

.logo-mark-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.logo-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text {
  font-weight: 700;
  font-size: 1.05rem;
}

.logo-sub {
  font-size: 0.72rem;
  color: #93c5fd;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.site-nav a {
  color: #dbeafe;
  text-decoration: none;
  font-size: 0.92rem;
}

.site-nav a.nav-admin {
  background: #e85d04;
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
}

.site-nav a.nav-admin:hover {
  color: #fff;
  background: #c2410c;
}

.hero {
  background:
    radial-gradient(circle at 80% 10%, rgba(34, 211, 238, 0.25), transparent 40%),
    linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 55%, #0e7490 100%);
  color: #fff;
  padding: 48px 20px 64px;
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.hero-kicker {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #7dd3fc;
  margin: 0 0 10px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.3;
}

.hero-lead {
  margin: 0 0 28px;
  max-width: 42rem;
  color: #dbeafe;
  line-height: 1.7;
}

.search-panel {
  background: #fff;
  color: var(--ink);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(7, 42, 64, 0.25);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.search-panel-title {
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.search-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.search-submit,
button.full {
  background: var(--accent);
  border: none;
}

.search-submit:hover,
button.full:hover {
  background: var(--accent-hover);
}

.section {
  padding: 48px 0;
}

.section-alt {
  background: #fff;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.section-header h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.section-sub {
  margin: 0;
  color: var(--muted);
}

.fleet-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  min-width: 0;
}

.fleet-card {
  background: var(--sand);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--line);
}

.fleet-card h3 {
  margin: 0 0 4px;
}

.fleet-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.fleet-card p {
  margin: 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

.fleet-stock {
  margin-top: 12px;
  font-weight: 700;
  color: var(--teal);
}

.rates-table {
  width: max-content;
  min-width: 640px;
  border-collapse: collapse;
  background: #fff;
}

.rates-table th,
.rates-table td {
  border: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  white-space: nowrap;
}

.rates-table th {
  background: var(--navy);
  color: #fff;
}

.rate-simulator {
  margin: 0 0 28px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.rate-simulator h3 {
  margin: 0 0 8px;
}

.sim-fields {
  display: grid;
  gap: 12px;
}

.sim-when-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.sim-season {
  margin: 16px 0 8px;
  font-weight: 700;
}

.sim-season.is-high {
  color: #c2410c;
}

.sim-season.is-low {
  color: #1d4ed8;
}

.rate-notes {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.shop-grid {
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: start;
}

.shop-about {
  line-height: 1.8;
  white-space: pre-wrap;
}

.shop-dl {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 8px 12px;
}

.shop-dl dt {
  color: var(--muted);
  font-weight: 600;
}

.shop-dl dd {
  margin: 0;
}

.shop-card {
  background: var(--sand);
  border-radius: 14px;
  padding: 20px;
}

.flow-list {
  margin: 0;
  padding-left: 20px;
  line-height: 2;
}

.site-footer {
  background: var(--navy-deep);
  color: #cbd5e1;
  padding: 8px 20px 32px;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.footer-brand {
  margin: 0;
  width: min(320px, 100%);
  padding-top: 20px;
  border-top: 1px solid rgba(203, 213, 225, 0.45);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(320px, 100%);
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.45);
}

.footer-nav a {
  color: #e2e8f0;
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-nav a[aria-disabled="true"] {
  color: #94a3b8;
  cursor: default;
  text-decoration: none;
}

.car-visual {
  height: 88px;
  border-radius: 10px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: #fff;
}

.car-visual.car-photo,
.car-detail-photo {
  width: 100%;
  object-fit: cover;
  background: #e2e8f0;
  color: transparent;
}

.car-photo-gallery {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}

.car-photo-gallery .car-detail-photo,
.car-photo-gallery .car-visual {
  height: 180px;
  margin-bottom: 0;
}

.car-photo-gallery .car-detail-photo:first-child {
  height: 220px;
}

.car-images-manager {
  margin-top: 8px;
}

.fleet-order-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}

.fleet-order-tile {
  width: 116px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: grab;
  text-align: center;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.fleet-order-tile .car-visual,
.fleet-order-tile img {
  pointer-events: none;
  height: 64px;
  margin-bottom: 6px;
}

.fleet-order-tile strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.35;
  font-weight: 700;
}

.fleet-order-tile.is-armed,
.fleet-order-tile.is-dragging {
  position: relative;
  z-index: 2;
  outline: 2px solid #0e7490;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  cursor: grabbing;
  transform: scale(0.9);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.fleet-car-card-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.fleet-drag-handle {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(#64748b, #64748b) center 14px / 16px 2px no-repeat,
    linear-gradient(#64748b, #64748b) center / 16px 2px no-repeat,
    linear-gradient(#64748b, #64748b) center 30px / 16px 2px no-repeat,
    #f8fafc;
  color: #64748b;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.fleet-drag-handle:active,
.fleet-car-card.is-dragging .fleet-drag-handle {
  cursor: grabbing;
}

.fleet-car-card.is-armed,
.fleet-car-card.is-dragging {
  outline: 2px solid #0e7490;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.fleet-car-card-header h3 {
  margin: 0;
}

.fleet-car-delete-row {
  margin-top: 12px;
}

.car-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}

.car-image-item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}

.car-image-item img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
}

.car-image-item figcaption {
  padding: 6px 8px 0;
  font-size: 0.8rem;
  color: #64748b;
}

.car-image-actions {
  display: flex;
  gap: 6px;
  padding: 8px;
  flex-wrap: wrap;
}

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  background: #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  overflow: hidden;
}

.file-button.compact,
button.compact {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.file-button input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.site-icon-preview-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.site-icon-preview {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}

.site-icon-controls {
  display: grid;
  gap: 10px;
  align-content: start;
}

.rate-fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px 16px;
  margin: 0;
}

.rate-fieldset legend {
  padding: 0 6px;
  font-weight: 700;
}

.rate-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.rate-car-block + .rate-car-block {
  margin-top: 20px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.rate-car-block h3 {
  margin: 8px 0 12px;
}

.season-weekdays,
.season-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.season-weekdays {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.season-calendar {
  margin-bottom: 16px;
}

.season-day {
  min-height: 42px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.season-day.blank {
  visibility: hidden;
  pointer-events: none;
}

.season-day.is-high {
  background: #ffedd5;
}

.season-day.is-low {
  background: #dbeafe;
}

.season-day.is-range {
  outline: 2px solid #0e7490;
}

.season-form {
  margin-top: 8px;
}

.season-period-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.season-period-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.car-visual.car-life { background: linear-gradient(135deg, #22c55e, #166534); }
.car-visual.car-solio { background: linear-gradient(135deg, #3b82f6, #1e3a8a); }
.car-visual.car-roomy { background: linear-gradient(135deg, #f59e0b, #b45309); }
.car-visual.car-custom-0 { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.car-visual.car-custom-1 { background: linear-gradient(135deg, #8b5cf6, #5b21b6); }
.car-visual.car-custom-2 { background: linear-gradient(135deg, #ef4444, #9f1239); }
.car-visual.car-custom-3 { background: linear-gradient(135deg, #0ea5e9, #075985); }
.car-visual.car-custom-4 { background: linear-gradient(135deg, #84cc16, #3f6212); }

.admin-login-wrap {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  border: 1px solid var(--line);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-tab {
  background: #e2e8f0;
  color: var(--ink);
  border: none;
}

.admin-tab.is-active {
  background: var(--navy);
  color: #fff;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.stat-card strong {
  display: block;
  font-size: 1.6rem;
  margin-top: 6px;
}

.admin-toolbar-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 800px) {
  .shop-grid {
    grid-template-columns: 1fr;
  }
}


.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #0f172a;
  color: #fff;
}

.header h1 {
  margin: 0;
  font-size: 1.25rem;
}

.header nav {
  display: flex;
  gap: 16px;
}

.header a {
  color: #93c5fd;
  text-decoration: none;
}

.container {
  max-width: 1120px;
  margin: 24px auto;
  padding: 0 20px;
  display: grid;
  gap: 16px;
}

.page-back-row {
  margin: 0;
}

.back-page-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #64748b;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
}

.back-page-link:hover {
  background: #475569;
  color: #fff;
}

.card {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 16px;
}

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.fleet-item {
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 10px;
}

.hint-text {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 0.9rem;
}

.car-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 12px;
  min-width: 0;
}

.car-type-card {
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 14px;
  background: #f8fafc;
}

.car-type-card.is-pending {
  opacity: 0.75;
}

.car-type-card.is-unavailable {
  background: #f1f5f9;
  opacity: 0.85;
}

.car-type-card.is-available {
  padding: 0;
  background: #fff;
  border-color: #93c5fd;
}

.car-type-link {
  display: block;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  min-height: 56px;
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(37, 99, 235, 0.15);
  touch-action: manipulation;
}

.car-type-card .car-visual,
.car-type-link .car-visual {
  height: 120px;
}

.car-type-link:hover {
  background: #eff6ff;
}

.car-type-name {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.car-type-status {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

.car-type-card.is-available .car-type-status {
  color: #1d4ed8;
  font-weight: 600;
}

.car-type-category {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: #64748b;
}

.car-type-price {
  margin: 8px 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.car-type-price-note {
  font-size: 0.75rem;
  font-weight: 400;
  color: #64748b;
  margin-left: 4px;
}

.price-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.price-total-display {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.price-tax-note {
  margin-bottom: 0;
}

.price-breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.price-breakdown-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.price-breakdown-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.price-breakdown-info {
  color: #64748b;
  font-size: 0.85rem;
  justify-content: flex-start;
}

.price-breakdown-total {
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
}

.price-breakdown-option {
  color: #c2410c;
  font-weight: 600;
}

.price-breakdown-onsite {
  color: #64748b;
  font-size: 0.85rem;
}

.options-section {
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.options-section-title {
  margin: 0 0 12px;
  font-size: 1rem;
}

.option-group {
  border: none;
  margin: 0 0 14px;
  padding: 0;
}

.option-group legend {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.option-check {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  flex-direction: row;
  min-height: 44px;
  padding: 6px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.option-check input {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin: 0;
  flex-shrink: 0;
}

.options-price-preview {
  margin: 8px 0 0;
  font-weight: 700;
  color: #0f172a;
}

.payment-method-group {
  border: none;
  margin: 0;
  padding: 0;
}

.payment-method-group .option-check:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

select option:disabled {
  color: #94a3b8;
}

.same-day-time-note {
  margin: -4px 0 0;
}

.page-label {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 0.9rem;
}

.car-detail-title {
  margin: 0 0 12px;
}

.car-detail-intro {
  margin: 0 0 16px;
  line-height: 1.6;
}

.rental-summary {
  margin: 0 0 20px;
  display: grid;
  gap: 10px;
}

.rental-summary dt {
  font-weight: 700;
  font-size: 0.85rem;
  color: #64748b;
}

.rental-summary dd {
  margin: 2px 0 0;
}

.confirm-section-title {
  margin: 20px 0 10px;
  font-size: 1rem;
}

.confirm-section-title:first-of-type {
  margin-top: 0;
}

.confirm-summary {
  margin: 0;
  display: grid;
  gap: 10px;
}

.confirm-summary dt {
  font-weight: 700;
  font-size: 0.85rem;
  color: #64748b;
}

.confirm-summary dd {
  margin: 2px 0 0;
}

.confirm-edit-link {
  margin: 16px 0 0;
  font-size: 0.9rem;
}

.confirm-edit-link a {
  display: inline-block;
  padding: 10px 4px;
  min-height: 44px;
  line-height: 32px;
  color: #2563eb;
}

.terms-scroll-box {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.terms-text {
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 0.9rem;
}

.terms-content h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.terms-content p {
  margin: 0 0 12px;
  line-height: 1.7;
  font-size: 0.9rem;
}

.terms-content h4 {
  margin: 20px 0 8px;
  font-size: 0.95rem;
}

.terms-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
  font-size: 0.85rem;
}

.terms-table th,
.terms-table td {
  border: 1px solid #dbe2ea;
  padding: 8px;
  text-align: left;
}

.terms-table th {
  background: #e5e7eb;
  font-weight: 700;
}

.terms-list {
  margin: 0 0 12px;
  padding-left: 1.4rem;
  line-height: 1.7;
  font-size: 0.9rem;
}

.terms-contact {
  margin: 0 0 12px;
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.terms-contact dt {
  font-weight: 700;
  color: #64748b;
  font-size: 0.85rem;
}

.terms-contact dd {
  margin: 0 0 8px;
}

.terms-placeholder-note {
  color: #64748b;
  font-style: italic;
}

.terms-end-marker {
  margin-top: 16px;
  font-weight: 700;
  text-align: center;
  color: #64748b;
}

.terms-agree-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.terms-agree-check {
  margin-top: 12px;
  font-weight: 700;
}

.terms-agree-check input:disabled {
  cursor: not-allowed;
}

.terms-agree-check.is-locked {
  opacity: 0.55;
}

button.is-disabled,
button[aria-disabled="true"]:not(:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

#termsAgreeBtn.needs-scroll {
  opacity: 0.9;
}

.terms-agreed-indicator {
  align-items: center;
  gap: 6px;
  color: #059669;
  font-weight: 700;
}

.terms-agreed-indicator[hidden] {
  display: none !important;
}

.terms-agreed-indicator:not([hidden]) {
  display: inline-flex;
}

.terms-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #059669;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

.date-field {
  position: relative;
}

.date-field-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
}

/* 日付は全端末でブラウザ標準の date 入力のみ（余計なヒント・ボタンは出さない） */
.date-touch-hint,
.date-display-input,
.date-picker-btn {
  display: none !important;
}

.date-picker-row {
  position: relative;
  display: block;
  min-height: 0;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.date-picker-row > .native-date-input,
input[type="date"].native-date-input,
input[type="date"] {
  display: block !important;
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  opacity: 1 !important;
  pointer-events: auto !important;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  box-sizing: border-box !important;
  background: #fff;
  color: #334155;
  font-size: 16px;
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
  color-scheme: light;
  touch-action: manipulation;
}

/* iOS Safari の date 入力が親より広がるのを抑える */
input[type="date"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}

.search-panel,
.search-grid,
.search-panel label,
.date-field,
.date-picker-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.search-panel select,
.search-panel input,
.search-panel button {
  max-width: 100%;
  box-sizing: border-box;
}

.phone-input-row {
  display: grid;
  grid-template-columns: minmax(140px, 42%) 1fr;
  gap: 8px;
}

.phone-input-row select {
  min-width: 0;
}

.full {
  grid-column: 1 / -1;
}

input,
select,
textarea,
button {
  font: inherit;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #cfd8e3;
  box-sizing: border-box;
}

select,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
textarea {
  min-height: 44px;
}

button {
  background: #2563eb;
  color: #fff;
  border: none;
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button.secondary {
  background: #64748b;
}

button.secondary:hover {
  background: #475569;
}

button:hover {
  background: #1d4ed8;
}

.danger {
  background: #dc2626;
}

.danger:hover {
  background: #b91c1c;
}

.message {
  min-height: 1.5em;
  margin-top: 8px;
}

.outside-hours-tag {
  color: #c2410c;
  font-weight: 700;
  font-size: 0.85em;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
}

.table-scroll > table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.table-scroll th,
.table-scroll td {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  vertical-align: top;
}

th,
td {
  border-bottom: 1px solid #e5e7eb;
  padding: 8px;
  font-size: 0.9rem;
  text-align: left;
}

.toolbar {
  margin-bottom: 8px;
}

.status-select,
.payment-status-select {
  min-width: 110px;
}

.unread-row {
  background: #eff6ff;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.calendar-weekday {
  text-align: center;
  font-weight: 700;
  background: #e5e7eb;
  border-radius: 6px;
  padding: 6px;
}

.calendar-day {
  min-height: 108px;
  min-width: 0;
  border: 1px solid #dbe2ea;
  border-radius: 0;
  padding: 6px;
  background: #fff;
  border-right: none;
  border-top: none;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.calendar-day-number {
  flex-shrink: 0;
  line-height: 1.2;
}

.calendar-day-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.calendar-day-bar-row {
  flex: 0 0 22px;
  min-height: 22px;
  display: flex;
  align-items: stretch;
}

.calendar-day-bar-row .calendar-reservation {
  margin-top: 0;
  flex: 1;
  min-height: 0;
  height: 22px;
}

button.calendar-reservation {
  padding: 3px 5px;
  border-radius: 0;
  background: #dbeafe;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: left;
  color: #1e3a8a;
  border: 1px solid transparent;
  border-left-width: 0;
  border-right-width: 0;
  cursor: pointer;
  min-height: 20px;
}

.calendar-day:nth-child(7n + 1) {
  border-left: 1px solid #dbe2ea;
}

.calendar-day:nth-child(-n + 14) {
  border-top: 1px solid #dbe2ea;
}

.calendar-day.blank {
  background: #f9fafb;
}

button.calendar-reservation.segment-start {
  border-radius: 4px 0 0 4px;
  border-left-width: 1px;
}

button.calendar-reservation.segment-end {
  border-radius: 0 4px 4px 0;
  border-right-width: 1px;
}

button.calendar-reservation.segment-single {
  border-radius: 4px;
  border-left-width: 1px;
  border-right-width: 1px;
}

button.calendar-reservation.segment-middle:not(.has-start-name) {
  color: transparent;
}

button.calendar-reservation.has-start-name {
  font-weight: 600;
}

button.calendar-reservation.car-life {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a8a;
}

button.calendar-reservation.car-solio {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

button.calendar-reservation.car-roomy {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

button.calendar-reservation.car-custom-0 {
  background: #ccfbf1;
  border-color: #5eead4;
  color: #115e59;
}

button.calendar-reservation.car-custom-1 {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}

button.calendar-reservation.car-custom-2 {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #9f1239;
}

button.calendar-reservation.car-custom-3 {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #075985;
}

button.calendar-reservation.car-custom-4 {
  background: #ecfccb;
  border-color: #bef264;
  color: #3f6212;
}

button.calendar-reservation.car-life.segment-middle:not(.has-start-name),
button.calendar-reservation.car-solio.segment-middle:not(.has-start-name),
button.calendar-reservation.car-roomy.segment-middle:not(.has-start-name),
button.calendar-reservation.car-custom-0.segment-middle:not(.has-start-name),
button.calendar-reservation.car-custom-1.segment-middle:not(.has-start-name),
button.calendar-reservation.car-custom-2.segment-middle:not(.has-start-name),
button.calendar-reservation.car-custom-3.segment-middle:not(.has-start-name),
button.calendar-reservation.car-custom-4.segment-middle:not(.has-start-name) {
  color: transparent;
}

button.calendar-reservation:hover {
  background: #bfdbfe;
}

button.calendar-reservation:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

button.calendar-more {
  margin-top: 4px;
  color: #1d4ed8;
  font-size: 0.75rem;
  background: transparent;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  text-decoration: underline;
  width: 100%;
  text-align: left;
}

button.calendar-more:hover {
  color: #1e40af;
  background: transparent;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(85vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #dbe2ea;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-title {
  margin: 0;
  font-size: 1rem;
}

.modal-close {
  background: #e5e7eb;
  color: #1f2937;
  padding: 10px 14px;
  line-height: 1.2;
  min-width: 44px;
  min-height: 44px;
}

.modal-close:hover {
  background: #d1d5db;
}

.modal-body {
  padding: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.modal-body dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.modal-body dt {
  font-weight: 700;
  font-size: 0.8rem;
  color: #64748b;
}

.modal-body dd {
  margin: 2px 0 0;
}

.modal-body .detail-block {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-body .detail-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 14px;
  border-top: 1px solid #e5e7eb;
}

button.secondary {
  background: #64748b;
}

button.secondary:hover {
  background: #475569;
}

.calendar-day-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.day-list-card {
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.day-list-card h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.day-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.day-list li {
  margin-bottom: 6px;
}

.complete-card {
  text-align: center;
  padding: 32px 24px;
}

.complete-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.complete-status h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #0f172a;
}

.complete-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #dcfce7;
  color: #059669;
  font-size: 2rem;
  font-weight: 700;
}

.complete-message {
  max-width: 560px;
  margin: 0 auto 28px;
  text-align: left;
}

.complete-message p {
  margin: 0 0 16px;
  line-height: 1.7;
  color: #334155;
}

.complete-message p:last-child {
  margin-bottom: 0;
}

.complete-top-link {
  display: inline-block;
  padding: 12px 24px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
}

.complete-top-link:hover {
  background: #1d4ed8;
  color: #fff;
}

.day-schedule-wrap {
  display: grid;
  gap: 24px;
}

.day-schedule-panel {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
}

.day-schedule-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: #0f172a;
}

.day-inventory-grid {
  margin-bottom: 16px;
}

.day-inventory-grid .fleet-item.car-life {
  border-color: #93c5fd;
  background: #eff6ff;
}

.day-inventory-grid .fleet-item.car-solio {
  border-color: #86efac;
  background: #f0fdf4;
}

.day-inventory-grid .fleet-item.car-roomy {
  border-color: #fcd34d;
  background: #fffbeb;
}

.day-inventory-grid .fleet-item.car-custom-0 { border-color: #5eead4; background: #f0fdfa; }
.day-inventory-grid .fleet-item.car-custom-1 { border-color: #c4b5fd; background: #f5f3ff; }
.day-inventory-grid .fleet-item.car-custom-2 { border-color: #fca5a5; background: #fef2f2; }
.day-inventory-grid .fleet-item.car-custom-3 { border-color: #7dd3fc; background: #f0f9ff; }
.day-inventory-grid .fleet-item.car-custom-4 { border-color: #bef264; background: #f7fee7; }

.schedule-board {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
}

.schedule-track-wrap {
  min-width: 720px;
}

.schedule-hour-axis,
.schedule-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: stretch;
}

.schedule-row-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  padding-right: 4px;
}

.schedule-row-label.car-life {
  color: #1e40af;
}

.schedule-row-label.car-solio {
  color: #166534;
}

.schedule-row-label.car-roomy {
  color: #92400e;
}

.schedule-row-label.car-custom-0 { color: #0f766e; }
.schedule-row-label.car-custom-1 { color: #5b21b6; }
.schedule-row-label.car-custom-2 { color: #9f1239; }
.schedule-row-label.car-custom-3 { color: #075985; }
.schedule-row-label.car-custom-4 { color: #3f6212; }

.schedule-axis-spacer {
  font-size: 0.75rem;
  color: #64748b;
}

.schedule-hour-labels {
  position: relative;
  height: 24px;
  border-bottom: 1px solid #cbd5e1;
}

.schedule-hour-mark {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: #64748b;
  white-space: nowrap;
}

.schedule-track {
  position: relative;
  height: 36px;
  border-radius: 4px;
  background-color: #fff;
  background-image: repeating-linear-gradient(
    to right,
    #f8fafc 0,
    #f8fafc calc(100% / 48 - 1px),
    #e2e8f0 calc(100% / 48 - 1px),
    #e2e8f0 calc(100% / 48)
  );
  border: 1px solid #dbe2ea;
  overflow: hidden;
}

.schedule-track::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(100% / 24 - 1px),
    #cbd5e1 calc(100% / 24 - 1px),
    #cbd5e1 calc(100% / 24)
  );
  pointer-events: none;
  opacity: 0.45;
}

.schedule-block {
  position: absolute;
  top: 3px;
  bottom: 3px;
  min-width: 2px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 30px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  z-index: 1;
}

.schedule-block.car-life {
  background: #3b82f6;
  color: #fff;
  border: 1px solid #1d4ed8;
}

.schedule-block.car-solio {
  background: #22c55e;
  color: #fff;
  border: 1px solid #15803d;
}

.schedule-block.car-roomy {
  background: #f59e0b;
  color: #fff;
  border: 1px solid #b45309;
}

.schedule-block.car-custom-0 { background: #14b8a6; color: #fff; border: 1px solid #0f766e; }
.schedule-block.car-custom-1 { background: #8b5cf6; color: #fff; border: 1px solid #5b21b6; }
.schedule-block.car-custom-2 { background: #ef4444; color: #fff; border: 1px solid #9f1239; }
.schedule-block.car-custom-3 { background: #0ea5e9; color: #fff; border: 1px solid #075985; }
.schedule-block.car-custom-4 { background: #84cc16; color: #fff; border: 1px solid #3f6212; }

.schedule-row + .schedule-row {
  margin-top: 8px;
}

.document-search-form {
  display: grid;
  grid-template-columns: 1fr 160px auto auto;
  gap: 12px;
  align-items: end;
}

.document-search-field {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.document-search-summary {
  margin: 12px 0 0;
  color: #475569;
  font-size: 0.9rem;
}

.table-scroll {
  overflow-x: auto;
}

.document-results-table {
  width: max-content;
  min-width: 720px;
  border-collapse: collapse;
}

.document-results-table th,
.document-results-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 0.85rem;
  vertical-align: middle;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.doc-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.doc-type-estimate {
  background: #dbeafe;
  color: #1e40af;
}

.doc-type-receipt {
  background: #dcfce7;
  color: #166534;
}

.document-modal-panel {
  max-width: 860px;
}

.document-modal-header {
  align-items: center;
}

.document-modal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.document-modal-body {
  background: #f8fafc;
}

.document-sheet {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 24px;
  color: #0f172a;
}

.document-sheet-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #0f172a;
}

.document-company-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.document-company p {
  margin: 0 0 4px;
  font-size: 0.85rem;
  color: #475569;
}

.document-title-block {
  text-align: right;
}

.document-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  letter-spacing: 0.2em;
}

.document-title-block p {
  margin: 0;
  font-size: 0.85rem;
}

.document-sheet section {
  margin-bottom: 18px;
}

.document-sheet h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: #334155;
}

.document-dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 12px;
  margin: 0;
}

.document-dl dt {
  color: #64748b;
  font-size: 0.85rem;
}

.document-dl dd {
  margin: 0;
  font-size: 0.9rem;
}

.document-table {
  width: 100%;
  border-collapse: collapse;
}

.document-table th,
.document-table td {
  border: 1px solid #dbe2ea;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.document-table th {
  background: #f1f5f9;
  text-align: left;
}

.document-table .doc-amount {
  text-align: right;
  white-space: nowrap;
}

.document-total-row td {
  font-weight: 700;
  background: #f8fafc;
}

.document-receipt-note,
.document-estimate-note {
  margin: 16px 0 0;
  font-size: 0.9rem;
  color: #334155;
}

@media print {
  body {
    background: #fff;
  }

  .header,
  .container > .card,
  .modal-backdrop,
  .modal-header,
  .modal-footer {
    display: none !important;
  }

  .modal {
    position: static !important;
    display: block !important;
  }

  .modal[hidden] {
    display: none !important;
  }

  .document-modal-panel {
    max-width: none;
    width: 100%;
    box-shadow: none;
    border: none;
  }

  .document-modal-body {
    padding: 0;
    background: #fff;
  }

  .document-sheet {
    border: none;
  }
}

@media (max-width: 700px) {
  .document-search-form {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .search-grid {
    grid-template-columns: 1fr;
  }

  body {
    font-size: 16px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .header nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .header a {
    display: inline-block;
    padding: 8px 4px;
    min-height: 44px;
    line-height: 28px;
  }

  .back-page-link {
    min-height: 44px;
    padding: 12px 16px;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .car-type-grid {
    grid-template-columns: 1fr;
  }

  .phone-input-row {
    grid-template-columns: 1fr;
  }

  .terms-agree-row .secondary {
    width: 100%;
  }

  #confirmSubmitBtn,
  #searchForm button[type="submit"] {
    width: 100%;
  }

  .price-summary-row {
    flex-direction: column;
    align-items: stretch;
  }

  .price-summary-row .secondary {
    width: 100%;
  }

  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-scroll > table {
    min-width: 640px;
  }

  .table-scroll th,
  .table-scroll td {
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
  }

  th,
  td {
    font-size: 0.85rem;
    padding: 10px 8px;
  }

  .terms-table {
    min-width: 0 !important;
    width: 100%;
  }

  .terms-table th,
  .terms-table td {
    white-space: normal;
    word-break: break-word;
  }

  .status-select,
  .payment-status-select {
    min-width: 120px;
    min-height: 44px;
    font-size: 16px;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .calendar-day {
    min-height: 112px;
    padding: 4px;
  }

  .calendar-day-bar-row {
    flex: 0 0 28px;
    min-height: 28px;
  }

  button.calendar-reservation {
    min-height: 26px;
    height: 26px;
    font-size: 0.65rem;
    padding: 2px 4px;
  }

  .calendar-day-lists {
    grid-template-columns: 1fr;
  }

  .schedule-track-wrap {
    min-width: 100%;
  }

  .modal-panel {
    width: 100%;
    max-height: 92vh;
    margin: 0 8px;
  }

  .complete-top-link {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
}

[hidden] {
  display: none !important;
}

.page-main {
  padding: 24px 0 64px;
}

.admin-tab {
  background: #e2e8f0;
  color: #1f2937;
  border: none;
}

.admin-tab.is-active {
  background: #0b3d5c;
  color: #fff;
}

#logoutBtn {
  background: transparent;
  border: 1px solid #93c5fd;
  color: #dbeafe;
  min-height: 36px;
  padding: 6px 12px;
}

input[type="password"],
input[type="number"] {
  min-height: 44px;
}

.login-card h1 {
  margin-top: 0;
}

.login-card button.full {
  margin-top: 12px;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.site-header {
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  width: 100%;
  box-sizing: border-box;
}

a,
button,
input,
select,
textarea,
label,
.car-type-link {
  touch-action: manipulation;
}

input,
select,
textarea {
  font-size: 16px;
  max-width: 100%;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  margin: 0;
  background: transparent;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
}

.nav-toggle:hover,
.nav-toggle:focus {
  background: rgba(255, 255, 255, 0.12);
}

button:active,
.car-type-link:active,
.site-nav a:active {
  opacity: 0.88;
}

.calendar-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding-bottom: 8px;
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
}

.admin-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.admin-tab {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 44px;
}

.day-schedule-wrap,
.schedule-track-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-panel {
  max-width: min(640px, calc(100vw - 24px));
  max-height: min(92vh, 92dvh);
}

.footer-inner {
  flex-direction: column;
  align-items: center;
}

@media (min-width: 861px) {
  .nav-toggle {
    display: none !important;
  }

  .site-nav {
    display: flex !important;
    position: static;
    background: transparent;
    padding: 0;
    flex-direction: row;
  }
}

@media (max-width: 860px) {
  .header-inner {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    position: relative;
    padding: 12px 16px;
  }

  .logo-text {
    font-size: 0.95rem;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    flex-direction: column;
    gap: 4px;
    background: var(--navy-deep);
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
  }

  .site-nav a.nav-admin {
    justify-content: center;
  }

  .hero {
    padding: 28px 16px 36px;
  }

  .search-panel {
    padding: 16px;
  }

  .search-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 32px 0;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-main {
    padding: 16px 0 48px;
  }

  .car-type-grid,
  .fleet-showcase {
    grid-template-columns: 1fr;
  }

  .phone-input-row {
    grid-template-columns: 1fr;
  }

  .admin-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-grid {
    min-width: 0;
    width: 100%;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  /* 公開カレンダーは画面幅に収める */
  .public-calendar-grid {
    min-width: 0;
  }

  /* 管理カレンダーも画面幅に収める（右端が見切れない） */
  .admin-panel .calendar-scroll {
    overflow-x: visible;
    max-width: 100%;
    padding-bottom: 0;
  }

  .admin-panel .calendar-grid,
  .public-calendar-grid,
  .calendar-grid {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100%;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .calendar-day {
    min-height: 64px;
    padding: 2px 1px;
    overflow: hidden;
  }

  .calendar-day-number {
    font-size: 0.7rem;
    line-height: 1.2;
  }

  .calendar-weekday {
    font-size: 0.7rem;
    padding: 4px 0;
  }

  .calendar-day-bar-row {
    flex: 0 0 10px;
    min-height: 10px;
    height: 10px;
  }

  button.calendar-reservation {
    min-height: 8px !important;
    height: 8px !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    padding: 0 !important;
    border-radius: 3px;
    overflow: hidden;
  }

  button.calendar-reservation.has-start-name {
    font-size: 0 !important;
    color: transparent !important;
  }

  .schedule-track-wrap {
    min-width: 640px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rates-table {
    min-width: 560px;
  }

  .public-calendar-card {
    padding: 12px;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .hero-inner,
  .header-inner,
  .search-panel,
  .page-main,
  main {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  button.full,
  .search-submit,
  .complete-top-link,
  .back-page-link {
    width: 100%;
    justify-content: center;
  }

  /* —— 管理画面スマホ —— */
  #adminApp.container,
  body:not(.public-body) > .container {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  #adminApp .card,
  body:not(.public-body) .card {
    padding: 12px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: visible;
  }

  #adminApp .card > h2,
  #adminApp .admin-toolbar-row h2 {
    font-size: 1.15rem;
    word-break: break-word;
  }

  .admin-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 8px;
    margin: 0 -4px 12px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .admin-tabs::after {
    content: "";
    flex: 0 0 12px;
  }

  .admin-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.88rem;
    padding: 10px 12px;
  }

  .admin-toolbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .admin-toolbar-row .danger,
  .admin-toolbar-row button {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    line-height: 1.35;
    text-align: center;
  }

  /* 前月 / タイトル / 次月 を1行に */
  .toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .toolbar button {
    flex: 0 0 auto;
    width: auto;
    min-width: 4.5rem;
    padding: 10px 12px;
  }

  #calendarTitle {
    flex: 1 1 auto;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .table-scroll {
    margin: 0;
    padding-bottom: 4px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-scroll::before {
    content: "表は左右にスワイプできます";
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin: 0 0 6px;
  }

  #adminApp .table-scroll::before {
    content: "表は左右にスワイプできます";
  }

  .public-body .table-scroll::before {
    content: "料金表は左右にスワイプできます";
  }

  /* 表を潰さず横スクロールで読める幅を確保（カード化しない表のみ） */
  #adminApp .table-scroll > table:not(.reservations-table) {
    width: max-content !important;
    min-width: 1100px !important;
    table-layout: auto;
  }

  .document-results-table {
    width: max-content !important;
    min-width: 800px !important;
  }

  .rates-table {
    width: max-content !important;
    min-width: 640px !important;
  }

  #adminApp .table-scroll > table:not(.reservations-table) th,
  #adminApp .table-scroll > table:not(.reservations-table) td,
  .rates-table th,
  .rates-table td {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    font-size: 0.82rem;
    padding: 8px 10px;
  }

  .status-select,
  .payment-status-select {
    min-width: 7.5rem;
    max-width: none;
    min-height: 44px;
    font-size: 16px;
  }

  .day-schedule-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .day-schedule-panel {
    min-width: 0;
  }

  .calendar-day-lists {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card strong {
    font-size: 1.35rem;
  }

  .modal-panel {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    margin: 8px auto;
    max-height: min(90vh, 90dvh);
  }

  .modal-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-body dd,
  .modal-body dt {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .login-card {
    width: min(420px, 100%);
    padding: 20px 16px;
  }

  .admin-login-wrap {
    padding: 16px;
  }

  #adminApp .form-grid {
    grid-template-columns: 1fr;
  }

  #adminApp input,
  #adminApp select,
  #adminApp textarea {
    max-width: 100%;
  }

  .site-nav button,
  .site-nav .secondary {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.55rem;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-day {
    min-height: 56px;
    padding: 2px 1px;
  }

  .calendar-day-number {
    font-size: 0.68rem;
    margin-bottom: 1px;
  }

  .calendar-weekday {
    font-size: 0.68rem;
    padding: 4px 0;
  }

  .public-calendar-grid .calendar-day,
  .admin-panel .calendar-day {
    min-height: 52px;
  }

  .calendar-day-bar-row,
  .public-calendar-grid .calendar-day-bar-row {
    flex: 0 0 8px;
    min-height: 8px;
    height: 8px;
  }

  button.calendar-reservation,
  .public-calendar-grid button.calendar-reservation {
    min-height: 6px !important;
    height: 6px !important;
    font-size: 0 !important;
    color: transparent !important;
    padding: 0 !important;
  }

  .search-panel,
  .public-calendar-card {
    border-radius: 12px;
  }

  .section-sub,
  .hint-text {
    overflow-wrap: anywhere;
  }
}

@media (hover: none) {
  button:hover,
  button.full:hover,
  .search-submit:hover,
  .site-nav a:hover,
  .car-type-link:hover {
    background: inherit;
  }

  button:hover {
    background: #2563eb;
  }

  button.full:hover,
  .search-submit:hover {
    background: var(--accent);
  }

  button.secondary:hover {
    background: #64748b;
  }

  .danger:hover {
    background: #dc2626;
  }

  .admin-tab:hover {
    background: #e2e8f0;
  }

  .admin-tab.is-active:hover {
    background: #0b3d5c;
  }
}

/* 予約サイト：空き状況カレンダー */
.public-calendar-card {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}

.public-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.public-calendar-toolbar span {
  font-weight: 700;
  font-size: 1.05rem;
}

.public-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #475569;
}

.public-calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.public-calendar-swatch {
  width: 18px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.public-calendar-swatch.is-busy {
  background: linear-gradient(90deg, #0e7490, #22d3ee);
}

.public-calendar-grid .calendar-day {
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.public-calendar-grid .calendar-day:hover,
.public-calendar-grid .calendar-day:focus-visible {
  background: #f8fafc;
  box-shadow: inset 0 0 0 2px #94a3b8;
  outline: none;
}

.public-calendar-grid .calendar-day.is-today {
  background: #f0f9ff;
}

.public-calendar-grid .calendar-day.has-busy {
  background: #fff7ed;
}

.public-calendar-grid .calendar-day.blank {
  cursor: default;
  pointer-events: none;
}

.public-calendar-grid button.calendar-reservation {
  pointer-events: none;
  font-size: 0.68rem;
  letter-spacing: 0;
  cursor: default;
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 860px) {
  .public-calendar-grid button.calendar-reservation,
  .public-calendar-grid button.calendar-reservation.has-start-name {
    font-size: 0 !important;
    color: transparent !important;
    min-height: 8px;
    height: 8px;
    padding: 0;
  }
}

.public-day-busy-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public-day-busy-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fafc;
}

.public-day-busy-item strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
}

.public-day-busy-item p {
  margin: 0;
  color: #334155;
  line-height: 1.5;
  font-size: 0.95rem;
}

.public-day-busy-note {
  margin-top: 8px !important;
  color: #b45309 !important;
  font-size: 0.88rem !important;
}

.public-day-empty {
  margin: 0;
  color: #64748b;
}

@media (max-width: 720px) {
  .public-calendar-card {
    padding: 12px;
  }

  .public-calendar-toolbar {
    flex-wrap: wrap;
  }

  .public-calendar-toolbar span {
    order: -1;
    width: 100%;
    text-align: center;
  }
}

/* PC：予約一覧の右端がページ外に切れないよう、表をカード幅に収める */
@media (min-width: 861px) {
  #adminApp.container {
    max-width: min(1440px, 100%);
  }

  #adminApp,
  #adminApp .admin-panel,
  #adminApp #tab-reservations .card {
    min-width: 0;
    max-width: 100%;
  }

  #adminApp .reservations-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
  }

  #adminApp .table-scroll > table.reservations-table {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    table-layout: fixed;
  }

  #adminApp .reservations-table th,
  #adminApp .reservations-table td {
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    vertical-align: top;
  }

  #adminApp .reservations-table th:nth-child(4),
  #adminApp .reservations-table td:nth-child(4),
  #adminApp .reservations-table th:nth-child(5),
  #adminApp .reservations-table td:nth-child(5) {
    width: 16%;
  }

  #adminApp .reservations-table .payment-status-select,
  #adminApp .reservations-table .status-select,
  #adminApp .reservations-table button {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* スマホ：予約一覧・書類一覧をカード型にして潰さない */
@media (max-width: 860px) {
  .reservations-table-wrap::before,
  #adminApp .reservations-table-wrap::before,
  .table-scroll:has(.document-results-table)::before {
    display: none !important;
    content: none !important;
  }

  .reservations-table-wrap,
  #adminApp .reservations-table-wrap,
  .table-scroll:has(.document-results-table) {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* 横長テーブル用の min-width を打ち消す（これが見切れの主因） */
  #adminApp .table-scroll > .reservations-table,
  #adminApp .reservations-table,
  #adminApp .table-scroll > table.reservations-table,
  .document-results-table,
  .table-scroll > .document-results-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 12px !important;
  }

  #adminApp .reservations-table thead,
  .document-results-table thead {
    display: none !important;
  }

  #adminApp .reservations-table tbody,
  .document-results-table tbody {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #adminApp .reservations-table tr,
  .document-results-table tr {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px !important;
    margin: 0 0 12px !important;
    overflow: hidden !important;
  }

  #adminApp .reservations-table tr.unread-row {
    background: #eff6ff;
    border-color: #bfdbfe;
  }

  #adminApp .reservations-table td,
  .document-results-table td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    font-size: 0.9rem !important;
    min-width: 0 !important;
  }

  #adminApp .reservations-table td:last-child,
  .document-results-table td:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
  }

  #adminApp .reservations-table td::before,
  .document-results-table td::before {
    content: attr(data-label);
    display: block !important;
    font-weight: 700;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.3;
    margin-bottom: 4px;
  }

  #adminApp .reservations-table td > *,
  .document-results-table td > * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #adminApp .reservations-table select,
  #adminApp .reservations-table button,
  .document-results-table select,
  .document-results-table button {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #adminApp .reservations-table .payment-status-select,
  #adminApp .reservations-table .status-select,
  #adminApp .reservations-table .payment-status-select,
  #adminApp .status-select {
    min-width: 0 !important;
  }

  #adminApp .admin-toolbar-row .danger {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }

  #adminApp #tab-reservations .card,
  body:not(.public-body) .card {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }
}


