:root {
  --ink: #101310;
  --muted: #687067;
  --line: #dfe4dd;
  --paper: #f4f5f0;
  --surface: #ffffff;
  --acid: #d8ff3e;
  --acid-deep: #b9e912;
  --forest: #172019;
  --warning: #f7e8a4;
  --danger: #b93c38;
  --shadow: 0 24px 80px rgba(22, 28, 23, 0.09);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  font-family:
    "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP",
    system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

body.modal-open,
body.nav-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 18px;
  font-weight: 800;
  gap: 10px;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-light {
  color: #fff;
}

.brand-mark {
  align-items: center;
  background: var(--acid);
  border-radius: 7px;
  color: var(--forest);
  display: inline-flex;
  font-family: Georgia, serif;
  font-size: 20px;
  font-style: italic;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(390px, 0.9fr) minmax(500px, 1.1fr);
}

.auth-story {
  background:
    radial-gradient(circle at 85% 20%, rgba(216, 255, 62, 0.12), transparent 26%),
    linear-gradient(145deg, #111612, #1a231b 65%, #111612);
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  padding: 44px 58px;
  position: relative;
}

.auth-story::after {
  border: 1px solid rgba(216, 255, 62, 0.18);
  border-radius: 50%;
  content: "";
  height: 520px;
  position: absolute;
  right: -300px;
  top: 20%;
  width: 520px;
}

.story-copy {
  margin: auto 0;
  max-width: 590px;
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  color: #8f988e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.19em;
  margin: 0 0 12px;
}

.story-copy .eyebrow {
  color: var(--acid);
}

.story-copy h1 {
  font-size: clamp(48px, 5vw, 78px);
  font-weight: 560;
  letter-spacing: -0.07em;
  line-height: 1.02;
  margin: 0 0 28px;
}

.story-copy h1 em {
  color: var(--acid);
  font-family: Georgia, "Yu Mincho", serif;
  font-weight: 400;
}

.story-lead {
  color: #b8c0b8;
  font-size: 16px;
  line-height: 1.9;
  max-width: 490px;
}

.trust-list {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  list-style: none;
  margin: 44px 0 0;
  padding: 22px 0 0;
}

.trust-list li {
  align-items: center;
  color: #dce2dc;
  display: flex;
  font-size: 13px;
  gap: 15px;
  margin: 12px 0;
}

.trust-list span {
  color: var(--acid);
  font: 11px ui-monospace, monospace;
}

.story-foot {
  color: #778078;
  font: 10px ui-monospace, monospace;
  letter-spacing: 0.15em;
  margin: 0;
}

.auth-panel {
  align-items: center;
  background: #f7f8f4;
  display: flex;
  justify-content: center;
  padding: 60px;
}

.mobile-brand {
  display: none;
}

.auth-card {
  max-width: 460px;
  width: 100%;
}

.mode-pill,
.micro-badge {
  background: #e7eadf;
  border: 1px solid #d7ddce;
  border-radius: 99px;
  display: inline-flex;
  font: 700 9px ui-monospace, monospace;
  letter-spacing: 0.12em;
  padding: 7px 10px;
}

.auth-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin: 40px 0;
}

.auth-tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 0 0 13px;
}

.auth-tab.active {
  border-color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 22px;
}

.auth-form h2,
.section-intro h2,
.panel h2,
.secret-modal h2 {
  font-size: 28px;
  letter-spacing: -0.055em;
  margin: 0 0 8px;
}

.auth-form p,
.section-intro p,
.secret-modal p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}

label {
  color: #394038;
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 8px;
}

input,
textarea,
select {
  background: var(--surface);
  border: 1px solid #d7ddd4;
  border-radius: 10px;
  color: var(--ink);
  outline: 0;
  padding: 13px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #8da62f;
  box-shadow: 0 0 0 3px rgba(216, 255, 62, 0.22);
}

label small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
}

