:root {
  color-scheme: dark;
  --black: #081321;
  --black-soft: #0b1b30;
  --panel: #10243b;
  --bone: #eef4f8;
  --silver: #a9b7c9;
  --faint: #71839a;
  --line: #28415f;
  --line-light: #8bdcff;
  --ember: #21c7b7;
  --ember-hot: #8bdcff;
  --water: #4aa8ff;
  --water-deep: #177bcb;
  --red: #f26b5e;
  --green: #21c7b7;
  --focus: #8bdcff;
  --topbar-bg: rgba(8, 19, 33, 0.96);
  --glass: rgba(5, 15, 28, 0.68);
  --service-veil:
    linear-gradient(90deg, rgba(5,15,28,0.60) 0%, rgba(5,15,28,0.38) 58%, rgba(5,15,28,0.46) 100%),
    linear-gradient(180deg, rgba(5,15,28,0.18) 0%, rgba(5,15,28,0.46) 48%, rgba(8,19,33,0.98) 100%);
  --max: 1360px;
}

html[data-theme="light"] {
  color-scheme: light;
  --black: #e9e2d7;
  --black-soft: #fffdf8;
  --panel: #f8f4ec;
  --bone: #112238;
  --silver: #54657a;
  --faint: #78879a;
  --line: #c9bdac;
  --line-light: #177bcb;
  --ember: #177bcb;
  --ember-hot: #36a7e9;
  --water: #36a7e9;
  --water-deep: #177bcb;
  --red: #c74d46;
  --green: #168c80;
  --focus: #177bcb;
  --topbar-bg: rgba(248, 244, 236, 0.96);
  --glass: rgba(255, 253, 248, 0.76);
  --service-veil:
    linear-gradient(90deg, rgba(248,244,236,0.56) 0%, rgba(248,244,236,0.32) 58%, rgba(248,244,236,0.58) 100%),
    linear-gradient(180deg, rgba(248,244,236,0.38) 0%, rgba(248,244,236,0.62) 48%, rgba(248,244,236,0.97) 100%);
}

