:root { color-scheme: light; --ink:#172e28; --muted:#516960; --line:#d8e4dd; --green:#135748; --paper:#f8fbf8; font:16px/1.55 system-ui,sans-serif; }
* { box-sizing:border-box; }
body { margin:0; height:100dvh; display:grid; grid-template-columns:256px minmax(0,1fr); background:var(--paper); color:var(--ink); }
button, textarea, select { font:inherit; }
button { cursor:pointer; }
button:focus-visible, select:focus-visible, textarea:focus-visible { outline:2px solid #529e88; outline-offset:3px; }
button:disabled { cursor:wait; opacity:.65; }
[hidden] { display:none !important; }
.rail { background:#102f29; color:#f1faf4; display:flex; flex-direction:column; padding:26px 18px 20px; min-height:0; }
.brand { display:flex; align-items:center; gap:12px; font-size:1.12rem; font-weight:700; margin:0 4px 30px; }
.brand small { display:block; font-size:.875rem; color:#b6d2c5; font-weight:400; }
.brand-mark,.seal { display:grid; place-items:center; font-family:Georgia,serif; }
.brand-mark { width:44px; height:44px; color:#143c32; background:#bfe4cc; border-radius:12px; font-size:1.65rem; }
.new { color:#fff; background:#21594b; border:1px solid #4e786c; border-radius:10px; padding:10px; text-align:start; }
.new span { margin-inline-end:7px; }
.history-title { display:flex; justify-content:space-between; align-items:center; color:#b6d2c5; font-size:.9rem; margin:30px 4px 8px; }
.bare { background:none; border:0; color:inherit; padding:4px 6px; border-radius:6px; }
.bare:hover { background:#8ab39c36; }
#history { overflow:auto; flex:1; }
.history-item { color:inherit; text-align:start; display:block; width:100%; padding:8px 10px; border:0; background:none; border-radius:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.92rem; }
.history-item:hover,.history-item[aria-current="true"] { background:#2b5348; }
.rail-footer { border-top:1px solid #426257; margin-top:14px; padding:14px 4px 0; display:grid; color:#cae0d5; font-size:.875rem; }
.workspace { min-width:0; min-height:0; display:grid; grid-template-rows:auto minmax(0,1fr) auto; }
.top { display:flex; align-items:center; justify-content:space-between; padding:14px clamp(16px,4vw,52px); border-bottom:1px solid var(--line); background:#fff; gap:12px; }
.desk-label { font-weight:650; }
.language { color:var(--muted); display:flex; gap:8px; align-items:center; font-size:.875rem; }
select { color:var(--ink); border:1px solid var(--line); border-radius:8px; padding:5px 8px; background:var(--paper); }
.menu { display:none; }
.scroll { overflow:auto; min-height:0; padding:24px 18px; }
.welcome { max-width:690px; margin:clamp(14px,8vh,105px) auto 0; text-align:center; }
.seal { margin:auto; width:70px; height:70px; border:1px solid #b5d3c6; color:var(--green); background:#e3f2e8; border-radius:20px; font-size:2.45rem; }
h1 { font-family:Georgia,serif; font-size:clamp(2rem,5vw,3.45rem); font-weight:500; line-height:1.07; margin:20px 0 12px; letter-spacing:-.035em; }
.welcome p { color:var(--muted); margin:0 auto; max-width:450px; }
.examples { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:26px auto 0; max-width:460px; }
.examples button,.source { border:1px solid var(--line); border-radius:12px; padding:12px 14px; text-align:start; background:#fff; color:var(--ink); }
.examples button:hover,.source:hover { background:#edf7ef; border-color:#a0c2af; }
.examples small,.source small { display:block; color:var(--muted); font-size:.875rem; }
.examples span { display:block; font-size:1.12rem; margin-top:4px; }
.thread { max-width:760px; margin:auto; display:grid; gap:23px; }
.turn { min-width:0; }
.prompt { background:#dceee4; border-radius:16px 16px 4px 16px; padding:11px 16px; max-width:min(86%,600px); width:fit-content; margin-inline-start:auto; overflow-wrap:anywhere; white-space:pre-wrap; }
.answer { white-space:pre-wrap; overflow-wrap:anywhere; margin:6px 0 10px; }
.response { margin-top:13px; }
.response h2 { font-size:.92rem; color:var(--green); margin:0; }
.response .problem { color:#912d2d; }
.sources { display:grid; gap:8px; margin:12px 0 0; }
.source { font:inherit; width:100%; overflow-wrap:anywhere; }
.source span { display:block; margin-top:4px; }
.composer-area { padding:8px 18px 12px; background:var(--paper); }
.composer { max-width:760px; margin:auto; background:#fff; border:1px solid #b9d3c6; border-radius:16px; box-shadow:0 6px 24px #17392b12; padding:10px; }
textarea { width:100%; resize:vertical; max-height:24vh; display:block; color:var(--ink); border:0; background:transparent; padding:5px 8px; }
.composer-controls { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top:5px; }
.modes { display:flex; gap:2px; background:#eff5ef; padding:3px; border-radius:8px; }
.modes button { border:0; background:none; color:var(--muted); border-radius:6px; padding:4px 8px; font-size:.875rem; }
.modes button[aria-pressed=true] { background:white; color:var(--green); box-shadow:0 1px 4px #17392b25; }
.send { background:var(--green); color:#fff; border:0; border-radius:8px; padding:6px 16px; font-weight:600; }
.send:hover { background:#0d4539; }
.notice { max-width:760px; margin:7px auto 0; color:var(--muted); text-align:center; font-size:.875rem; }
dialog { max-width:min(760px,calc(100% - 24px)); width:100%; max-height:86dvh; overflow:auto; border:1px solid var(--line); border-radius:14px; color:var(--ink); background:#fff; padding:0; }
dialog::backdrop { background:#102f29a0; }
dialog header { background:#f1f8f3; border-bottom:1px solid var(--line); padding:14px 19px; display:flex; justify-content:space-between; gap:12px; align-items:start; }
dialog h2,dialog p { margin:0; }
dialog h2 { font-size:1.12rem; }
dialog header p { color:var(--muted); }
.page { padding:20px; white-space:pre-wrap; line-height:1.95; font-size:1.24rem; overflow-wrap:anywhere; }
@media(max-width:700px) {
  body { display:block; }
  .workspace { height:100dvh; }
  .rail { display:none; position:fixed; z-index:2; top:55px; bottom:0; width:min(300px,88vw); box-shadow:0 0 0 100vmax #102f2940; }
  .rail.open { display:flex; }
  .menu { display:block; font-size:.875rem; }
  .desk-label,.desktop-break { display:none; }
  .top { padding:10px 12px; }
  .examples { margin-top:18px; }
}

.rail-footer a { color:inherit; }