.primary-button {
  align-items: center;
  background: var(--ink);
  border: 0;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-weight: 700;
  justify-content: space-between;
  padding: 14px 17px;
  transition: transform 0.15s, background 0.15s;
}

.primary-button:hover {
  background: #242a24;
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.primary-button.compact {
  font-size: 12px;
  padding: 12px 16px;
  white-space: nowrap;
}

.secondary-button {
  background: var(--surface);
  border: 1px solid #cfd6cb;
  border-radius: 9px;
  color: var(--forest);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  min-height: 42px;
  padding: 10px 14px;
}

.secondary-button:hover {
  background: #f1f4ed;
  border-color: #aeb9a8;
}

.auth-note {
  border-top: 1px solid var(--line);
  color: #858c84;
  font-size: 10px;
  line-height: 1.6;
  margin: 28px 0 0;
  padding-top: 18px;
}

.legal-links {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}

.legal-links a,
.sidebar-legal a {
  color: inherit;
  text-decoration: none;
}

.legal-links a:hover,
.sidebar-legal a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.app-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #eef0ea;
  border-right: 1px solid #dce0d8;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 28px 22px 22px;
  position: sticky;
  top: 0;
}

.main-nav {
  display: grid;
  gap: 4px;
  margin-top: 48px;
}

.nav-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: #626a61;
  cursor: pointer;
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 12px;
  padding: 11px 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--surface);
  color: var(--ink);
}

.nav-item.active {
  box-shadow: 0 8px 25px rgba(21, 28, 21, 0.05);
}

.nav-icon {
  color: #7b847a;
  font: 14px ui-monospace, monospace;
  width: 18px;
}

.sidebar-bottom {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.environment-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid #dce2d8;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  padding: 11px;
}

.environment-card div {
  display: grid;
  gap: 2px;
}

.environment-card strong {
  font-size: 10px;
}

.environment-card small {
  color: var(--muted);
  font-size: 9px;
}

.status-dot {
  background: #79a814;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(121, 168, 20, 0.12);
  display: inline-block;
  height: 7px;
  width: 7px;
}

.quiet-button,
.text-button,
.menu-button {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
}

.quiet-button {
  font-size: 10px;
  padding: 8px;
  text-align: left;
}

.sidebar-legal {
  color: #8a9189;
  display: flex;
  font: 8px ui-monospace, monospace;
  gap: 12px;
  padding: 0 8px;
}

.legal-shell {
  margin: 0 auto;
  max-width: 860px;
  padding: 38px 24px 90px;
}

.legal-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 56px;
  padding-bottom: 24px;
}

.legal-header nav {
  display: flex;
  gap: 18px;
}

.legal-header nav a {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.legal-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(25px, 6vw, 64px);
}

.legal-content h1 {
  font-size: clamp(34px, 7vw, 56px);
  letter-spacing: -0.065em;
  line-height: 1.05;
  margin: 0 0 14px;
}

.legal-content .legal-lead {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 48px;
}

.legal-content h2 {
  font-size: 17px;
  letter-spacing: -0.03em;
  margin: 38px 0 12px;
}

.legal-content p,
.legal-content li {
  color: #545c53;
  font-size: 12px;
  line-height: 1.95;
}

.legal-content code {
  background: #f0f2ed;
  border-radius: 5px;
  font: 10px ui-monospace, monospace;
  padding: 3px 6px;
}

.status-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 28px 0;
  padding: 0;
}

