:root{--ui-font:system-ui,-apple-system,"PingFang SC","Microsoft YaHei UI","Noto Sans CJK SC",sans-serif;--ink:#392e29;--green:#ff3f11;--gold:#f58962;--muted:#827772;--line:#eee4de;--bg:#fffaf7}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.65 var(--ui-font)}button,input,textarea{font:inherit}button,a{ -webkit-tap-highlight-color:transparent}button{cursor:pointer;border:0}a{color:inherit;text-decoration:none}.review{min-height:34px;background:#fff0e8;display:flex;align-items:center;justify-content:center;gap:24px;font-size:11px;color:#99543c;padding:5px 20px}.review button{background:none;text-decoration:underline;color:inherit}header{height:98px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 6vw}.brand{display:flex;align-items:center;gap:12px;font-weight:650;letter-spacing:1px}.brand>b{background:var(--green);color:#fff;width:43px;height:43px;text-align:center;font:700 30px var(--ui-font);padding:4px}.brand>b span{font:17px system-ui;color:#d8c68d}small{display:block;font-size:12px;letter-spacing:0;color:var(--muted)}nav{display:flex;align-items:center;gap:32px;color:#756761;font-size:15px;font-weight:600}nav a.active{color:var(--green);font-weight:650}.badge,.tag{background:#fff0e9;color:#a33e1e;padding:5px 12px;border-radius:20px;font-size:13px;font-weight:600;white-space:nowrap}main{max-width:1250px;margin:auto;padding:50px 34px}h1{font-size:44px;font-weight:750;line-height:1.25;letter-spacing:-.025em;margin:18px 0}h2{font-size:26px;font-weight:700;line-height:1.3;margin:0 0 12px}h3{font-size:18px;font-weight:650;line-height:1.4;margin:0 0 9px}p{margin:0 0 18px}.muted{color:var(--muted);font-size:14px}.eyebrow{font-size:12px;font-weight:650;letter-spacing:.12em;color:#aa593a}.hero{display:grid;grid-template-columns:1.2fr .85fr;gap:80px;align-items:center;padding:15px 20px}.hero-copy{padding:10px 0}.hero h1 em{font-style:normal;color:#ff3f11}.hero p{max-width:450px;color:#8a766a}.features{display:flex;gap:24px;margin-top:38px;padding-top:25px;border-top:1px solid var(--line)}.features div{font-size:14px;flex:1}.features b{display:block;color:#d04d25;font-size:23px;font-weight:750;font-variant-numeric:tabular-nums;margin-bottom:8px}.orbit{height:120px;margin-top:36px;position:relative;overflow:hidden;color:#efd4c5}.orbit:before{content:"";position:absolute;width:350px;height:200px;left:50px;top:20px;border:1px solid #f2d8c9;border-radius:50%;transform:rotate(-20deg)}.orbit:after{content:"EMILY / YOUR NEXT MARKET";position:absolute;top:55px;left:20px;letter-spacing:4px;font-size:10px}.card{background:white;border:1px solid var(--line);border-radius:14px;padding:32px;box-shadow:0 12px 35px #a6441406}.login-card{padding:38px}.card-top{display:flex;gap:10px;align-items:center;margin-bottom:25px}.square{background:#fff0e8;padding:10px;border-radius:10px;color:var(--green)}label{display:block;font-size:15px;font-weight:600;margin:18px 0 6px}input,textarea{width:100%;min-width:0;border:1px solid #eaded6;border-radius:7px;padding:12px;background:#fff;outline:none;color:var(--ink);font-weight:400}input:focus,textarea:focus{border-color:#ff734b;box-shadow:0 0 0 3px #fff0e8}.code{display:flex;gap:9px}.code button{white-space:nowrap;padding:0 13px;background:#fff0e8;color:#a94020;border-radius:6px;font-size:14px;font-weight:600}.primary{background:var(--green);color:white;border-radius:7px;padding:12px 22px;font-size:16px;font-weight:650}.login-card .primary{width:100%;margin:18px 0}.check{display:flex;align-items:flex-start;gap:8px;color:#88786e;font-weight:400;font-size:11px}.check input{width:14px;margin-top:4px}.note{padding:13px;background:#fff8f0;border:1px dashed #f1dfcc;border-radius:7px;font-size:11px;color:#99785e;margin-top:18px}.error{color:#b04a3f;font-size:14px;min-height:22px}.section-head{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:20px}.section-head p{margin:0}.ghost{background:#fff;border:1px solid var(--line);border-radius:7px;padding:9px 14px;color:var(--ink);font-size:14px;font-weight:600;white-space:nowrap}.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin:28px 0}.stat{padding:20px 24px;background:#fff;border:1px solid var(--line);border-radius:10px}.stat b{display:block;font-size:34px;font-weight:750;line-height:1.3;font-variant-numeric:tabular-nums}.stat span{font-size:14px;color:var(--muted)}.toolbar{display:flex;gap:12px;margin-bottom:24px}.toolbar input{max-width:340px}table{border-collapse:collapse;width:100%;font-size:14px;font-variant-numeric:tabular-nums}th{text-align:left;color:#756761;font-weight:650;background:#fff8f3}td,th{padding:18px 14px;border-bottom:1px solid var(--line)}td button{background:none;color:#be4b27}.table-wrap{overflow:auto}.pill{font-size:13px;background:#fff0e8;padding:4px 9px;border-radius:14px;white-space:nowrap}.pill.off{background:#f7eee9;color:#a07561}.chat-layout{display:grid;grid-template-columns:230px 1fr;gap:30px;min-height:620px}.side{border-right:1px solid var(--line);padding-right:24px}.side .primary{width:100%;margin-bottom:30px}.side h3{font-size:16px;color:#76635b;letter-spacing:.03em}.side button.topic{display:block;background:none;text-align:left;color:#785b4c;padding:12px 0;font-size:17px;font-weight:550}.quota{margin-top:80px;padding:18px;background:#fff0e5;border-radius:9px;font-size:14px;font-variant-numeric:tabular-nums}.bar{height:4px;background:#f2d3bf;margin:12px 0;border-radius:5px;overflow:hidden}.bar i{display:block;background:#ff734b;height:4px}.chat-main{display:flex;flex-direction:column;min-width:0}.chat-title{display:flex;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line);padding-bottom:19px}
.chat-title .badge{align-self:center;white-space:nowrap}.welcome{text-align:center;margin:55px 0 26px}.welcome .square{display:inline-block;font-size:25px;margin-bottom:15px}.welcome h2{font-size:30px}.prompts{display:grid;grid-template-columns:1fr 1fr;gap:12px;max-width:650px;margin:0 auto 40px}.prompt{background:#fff;border:1px solid var(--line);border-radius:10px;text-align:left;padding:20px;color:var(--ink)}.prompt small{font-size:13px;margin-top:5px}.messages {
  flex: 1;
  max-height: clamp(320px, 53vh, 580px);
  overflow: auto;
  padding: 16px 8px 14px 0;
}
.message {
  width: fit-content;
  max-width: min(96%, 49rem);
  margin: 0 auto 12px 0;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px;
  background: #fff;
  font-size: 16px;
  line-height: 1.7;
}
.message.user {
  max-width: min(84%, 38rem);
  margin-left: auto;
  margin-right: 0;
  border-color: #f3dace;
  border-radius: 14px 4px 14px 14px;
  background: #ffede2;
}
.message-author {
  margin-bottom: 4px;
  font-size: 13px;
  letter-spacing: 0;
}
.message-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 4px; }
.message-head .message-author { margin: 0; }
.copy-reply {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #fff0e9;
  color: #a33e1e;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.copy-reply:hover { background: #ffe4d7; }
.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.assistant .message-text > :first-child { margin-top: 0; }
.assistant .message-text > :last-child { margin-bottom: 0; }
.assistant .message-text p { margin: 0 0 12px; }
.assistant .message-text h3 { margin: 19px 0 7px; color: #783722; font-size: 18px; }
.assistant .message-text strong { color: #502c21; font-weight: 700; }
.assistant .message-text a { color: #93401f; text-decoration: underline; text-underline-offset: 3px; }
.reply-table { max-width: 100%; overflow-x: auto; border: 1px solid #efdfd4; border-radius: 9px; margin: 8px 0 14px; }
.reply-table table { width: 100%; min-width: 490px; border-collapse: collapse; white-space: normal; font-size: 14px; }
.reply-table th, .reply-table td { padding: 9px 12px; border-bottom: 1px solid #efdfd4; vertical-align: top; text-align: left; }
.reply-table th { background: #fff2e8; color: #783722; }
.reply-table tbody tr:last-child td { border-bottom: 0; }
.reply-table tbody tr:nth-child(even) { background: #fffbf8; }
.country-table tr > :nth-child(-n+2) { white-space: nowrap; }
.thinking-card { width: fit-content; max-width: 100%; margin: 0 0 12px; padding: 12px 15px; border: 1px solid #f2e0d2; border-radius: 4px 14px 14px; background: #fff8f2; }
.thinking-card p { margin: 5px 0 0 22px; color: #786c65; font-size: 13px; }
.analysis-status { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 13px; }
.analysis-status span:last-child { color: #786c65; font-variant-numeric: tabular-nums; }
.analysis-status.is-thinking { color: #a34424; }
.analysis-status.is-complete { color: #35624a; margin: 4px 0 11px; }
.analysis-indicator { display: inline-grid; place-items: center; width: 15px; height: 15px; }
.thinking-card .analysis-indicator { border: 2px solid #f2c4ac; border-top-color: #ad4725; border-radius: 50%; animation: thinking-spin 800ms linear infinite; }
@keyframes thinking-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .thinking-card .analysis-indicator { animation: none; } }
.clarification { margin-top: 12px; padding: 13px; border: 1px solid #efdfd4; border-radius: 9px; background: #fff8f2; }
.clarification fieldset { min-width: 0; padding: 0; margin: 0 0 12px; border: 0; }
.clarification legend { margin-bottom: 5px; color: #783722; font-weight: 700; }
.clarify-option { display: flex; align-items: center; gap: 9px; min-height: 34px; cursor: pointer; }
.clarify-option input { width: auto; margin: 0; accent-color: #b34a27; }
.clarification .primary { width: 100%; }
.clarify-history { margin: 6px 0 0; color: #783722; }
.compose{margin-top:auto;background:#fff;border:1px solid #eed9cb;border-radius:12px;padding:12px}.compose textarea{border:0;resize:none;box-shadow:none;padding:7px;min-height:80px}.compose-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px;color:#786c65}
.compose-footer .primary{font-size:16px;white-space:nowrap}.footer{text-align:center;font-size:12px;color:var(--muted);margin-top:35px;letter-spacing:1px}dialog{border:1px solid var(--line);border-radius:15px;width:470px;padding:30px;color:var(--ink)}dialog::backdrop{background:#49261166}dialog .primary{width:100%;margin-top:24px}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#9d391e;color:white;border-radius:8px;padding:10px 22px;font-size:14px;display:none;z-index:5}@media(max-width:800px){header{padding:0 20px;height:85px}.badge{display:none}nav{gap:14px;font-size:14px}.brand{font-size:13px}.brand small{font-size:7px}main{padding:28px 18px}.hero{grid-template-columns:1fr;gap:24px;padding:0}.hero h1{font-size:34px}.orbit{display:none}.features{margin-top:20px}.hero-copy{padding:0 10px}.login-card{padding:26px}.stats{grid-template-columns:1fr 1fr}.chat-layout{grid-template-columns:1fr}.side{display:none}.review{font-size:9px;gap:10px}.review span:nth-child(2){max-width:170px}.prompts{gap:10px}.prompt{padding:15px}.section-head{align-items:flex-start}.section-head .primary{font-size:14px;padding:10px;white-space:nowrap}.card{padding:20px}.welcome{margin-top:30px}}

/* Emily supplied brand asset and signature orange */
.brand-logo{position:relative;display:block;width:215px;height:44px;overflow:hidden}.brand-logo img{position:absolute;width:272px;height:88px;max-width:none;left:-13px;top:-30px;mix-blend-mode:multiply}.primary:hover{background:#e7350c}.primary:focus-visible,a:focus-visible,button:focus-visible{outline:3px solid #ffae91;outline-offset:3px}@media(max-width:800px){.brand-logo{width:172px;height:36px}.brand-logo img{width:218px;height:70.5px;left:-10px;top:-24px}header{gap:12px;padding:0 16px}nav{gap:12px}}@media(max-width:540px){header{flex-wrap:wrap;height:auto;min-height:95px;padding-top:10px;padding-bottom:10px}nav{order:1;width:100%;justify-content:space-between}.hero h1{font-size:30px}}

.brand-logo img{height:auto;mix-blend-mode:normal;top:-29px}@media(max-width:800px){.brand-logo img{height:auto;top:-23px}}

[hidden] { display: none !important; }
button:disabled { opacity: .55; cursor: not-allowed; }
.admin-login { max-width: 470px; margin: 40px auto; }
.chat-title h1 {
  margin: 0 0 7px;
  font-size: clamp(24px, 2.6vw, 36px);
}
.chat-title .muted { font-size: 15px; }
.chat-note { margin: 12px 0; text-align: center; font-size: 13px; }
.admin-title { margin: 8px 0; font-size: clamp(28px, 2.5vw, 36px); }
.admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
#memberRoleValue { display: block; width: 100%; margin: 5px 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font: inherit; }
#memberRole small { color: var(--muted); font-size: 13px; }
.compose-footer { flex-wrap: wrap; }
.compose-footer > span { flex: 1 1 175px; }
.compose-actions { display: flex; align-items: stretch; gap: 8px; margin-left: auto; }
.voice-input { display: inline-flex; align-items: center; gap: 6px; }
.voice-input[aria-pressed="true"] { background: #fff0e9; color: #a33e1e; border-color: #ffae91; }
.table-hint { margin: 20px 0 0; font-size: 13px; }

.login-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #fff5ee;
}
.login-methods button {
  border-radius: 7px;
  padding: 8px;
  color: #785b4c;
  background: transparent;
  font-weight: 600;
}
.login-methods button[aria-pressed="true"] {
  color: #a33e1e;
  background: #fff;
  box-shadow: 0 1px 4px #9d391e22;
}
.login-card .login-reset-hint { margin: 16px 0 0; font-size: 14px; }
.login-card a.primary { display: block; text-align: center; }
#setupStudentPassword { margin-top: 0; }
.login-reset {
  min-height: 44px;
  padding: 0;
  margin-top: -8px;
  color: #a33e1e;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
}
.login-reset:hover { text-decoration: underline; }

@media (max-width: 540px) {
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px; }
  .stat b { font-size: 30px; }
  .welcome h2 { font-size: 25px; }
}
