
:root {
  --ink: #06142d;
  --ink-soft: #10264a;
  --blue: #17478a;
  --blue-bright: #2d6bb4;
  --gold: #c9a86a;
  --gold-light: #ead8ad;
  --paper: #f7f5ef;
  --line: rgba(8, 31, 65, 0.13);
  --muted: #6b7788;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  color: rgba(255, 255, 255, 0.55);
  background: #07152e;
  font-size: 10px;
  letter-spacing: 0.24em;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark__orbit {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.55;
}

.brand-mark::before { transform: rotate(58deg) scaleX(0.38); }
.brand-mark::after { transform: rotate(-58deg) scaleX(0.38); }
.brand-mark__orbit { transform: scaleY(0.38); }

.brand-mark__s {
  position: relative;
  z-index: 2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-style: italic;
  line-height: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: white;
  text-decoration: none;
}

.brand > span:last-child { display: grid; gap: 4px; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 15px; letter-spacing: 0.14em; font-weight: 500; }
.brand small { font-size: 7px; letter-spacing: 0.2em; opacity: 0.53; }

/* Access gate */
.gate-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 77% 44%, rgba(46, 105, 170, 0.26), transparent 31%),
    linear-gradient(115deg, #050f22 0%, #081b38 46%, #07172f 100%);
}

.gate-shell::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -22vw;
  right: -14vw;
  width: 68vw;
  height: 68vw;
  min-width: 760px;
  min-height: 760px;
  border: 1px solid rgba(207, 177, 115, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 0 9vw rgba(255,255,255,0.012), 0 0 0 18vw rgba(255,255,255,0.008);
}

.gate-grid {
  position: absolute;
  z-index: -3;
  inset: 0;
  opacity: 0.11;
  background-image:
    linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 100% 92px, 92px 100%;
  mask-image: linear-gradient(90deg, black, transparent 78%);
}

.ambient { position: absolute; z-index: -2; border-radius: 999px; filter: blur(2px); pointer-events: none; }
.ambient--one { width: 520px; height: 1px; top: 28%; right: 17%; background: linear-gradient(90deg, transparent, rgba(222,192,131,.8), transparent); transform: rotate(-22deg); box-shadow: 0 0 44px 12px rgba(205,170,104,.18); }
.ambient--two { width: 560px; height: 560px; right: -260px; bottom: -290px; border: 1px solid rgba(72,135,205,.16); box-shadow: inset 0 0 80px rgba(49,112,183,.08); }

.gate-header {
  width: min(1500px, calc(100% - 96px));
  height: 108px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.11);
}