.status-list li {
  align-items: center;
  background: #f5f7f1;
  border-radius: 9px;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.status-list span:last-child {
  color: #527d11;
  font-size: 10px;
  font-weight: 800;
}

.live-status {
  background: #edf6e2;
  border: 1px solid #cfe1b8;
  border-radius: 12px;
  margin: 26px 0;
  padding: 20px;
}

.live-status > div:first-child {
  align-items: center;
  display: flex;
  gap: 12px;
}

.live-status h2 {
  margin: 0;
}

.live-status > div:first-child > span {
  background: #527d11;
  border-radius: 999px;
  color: white;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 5px 8px;
}

.live-status[data-state="maintenance"],
.live-status[data-state="error"] {
  background: #fff0ef;
  border-color: #efc9c6;
}

.live-status[data-state="maintenance"] > div:first-child > span,
.live-status[data-state="error"] > div:first-child > span {
  background: #aa342f;
}

.live-status[data-state="degraded"] {
  background: #fff8e8;
  border-color: #efd697;
}

.live-status[data-state="degraded"] > div:first-child > span {
  background: #a86800;
}

.live-status > p {
  margin: 14px 0;
}

.live-status dl {
  display: flex;
  gap: 26px;
  margin: 0;
}

.live-status dt {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .1em;
}

.live-status dd {
  font-size: 11px;
  margin: 4px 0 0;
}

.app-main {
  min-width: 0;
}

.topbar {
  align-items: center;
  background: rgba(244, 245, 240, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 92px;
  padding: 20px clamp(24px, 4vw, 58px);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
}

.topbar h1 {
  font-size: 25px;
  letter-spacing: -0.05em;
  margin: 0;
}

.topbar .section-kicker {
  margin-bottom: 5px;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.language-control {
  align-items: center;
  display: inline-flex;
}

.language-control > span,
.language-control label > span {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.locale-select {
  appearance: none;
  background: #f4f6f1;
  border: 1px solid #d9ded4;
  border-radius: 8px;
  color: var(--forest);
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  min-width: 104px;
  padding: 9px 10px;
}

.auth-language {
  position: fixed;
  right: 20px;
  top: 18px;
  z-index: 20;
}

.menu-button {
  display: none;
}

.account-chip {
  align-items: center;
  display: flex;
  gap: 10px;
}

.account-chip > span {
  align-items: center;
  background: var(--forest);
  border-radius: 50%;
  color: var(--acid);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  height: 35px;
  justify-content: center;
  width: 35px;
}

.account-chip div {
  display: grid;
  gap: 2px;
}

.account-chip strong {
  font-size: 10px;
}

.account-chip small {
  color: var(--muted);
  font-size: 9px;
}

.page-view {
  margin: 0 auto;
  max-width: 1500px;
  padding: 34px clamp(24px, 4vw, 58px) 70px;
}

.notice-banner {
  align-items: center;
  background: #edf3dc;
  border: 1px solid #d9e4bd;
  border-radius: 12px;
  display: flex;
  gap: 13px;
  margin-bottom: 22px;
  padding: 12px 14px;
}

.notice-banner p {
  color: #59634d;
  flex: 1;
  font-size: 11px;
  margin: 0;
}

.notice-banner strong {
  color: #29321f;
}

.micro-badge {
  background: #dfff70;
  border-color: #c7ec45;
  color: #35420f;
}

.micro-badge.muted {
  background: #eceee9;
  border-color: #dde1da;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 150px;
  overflow: hidden;
  padding: 22px;
  position: relative;
}

.metric-card.featured {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

.metric-card p {
  color: #7d867c;
  font-size: 10px;
  font-weight: 700;
  margin: 0 0 26px;
}

.metric-card.featured p {
  color: #a8b1a9;
}

.metric-card strong {
  display: block;
  font-size: clamp(25px, 3vw, 36px);
  letter-spacing: -0.055em;
  line-height: 1;
  margin-bottom: 8px;
}

.metric-card.featured strong {
  color: var(--acid);
}

.metric-card small {
  color: #8a9289;
  font-size: 9px;
}

.metric-line {
  background: linear-gradient(90deg, var(--acid), transparent);
  bottom: 0;
  height: 2px;
  left: 0;
  position: absolute;
  width: 70%;
}

.split-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  margin-top: 14px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 35px rgba(29, 35, 29, 0.025);
  min-width: 0;
  padding: 22px;
}

.panel-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 18px;
  margin: 0;
}

.text-button {
  font-size: 10px;
  font-weight: 700;
}

.table-wrap {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th {
  color: #929a91;
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 10px 8px;
  text-align: left;
  text-transform: uppercase;
}

td {
  border-top: 1px solid #edf0eb;
  font-size: 11px;
  padding: 13px 8px;
  vertical-align: middle;
}

td code {
  background: #f2f4ef;
  border-radius: 5px;
  font: 10px ui-monospace, monospace;
  padding: 5px 7px;
}

.table-action {
  background: none;
  border: 0;
  color: var(--danger);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.key-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

.rotate-key {
  color: var(--forest);
}

.status-label {
  align-items: center;
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  gap: 7px;
}

.status-label::before {
  background: #82ad27;
  border-radius: 50%;
  content: "";
  height: 6px;
  width: 6px;
}

.status-label.revoked {
  color: var(--muted);
}

.status-label.revoked::before {
  background: #a7ada6;
}

.empty-state {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  min-height: 210px;
  justify-content: center;
  text-align: center;
}

.empty-state > span {
  color: #b8beb6;
  font: 30px ui-monospace, monospace;
  margin-bottom: 10px;
}

.empty-state strong {
  color: #50574f;
  font-size: 12px;
}

.empty-state p {
  font-size: 10px;
  line-height: 1.7;
  max-width: 300px;
}

.step-list {
  display: grid;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step-list li {
  align-items: flex-start;
  display: flex;
  gap: 13px;
}

.step-list li > span {
  align-items: center;
  background: var(--acid);
  border-radius: 50%;
  display: flex;
  flex: 0 0 auto;
  font: 700 10px ui-monospace, monospace;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.step-list strong {
  font-size: 11px;
}

.step-list p {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  margin: 4px 0 0;
}

.step-list code {
  background: #f1f3ee;
  border-radius: 5px;
  display: inline-block;
  font: 9px ui-monospace, monospace;
  margin-top: 5px;
  padding: 5px 7px;
}

.section-intro {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 26px;
}

.section-intro h2 {
  font-size: 32px;
}

.inline-form {
  align-items: end;
  display: flex;
  gap: 10px;
}

.inline-form label {
  min-width: 240px;
}

.key-policy-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns:
    minmax(170px, 1.35fr)
    minmax(165px, 1.2fr)
    minmax(170px, 1fr)
    minmax(120px, 0.7fr)
    auto;
  margin-top: 20px;
  width: 100%;
}

.key-policy-form > label,
.key-policy-form input,
.key-policy-form select {
  min-width: 0;
  width: 100%;
}

.key-policy-form input,
.key-policy-form select {
  box-sizing: border-box;
}

.key-policy-detail {
  color: var(--muted);
  display: block;
  font-size: 9px;
  margin-top: 5px;
}

#view-keys .section-intro {
  align-items: stretch;
  flex-direction: column;
}

.playground-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(350px, 0.85fr) minmax(400px, 1.15fr);
}

.playground-grid > *,
.security-grid > * {
  min-width: 0;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 550px;
}

.form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.composer .grow {
  flex: 1;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

.response-panel {
  min-height: 550px;
  overflow: hidden;
}

.response-placeholder {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  height: 430px;
  justify-content: center;
  text-align: center;
}

.response-placeholder span {
  color: #bcc2ba;
  font-size: 40px;
}

.response-placeholder p {
  font-size: 10px;
}

.response-panel pre,
.doc-card pre {
  background: #171d18;
  border-radius: 10px;
  color: #dce8d4;
  font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  margin: 0;
  max-height: 445px;
  overflow: auto;
  padding: 18px;
  white-space: pre-wrap;
  word-break: break-word;
}

.billing-hero {
  align-items: center;
  background: var(--forest);
  border-radius: var(--radius);
  color: #fff;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 30px;
}

.billing-hero p {
  color: #aab3aa;
  font-size: 10px;
  margin: 0 0 8px;
}

.billing-hero strong {
  color: var(--acid);
  display: block;
  font-size: 42px;
  letter-spacing: -0.06em;
}

.billing-hero small {
  color: #8e988e;
  font-size: 9px;
}

.topup-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.topup-button {
  background: transparent;
  border: 1px solid #586159;
  border-radius: 8px;
  color: #e8ede8;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  padding: 11px 13px;
}

.topup-button:hover {
  background: var(--acid);
  border-color: var(--acid);
  color: var(--forest);
}

.plan-panel {
  margin-bottom: 14px;
}

.plan-panel .panel-head p {
  color: var(--muted);
  font-size: 10px;
  margin: 7px 0 0;
  max-width: 720px;
}

.plan-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}

.plan-card.current {
  background: #f4f8e9;
  border-color: #9db950;
}

.plan-card-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.plan-card-head span {
  color: var(--muted);
  display: block;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.plan-card h3 {
  font-size: 18px;
  margin: 0;
}

.plan-card strong {
  color: #527d11;
  font-size: 9px;
  text-align: right;
}

.plan-card > p {
  color: var(--muted);
  font-size: 9px;
  margin: 16px 0;
}

.plan-select-button {
  background: var(--forest);
  border: 1px solid var(--forest);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  padding: 9px 12px;
  width: 100%;
}

.plan-select-button:disabled {
  background: #dde4d8;
  border-color: #dde4d8;
  color: #697267;
  cursor: default;
}

.positive-amount {
  color: #527d11;
  font-weight: 800;
}

.source-reference {
  color: #929a91;
  display: block;
  font-size: 8px;
  margin-top: 6px;
}

.refund-complete {
  color: #687168;
  font-size: 10px;
  font-weight: 700;
}

.docs-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.security-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 1.1fr);
}

.security-form {
  display: grid;
  gap: 18px;
}

.security-form h3,
.security-explainer h3 {
  font-size: 20px;
  margin: 0 0 8px;
}

.security-form > div > p:last-child,
.security-footnote {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  margin: 0;
}

.security-explainer {
  align-content: start;
  display: grid;
}

.security-explainer .support-list {
  margin-top: 18px;
}

.security-footnote {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.email-verification-manager,
.mfa-manager {
  margin-top: 14px;
}

.email-verification-manager .panel-head p:last-child,
.email-verification-manager > div > p,
.mfa-manager .panel-head p:last-child,
.mfa-manager > div > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.email-verification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.verification-note {
  color: #8b6200;
  font-size: 11px;
  font-weight: 700;
  margin-top: 10px;
}

.inline-security-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) auto;
}

.mfa-actions {
  display: grid;
  gap: 16px;
}

.danger-zone {
  border-top: 1px solid var(--line);
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  padding-top: 16px;
}

.danger-button {
  border-color: #e3b8b6;
  color: var(--danger);
}

.session-manager {
  margin-top: 14px;
}

.account-lifecycle-manager {
  border-color: #e3b8b6;
  margin-top: 14px;
}

.account-lifecycle-manager .panel-head {
  align-items: flex-end;
}

.account-lifecycle-manager .panel-head p:last-child,
.account-deletion-copy > p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  margin: 7px 0 0;
}

.account-deletion-grid {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  margin-top: 20px;
  padding-top: 20px;
}

.account-deletion-copy h3 {
  font-size: 20px;
  margin: 0;
}

.account-deletion-copy .support-list {
  margin-top: 18px;
}

.account-delete-form {
  gap: 12px;
}

.account-delete-button {
  background: #fff5f4;
  border: 1px solid #e3b8b6;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
}

.account-delete-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.session-manager .panel-head {
  align-items: flex-end;
}

.session-manager .panel-head p:last-child {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  margin: 7px 0 0;
}

.session-table-shell {
  -webkit-overflow-scrolling: touch;
  margin-top: 18px;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.session-reference {
  color: var(--muted);
  display: block;
  font-size: 9px;
  margin-top: 4px;
}

.doc-card {
  min-height: 230px;
  position: relative;
}

.doc-card:nth-child(3) {
  grid-column: span 2;
}

.doc-number {
  color: #bec5bc;
  font: 10px ui-monospace, monospace;
}

.doc-card h3 {
  font-size: 17px;
  letter-spacing: -0.03em;
  margin: 28px 0 14px;
}

.support-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
  list-style: none;
  margin: 0;
  padding: 0;
}

.support-list li {
  font-size: 11px;
}

.support-list span {
  color: #729b20;
  display: inline-block;
  width: 22px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(14, 18, 14, 0.66);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.sidebar-backdrop {
  display: none;
}

.secret-modal {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
  max-width: 560px;
  padding: 34px;
  width: 100%;
}

.secret-icon {
  align-items: center;
  background: var(--acid);
  border-radius: 50%;
  display: flex;
  font-size: 20px;
  font-weight: 900;
  height: 46px;
  justify-content: center;
  margin-bottom: 28px;
  width: 46px;
}

.secret-value {
  align-items: center;
  background: #171d18;
  border-radius: 10px;
  display: flex;
  gap: 14px;
  margin: 24px 0 18px;
  padding: 15px;
}

.secret-value code {
  color: var(--acid);
  flex: 1;
  font: 11px ui-monospace, monospace;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.secret-value button {
  background: transparent;
  border: 1px solid #536054;
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  font-size: 10px;
  padding: 8px 10px;
}

.confirmation-check {
  align-items: center;
  display: flex;
  font-size: 11px;
  grid-template-columns: auto 1fr;
  margin-bottom: 18px;
}

.confirmation-check input {
  accent-color: #90b423;
}

.toast-region {
  bottom: 22px;
  display: grid;
  gap: 8px;
  position: fixed;
  right: 22px;
  z-index: 200;
}

.toast {
  background: var(--forest);
  border: 1px solid #39423a;
  border-radius: 10px;
  box-shadow: var(--shadow);
  color: #fff;
  font-size: 11px;
  max-width: 360px;
  padding: 13px 16px;
}

.toast.error {
  background: #562c29;
  border-color: #78413d;
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-grid,
  .playground-grid {
    grid-template-columns: 1fr;
  }

  .key-policy-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .key-policy-form button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 800px) {
  .auth-shell {
    display: block;
  }

  .auth-story {
    display: none;
  }

  .auth-panel {
    align-items: stretch;
    display: block;
    min-height: 100vh;
    padding: max(22px, env(safe-area-inset-top)) 20px calc(60px + env(safe-area-inset-bottom));
  }

  .mobile-brand {
    align-items: center;
    display: flex;
    font-weight: 800;
    gap: 10px;
    margin-bottom: 54px;
  }

  .auth-language .locale-select {
    min-height: 44px;
  }

  .auth-tabs {
    gap: 4px;
    justify-content: stretch;
    margin: 30px 0;
  }

  .auth-tab {
    flex: 1 1 0;
    min-height: 44px;
    padding: 10px 4px;
  }

  .auth-card {
    margin: 0 auto;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    bottom: 0;
    box-shadow: 16px 0 45px rgba(0, 0, 0, 0.15);
    display: none;
    left: 0;
    position: fixed;
    top: 0;
    max-width: 300px;
    overflow-y: auto;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
    padding-top: calc(28px + env(safe-area-inset-top));
    width: min(82vw, 300px);
    z-index: 40;
  }

  .sidebar.open {
    display: flex;
  }

  .sidebar-backdrop {
    background: rgba(15, 20, 16, 0.48);
    border: 0;
    display: block;
    inset: 0;
    padding: 0;
    position: fixed;
    z-index: 30;
    backdrop-filter: blur(2px);
  }

  .nav-item,
  .quiet-button {
    min-height: 44px;
  }

  .menu-button {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    display: inline-flex;
    flex: 0 0 44px;
    font-size: 21px;
    height: 44px;
    justify-content: center;
    margin-right: 12px;
    padding: 0;
  }

  .topbar {
    justify-content: flex-start;
    min-height: 76px;
    padding-bottom: 12px;
    padding-top: calc(12px + env(safe-area-inset-top));
  }

  .topbar .locale-select {
    min-height: 44px;
  }

  .account-chip {
    margin-left: auto;
  }

  .account-chip div {
    display: none;
  }

  .section-intro,
  .billing-hero {
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-form label {
    min-width: 0;
  }

  .key-policy-form {
    grid-template-columns: 1fr;
  }

  .key-policy-form button {
    grid-column: auto;
  }

  .topup-options {
    justify-content: flex-start;
  }

  .topup-button,
  .plan-select-button,
  .table-action,
  .text-button,
  .secondary-button {
    min-height: 44px;
  }

  .table-action {
    min-width: 44px;
  }

  .page-view .primary-button,
  .account-delete-button {
    min-height: 44px;
  }

  #view-overview table {
    min-width: 520px;
  }

  #view-keys table {
    min-width: 820px;
  }

  #view-billing table,
  .session-table-shell table {
    min-width: 680px;
  }

  #view-keys th:last-child,
  #view-keys td:last-child,
  #view-billing th:last-child,
  #view-billing td:last-child,
  .session-table-shell th:last-child,
  .session-table-shell td:last-child {
    background: var(--surface);
    box-shadow: -8px 0 12px rgba(16, 19, 16, 0.04);
    position: sticky;
    right: 0;
    z-index: 1;
  }

  .docs-grid {
    grid-template-columns: 1fr;
  }

  .security-grid {
    grid-template-columns: 1fr;
  }

  .inline-security-form,
  .danger-zone {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .session-manager .panel-head {
    align-items: stretch;
  }

  .account-lifecycle-manager .panel-head {
    align-items: stretch;
  }

  .account-deletion-grid {
    grid-template-columns: 1fr;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .doc-card:nth-child(3) {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .legal-shell {
    padding: 20px 16px calc(70px + env(safe-area-inset-bottom));
  }

  .legal-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 28px;
  }

  .legal-header nav {
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
  }

  .legal-header nav a {
    align-items: center;
    display: inline-flex;
    min-height: 32px;
  }

  .legal-content {
    padding: 24px 20px;
  }

  .form-row,
  .support-list {
    grid-template-columns: 1fr;
  }

  .playground-grid,
  .playground-grid > *,
  .composer label,
  .composer input,
  .composer select,
  .composer textarea {
    min-width: 0;
    width: 100%;
  }

  .metric-grid {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 128px;
    padding: 16px;
  }

  .metric-card p {
    margin-bottom: 18px;
  }

  .metric-card strong {
    font-size: 24px;
  }

  .page-view {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
    padding-left: 15px;
    padding-right: 15px;
  }

  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar .section-kicker {
    display: none;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .topbar .locale-select {
    min-width: 82px;
    width: 82px;
  }

  .account-chip > span {
    height: 40px;
    width: 40px;
  }

  .notice-banner {
    align-items: flex-start;
  }

  .panel {
    border-radius: 14px;
    padding: 17px;
  }

  .panel-head {
    align-items: flex-start;
    gap: 12px;
  }

  .section-intro h2 {
    font-size: 28px;
  }

  .billing-hero {
    padding: 22px;
  }

  .topup-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .topup-button {
    padding: 10px 6px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 12px;
  }

  .secret-modal {
    border-radius: 18px 18px 10px 10px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  }

  .secret-icon {
    margin-bottom: 18px;
  }

  .secret-value {
    align-items: stretch;
    flex-direction: column;
  }

  .secret-value button {
    min-height: 44px;
    width: 100%;
  }

  .toast-region {
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
  }

  .toast {
    max-width: none;
  }

  .notice-banner .micro-badge {
    display: none;
  }
}