* { box-sizing: border-box; }
html { min-width: 320px; max-width: 100%; overflow-x: clip; background: var(--black); }
body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  min-height: 100vh;
  color: var(--bone);
  background: var(--black);
  font-family: Inter, "Noto Sans Thai", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
  transition: color 220ms ease, background-color 220ms ease;
}
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.topbar {
  position: relative;
  z-index: 30;
  min-height: 72px;
  padding: 10px max(24px, calc((100vw - var(--max)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
}
.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand img { width: 104px; height: 40px; object-fit: contain; }
.brand-divider { width: 1px; height: 24px; background: var(--line); }
.brand > span:not(.brand-divider) { font-size: 14px; font-weight: 850; }
.brand small {
  padding: 3px 7px;
  color: var(--black);
  background: var(--ember-hot);
  border-radius: 2px;
  font-size: 9px;
  font-weight: 900;
}
.top-actions { display: flex; align-items: center; gap: 16px; }
.service-state { display: inline-flex; align-items: center; gap: 8px; color: var(--silver); font-size: 11px; text-transform: uppercase; }
.service-state i { width: 7px; height: 7px; border-radius: 50%; background: #666; }
.service-state i.online { background: var(--green); box-shadow: 0 0 12px rgba(141, 224, 178, 0.75); }
.theme-toggle {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--bone);
  background: transparent;
}
.theme-toggle span {
  position: absolute;
  inset: 8px;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.theme-toggle span::after {
  content: "";
  position: absolute;
  inset: -1px -1px -1px 50%;
  background: currentColor;
  transition: inset 220ms ease;
}
html[data-theme="light"] .theme-toggle span::after { inset: 3px; border-radius: 50%; }
.theme-toggle:hover { border-color: var(--water); color: var(--water); }
.language-switch { display: inline-flex; border: 1px solid var(--line); overflow: hidden; }
.language-switch button {
  width: 42px;
  height: 34px;
  border: 0;
  color: var(--silver);
  background: transparent;
  font-size: 11px;
  font-weight: 850;
}
.language-switch button.active { color: var(--black); background: var(--bone); }

.app-shell {
  width: min(var(--max), 100%);
  min-width: 0;
  max-width: 100%;
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  background: var(--black);
}
.access-workspace {
  min-width: 0;
  padding: clamp(54px, 7vw, 104px) clamp(28px, 6vw, 86px) 72px;
  background: var(--black);
}
.workspace-head { min-width: 0; max-width: 680px; }
.kicker, .service-overline, .flow-label {
  margin: 0;
  color: var(--ember);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.workspace-head h1 {
  min-width: 0;
  max-width: 650px;
  margin: 18px 0 0;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.02;
  font-weight: 720;
  overflow-wrap: break-word;
}
.workspace-head > p:last-of-type {
  max-width: 570px;
  margin: 22px 0 0;
  color: var(--silver);
  font-size: 17px;
}
.access-steps {
  margin: 34px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.access-steps li { min-width: 0; padding: 16px 12px 16px 0; }
.access-steps li + li { padding-left: 16px; border-left: 1px solid var(--line); }
.access-steps span { display: block; color: var(--faint); font: 700 10px/1.2 "Cascadia Code", Consolas, monospace; }
.access-steps strong { display: block; margin-top: 6px; font-size: 12px; }

.auth-flow { max-width: 680px; margin-top: 42px; }
.flow-step label, .rotate-form label { display: block; margin-bottom: 10px; color: var(--silver); font-size: 12px; font-weight: 780; }
.input-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
input {
  min-width: 0;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--bone);
  background: var(--black-soft);
}
input:hover { border-color: var(--water); }
.primary, .secondary, .quiet-button, .copy-button, .danger-button, .back-button {
  min-height: 44px;
  padding: 0 19px;
  border-radius: 0;
  font-weight: 820;
}
.primary { border: 1px solid var(--bone); color: var(--black); background: var(--bone); }
.primary:hover { color: #000; background: #fff; }
.primary:disabled { cursor: wait; opacity: 0.5; }
.secondary { border: 1px solid var(--line); color: var(--bone); background: transparent; }
.secondary:hover { border-color: var(--bone); }
.full { width: 100%; margin-top: 22px; }
.back-button { min-height: 32px; margin: 0 0 18px; padding: 0; border: 0; color: var(--water); background: transparent; }
.field-note { margin: 10px 0 0; color: var(--faint); font-size: 12px; }
.form-status { min-height: 24px; margin: 18px 0 0; color: var(--silver); font-size: 13px; }
.form-status.error { color: var(--red); }
.form-status.success { color: var(--green); }

.key-reveal, .dashboard { padding-top: 5px; border-top: 1px solid #5e6468; }
.key-reveal h2, .dashboard h2 { margin: 7px 0 6px; font-size: 28px; }
.key-reveal > p:not(.success-label):not(.field-note) { margin: 0 0 20px; color: var(--silver); }
.success-label { margin: 18px 0 0; color: var(--green); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.secret-row, .endpoint-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.secret-row input { font-family: "Cascadia Code", Consolas, monospace; font-size: 13px; }
.copy-button { border: 1px solid #4a5054; color: var(--bone); background: transparent; }
.copy-button:hover { border-color: var(--ember-hot); color: var(--ember-hot); }
.key-reveal h3 { margin: 26px 0 10px; font-size: 14px; }
.word-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.word-row span {
  padding: 12px 8px;
  border: 1px solid #574a3c;
  color: var(--ember-hot);
  background: #15110d;
  text-align: center;
  font-family: "Cascadia Code", Consolas, monospace;
  font-weight: 800;
}
.inline-copy { min-height: 36px; margin-top: 8px; padding: 0 12px; font-size: 12px; }
.dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.quiet-button { border: 0; color: var(--silver); background: transparent; }

.flow-meter {
  --flow-level: 1;
  --flow-speed: 0.8s;
  margin-top: 26px;
  padding: 20px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.flow-copy { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.flow-copy strong { display: block; margin-top: 5px; font-size: 26px; line-height: 1; }
.flow-copy div > span { color: var(--silver); font-size: 11px; }
.flow-state {
  padding: 5px 9px;
  border: 1px solid #315b70;
  color: var(--water);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}
.flow-scene { position: relative; height: 150px; margin-top: 18px; overflow: hidden; }
.flow-reservoir {
  position: absolute;
  left: 4px;
  bottom: 14px;
  width: 70px;
  height: 116px;
  overflow: hidden;
  border: 2px solid #777d81;
  border-top-color: #aab0b4;
  background: #080a0b;
}
.flow-reservoir::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.1);
  pointer-events: none;
}
.flow-reservoir > span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(180deg, #d8f4ff 0%, var(--water) 42%, var(--water-deep) 100%);
  box-shadow: 0 -7px 22px rgba(155, 220, 255, 0.28);
  transition: height 700ms ease;
}
.flow-reservoir i {
  position: absolute;
  z-index: 3;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.65);
  animation: bubble 2.4s linear infinite;
}
.flow-reservoir i:nth-of-type(1) { left: 18px; bottom: 8px; }
.flow-reservoir i:nth-of-type(2) { left: 42px; bottom: 28px; animation-delay: 0.7s; }
.flow-reservoir i:nth-of-type(3) { left: 30px; bottom: 4px; animation-delay: 1.3s; }
.flow-pipe {
  position: absolute;
  left: 72px;
  bottom: 66px;
  width: min(58%, 330px);
  height: 26px;
  border-top: 7px solid #7a7f83;
  border-bottom: 7px solid #3c4043;
  background: #171a1c;
}
.flow-pipe::after {
  content: "";
  position: absolute;
  right: -25px;
  top: -7px;
  width: 28px;
  height: 46px;
  border-top: 7px solid #7a7f83;
  border-right: 7px solid #5d6266;
  border-radius: 0 18px 0 0;
}
.quota-valve {
  position: absolute;
  left: min(43%, 260px);
  bottom: 66px;
  z-index: 4;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 2px solid #b7b8b4;
  border-radius: 50%;
  color: var(--bone);
  background: #0a0c0d;
  box-shadow: 0 0 0 7px rgba(255,255,255,0.03);
  transform: rotate(var(--valve-rotation, 0deg));
  transition: transform 500ms ease, border-color 300ms ease;
}
.quota-valve::before, .quota-valve::after, .quota-valve span {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 5px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.quota-valve::after { transform: translate(-50%, -50%) rotate(60deg); }
.quota-valve span { transform: translate(-50%, -50%) rotate(-60deg); }
.flow-stream {
  position: absolute;
  left: min(63%, 395px);
  bottom: 14px;
  width: 36px;
  height: 64px;
  opacity: calc(0.18 + var(--flow-level) * 0.82);
}
.flow-stream::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15px;
  width: var(--stream-width, 9px);
  height: 48px;
  border-radius: 0 0 8px 8px;
  background: var(--water);
  box-shadow: 0 0 16px rgba(155, 220, 255, 0.45);
}
.flow-stream i {
  position: absolute;
  top: 10px;
  left: 16px;
  width: 7px;
  height: 10px;
  border-radius: 50% 50% 60% 60%;
  background: var(--water);
  opacity: 0;
  animation: drip var(--flow-speed) linear infinite;
}
.flow-stream i:nth-child(2) { animation-delay: -0.32s; }
.flow-stream i:nth-child(3) { animation-delay: -0.64s; }
.flow-catch {
  position: absolute;
  left: calc(min(63%, 395px) - 28px);
  bottom: 2px;
  width: 92px;
  height: 13px;
  border: 2px solid #555b5f;
  border-top-color: var(--water-deep);
  border-radius: 50%;
}
.flow-meter.low .flow-state { border-color: #826131; color: var(--ember-hot); }
.flow-meter.low .flow-reservoir > span, .flow-meter.low .flow-stream::before, .flow-meter.low .flow-stream i { background: var(--ember-hot); }
.flow-meter.dry .flow-state { border-color: #703b39; color: var(--red); }
.flow-meter.dry .flow-reservoir i, .flow-meter.dry .flow-stream { display: none; }
.flow-meter.dry .quota-valve { color: #6b6f72; border-color: #4c5053; }
.quota-valve.rattle { animation: rattle 500ms ease; }
.quota-valve.pulse { animation: valvePulse 550ms ease; }

.account-facts { margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-facts div { min-width: 0; padding: 14px 14px 14px 0; }
.account-facts div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.account-facts dt { color: #777d81; font-size: 10px; text-transform: uppercase; }
.account-facts dd { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 800; }
.private-gateways {
  margin: 20px 0;
  border: 1px solid var(--line);
}
.ideaing-gateway {
  min-height: 74px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 0;
  color: var(--bone);
  background: linear-gradient(105deg, rgba(33, 199, 183, 0.09), rgba(74, 168, 255, 0.05));
  text-decoration: none;
  transition: border-color 180ms ease, background-color 180ms ease;
}
.ideaing-gateway + .ideaing-gateway { border-top: 1px solid var(--line); }
.ideaing-gateway:hover { border-color: var(--ember); background-color: rgba(33, 199, 183, 0.08); }
.ideaing-gateway img { width: 74px; height: 30px; object-fit: contain; object-position: left center; }
.ideaing-gateway span { min-width: 0; display: grid; gap: 3px; }
.ideaing-gateway strong { font-size: 14px; }
.ideaing-gateway small { color: var(--silver); font-size: 11px; }
.ideaing-gateway i { color: var(--ember-hot); font-style: normal; font-size: 18px; }
.gateway-local-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7f878d;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.gateway-local-state::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6f7478;
  content: "";
}
.ideaing-gateway.local-ready .gateway-local-state { color: var(--green); }
.ideaing-gateway.local-ready .gateway-local-state::before { background: var(--green); box-shadow: 0 0 8px rgba(91, 229, 194, 0.6); }
.ideaing-gateway.local-offline { cursor: help; }
.ideaing-gateway.local-offline .gateway-local-state { color: #c8a16f; }
.ideaing-gateway.local-offline .gateway-local-state::before { background: #c8a16f; }
.gateway-mark { width: 74px; color: var(--ember-hot); font-size: 24px; text-align: center; }
.rotate-form { margin-top: 20px; padding: 18px; border-left: 2px solid var(--red); background: #140b0b; }
.rotate-form input { width: 100%; }
.danger-button { width: 100%; margin-top: 10px; border: 1px solid var(--red); color: var(--black); background: var(--red); }

.service-pane {
  --scene-x: 0px;
  --scene-y: 0px;
  position: relative;
  min-width: 0;
  min-height: calc(100vh - 72px);
  padding: clamp(42px, 6vw, 80px) clamp(28px, 5vw, 62px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  background-color: var(--black-soft);
  background-image: url("/kaiman-ideaing-habitat-v2.png");
  background-position: calc(50% + var(--scene-x)) calc(50% + var(--scene-y));
  background-size: cover;
  background-repeat: no-repeat;
  transition: background-position 280ms ease-out;
}
.service-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--service-veil);
}
.mark-stage {
  position: relative;
  z-index: 4;
  width: min(320px, 72%);
  height: clamp(66px, 8vw, 92px);
  margin-bottom: clamp(24px, 4vh, 40px);
  flex: 0 0 auto;
}
.mark-stage img { width: 100%; height: 100%; object-fit: contain; object-position: left center; }
.service-content { position: relative; z-index: 4; width: 100%; max-width: 620px; }
.service-content h2 { margin: 12px 0 0; font-size: clamp(28px, 3vw, 42px); line-height: 1.08; }
.service-intro { max-width: 500px; margin: 16px 0 0; color: var(--silver); }
.endpoint-brief { margin-top: 28px; }
.endpoint-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.endpoint-heading span { color: var(--faint); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.endpoint-row { margin-top: 9px; }
.endpoint-row code {
  min-width: 0;
  padding: 13px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--bone);
  background: var(--glass);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-button.dark { border-color: var(--line); color: var(--bone); background: var(--glass); }
.tool-chooser { margin-top: 30px; }
.tool-chooser-head {
  margin-bottom: 12px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}
.tool-chooser-head p { margin: 0; font-size: 14px; font-weight: 850; }
.tool-chooser-head div > span { color: var(--silver); font-size: 11px; }
.verified-label { color: var(--green); font-size: 9px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.tool-list { display: grid; gap: 7px; }
.tool-card {
  min-width: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(169,183,201,0.22);
  border-radius: 6px;
  background: rgba(5,15,28,0.56);
  backdrop-filter: blur(8px);
}
.tool-card-featured {
  margin-bottom: 8px;
  border-color: rgba(33,199,183,0.75);
  background: linear-gradient(100deg, rgba(33,199,183,0.14), rgba(5,15,28,0.7));
  box-shadow: inset 3px 0 0 var(--ember);
}
.tool-card-copy { min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: center; }
.tool-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ember-hot);
  background: rgba(8,19,33,0.86);
  font: 850 10px/1 "Cascadia Code", Consolas, monospace;
}
.tool-mark-ideaing { color: var(--black); background: var(--ember); border-color: var(--ember); }
.tool-name-line { min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-name-line h3 { margin: 0; font-size: 13px; line-height: 1.2; }
.tool-card-copy p { margin: 4px 0 0; color: var(--silver); font-size: 10px; line-height: 1.35; }
.tool-badge, .tool-tag {
  padding: 2px 6px;
  border: 1px solid rgba(33,199,183,0.48);
  border-radius: 999px;
  color: var(--ember-hot);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}
.tool-tag { border-color: var(--line); color: var(--faint); }
.tool-card-actions { display: flex; align-items: center; gap: 6px; }
.tool-card-actions a, .tool-card-actions button {
  min-height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--bone);
  background: rgba(8,19,33,0.72);
  font-size: 9px;
  font-weight: 820;
  text-decoration: none;
  white-space: nowrap;
}
.tool-card-actions a:hover, .tool-card-actions button:hover { border-color: var(--ember); color: var(--ember-hot); }
.tool-disclaimer { margin: 12px 0 0; color: var(--faint); font-size: 9px; line-height: 1.45; }
.service-facts { margin-top: 30px; border-top: 1px solid rgba(255,255,255,0.18); }
.service-facts div { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid rgba(255,255,255,0.18); }
.service-facts span { color: var(--silver); font-size: 11px; }
.service-facts strong { font-size: 13px; }
.privacy-line { margin: 24px 0 0; color: var(--faint); font-size: 11px; }

.tool-guide {
  width: min(700px, calc(100vw - 32px));
  max-height: min(780px, calc(100vh - 32px));
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  color: var(--bone);
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(0,0,0,0.66);
}
.tool-guide::backdrop { background: rgba(2,8,16,0.8); backdrop-filter: blur(5px); }
.tool-guide-shell { position: relative; padding: clamp(26px, 5vw, 46px); }
.tool-guide-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--bone);
  background: transparent;
  font-size: 24px;
  line-height: 1;
}
.tool-guide-close:hover { border-color: var(--ember); color: var(--ember); }
.tool-guide h2 { margin: 10px 48px 0 0; font-size: clamp(32px, 6vw, 54px); line-height: 1; }
.tool-guide-summary { max-width: 560px; margin: 16px 0 0; color: var(--silver); }
.connection-recipe { margin-top: 26px; display: grid; grid-template-columns: 1.35fr 1fr 0.6fr; border: 1px solid var(--line); }
.connection-recipe div { min-width: 0; padding: 13px; }
.connection-recipe div + div { border-left: 1px solid var(--line); }
.connection-recipe span { display: block; color: var(--faint); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.connection-recipe code { display: block; margin-top: 7px; overflow-wrap: anywhere; color: var(--bone); font-size: 11px; }
.tool-guide h3 { margin: 28px 0 0; font-size: 13px; text-transform: uppercase; }
.tool-guide-steps { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: guide-step; border-top: 1px solid var(--line); }
.tool-guide-steps li {
  min-height: 56px;
  padding: 13px 4px 13px 48px;
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--silver);
  counter-increment: guide-step;
}
.tool-guide-steps li::before {
  content: counter(guide-step, decimal-leading-zero);
  position: absolute;
  left: 6px;
  color: var(--ember);
  font: 800 11px/1 "Cascadia Code", Consolas, monospace;
}
.tool-guide-actions { margin-top: 24px; display: flex; justify-content: space-between; gap: 10px; }
.tool-guide-actions a, .tool-guide-actions button {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--bone);
  background: transparent;
  font-weight: 820;
  text-decoration: none;
}
.tool-guide-actions a { border-color: var(--ember); color: var(--ember-hot); }
.tool-guide-actions a:hover, .tool-guide-actions button:hover { background: rgba(33,199,183,0.1); }

.kaiman-world {
  position: fixed;
  inset: 72px 0 0;
  z-index: 11;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms ease;
}
.kaiman-world.is-ready { opacity: 0.96; }
.kaiman-runner {
  position: absolute;
  top: 0;
  left: 0;
  width: clamp(58px, 5vw, 88px);
  pointer-events: auto;
  cursor: pointer;
  border-radius: 50%;
  outline: 0;
  will-change: transform;
  transition-property: transform;
  transition-timing-function: linear;
}
.kaiman-runner:focus-visible { box-shadow: 0 0 0 2px var(--ember), 0 0 22px rgba(74, 168, 255, 0.48); }
.kaiman-runner:hover .kaiman-companion { filter: drop-shadow(0 5px 8px rgba(0,0,0,0.58)) drop-shadow(0 0 13px rgba(139,220,255,0.55)); }
.kaiman-facing {
  width: 100%;
  transform-origin: 50% 50%;
}
.kaiman-companion {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,0.58)) drop-shadow(0 0 8px rgba(139,220,255,0.22));
  animation: kaimanWalk 820ms ease-in-out infinite alternate;
  transform-origin: 50% 86%;
}
html[data-theme="light"] .kaiman-companion {
  filter: drop-shadow(0 5px 7px rgba(17,34,56,0.28)) drop-shadow(0 0 7px rgba(23,123,203,0.2));
}

.cookie-gate {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 50;
  width: min(680px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #50565a;
  background: var(--panel);
  box-shadow: 0 16px 42px rgba(0,0,0,0.5);
}
.cookie-gate img { width: 42px; height: 42px; object-fit: contain; }
.cookie-gate strong { display: block; font-size: 13px; }
.cookie-gate p { margin: 2px 0 0; color: var(--silver); font-size: 12px; }

@keyframes bubble { from { transform: translateY(0); opacity: 0; } 25% { opacity: 0.8; } to { transform: translateY(-82px); opacity: 0; } }
@keyframes drip { 0% { transform: translateY(0); opacity: 0; } 18% { opacity: 0.9; } 100% { transform: translateY(44px); opacity: 0; } }
@keyframes rattle { 0%, 100% { translate: 0; } 20% { translate: -5px; } 40% { translate: 5px; } 60% { translate: -3px; } 80% { translate: 3px; } }
@keyframes valvePulse { 50% { box-shadow: 0 0 0 12px rgba(155,220,255,0.12), 0 0 20px rgba(155,220,255,0.35); } }
@keyframes kaimanWalk {
  from { transform: translateY(0) rotate(-1.5deg); }
  to { transform: translateY(-3px) rotate(1.5deg); }
}

html[data-theme="light"] .brand img,
html[data-theme="light"] .mark-stage img,
html[data-theme="light"] .ideaing-gateway img { filter: brightness(0.32) saturate(0.55); }
html[data-theme="light"] .flow-reservoir,
html[data-theme="light"] .quota-valve { background: var(--surface, #f8f4ec); }
html[data-theme="light"] .word-row span { background: #f2f7fb; }
html[data-theme="light"] .rotate-form { background: #fff4f2; }
html[data-theme="light"] .tool-card { border-color: rgba(17,34,56,0.18); background: rgba(255,253,248,0.72); }
html[data-theme="light"] .tool-card-featured { border-color: rgba(23,123,203,0.55); background: linear-gradient(100deg, rgba(54,167,233,0.12), rgba(255,253,248,0.82)); box-shadow: inset 3px 0 0 var(--water-deep); }
html[data-theme="light"] .tool-mark { color: var(--water-deep); background: rgba(255,253,248,0.86); }
html[data-theme="light"] .tool-mark-ideaing { color: #fff; background: var(--water-deep); border-color: var(--water-deep); }
html[data-theme="light"] .tool-card-actions a,
html[data-theme="light"] .tool-card-actions button { color: var(--bone); background: rgba(255,253,248,0.9); }
@media (max-width: 940px) {
  .service-state { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .service-pane { min-height: 620px; }
}

@media (max-width: 600px) {
  .topbar { width: 100%; min-width: 0; min-height: 64px; padding: 8px 10px; gap: 8px; }
  .brand { flex: 0 1 auto; gap: 7px; }
  .brand img { width: 64px; height: 32px; }
  .brand-divider { height: 20px; }
  .brand small { display: none; }
  .brand > span:not(.brand-divider) { font-size: 13px; }
  .language-switch button { width: 34px; height: 32px; }
  .top-actions { min-width: 0; flex: 0 0 auto; gap: 6px; }
  .theme-toggle { width: 30px; height: 30px; }
  .kaiman-world { inset: 64px 0 0; }
  .kaiman-runner { width: 62px; }
  .access-workspace { padding: 42px 20px 48px; }
  .workspace-head h1 { max-width: 100%; font-size: clamp(35px, 10.2vw, 40px); }
  .workspace-head > p:last-of-type { font-size: 15px; }
  .access-steps { grid-template-columns: 1fr; }
  .access-steps li { padding: 12px 0; }
  .access-steps li + li { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .auth-flow { margin-top: 32px; }
  .input-action, .secret-row { grid-template-columns: 1fr; }
  .input-action button, .secret-row button { width: 100%; min-height: 50px; }
  .word-row, .account-facts { grid-template-columns: 1fr; }
  .account-facts div + div { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .flow-copy { align-items: flex-start; flex-direction: column; gap: 10px; }
  .flow-scene { transform: scale(0.86); transform-origin: left bottom; width: 116%; }
  .quota-valve { left: min(46%, 210px); }
  .flow-stream { left: min(70%, 310px); }
  .flow-catch { left: calc(min(70%, 310px) - 28px); }
  .service-pane { min-height: 700px; padding: 36px 20px; }
  .mark-stage { width: 220px; height: 72px; margin-bottom: 28px; }
  .ideaing-gateway { grid-template-columns: auto minmax(0, 1fr); }
  .ideaing-gateway i { display: none; }
  .service-content h2 { font-size: 32px; }
  .endpoint-row { grid-template-columns: 1fr; }
  .endpoint-row button { width: 100%; }
  .tool-card { grid-template-columns: 1fr; }
  .tool-card-actions { padding-left: 42px; }
  .connection-recipe { grid-template-columns: 1fr; }
  .connection-recipe div + div { border-top: 1px solid var(--line); border-left: 0; }
  .tool-guide-actions { flex-direction: column; }
  .tool-guide-actions a, .tool-guide-actions button { width: 100%; justify-content: center; }
  .cookie-gate { grid-template-columns: auto 1fr; }
  .cookie-gate .primary { grid-column: 1 / -1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .kaiman-world.is-ready { opacity: 0.88; }
  .kaiman-companion { animation: none; }
}
