:root {
  color-scheme: dark;
  --bg: #080c18;
  --panel: rgba(16, 23, 43, 0.78);
  --panel-solid: #10172b;
  --panel-soft: #141d35;
  --line: rgba(177, 190, 228, 0.14);
  --line-bright: rgba(177, 190, 228, 0.24);
  --text: #f3f5ff;
  --muted: #909ab7;
  --quiet: #606b89;
  --purple: #8b7cff;
  --purple-deep: #6559dc;
  --coral: #ff927b;
  --green: #70d7ad;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-size: 14px; }
button, textarea { font: inherit; }
button { cursor: pointer; }
.ambient { position: fixed; pointer-events: none; filter: blur(1px); opacity: .35; border-radius: 999px; z-index: 0; }
.ambient-one { width: 470px; height: 470px; top: -240px; right: 14%; background: radial-gradient(circle, rgba(102, 86, 255, .28), transparent 66%); }
.ambient-two { width: 380px; height: 380px; bottom: -220px; left: 8%; background: radial-gradient(circle, rgba(37, 174, 195, .15), transparent 68%); }
.app-shell { position: relative; z-index: 1; max-width: 1480px; min-height: 100vh; margin: 0 auto; padding: 30px 38px 22px; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-family: Inter, sans-serif; font-size: 17px; letter-spacing: -.04em; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(145deg, #9184ff, #5e52d7); box-shadow: 0 7px 20px rgba(117, 100, 255, .26); transform: rotate(-4deg); }
.brand-mark span { position: relative; display: block; width: 13px; height: 15px; border: 2px solid #fff; border-radius: 8px 8px 4px 4px; }
.brand-mark span::after { content: ''; position: absolute; width: 3px; height: 3px; border-radius: 99px; background: #fff; right: -4px; top: -4px; box-shadow: 0 0 8px #fff; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(112, 215, 173, .18); border-radius: 999px; background: rgba(112, 215, 173, .06); color: #a7e7cb; font-size: 11px; }
.status-pill i, .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--green); box-shadow: 0 0 0 4px rgba(112, 215, 173, .1); display: inline-block; }
.account-button { max-width: 190px; overflow: hidden; padding: 8px 12px; border: 1px solid rgba(139, 124, 255, .28); border-radius: 999px; background: rgba(139, 124, 255, .08); color: #d5d0ff; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; transition: .18s ease; }
.account-button:hover, .account-button.signed-in { border-color: rgba(139, 124, 255, .55); background: rgba(139, 124, 255, .16); color: #fff; }
.icon-button { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; transition: .18s ease; }
.icon-button:hover { background: var(--panel-soft); color: var(--text); border-color: var(--line-bright); }
.workspace { flex: 1; display: grid; grid-template-columns: 216px minmax(450px, 1fr) 236px; gap: 18px; min-height: 610px; }
.mode-rail, .composer-panel, .context-panel { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(18, 27, 52, .84), rgba(11, 16, 31, .84)); box-shadow: var(--shadow); }
.mode-rail, .context-panel { border-radius: 18px; padding: 25px 16px 17px; }
.composer-panel { border-radius: 22px; padding: 31px 34px 20px; display: flex; flex-direction: column; min-width: 0; }
.eyebrow { display: block; color: var(--purple); font-family: Inter, sans-serif; font-size: 9px; letter-spacing: .18em; font-weight: 700; }
.rail-heading { padding: 0 10px 22px; }
.rail-heading h1, .context-heading h2, .panel-header h2 { margin: 8px 0 0; letter-spacing: -.045em; }
.rail-heading h1 { font-size: 16px; }
.mode-list { display: flex; flex-direction: column; gap: 7px; }
.mode-item { display: grid; grid-template-columns: 27px 1fr 12px; align-items: center; gap: 8px; width: 100%; padding: 12px 9px; border: 1px solid transparent; border-radius: 12px; color: var(--muted); text-align: left; background: transparent; transition: .2s ease; }
.mode-item:hover { color: var(--text); background: rgba(145, 132, 255, .06); }
.mode-item.active { background: linear-gradient(90deg, rgba(139, 124, 255, .16), rgba(139, 124, 255, .04)); color: var(--text); border-color: rgba(139, 124, 255, .18); }
.mode-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: rgba(139, 124, 255, .1); color: var(--purple); font-size: 17px; }
.mode-item b { display: block; font-size: 12px; font-weight: 600; }
.mode-item small { display: block; margin-top: 3px; color: var(--quiet); font-size: 9px; }
.mode-item.active small { color: var(--muted); }
.mode-arrow { opacity: 0; color: var(--purple); font-size: 15px; transition: .2s; }
.mode-item.active .mode-arrow, .mode-item:hover .mode-arrow { opacity: 1; }
.rail-tip { margin: auto 6px 0; padding: 15px 12px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 10px; line-height: 1.7; }
.rail-tip p { margin: 9px 0 0; }
.rail-tip strong { color: var(--muted); font-weight: 600; }
.tip-spark { color: var(--coral); font-size: 16px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-header h2 { font-size: clamp(21px, 2.2vw, 29px); line-height: 1.35; }
.panel-header p { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.shortcut { flex: 0 0 auto; color: var(--quiet); font-size: 10px; padding-top: 4px; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 5px; margin: 0 2px; border: 1px solid var(--line-bright); border-bottom-color: rgba(177, 190, 228, .4); border-radius: 5px; font-family: Inter, sans-serif; font-size: 10px; color: var(--muted); }
.conversation { flex: 1; min-height: 270px; margin: 27px 0 22px; overflow: auto; }
.empty-state { height: 100%; min-height: 255px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; animation: rise .55s ease both; }
.empty-orbit { width: 60px; height: 60px; display: grid; place-items: center; margin-bottom: 17px; border: 1px solid rgba(139, 124, 255, .28); border-radius: 20px; background: radial-gradient(circle, rgba(139, 124, 255, .2), rgba(139, 124, 255, .03)); color: var(--purple); font-size: 23px; box-shadow: 0 0 36px rgba(139, 124, 255, .13); }
.empty-kicker { color: var(--purple); font: 700 9px Inter, sans-serif; letter-spacing: .2em; margin: 0 0 9px; }
.empty-state h3 { margin: 0; font-size: 17px; letter-spacing: -.04em; }
.empty-state > p:last-child { max-width: 300px; margin: 10px 0 0; color: var(--quiet); font-size: 11px; line-height: 1.7; }
.composer { margin-top: auto; padding: 14px 15px 13px; border: 1px solid var(--line-bright); border-radius: 14px; background: rgba(7, 11, 23, .56); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.composer:focus-within { border-color: rgba(139, 124, 255, .64); box-shadow: 0 0 0 4px rgba(139, 124, 255, .07); }
.composer-label, .composer-footer { display: flex; align-items: center; justify-content: space-between; }
.composer-label { color: var(--muted); font-size: 10px; }
.char-count { color: var(--quiet); font-family: Inter, sans-serif; }
textarea { width: 100%; resize: vertical; min-height: 92px; margin: 12px 0 9px; border: 0; outline: none; background: transparent; color: var(--text); line-height: 1.8; font-size: 13px; }
textarea::placeholder { color: #555f7d; }
.hint { display: inline-flex; align-items: center; gap: 8px; color: var(--quiet); font-size: 10px; }
.generate-button { display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px; border: 0; border-radius: 9px; background: linear-gradient(135deg, var(--purple), var(--purple-deep)); color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 6px 18px rgba(101, 89, 220, .27); transition: .2s ease; }
.generate-button:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(101, 89, 220, .4); }
.generate-button:disabled { cursor: wait; opacity: .7; transform: none; }
.button-icon { color: #d9d5ff; }
.button-arrow { font-size: 15px; line-height: 10px; }
.privacy-note { margin: 12px 0 0; text-align: center; color: var(--quiet); font-size: 9px; }
.context-heading { display: flex; justify-content: space-between; align-items: flex-start; padding: 0 4px 19px; }
.context-heading h2 { font-size: 15px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--quiet); font-size: 9px; }
.text-button:hover { color: var(--coral); }
.context-card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.card-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; font-size: 14px; }
.card-icon.purple { background: rgba(139, 124, 255, .13); color: var(--purple); }
.card-label, .history-title { color: var(--quiet); font-size: 9px; }
.context-card strong { display: block; margin-top: 3px; font-size: 11px; }
.context-card p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.history-block { margin-top: 24px; }
.history-title { display: flex; justify-content: space-between; align-items: center; padding: 0 3px 10px; text-transform: uppercase; letter-spacing: .08em; }
.history-count { min-width: 17px; padding: 2px 4px; border-radius: 99px; background: rgba(139, 124, 255, .11); color: var(--purple); text-align: center; font-family: Inter, sans-serif; }
.history-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow: auto; }
.history-empty { margin: 4px 2px; color: var(--quiet); font-size: 10px; line-height: 1.7; }
.history-item { padding: 10px; border: 1px solid transparent; border-radius: 9px; background: rgba(255,255,255,.025); text-align: left; transition: .18s ease; }
.history-item:hover { border-color: var(--line); background: rgba(139, 124, 255, .06); }
.history-item button { width: 100%; padding: 0; border: 0; background: transparent; color: var(--muted); text-align: left; }
.history-item small { display: block; margin-bottom: 4px; color: var(--purple); font-size: 8px; }
.history-item span { display: block; overflow: hidden; color: var(--text); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.usage-card { display: flex; gap: 9px; margin-top: auto; padding: 13px 10px 3px; border-top: 1px solid var(--line); color: var(--quiet); }
.usage-icon { color: var(--coral); font-size: 18px; }
.usage-card strong { display: block; margin: 1px 0 5px; color: var(--muted); font-size: 10px; }
.usage-card p { margin: 0; font-size: 9px; line-height: 1.6; }
.message { max-width: 88%; margin: 0 0 17px; animation: rise .3s ease both; }
.message.user { margin-left: auto; }
.message-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; color: var(--quiet); font-size: 9px; }
.message.user .message-head { justify-content: flex-end; }
.message-bubble { padding: 12px 14px; border-radius: 12px; color: var(--text); font-size: 12px; line-height: 1.8; white-space: pre-wrap; }
.message.user .message-bubble { border: 1px solid rgba(139, 124, 255, .2); background: rgba(139, 124, 255, .12); }
.message.assistant .message-bubble { border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.message-bubble strong { color: #fff; }
.message-actions { display: flex; gap: 7px; margin-top: 7px; }
.message-actions button { padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--quiet); font-size: 9px; }
.message-actions button:hover { color: var(--text); border-color: var(--line-bright); }
.typing { display: inline-flex; align-items: center; gap: 5px; }
.typing span { width: 5px; height: 5px; border-radius: 99px; background: var(--purple); animation: pulse 1s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }.typing span:nth-child(3) { animation-delay: .3s; }
.footer { display: flex; justify-content: space-between; padding: 17px 4px 0; color: var(--quiet); font: 8px Inter, sans-serif; letter-spacing: .14em; }
.auth-dialog { width: min(430px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line-bright); border-radius: 18px; background: var(--panel-solid); color: var(--text); box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.auth-dialog::backdrop { background: rgba(3, 6, 15, .76); backdrop-filter: blur(8px); }
.auth-card { position: relative; padding: 30px; }
.auth-card h2 { margin: 9px 0 7px; font-size: 23px; letter-spacing: -.045em; }
.auth-description { margin: 0 0 20px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.auth-close { position: absolute; top: 17px; right: 18px; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 19px; line-height: 1; }
.auth-close:hover { border-color: var(--line-bright); color: var(--text); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 17px; padding: 4px; border-radius: 9px; background: rgba(255,255,255,.035); }
.auth-tab { padding: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--quiet); font-size: 11px; }
.auth-tab.active { background: rgba(139, 124, 255, .16); color: #fff; }
.auth-field { display: block; margin: 12px 0; color: var(--muted); font-size: 10px; }
.auth-field input { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: rgba(4, 8, 18, .55); color: var(--text); font-size: 12px; }
.auth-field input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139,124,255,.1); }
.auth-field input::placeholder { color: var(--quiet); }
.auth-submit, .oauth-button { width: 100%; padding: 11px 13px; border-radius: 9px; font-size: 11px; font-weight: 700; transition: .18s ease; }
.auth-submit { margin-top: 8px; border: 0; background: linear-gradient(135deg, var(--purple), var(--purple-deep)); color: #fff; box-shadow: 0 6px 18px rgba(101,89,220,.27); }
.auth-submit:hover { transform: translateY(-1px); }
.auth-submit:disabled { cursor: wait; opacity: .65; transform: none; }
.auth-message { min-height: 18px; margin: 10px 0 0; color: var(--coral); font-size: 10px; line-height: 1.5; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; color: var(--quiet); font-size: 9px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.oauth-button { border: 1px solid var(--line-bright); background: rgba(255,255,255,.03); color: var(--muted); }
.oauth-button:hover { background: rgba(139,124,255,.08); color: var(--text); }
.auth-footnote { margin: 14px 0 0; color: var(--quiet); text-align: center; font-size: 9px; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 10; padding: 10px 14px; border: 1px solid var(--line-bright); border-radius: 8px; background: #18213a; color: var(--text); font-size: 11px; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 1080px) { .app-shell { padding: 24px; }.workspace { grid-template-columns: 190px minmax(0, 1fr); }.context-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.4fr 1.2fr; gap: 20px; align-items: start; }.context-heading { padding-bottom: 0; }.history-block { margin-top: 0; }.usage-card { margin-top: 0; padding-top: 0; border-top: 0; } }
@media (max-width: 720px) { .app-shell { padding: 18px 14px; }.topbar { padding-bottom: 18px; }.status-pill { display: none; }.account-button { max-width: 150px; padding: 8px 9px; font-size: 9px; }.workspace { display: flex; flex-direction: column; min-height: 0; gap: 12px; }.mode-rail { order: 1; padding: 14px; }.rail-heading { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 12px; }.rail-heading h1 { margin: 0; font-size: 14px; }.mode-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }.mode-item { display: flex; flex-direction: column; justify-content: center; gap: 5px; min-height: 73px; padding: 7px 3px; text-align: center; }.mode-item b { font-size: 10px; }.mode-item small, .mode-arrow, .rail-tip { display: none; }.mode-icon { width: 26px; height: 26px; }.composer-panel { order: 2; padding: 23px 15px 16px; min-height: 610px; }.panel-header { display: block; }.shortcut { display: none; }.panel-header p { line-height: 1.7; }.conversation { min-height: 245px; margin: 20px 0 17px; }.context-panel { order: 3; display: block; padding: 17px 14px; }.context-heading { padding-bottom: 13px; }.history-block { margin-top: 18px; }.history-list { max-height: 150px; }.usage-card { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }.footer { padding-top: 14px; font-size: 7px; } }
