:root {
  --primary: #c83332;
  --primary-dark: #9e2827;
  --primary-muted: #9a5c5c;
  --background: #fdf7f7;
  --surface: #ffffff;
  --text-primary: #111827;
  --text-secondary: #64748b;
  --text-muted: #6b7280;
  --border: #e8e8e8;
  --accent-soft: #fff5f5;
  --accent-border: #f0d0d0;
  --brand-red: #c83332;
  --shadow: 0 4px 24px rgba(200, 51, 50, 0.1);
  --radius: 12px;
  --max-width: 760px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: transparent;
  color: var(--text-primary);
  padding: 0;
}

.terms-hero {
  width: 100%;
  display: block;
  margin-top: -2rem;
}

.terms-hero__image {
  display: block;
  width: 100%;
  height: auto;
}

.terms-logo {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: -2.8rem;
  padding: 1rem 0 0.5rem;
}

.terms-logo__image {
  display: block;
  width: min(120px, 23vw);
  height: auto;
}

.site-header__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-header__brand {
  display: flex;
  justify-content: center;
  align-items: center;
  width: auto;
  max-width: 100%;
  margin: 0 auto 1rem;
}

.site-header__mark {
  width: 5.5rem;
  height: 5.5rem;
  flex-shrink: 0;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.375rem;
}

.site-header__mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  margin: 0 auto;
  transform: scale(1.65);
  transform-origin: center center;
}

.site-header__title {
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  text-align: center;
  font-weight: 700;
  line-height: 1.3;
}

.site-header__title-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  width: 100%;
  text-align: center;
}

.site-header__title-main,
.site-header__title-sub,
.site-header__title-app {
  display: block;
  width: 100%;
  text-align: center;
}

.site-header__title-main,
.site-header__title-sub {
  color: #1c3f6e;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.site-header__title-app {
  margin-top: 0.125rem;
  color: #1c3f6e;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
}

/* Keep brand name and short tail words on one line (prevents "Taxi" orphan) */
.app-name {
  white-space: nowrap;
}

.site-header__meta {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.layout {
  max-width: var(--max-width);
  margin: 0 auto 2.5rem;
  padding: 0 calc(max(1rem, env(safe-area-inset-right, 0px)) + 10px) 0
    calc(max(1rem, env(safe-area-inset-left, 0px)) + 10px);
}

.card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.card__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.card__nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.4375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--accent-border);
  text-decoration: none;
}

.card__nav a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

.card__nav a.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.content {
  padding: 0.75rem 0 1.75rem;
}

.content-placeholder {
  padding: 1.25rem 1rem;
  margin-bottom: 2rem;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.9375rem;
}

.content-placeholder strong {
  display: block;
  margin-bottom: 0.25rem;
}


.toc-menu {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 0.75rem 0 1.25rem;
}

.toc-toggle {
  appearance: none;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 0.625rem 1.125rem;
  display: inline-flex;
  align-items: center;
  gap: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.toc-toggle:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.toc {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + 0.5rem);
  width: min(22rem, 92vw);
  margin: 0;
  padding: 0.75rem calc(0.875rem + 10px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(17, 24, 39, 0.12);
  z-index: 20;
}

.toc ol {
  margin: 0;
  padding-left: 1.125rem;
}

.toc li {
  margin: 0.375rem 0;
}

.toc a {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  text-wrap: pretty;
}

.content h2 {
  margin: 1.5rem 0 0.625rem;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.content h3 {
  margin: 1.125rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.content section {
  margin-bottom: 1.5rem;
  scroll-margin-top: 1.5rem;
}

.content section:last-child {
  margin-bottom: 0;
}

.content section:first-of-type h2 {
  margin-top: 0;
}

.content ul,
.content ol {
  margin: 0 0 1rem;
  padding-left: 1.375rem;
  color: var(--text-primary);
}

.content li {
  margin: 0.375rem 0;
}

.content li::marker {
  color: var(--primary-muted);
}

.section-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.content .lead {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.content p {
  margin: 0 0 1rem;
  color: var(--text-primary);
  text-wrap: pretty;
  overflow-wrap: break-word;
  hyphens: auto;
}

.def-list {
  margin: 0 0 1rem;
}

.def-list dt {
  margin: 1rem 0 0.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.def-list dt:first-child {
  margin-top: 0;
}

.def-list dd {
  margin: 0 0 0 0;
  padding-left: 0;
  color: var(--text-primary);
}

.content a[href^="http"] {
  word-break: break-word;
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto 2rem;
  padding: 0 max(1rem, env(safe-area-inset-right, 0px)) 0 max(1rem, env(safe-area-inset-left, 0px));
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.site-footer a {
  font-weight: 600;
}

/* Wider screens: two-line title; mobile keeps three lines */
@media (min-width: 640px) {
  .site-header {
    padding-top: max(2rem, env(safe-area-inset-top, 0px));
    padding-bottom: 2.5rem;
  }

  .site-header__brand {
    margin-bottom: 1.25rem;
  }

  .site-header__title {
    gap: 0.625rem;
    width: 100%;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.25;
  }

  .site-header__title-line {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    column-gap: 0.35em;
    row-gap: 0.125rem;
    width: 100%;
    text-align: center;
  }

  .site-header__title-main,
  .site-header__title-sub {
    width: auto;
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
  }

  .site-header__title-app {
    width: auto;
    margin-top: 0;
    text-align: center;
    font-size: 1.625rem;
    letter-spacing: -0.015em;
  }

  .layout {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .content {
    padding: 1.75rem 1.5rem 2rem;
  }

  .site-footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

@media (min-width: 900px) {
  .site-header__title-main,
  .site-header__title-sub {
    font-size: 1.625rem;
  }

  .site-header__title-app {
    font-size: 1.75rem;
  }
}
