:root {
  color-scheme: light;
  --ink: #10233e;
  --muted: #5d6c82;
  --paper: #f5f9ff;
  --panel: #ffffff;
  --line: #cfe0f7;
  --accent: #1684f8;
  --accent-dark: #0865cf;
  --soft: #e6f2ff;
  --danger: #9d2d2d;
  font-family: Inter, "Noto Sans JP", "Yu Gothic UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: linear-gradient(180deg, #fbfdff 0, var(--paper) 420px, #eef6ff 100%); line-height: 1.8; min-height: 100vh; }
a { color: var(--accent-dark); text-underline-offset: 0.2em; }
.site-header, main, .footer-inner { width: min(1180px, calc(100% - 32px)); width: min(1180px, calc(100svw - 32px)); margin-inline: auto; }
.site-header { position: relative; padding-top: 24px; }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 18px; border: 1px solid #cfe0f7; border-radius: 12px; background: rgba(255,255,255,.94); box-shadow: 0 12px 35px rgba(22,132,248,.08); }
.brandCluster, .brand, .account, .primaryButton { display: flex; align-items: center; }
.brandCluster { min-width: 0; flex: 0 1 auto; }
.brand { gap: 10px; min-width: 0; color: #172018; text-decoration: none; }
.brandPicture { display: inline-flex; flex: 0 0 auto; }
.brandLogo { width: 240px; height: 60px; display: block; flex: 0 0 auto; object-fit: contain; border-radius: 7px; }
.brand h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.account { gap: 10px; min-width: 0; flex-wrap: nowrap; justify-content: flex-end; flex: 0 1 auto; }
.accountName { display: inline-block; flex: 1 1 auto; min-width: 0; max-width: min(420px, 52vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.primaryButton, .iconButton, .adminToggle { border: 1px solid #cbd3c8; border-radius: 7px; background: #fff; color: #172018; cursor: pointer; }
.primaryButton { min-height: 40px; gap: 8px; justify-content: center; padding: 0 12px; border-color: #1d6f55; background: #1d6f55; color: #fff; text-decoration: none; font-weight: 700; white-space: nowrap; }
.iconButton, .adminToggle { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; text-decoration: none; }
.adminToggle { width: 32px; height: 32px; color: #66758a; border-radius: 999px; }
.adminToggle.active { border-color: var(--accent); background: var(--soft); color: var(--accent-dark); }
.adminToggle.active svg { fill: currentColor; }
.site-nav { display: flex; flex-wrap: wrap; gap: 18px; padding: 12px 18px 0; font-size: 14px; font-weight: 700; }
.site-nav a { color: #245a94; text-decoration: none; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
main { padding-block: 2rem 5rem; }
.hero { padding: clamp(2rem, 7vw, 5rem) 0 3rem; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: 0.08em; font-size: 0.78rem; text-transform: uppercase; }
h1, h2 { line-height: 1.35; letter-spacing: -0.035em; }
h1 { font-size: clamp(2.25rem, 7vw, 4.5rem); margin: 0.2rem 0 1rem; }
h2 { margin-top: 2.8rem; font-size: 1.4rem; }
h3 { margin-top: 1.8rem; font-size: 1.05rem; }
.lead { color: var(--muted); font-size: 1.12rem; max-width: 44rem; }
.nowrap { white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.card { width: 100%; padding: 1.35rem; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 30px rgba(22, 132, 248, 0.06); }
.card h2, .card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.meta { color: var(--muted); font-size: 0.9rem; }
.documentUpdated { margin-top: 2.5rem; text-align: right; }
.notice { padding: 1rem 1.2rem; border-left: 4px solid var(--accent); background: var(--soft); border-radius: 0 10px 10px 0; }
.notice + [data-support-app] { display: block; margin-top: 1.25rem; }
.legal { max-width: 970px; }
.home { max-width: 970px; }
.legal li + li { margin-top: 0.5rem; }
.legal table { width: 100%; border: 1px solid var(--line); border-spacing: 0; border-radius: 12px; overflow: hidden; margin: 1.5rem 0; background: #fff; }
.legal th, .legal td { padding: 0.75rem; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal tr:last-child > * { border-bottom: 0; }
.legal tr > *:last-child { border-right: 0; }
.legal th { width: 29%; background: var(--soft); }
label, legend { font-weight: 700; }
input, textarea, select, button { font: inherit; }
input, textarea, select { width: 100%; padding: 0.75rem; border: 1px solid #aebbb3; border-radius: 9px; background: white; color: var(--ink); }
input[type="checkbox"] { width: auto; }
textarea { min-height: 9rem; resize: vertical; }
.field { margin: 1.2rem 0; }
.hint { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 400; }
.button { display: inline-block; border: 0; border-radius: 999px; padding: 0.75rem 1.25rem; color: white; background: var(--accent-dark); cursor: pointer; font-weight: 700; text-decoration: none; }
.button:hover { background: #064fa2; }
.button:disabled { opacity: 0.6; cursor: wait; }
.status { min-height: 1.8rem; margin-top: 1rem; }
.status.error { color: var(--danger); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { padding-block: 1.5rem; display: flex; justify-content: center; text-align: center; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; }
code { padding: 0.12rem 0.35rem; border-radius: 5px; background: var(--soft); }
.result { white-space: pre-wrap; word-break: break-word; background: #f3f6f3; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.account-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.text-button, .thread-button { border: 0; background: transparent; color: var(--accent-dark); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; padding: 0.35rem; }
.thread-list { display: grid; gap: 0.5rem; }
.thread-button { text-align: left; padding: 0.8rem 1rem; background: white; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; }
.message { margin: 1rem 0; padding: .9rem 1rem; border-radius: 10px; background: #f4f8ff; }
.message.admin { background: var(--soft); border-left: 4px solid var(--accent); }
.message, .message p, [data-support-detail], [data-support-messages], [data-support-reply], [data-support-reply] textarea { width: 100%; max-width: none; }
.message p { white-space: pre-wrap; overflow-wrap: anywhere; }
.formActions { display: flex; align-items: center; gap: .75rem; min-height: 48px; flex-wrap: wrap; }
.operationStatus { display: inline-flex; align-items: center; min-height: 48px; color: var(--accent-dark); font-weight: 700; }
.toastNotice { position: absolute; z-index: 20; left: 50%; bottom: -5px; transform: translateX(-50%); margin: 0; padding: .35rem .75rem; border: 1px solid #9dc9fa; border-radius: 9px; background: #fff; color: var(--accent-dark); box-shadow: 0 8px 24px rgba(7, 70, 140, .15); font-weight: 700; line-height: 1.5; text-align: center; white-space: nowrap; }
.diagnosticState { padding: .7rem .8rem; border-radius: 9px; background: #f0f3f7; color: var(--muted); font-weight: 700; }
.diagnosticState.active { background: #e1f1ff; color: #075eaf; }
.logGrid { display: grid; gap: 1rem; margin-top: 2rem; }
.logToolbar { display: flex; align-items: end; gap: 1rem; flex-wrap: wrap; }
.logToolbar .field { margin: 0; }
.logToolbar .grow { flex: 1 1 360px; }
.logToolbar .pageSize { flex: 0 0 110px; }
.tableCard { width: 100%; margin-top: 1rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.dataTable { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .92rem; }
.dataTable th, .dataTable td { padding: .72rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.dataTable th { background: var(--soft); white-space: nowrap; }
.dataTable tr:last-child td { border-bottom: 0; }
.emptyCell { text-align: center !important; color: var(--muted); }
.smallButton { border: 1px solid #9dc9fa; border-radius: 8px; padding: .4rem .7rem; background: #fff; color: var(--accent-dark); cursor: pointer; white-space: nowrap; }
.smallButton:disabled { opacity: .45; cursor: default; }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: .8rem; margin-top: .8rem; color: var(--muted); font-size: .9rem; }
.inspectionCard { margin-top: 1rem; }
.selectedEvent { padding: .75rem; border-radius: 9px; background: var(--soft); font-weight: 700; }
.checkboxGrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem 1rem; }
.recordDetail { margin-top: 1rem; padding: 1rem; border-radius: 10px; background: var(--soft); }
.recordList { display: grid; grid-template-columns: minmax(130px, .35fr) minmax(0, 1fr); gap: .35rem 1rem; margin: .7rem 0 0; }
.recordList dt { color: var(--muted); font-weight: 700; }
.recordList dd { margin: 0; overflow-wrap: anywhere; }
.logDetails summary { color: var(--accent-dark); cursor: pointer; font-weight: 700; }
.supportToolbar { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; margin-bottom: .8rem; }
.supportToolbar label { display: grid; gap: .2rem; min-width: 130px; font-size: .86rem; }
.supportToolbar select { padding: .55rem .7rem; }
.sortButton { min-height: 45px; display: inline-flex; align-items: center; gap: .35rem; padding: .55rem .8rem; border: 1px solid #9dc9fa; border-radius: 9px; background: #fff; color: var(--accent-dark); cursor: pointer; font-weight: 700; }
.operationSelector { margin-top: 2.5rem; }
.operationButtons { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; }
.operationButtons button { min-height: 58px; padding: .7rem .8rem; border: 1px solid #9dc9fa; border-radius: 12px; background: #fff; color: var(--accent-dark); cursor: pointer; font-weight: 800; }
.operationButtons button:hover, .operationButtons button.active { border-color: var(--accent); background: var(--soft); box-shadow: 0 7px 20px rgba(22,132,248,.1); }
.operationPanel, [data-operation-panel="mail"] { scroll-margin-top: 1rem; margin-top: 1.2rem; }
.segmentControl { display: inline-flex; padding: 3px; border: 1px solid #9dc9fa; border-radius: 10px; background: var(--soft); }
.segmentControl button { min-width: 110px; padding: .55rem .9rem; border: 0; border-radius: 7px; background: transparent; color: var(--accent-dark); cursor: pointer; font-weight: 800; }
.segmentControl button.active { background: #fff; box-shadow: 0 2px 8px rgba(22,132,248,.15); }
[data-operation-panel="addresses"], [data-address-form] { width: 100%; max-width: none; }

@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
  .legal th, .legal td { display: block; width: 100%; }
  .legal th { border-bottom: 0; }
  .checkboxGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pagination { justify-content: space-between; }
  .operationButtons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .header-inner { gap: 8px; padding: 12px; }
  .brandLogo { width: 180px; height: 45px; }
  .accountName { max-width: clamp(72px, 24vw, 120px); text-align: right; }
  .primaryButton { padding: 0 9px; }
  .toastNotice { bottom: -44px; max-width: calc(100vw - 24px); white-space: normal; }
}

@media (max-width: 420px) {
  .header-inner { align-items: stretch; flex-wrap: wrap; }
  .brandCluster, .account { width: 100%; }
  .account { justify-content: flex-end; }
  .accountName { max-width: calc(100% - 92px); }
}
