@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #0a0f2c;
  --muted: #50576f;
  --blue: #2636d6;
  --paper: #f5f3ee;
  --line: #dbddec;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.65 Inter, Arial, sans-serif;
}

a { color: var(--blue); text-underline-offset: .18em; }
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.terms-wrap { width: min(100% - 48px, 1080px); margin: 0 auto; }
.terms-header { background: #fff; border-bottom: 1px solid var(--line); }
.terms-header .terms-wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 72px; }
.terms-header img { display: block; width: clamp(116px, 17vw, 156px); height: auto; }
.terms-home { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: .875rem; font-weight: 700; }
.terms-intro { padding: clamp(28px, 6vw, 64px) 0 24px; }
.terms-version { color: var(--blue); font-size: .875rem; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(2rem, 5.4vw, 3.875rem); line-height: 1.06; letter-spacing: -.05em; font-weight: 800; }
h2 { margin-bottom: 14px; font-size: clamp(1.35rem, 3.8vw, 1.8rem); letter-spacing: -.025em; line-height: 1.18; }
.terms-intro > p:last-child { max-width: 68ch; margin-bottom: 0; color: var(--muted); }

.terms-summary {
  padding: clamp(20px, 4vw, 32px);
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  background: #e8ebff;
}

.terms-summary dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px 22px;
  margin: 0 0 16px;
}

.terms-summary dt { color: var(--muted); font-size: .875rem; font-weight: 600; }
.terms-summary dd { margin: 2px 0 0; font-size: clamp(1.04rem, 2vw, 1.25rem); font-weight: 800; line-height: 1.24; }
.terms-summary p { margin: 0; }
.terms-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 40px; margin: 38px 0 64px; }
.terms-nav { position: sticky; top: 20px; display: grid; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.terms-nav a { display: flex; align-items: center; min-height: 44px; font-size: .875rem; font-weight: 650; }
.terms-content { border-radius: 14px; border: 1px solid var(--line); background: #fff; padding: clamp(20px, 4.2vw, 38px); }
.terms-content section + section { border-top: 1px solid var(--line); padding-top: 25px; margin-top: 25px; }
.terms-content p { margin-bottom: 12px; max-width: 75ch; }
.terms-content p:last-child { margin-bottom: 0; }
.terms-notice { margin-top: 17px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: #f4f5fa; }
.terms-notice p { margin-top: 4px; }

.privacy-request-page { max-width: 700px; padding-bottom: 48px; }
.privacy-request { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.privacy-request[hidden] { display: none; }
.privacy-request label { display: grid; gap: 5px; font-weight: 650; }
.privacy-request :is(input, select, textarea, button) { font: inherit; min-height: 44px; }
.privacy-request :is(input, select, textarea) {
  width: 100%;
  border: 1px solid #a8aec5;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
}
.privacy-request textarea { resize: vertical; }
.privacy-request p { margin-bottom: 0; }
.privacy-request button {
  justify-self: start;
  border: 0;
  border-radius: 22px;
  padding: 8px 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.privacy-request button:disabled { opacity: .7; cursor: wait; }
.privacy-request :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.privacy-request [role="alert"] { color: #a02336; }
.privacy-request [role="alert"]:empty { display: none; }
.privacy-protocol { overflow-wrap: anywhere; }

@media (max-width: 750px) {
  .terms-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 20px; }
  .terms-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
}

@media (max-width: 410px) {
  .terms-wrap { width: calc(100% - 32px); }
  .terms-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .terms-summary dl > div:last-child { grid-column: 1 / -1; }
}

@media print {
  body, .terms-summary, .terms-content { background: white; color: black; }
  .terms-nav, .terms-home { display: none; }
  .terms-wrap { width: 100%; }
  .terms-layout { display: block; margin-bottom: 0; }
  .terms-content { border: 0; padding-inline: 0; }
  h2 { break-after: avoid; }
}