.security-pill { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.48); font-size: 9px; letter-spacing: .19em; }
.security-pill i { width: 6px; height: 6px; border-radius: 50%; background: #6ebd91; box-shadow: 0 0 14px #6ebd91; }

.gate-main {
  width: min(1500px, calc(100% - 96px));
  min-height: calc(100vh - 182px);
  margin: 0 auto;
  padding: 72px 3.4% 82px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(430px, .72fr);
  gap: clamp(64px, 8vw, 150px);
  align-items: center;
}

.gate-copy { align-self: center; padding-bottom: 18px; }
.eyebrow { margin: 0 0 28px; display: flex; align-items: center; gap: 12px; color: var(--gold-light); font-family: Georgia, serif; font-size: 10px; letter-spacing: .23em; }
.eyebrow i { display: block; width: 18px; height: 1px; background: rgba(233,215,174,.55); }

.gate-copy h1 {
  max-width: 720px;
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  font-size: clamp(62px, 6.4vw, 106px);
  line-height: 1.12;
  letter-spacing: .025em;
  font-weight: 500;
}

.gate-copy h1 em { position: relative; color: var(--gold-light); font-style: normal; }
.gate-copy h1 em::after { content: ""; position: absolute; left: .06em; right: 0; bottom: -.03em; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }

.gate-lead { margin: 35px 0 0; color: rgba(255,255,255,.67); font-size: clamp(14px, 1.08vw, 17px); line-height: 2.05; letter-spacing: .045em; }

.principle-row { display: flex; gap: 0; margin-top: 54px; }
.principle-row > div { min-width: 150px; display: flex; align-items: center; gap: 17px; padding-right: 34px; margin-right: 34px; border-right: 1px solid rgba(255,255,255,.13); }
.principle-row > div:last-child { border-right: 0; margin-right: 0; }
.principle-row b { color: var(--gold); font-family: Georgia, serif; font-size: 10px; font-weight: 400; letter-spacing: .08em; }
.principle-row span { color: rgba(255,255,255,.78); font-family: "Yu Mincho", serif; font-size: 13px; line-height: 1.7; letter-spacing: .08em; }

.gate-card-wrap { position: relative; width: min(100%, 500px); justify-self: end; }
.gate-orbit { position: absolute; inset: -122px -118px; z-index: -1; border: 1px solid rgba(217,187,126,.14); border-radius: 50%; animation: orbit-breathe 8s ease-in-out infinite; }
.gate-orbit::before, .gate-orbit::after { content: ""; position: absolute; inset: 17%; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; }
.gate-orbit::after { inset: 40%; background: rgba(40,99,167,.08); border-color: rgba(57,120,190,.15); box-shadow: 0 0 80px rgba(54,111,178,.12); }
.gate-orbit span { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 16px var(--gold); }
.gate-orbit span:first-child { top: 20%; left: 9%; }
.gate-orbit span:last-child { right: 12%; bottom: 22%; }

@keyframes orbit-breathe { 0%,100% { transform: scale(1) rotate(0deg); opacity:.78; } 50% { transform: scale(1.035) rotate(4deg); opacity:1; } }

.gate-card {
  position: relative;
  overflow: hidden;
  padding: 45px 46px 42px;
  background: rgba(255,255,255,.965);
  color: var(--ink);
  box-shadow: 0 42px 100px rgba(0,0,0,.34);
}

.gate-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--gold), #f0e1bd, transparent); }
.gate-card__topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 38px; }
.gate-card__topline span { color: var(--blue); font-size: 8px; letter-spacing: .27em; font-weight: 700; }
.gate-card__topline b { color: #d4cfc4; font-family: Georgia, serif; font-size: 10px; font-weight: 400; }
.gate-card h2 { margin: 0; font-family: "Yu Mincho", serif; font-size: 30px; letter-spacing: .08em; font-weight: 500; }
.gate-card > p { margin: 13px 0 30px; color: var(--muted); font-size: 12px; }
.code-label { display: block; margin-bottom: 10px; color: #5d6879; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.code-input-wrap { position: relative; }
.code-input-wrap input { width: 100%; height: 59px; padding: 0 74px 0 19px; border: 1px solid #d5dbe4; border-radius: 0; outline: 0; color: var(--ink); background: #fbfbfa; letter-spacing: .16em; transition: border-color .2s, box-shadow .2s; }
.code-input-wrap input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,83,145,.09); }
.code-input-wrap span { position: absolute; top: 50%; right: 17px; transform: translateY(-50%); color: #a3acb9; font-family: Georgia, serif; font-size: 8px; letter-spacing: .12em; }
.consent-row { margin: 20px 0 24px; display: grid; grid-template-columns: 17px 1fr; align-items: start; gap: 10px; color: #727d8c; font-size: 10px; line-height: 1.65; cursor: pointer; }
.consent-row input { position: absolute; opacity: 0; pointer-events: none; }
.custom-check { position: relative; width: 17px; height: 17px; border: 1px solid #c8cfd8; background: white; }
.consent-row input:checked + .custom-check { background: var(--blue); border-color: var(--blue); }
.consent-row input:checked + .custom-check::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid white; border-width: 0 1px 1px 0; transform: rotate(45deg); }
.gate-error { margin: -10px 0 16px !important; color: #a33c3c !important; font-size: 11px !important; }
.primary-button { width: 100%; height: 61px; padding: 0 19px 0 23px; display: flex; align-items: center; justify-content: space-between; border: 0; color: white; background: linear-gradient(110deg, #123b72, #0a2751); box-shadow: 0 15px 30px rgba(11,40,79,.2); transition: transform .2s, box-shadow .2s, opacity .2s; }
.primary-button span { font-family: "Yu Mincho", serif; font-size: 13px; letter-spacing: .09em; }
.primary-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.primary-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(11,40,79,.27); }
.primary-button:disabled { cursor: not-allowed; opacity: .42; }
.gate-notice { margin-top: 28px; padding-top: 23px; display: grid; grid-template-columns: 25px 1fr; gap: 11px; border-top: 1px solid #e2e4e6; }
.gate-notice > span { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #c8b17f; border-radius: 50%; color: #9c7e43; font-family: Georgia, serif; font-size: 11px; font-style: italic; }
.gate-notice p { margin: 0; color: #7a8490; font-size: 9px; line-height: 1.7; }
.gate-notice strong { display: block; margin-bottom: 2px; color: #5d6672; font-size: 10px; }

.gate-footer { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: min(1500px, calc(100% - 96px)); height: 74px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.08); color: rgba(255,255,255,.26); font-size: 8px; letter-spacing: .15em; }
.gate-footer p { margin: 0; }
.gate-footer a { color:inherit; text-decoration:none; }

/* Chat */
.chat-shell { min-height: 100vh; display: grid; grid-template-columns: 265px minmax(0, 1fr); background: #f4f3ee; }
.chat-sidebar { position: sticky; top: 0; height: 100vh; padding: 31px 27px 25px; display: flex; flex-direction: column; color: white; background: linear-gradient(160deg, #06142d 0%, #0a2143 100%); }
.brand--dark .brand-mark { color: var(--gold-light); }
.side-rule { height: 1px; margin: 29px 0 28px; background: rgba(255,255,255,.09); }
.side-label { margin: 0 0 12px 5px; color: rgba(255,255,255,.32); font-size: 7px; letter-spacing: .23em; }
.new-chat { height: 48px; padding: 0 16px; display: flex; align-items: center; gap: 12px; border: 1px solid rgba(210,183,127,.32); color: #efe6d2; background: rgba(255,255,255,.03); font-size: 12px; text-align: left; }
.new-chat span { color: var(--gold); font-size: 20px; font-weight: 200; }
.side-spacer { flex: 1; }
.side-link { padding: 12px 4px; display: flex; gap: 10px; align-items: center; border: 0; color: rgba(255,255,255,.56); background: transparent; font-size: 10px; text-align: left; }
.side-link span { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; font-family: Georgia, serif; font-style: italic; }
.session-card { margin-top: 16px; padding: 16px 14px; display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.035); }
.session-dot { width: 6px; height: 6px; border-radius: 50%; background: #68b989; box-shadow: 0 0 11px rgba(104,185,137,.65); }
.session-card div { display: grid; gap: 3px; min-width: 0; }
.session-card small { color: rgba(255,255,255,.27); font-size: 6px; letter-spacing: .17em; }
.session-card strong { overflow: hidden; color: rgba(255,255,255,.72); font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.session-card button { border: 0; color: rgba(255,255,255,.4); background: transparent; }

.chat-main { min-width: 0; height: 100vh; display: grid; grid-template-rows: 82px minmax(0, 1fr) auto; }
.chat-header { padding: 0 clamp(24px, 4.2vw, 72px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(250,249,245,.88); backdrop-filter: blur(20px); }
.chat-header p { margin: 0 0 5px; display: flex; align-items: center; gap: 7px; color: #758196; font-size: 7px; letter-spacing: .15em; }
.chat-header p span { width: 5px; height: 5px; border-radius: 50%; background: #6bb38a; }
.chat-header h1 { margin: 0; font-family: "Yu Mincho", serif; font-size: 20px; font-weight: 500; letter-spacing: .07em; }
.chat-header h1 small { margin-left: 10px; padding-left: 10px; border-left: 1px solid #c8ced6; color: #8b95a2; font-family: sans-serif; font-size: 8px; font-weight: 400; letter-spacing: .06em; }
.info-button { width: 34px; height: 34px; border: 1px solid #cdd2d8; border-radius: 50%; color: #68778a; background: transparent; font-family: Georgia, serif; font-style: italic; }

.message-list { overflow-y: auto; padding: 36px clamp(24px, 7vw, 120px) 42px; scroll-behavior: smooth; }
.message-list::-webkit-scrollbar { width: 7px; }
.message-list::-webkit-scrollbar-thumb { background: rgba(14,47,88,.17); border-radius: 8px; }
.conversation-date { margin: 0 auto 38px; display: flex; align-items: center; justify-content: center; gap: 14px; color: #a0a8b1; font-size: 8px; letter-spacing: .1em; }
.conversation-date span { width: 38px; height: 1px; background: #d6d7d5; }
.message { width: min(900px, 100%); margin: 0 auto 32px; display: grid; grid-template-columns: 43px minmax(0, 1fr); gap: 15px; }
.message--user { grid-template-columns: minmax(0, 1fr); justify-items: end; }
.avatar { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid rgba(22,69,129,.22); border-radius: 50%; color: var(--blue); background: #fff; box-shadow: 0 6px 18px rgba(12,42,78,.08); }
.avatar .brand-mark { width: 28px; height: 28px; flex-basis: 28px; }
.avatar .brand-mark__s { font-size: 13px; }
.avatar .brand-mark::before, .avatar .brand-mark::after, .avatar .brand-mark__orbit { inset: 2px; }
.message-body { min-width: 0; }
.message--user .message-body { max-width: min(75%, 660px); }
.message-meta { height: 28px; display: flex; align-items: flex-start; gap: 10px; }
.message-meta strong { color: var(--ink); font-family: Georgia, serif; font-size: 9px; letter-spacing: .13em; }
.message-meta span { padding-left: 9px; border-left: 1px solid #cfd3d7; color: #9ba3ad; font-size: 6px; letter-spacing: .14em; }
.message--user .message-meta { justify-content: flex-end; }
.message-bubble { padding: 22px 25px; border: 1px solid #dedfdd; color: #24354d; background: rgba(255,255,255,.87); box-shadow: 0 8px 24px rgba(12,34,64,.045); font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 14px; line-height: 2; letter-spacing: .025em; }
.message-bubble p { margin: 0 0 9px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message--user .message-bubble { border-color: #113964; color: white; background: linear-gradient(135deg, #173f70, #0c2a50); }
.source-row { margin-top: 10px; display: flex; align-items: center; gap: 7px; }
.source-row > span { color: #9ba3ad; font-size: 8px; }
.source-row button { min-width: 27px; height: 21px; padding: 0 6px; border: 1px solid #cbd2da; color: #68788b; background: transparent; font-family: Georgia, serif; font-size: 7px; }
.source-row .report-button { margin-left: auto; padding: 0; border: 0; color: #8d96a2; font-family: sans-serif; font-size: 8px; text-decoration: underline; text-underline-offset: 3px; }
.source-row--report { justify-content: flex-end; }

.prompt-grid { width: min(900px, calc(100% - 58px)); margin: 18px auto 42px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.prompt-grid button { min-height: 77px; padding: 14px 16px; display: grid; grid-template-columns: 25px 1fr 20px; gap: 10px; align-items: center; border: 1px solid #d9dcdf; color: var(--ink); background: rgba(255,255,255,.62); text-align: left; transition: border-color .2s, background .2s, transform .2s; }
.prompt-grid button:hover { border-color: #96aac1; background: white; transform: translateY(-1px); }
.prompt-grid button > span { color: #b69b65; font-family: Georgia, serif; font-size: 8px; }
.prompt-grid button p { margin: 0; font-family: "Yu Mincho", serif; font-size: 11px; line-height: 1.65; }
.prompt-grid svg { width: 17px; fill: none; stroke: #8b98a7; stroke-width: 1.2; }
.thinking { width: 86px; height: 43px; padding: 0 20px; display: flex; align-items: center; gap: 7px; border: 1px solid #dedfdd; background: white; }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: #587ba4; animation: thinking 1.2s infinite; }
.thinking i:nth-child(2) { animation-delay: .16s; }
.thinking i:nth-child(3) { animation-delay: .32s; }
@keyframes thinking { 0%,80%,100% { transform: translateY(0); opacity:.35; } 40% { transform: translateY(-4px); opacity:1; } }

.composer-wrap { padding: 14px clamp(24px, 7vw, 120px) 17px; border-top: 1px solid var(--line); background: rgba(250,249,245,.95); }
.composer { width: min(900px, 100%); min-height: 59px; margin: 0 auto; padding: 8px 8px 8px 20px; display: flex; align-items: center; gap: 14px; border: 1px solid #cfd3d7; background: white; box-shadow: 0 10px 28px rgba(14,40,74,.06); }
.composer textarea { flex: 1; min-width: 0; max-height: 140px; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; line-height: 1.6; }
.composer textarea::placeholder { color: #abb2bb; }
.composer button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; color: white; background: var(--ink-soft); transition: opacity .2s, transform .2s; }
.composer button:disabled { cursor: not-allowed; opacity: .32; }
.composer button:hover:not(:disabled) { transform: scale(1.03); }
.composer svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.composer-wrap > p { width: min(900px, 100%); margin: 8px auto 0; color: #a0a7af; font-size: 8px; text-align: center; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; padding: 24px; display: grid; place-items: center; background: rgba(3,13,29,.7); backdrop-filter: blur(12px); }
.info-modal { position: relative; width: min(570px, 100%); max-height: min(760px, calc(100vh - 48px)); overflow-y: auto; padding: 54px 56px; background: #fbfaf6; box-shadow: 0 40px 110px rgba(0,0,0,.38); }
.modal-close { position: absolute; top: 19px; right: 20px; width: 31px; height: 31px; border: 1px solid #d3d6d9; color: #7f8994; background: transparent; font-size: 21px; font-weight: 200; }
.eyebrow--dark { color: #9a7d45; }
.info-modal h2 { margin: 0 0 23px; font-family: "Yu Mincho", serif; font-size: 32px; line-height: 1.55; font-weight: 500; letter-spacing: .045em; }
.info-modal > p:not(.eyebrow) { color: #5f6c7b; font-family: "Yu Mincho", serif; font-size: 13px; line-height: 2; }
.info-alert { margin: 26px 0; padding: 18px 20px; border-left: 2px solid var(--gold); background: #f1eee5; }
.info-alert strong { color: #8a6c35; font-size: 9px; letter-spacing: .12em; }
.info-alert p { margin: 6px 0 0; color: #64707d; font-size: 10px; line-height: 1.8; }
.info-modal ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid #dddeda; }
.info-modal li { min-height: 51px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid #dddeda; color: #506074; font-size: 10px; }
.info-modal li span { color: #ad8d52; font-family: Georgia, serif; font-size: 8px; }

@media (max-width: 1020px) {
  .gate-header, .gate-main, .gate-footer { width: min(100% - 48px, 900px); }
  .gate-main { padding: 60px 0 110px; grid-template-columns: minmax(0, 1fr) 390px; gap: 52px; }
  .gate-copy h1 { font-size: clamp(55px, 7vw, 78px); }
  .principle-row > div { min-width: 0; padding-right: 20px; margin-right: 20px; gap: 11px; }
  .gate-card { padding: 38px 35px 35px; }
  .chat-shell { grid-template-columns: 220px minmax(0,1fr); }
  .chat-sidebar { padding-inline: 20px; }
  .message-list, .composer-wrap { padding-left: 40px; padding-right: 40px; }
}

@media (max-width: 760px) {
  .desktop-only { display: none; }
  .gate-shell { min-height: 100svh; overflow-y: auto; }
  .gate-header { width: calc(100% - 36px); height: 81px; }
  .brand-mark { width: 39px; height: 39px; flex-basis: 39px; }
  .brand strong { font-size: 13px; }
  .security-pill { font-size: 0; gap: 6px; }
  .security-pill::after { content: "PRIVATE"; font-size: 7px; letter-spacing: .16em; }
  .gate-main { width: calc(100% - 36px); min-height: auto; padding: 48px 0 116px; display: block; }
  .gate-copy { text-align: center; }
  .eyebrow { justify-content: center; margin-bottom: 21px; font-size: 8px; }
  .gate-copy h1 { font-size: clamp(50px, 15vw, 70px); line-height: 1.18; }
  .gate-lead { margin-top: 25px; font-size: 12px; line-height: 1.9; }
  .principle-row { margin: 35px auto 53px; justify-content: center; }
  .principle-row > div { padding-right: 14px; margin-right: 14px; gap: 7px; }
  .principle-row span { font-size: 10px; }
  .principle-row b { font-size: 7px; }
  .gate-card-wrap { width: 100%; }
  .gate-card { padding: 34px 25px 29px; }
  .gate-card h2 { font-size: 26px; }
  .gate-orbit { inset: -60px -95px; }
  .gate-footer { width: calc(100% - 36px); height: 64px; }

  .chat-shell { display: block; }
  .chat-sidebar { display: none; }
  .chat-main { height: 100svh; grid-template-rows: 70px minmax(0,1fr) auto; }
  .chat-header { padding: 0 17px; }
  .chat-header h1 { font-size: 16px; }
  .chat-header h1 small { margin-left: 6px; padding-left: 6px; font-size: 7px; }
  .message-list { padding: 25px 15px 34px; }
  .conversation-date { margin-bottom: 27px; font-size: 7px; }
  .message { grid-template-columns: 34px minmax(0,1fr); gap: 9px; margin-bottom: 25px; }
  .avatar { width: 34px; height: 34px; }
  .avatar .brand-mark { width: 23px; height: 23px; flex-basis: 23px; }
  .avatar .brand-mark__s { font-size: 11px; }
  .message-bubble { padding: 17px 18px; font-size: 12px; line-height: 1.9; }
  .message--user .message-body { max-width: 88%; }
  .prompt-grid { width: calc(100% - 43px); grid-template-columns: 1fr; margin-bottom: 30px; }
  .prompt-grid button { min-height: 64px; }
  .composer-wrap { padding: 10px 12px 12px; }
  .composer { min-height: 55px; padding-left: 14px; }
  .composer-wrap > p { display: none; }
  .info-modal { padding: 48px 25px 34px; }
  .info-modal h2 { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Administration */
.admin-loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 20px; color: rgba(255,255,255,.45); background: #07152e; font-size: 8px; letter-spacing: .22em; }
.admin-mark { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 1px solid rgba(209,181,124,.65); border-radius: 50%; color: #ddc58f; font-family: Georgia, serif; font-size: 18px; font-style: italic; }
.admin-login { position: relative; min-height: 100vh; overflow: hidden; display: grid; place-items: center; padding: 30px; color: white; background: linear-gradient(135deg,#050f22,#0b2448); }
.admin-login::before { content:""; position:absolute; inset:0; opacity:.12; background-image:linear-gradient(rgba(255,255,255,.18) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.18) 1px,transparent 1px); background-size:80px 80px; }
.admin-login__glow { position:absolute; width:630px; height:630px; border:1px solid rgba(211,181,122,.12); border-radius:50%; box-shadow:0 0 0 110px rgba(255,255,255,.012),0 0 100px rgba(38,95,163,.18); }
.admin-login form { position:relative; width:min(430px,100%); padding:48px 48px 42px; color:var(--ink); background:#fbfaf7; box-shadow:0 40px 100px rgba(0,0,0,.36); }
.admin-login form::before { content:""; position:absolute; top:0; left:0; right:0; height:3px; background:linear-gradient(90deg,var(--gold),#e9d8b2,transparent); }
.admin-login form > .admin-mark { margin-bottom:22px; color:var(--blue); border-color:rgba(23,71,138,.3); }
.admin-login form > p { margin:0 0 28px; color:#8d7444; font-size:7px; letter-spacing:.2em; }
.admin-login h1 { margin:0 0 8px; font-family:"Yu Mincho",serif; font-size:31px; font-weight:500; letter-spacing:.06em; }
.admin-login form > span { display:block; margin-bottom:28px; color:#77818e; font-size:11px; }
.admin-login label { display:block; margin-bottom:9px; color:#5f6b79; font-size:9px; font-weight:700; letter-spacing:.09em; }
.admin-login input { width:100%; height:56px; padding:0 17px; border:1px solid #d2d7dd; outline:0; color:var(--ink); background:white; }
.admin-login input:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(23,71,138,.08); }
.admin-login form > button { width:100%; height:56px; margin-top:16px; border:0; color:white; background:var(--ink-soft); font-family:"Yu Mincho",serif; font-size:12px; letter-spacing:.08em; }
.admin-login form > button:disabled { opacity:.35; cursor:not-allowed; }
.admin-login form > a { display:block; margin-top:24px; color:#83909d; font-size:9px; text-align:center; text-decoration:none; }
.admin-form-error { margin:12px 0 -3px; color:#a33c3c; font-size:10px; }

.admin-shell { min-height:100vh; display:grid; grid-template-columns:235px minmax(0,1fr); background:#f2f1ed; }
.admin-sidebar { position:sticky; top:0; height:100vh; padding:29px 20px 22px; display:flex; flex-direction:column; color:white; background:linear-gradient(160deg,#06142d,#0a2143); }
.admin-brand { padding:0 7px 27px; display:flex; align-items:center; gap:12px; border-bottom:1px solid rgba(255,255,255,.09); }
.admin-brand .admin-mark { width:36px; height:36px; font-size:15px; }
.admin-brand > div { display:grid; gap:4px; }
.admin-brand strong { font-family:Georgia,serif; font-size:12px; letter-spacing:.13em; font-weight:500; }
.admin-brand span { color:rgba(255,255,255,.34); font-size:6px; letter-spacing:.16em; }
.admin-sidebar nav { margin-top:33px; display:grid; gap:4px; }
.admin-sidebar nav button { position:relative; height:48px; padding:0 14px; display:flex; align-items:center; gap:15px; border:0; color:rgba(255,255,255,.48); background:transparent; font-size:11px; text-align:left; }
.admin-sidebar nav button::before { content:""; position:absolute; left:-20px; top:8px; bottom:8px; width:2px; background:transparent; }
.admin-sidebar nav button i { color:rgba(211,183,125,.58); font-family:Georgia,serif; font-size:7px; font-style:normal; }
.admin-sidebar nav button.active { color:white; background:rgba(255,255,255,.055); }
.admin-sidebar nav button.active::before { background:var(--gold); }
.admin-side-bottom { margin-top:auto; display:grid; gap:10px; padding:20px 8px 0; border-top:1px solid rgba(255,255,255,.09); }
.admin-side-bottom a,.admin-side-bottom button { border:0; color:rgba(255,255,255,.47); background:transparent; font-size:9px; text-decoration:none; text-align:left; }
.admin-main { min-width:0; }
.admin-header { min-height:93px; padding:20px clamp(30px,4vw,65px); display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); background:rgba(250,249,245,.87); backdrop-filter:blur(16px); }
.admin-header p,.section-title p,.invite-form > p,.control-panel > div > p { margin:0 0 6px; color:#9a7d45; font-size:7px; letter-spacing:.19em; }
.admin-header h1 { margin:0; font-family:"Yu Mincho",serif; font-size:23px; font-weight:500; letter-spacing:.05em; }
.system-state { padding:9px 12px; display:flex; align-items:center; gap:8px; border:1px solid #cfd4d8; color:#768290; background:white; font-size:7px; letter-spacing:.13em; }
.system-state i { width:6px; height:6px; border-radius:50%; background:#9ca5ae; }
.system-state.on i { background:#5fb181; box-shadow:0 0 10px rgba(95,177,129,.55); }
.system-state.off { color:#a45e55; border-color:#dbc5c0; background:#fff8f7; }
.system-state.off i { background:#b65d51; }
.admin-error { margin:22px clamp(30px,4vw,65px) 0; padding:14px 17px; display:flex; align-items:center; gap:12px; border-left:2px solid #b95b50; color:#7b4741; background:#fff7f5; font-size:10px; }
.admin-error strong { font-size:10px; }
.admin-error button { margin-left:auto; border:0; color:#7b4741; background:transparent; text-decoration:underline; font-size:9px; }
.admin-content { padding:38px clamp(30px,4vw,65px) 65px; }
.admin-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:15px; }
.admin-stats article { min-height:154px; padding:23px 25px; border:1px solid #dedfdd; background:white; box-shadow:0 7px 22px rgba(15,39,70,.035); }
.admin-stats span { color:#8792a0; font-size:7px; letter-spacing:.16em; }
.admin-stats strong { display:block; margin:16px 0 5px; color:var(--ink); font-family:Georgia,serif; font-size:43px; font-weight:400; }
.admin-stats p { margin:0; color:#8a949f; font-size:9px; }
.control-panel { margin-top:15px; padding:24px 27px; display:flex; align-items:center; justify-content:space-between; border:1px solid #d9d6cd; background:linear-gradient(100deg,#f8f6ee,#fff); }
.control-panel h2 { margin:0 0 8px; font-family:"Yu Mincho",serif; font-size:17px; font-weight:500; }
.control-panel > div > span { color:#7d8792; font-size:9px; }
.power-switch { width:57px; height:29px; padding:3px; border:0; border-radius:30px; background:#a9afb6; transition:background .2s; }
.power-switch i { display:block; width:23px; height:23px; border-radius:50%; background:white; box-shadow:0 2px 6px rgba(0,0,0,.25); transition:transform .2s; }
.power-switch.on { background:#39765a; }
.power-switch.on i { transform:translateX(28px); }
.admin-section { margin-top:30px; border:1px solid #dedfdd; background:white; }
.section-title { min-height:75px; padding:18px 22px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #e3e3e0; }
.section-title h2 { margin:0; font-family:"Yu Mincho",serif; font-size:17px; font-weight:500; }
.section-title > button { border:0; color:#65758a; background:transparent; font-size:9px; }
.section-title > span { color:#89939e; font-size:9px; }
.recent-list article { min-height:58px; padding:13px 20px; display:grid; grid-template-columns:120px minmax(0,1fr) 145px auto; align-items:center; gap:15px; border-bottom:1px solid #ececea; }
.recent-list article:last-child { border-bottom:0; }
.recent-list article > span { color:#52647a; font-size:9px; }
.recent-list article p { overflow:hidden; margin:0; color:#34455b; font-family:"Yu Mincho",serif; font-size:11px; white-space:nowrap; text-overflow:ellipsis; }
.recent-list time { color:#9aa2aa; font-size:8px; }
.recent-list b { padding:4px 7px; color:#a14f45; background:#fff0ed; font-size:7px; font-weight:500; }
.empty-state { padding:34px 20px; color:#9aa2aa; font-size:10px; text-align:center; }
.admin-content--grid { display:grid; grid-template-columns:310px minmax(0,1fr); gap:20px; align-items:start; }
.invite-form { padding:28px 27px; border-top:2px solid var(--gold); background:white; box-shadow:0 7px 22px rgba(15,39,70,.035); }
.invite-form h2 { margin:0 0 26px; font-family:"Yu Mincho",serif; font-size:19px; font-weight:500; }
.invite-form label { display:block; margin-bottom:18px; color:#586778; font-size:9px; font-weight:600; }
.invite-form input,.invite-form select { width:100%; height:45px; margin-top:8px; padding:0 12px; border:1px solid #d3d8dd; outline:0; color:var(--ink); background:white; font-size:11px; }
.invite-form small { display:block; margin-top:5px; color:#9aa2aa; font-size:8px; font-weight:400; }
.invite-form > button { width:100%; height:48px; border:0; color:white; background:var(--ink-soft); font-family:"Yu Mincho",serif; font-size:11px; }
.invite-form > button:disabled { opacity:.35; cursor:not-allowed; }
.invite-list-section { margin-top:0; }
.invite-list article { min-height:71px; padding:14px 18px; display:grid; grid-template-columns:65px minmax(0,1fr) auto; gap:15px; align-items:center; border-bottom:1px solid #ebebe8; }
.invite-list article:last-child { border-bottom:0; }
.invite-state { display:flex; align-items:center; gap:6px; color:#4f7861; font-size:8px; }
.invite-state i { width:6px; height:6px; border-radius:50%; background:#64a57b; }
.invite-list article > div:nth-child(2) { min-width:0; }
.invite-list strong { display:block; margin-bottom:6px; color:#26394f; font-size:11px; }
.invite-list p { margin:0; color:#929aa3; font-size:8px; }
.invite-list article > button { padding:6px 10px; border:1px solid #d5d9dd; color:#798591; background:white; font-size:8px; }
.invite-list article.disabled { opacity:.52; background:#f7f7f5; }
.invite-list article.disabled .invite-state { color:#8b9299; }
.invite-list article.disabled .invite-state i { background:#a3a8ad; }
.log-section { margin-top:0; }
.log-list details { border-bottom:1px solid #e7e7e4; }
.log-list summary { min-height:67px; padding:14px 20px; display:grid; grid-template-columns:minmax(0,1fr) 145px auto 18px; gap:15px; align-items:center; cursor:pointer; list-style:none; }
.log-list summary::-webkit-details-marker { display:none; }
.log-list summary > div { min-width:0; display:grid; gap:5px; }
.log-list summary span { color:#8090a2; font-size:8px; }
.log-list summary strong { overflow:hidden; color:#304258; font-family:"Yu Mincho",serif; font-size:11px; font-weight:500; white-space:nowrap; text-overflow:ellipsis; }
.log-list summary time { color:#98a0a9; font-size:8px; }
.log-list summary b { padding:5px 7px; color:#9c4f46; background:#fff0ed; font-size:7px; font-weight:500; }
.log-list summary > i { color:#8d98a4; font-size:17px; font-style:normal; font-weight:200; }
.log-list details[open] summary > i { transform:rotate(45deg); }
.log-list details.reported { border-left:2px solid #b95b50; }
.log-detail { padding:2px 20px 22px; }
.log-detail > p { margin:0; padding:15px 17px; color:#35465a; font-size:10px; line-height:1.8; white-space:pre-wrap; }
.log-detail > p span { display:block; margin-bottom:6px; color:#9c7d43; font-family:Georgia,serif; font-size:7px; letter-spacing:.13em; }
.log-question { background:#f5f4f0; }
.log-answer { border:1px solid #e2e2df; background:white; }
.log-detail > div { margin-top:9px; display:flex; gap:15px; color:#9aa1a9; }
.log-detail small { font-size:7px; }
.code-modal { position:fixed; z-index:80; inset:0; padding:24px; display:grid; place-items:center; background:rgba(3,13,29,.76); backdrop-filter:blur(12px); }
.code-modal > div { width:min(470px,100%); padding:44px 46px 38px; text-align:center; background:#fbfaf6; box-shadow:0 40px 100px rgba(0,0,0,.4); }
.code-modal p { margin:0 0 16px; color:#96783f; font-size:7px; letter-spacing:.2em; }
.code-modal h2 { margin:0 0 9px; font-family:"Yu Mincho",serif; font-size:23px; font-weight:500; }
.code-modal > div > span { display:block; color:#7c8793; font-size:10px; }
.code-modal strong { display:block; margin:26px 0 10px; padding:18px 12px; border:1px solid #d4d8dc; color:var(--blue); background:white; font-family:Georgia,serif; font-size:18px; letter-spacing:.08em; }
.code-modal small { display:block; margin-bottom:22px; color:#939ba4; font-size:8px; line-height:1.6; }
.code-modal button { width:100%; height:46px; border:0; color:white; background:var(--ink-soft); font-size:10px; }
.code-modal .text-button { margin-top:8px; color:#7b8793; background:transparent; }

@media (max-width:900px) {
  .admin-shell { grid-template-columns:190px minmax(0,1fr); }
  .admin-sidebar { padding-inline:15px; }
  .admin-stats { grid-template-columns:1fr; }
  .admin-stats article { min-height:115px; }
  .admin-content--grid { grid-template-columns:1fr; }
  .recent-list article { grid-template-columns:90px minmax(0,1fr); }
  .recent-list time,.recent-list b { display:none; }
}

@media (max-width:640px) {
  .admin-shell { display:block; }
  .admin-sidebar { position:relative; width:100%; height:auto; padding:18px; display:block; }
  .admin-brand { padding-bottom:16px; }
  .admin-sidebar nav { margin-top:14px; display:flex; overflow-x:auto; }
  .admin-sidebar nav button { min-width:115px; }
  .admin-sidebar nav button::before { display:none; }
  .admin-side-bottom { display:none; }
  .admin-header { min-height:78px; padding:16px 18px; }
  .admin-header h1 { font-size:19px; }
  .system-state { padding:8px; }
  .system-state span { display:none; }
  .admin-content { padding:24px 14px 45px; }
  .admin-error { margin:14px 14px 0; }
  .control-panel { align-items:flex-start; gap:18px; }
  .control-panel > div > span { line-height:1.6; }
  .recent-list article { grid-template-columns:72px minmax(0,1fr); }
  .invite-list article { grid-template-columns:54px minmax(0,1fr); }
  .invite-list article > button { grid-column:2; justify-self:start; }
  .log-list summary { grid-template-columns:minmax(0,1fr) 18px; }
  .log-list summary time,.log-list summary b { display:none; }
  .log-detail > div { flex-wrap:wrap; }
  .admin-login form { padding:39px 27px 34px; }
  .code-modal > div { padding:38px 24px 30px; }
}

/* Policy */
.policy-shell { min-height:100vh; color:#eaf0f7; background:linear-gradient(135deg,#06142d,#0b2448); }
.policy-shell > header { width:min(1080px,calc(100% - 48px)); height:82px; margin:0 auto; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid rgba(255,255,255,.1); }
.policy-shell > header a,.policy-shell > header span { color:rgba(255,255,255,.48); font-size:8px; letter-spacing:.14em; text-decoration:none; }
.policy-shell article { width:min(900px,calc(100% - 48px)); margin:0 auto; padding:78px 0 90px; }
.policy-kicker { margin:0 0 20px; color:var(--gold-light); font-size:8px; letter-spacing:.22em; }
.policy-shell h1 { margin:0; font-family:"Yu Mincho",serif; font-size:clamp(42px,6vw,70px); line-height:1.3; font-weight:500; letter-spacing:.04em; }
.policy-lead { max-width:750px; margin:34px 0 54px; color:rgba(255,255,255,.66); font-size:12px; line-height:2.1; }
.policy-shell section { padding:29px 0; display:grid; grid-template-columns:55px minmax(0,1fr); gap:20px; border-top:1px solid rgba(255,255,255,.1); }
.policy-shell section > span { color:var(--gold); font-family:Georgia,serif; font-size:9px; }
.policy-shell section h2 { margin:0 0 12px; font-family:"Yu Mincho",serif; font-size:18px; font-weight:500; letter-spacing:.05em; }
.policy-shell section p { margin:0; color:rgba(255,255,255,.62); font-size:11px; line-height:2; }
.policy-shell article > footer { padding-top:30px; display:flex; align-items:center; justify-content:space-between; border-top:1px solid rgba(255,255,255,.1); }
.policy-shell article > footer p { color:rgba(255,255,255,.36); font-size:8px; }
.policy-shell article > footer a { color:var(--gold-light); font-size:9px; text-decoration:none; }

@media(max-width:640px){
  .policy-shell > header,.policy-shell article { width:calc(100% - 36px); }
  .policy-shell article { padding:52px 0 68px; }
  .policy-shell section { grid-template-columns:36px minmax(0,1fr); gap:10px; }
  .policy-shell article > footer { align-items:flex-start; flex-direction:column; gap:12px; }
}
