/* ZawstyAI: the logo's colors (deep teal night, glowing orange orb, teal wave), laid out like modern AI chat apps */
:root {
  --bg: #f6f8f8; --panel: #ffffff; --side: #eef3f3; --ink: #10272c; --muted: #5b7076; --line: #dde6e7; --field: #c3d2d4;
  --accent: #d97a14; --accent-ink: #fff; --me: #fbe7cc; --hover: rgba(16, 39, 44, .06); --err: #b91c1c; --wave: #1f7480;
  --shadow: 0 10px 30px rgba(16, 39, 44, .12);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1d22; --panel: #10282e; --side: #08171b; --ink: #e9f1f1; --muted: #93aeb2; --line: #1d3a41; --field: #2a4a52;
          --accent: #f2a03d; --accent-ink: #1a1206; --me: #33260f; --hover: rgba(233, 241, 241, .06); --err: #f87171; --wave: #7fd3d3;
          --shadow: 0 10px 30px rgba(0, 0, 0, .45); }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.err { color: var(--err); min-height: 1.2em; }
a { color: var(--accent); }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--accent); color: var(--accent-ink); border-radius: 12px; padding: 11px 18px; font-weight: 600; }
.primary.wide, .wide { width: 100%; }
.ghost { border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; color: var(--ink); }
.ghost:hover { background: var(--hover); }
.ghost.small { padding: 3px 10px; font-size: 13px; }
.danger { color: var(--err) !important; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 18px; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.small { width: 26px; height: 26px; font-size: 15px; }
input, textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--field);
  border-radius: 12px; padding: 11px 13px; margin: 4px 0 14px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
label { display: block; font-size: 14px; color: var(--muted); }
label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); margin: 6px 0 16px; }
label.check input { width: auto; margin: 4px 0 0; }
.logo-lg { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 0 40px rgba(242, 160, 61, .28); }
.tag { font-size: 18px; color: var(--wave); margin: 2px 0 18px; font-weight: 500; }
.fine { font-size: 12px; color: var(--muted); text-align: center; margin: 8px 0 0; }

/* sign in */
.auth { min-height: 100%; display: grid; place-items: center; padding: 28px 16px;
  background: radial-gradient(ellipse at top, rgba(242, 160, 61, .12), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 30px 26px;
  box-shadow: var(--shadow); text-align: left; }
.auth-card h1 { margin: 14px 0 0; font-size: 28px; letter-spacing: -.3px; }
.tabs { display: flex; gap: 6px; margin: 4px 0 18px; background: var(--bg); border-radius: 12px; padding: 4px; }
.tabs button { flex: 1; padding: 9px; border-radius: 9px; color: var(--muted); }
.tabs button.on { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }

/* layout */
.app { display: flex; height: 100%; height: 100dvh; }
.side { width: 272px; flex: none; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 10px; gap: 8px; transition: margin .2s; }
body.side-closed .side { margin-left: -272px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.new-chat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); font-weight: 600; }
.new-chat:hover { border-color: var(--accent); }
.search { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: 14px; background: var(--panel); border-color: var(--line); }
.side-scroll { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.sec { margin: 10px 0 4px; }
.sec-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 8px; }
.list { list-style: none; margin: 2px 0; padding: 0; }
.item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.item .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item:hover, .item.on { background: var(--hover); }
.item.on { font-weight: 600; }
.item.nested { padding-left: 34px; }
.item .x { color: var(--muted); padding: 0 4px; visibility: hidden; font-size: 12px; }
.item:hover .x, .item.on .x { visibility: visible; }
.item .fi { width: 18px; text-align: center; }
.empty-note { color: var(--muted); font-size: 13px; padding: 6px 10px; list-style: none; }
.side-foot { position: relative; border-top: 1px solid var(--line); padding-top: 8px; }
.me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 12px; text-align: left; }
.me:hover { background: var(--hover); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.dots { color: var(--muted); }
.menu { position: absolute; bottom: 54px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; z-index: 20; }
.menu button, .menu a { text-align: left; padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 15px; }
.menu button:hover, .menu a:hover { background: var(--hover); }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 4; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 54px; }
#open { display: none; }
body.side-closed #open { display: inline-grid; }
.title { font-weight: 600; font-size: 16px; padding: 6px 10px; border-radius: 10px; max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title:hover { background: var(--hover); }
.chip { font-size: 13px; background: var(--hover); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }

/* chat */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.msgs { flex: 1; overflow-y: auto; padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 22px; }
.welcome { margin: auto; text-align: center; max-width: 640px; padding: 20px 0; }
.welcome h1 { font-size: 32px; margin: 16px 0 2px; letter-spacing: -.5px; }
.sugs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; text-align: left; }
.sug { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-weight: 600; font-size: 14px; background: var(--panel); text-align: left; }
.sug small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.sug:hover { border-color: var(--accent); }
.msg { display: flex; gap: 12px; max-width: 760px; width: 100%; margin: 0 auto; }
.msg .av { width: 30px; height: 30px; border-radius: 9px; flex: none; margin-top: 2px; }
.msg .body { flex: 1; min-width: 0; }
.msg.user { justify-content: flex-end; }
.msg.user .body { display: flex; flex-direction: column; align-items: flex-end; }
.msg.user .bubble { background: var(--me); padding: 10px 15px; border-radius: 20px 20px 6px 20px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 6px; }
.thumbs img { max-width: 180px; max-height: 180px; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; }
.md { overflow-wrap: anywhere; }
.md p { margin: 0 0 10px; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 4px 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md h4 { margin: 12px 0 6px; }
.md code { background: var(--hover); border-radius: 6px; padding: 1px 5px; font-size: 14px; }
.md pre { background: var(--side); border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.saved { color: var(--accent); font-size: 13px; margin-top: 8px; }
.how { font-size: 13px; color: var(--muted); margin-top: 8px; }
.how summary { cursor: pointer; }
.how a { display: block; overflow-wrap: anywhere; margin: 2px 0; }
.how .step { margin: 4px 0; white-space: pre-wrap; }
.acts { display: flex; gap: 6px; margin-top: 8px; opacity: .6; flex-wrap: wrap; }
.acts .on { border-color: var(--accent); color: var(--accent); opacity: 1; }
.reasoning { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--side);
  font-size: 13px; color: var(--muted); }
.reasoning .step { margin: 3px 0; white-space: pre-wrap; }
.reasoning a { display: block; overflow-wrap: anywhere; margin: 2px 0; }
.msg:hover .acts { opacity: 1; }
.typing { display: inline-flex; gap: 5px; padding: 10px 0; }
.typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; opacity: .7; } }
.composer { padding: 0 16px 10px; max-width: 792px; width: 100%; margin: 0 auto; }
.composer .box { display: flex; align-items: flex-end; gap: 6px; background: var(--panel); border: 1px solid var(--field); border-radius: 24px;
  padding: 7px 7px 7px 8px; box-shadow: var(--shadow); }
.composer .box:focus-within { border-color: var(--accent); }
.composer textarea { border: 0; margin: 0; padding: 8px 4px; resize: none; max-height: 200px; background: transparent; }
.composer textarea:focus { outline: none; }
.send { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 19px; font-weight: 700; flex: none; }
.pics { display: flex; gap: 8px; padding: 0 6px 8px; flex-wrap: wrap; }
.pic { position: relative; }
.pic img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.pic .x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 11px; }
.drop { position: absolute; inset: 10px; border: 2px dashed var(--accent); border-radius: 20px; display: grid; place-items: center;
  background: rgba(242, 160, 61, .1); font-weight: 600; font-size: 18px; pointer-events: none; z-index: 3; }

/* project page */
.project { flex: 1; overflow-y: auto; padding: 12px 16px 40px; }
.project-in { max-width: 900px; margin: 0 auto; }
.project-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.project-top h1 { margin: 0; font-size: 28px; flex: 1; min-width: 0; }
.project-top .folder { font-size: 30px; }   /* the project page's big folder icon only, not the sidebar item */
.project-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; margin-top: 16px; }
.cards { display: flex; flex-direction: column; gap: 8px; }
.card { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column;
  gap: 4px; cursor: pointer; list-style: none; }
.card.row { flex-direction: row; align-items: center; cursor: default; }
.card:hover { border-color: var(--accent); }
.card.new { border-style: dashed; }
.card .clip { color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.card .ghost { align-self: flex-start; }

/* sheets */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: grid; place-items: center; padding: 16px; z-index: 30; }
.sheet { background: var(--panel); border-radius: 20px; padding: 24px; width: 100%; max-width: 540px; max-height: 88vh; overflow: auto;
  position: relative; box-shadow: var(--shadow); }
.sheet h2 { margin: 0 0 6px; }
.sheet .close { position: absolute; top: 12px; right: 12px; }
.sheet .primary, .sheet .ghost { margin-top: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.toast { position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px;
  border-radius: 999px; font-size: 14px; z-index: 40; }

@media (max-width: 820px) {
  .side { position: fixed; inset: 0 auto 0 0; z-index: 5; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); margin-left: 0 !important; }
  .side.open { transform: none; }
  #open { display: inline-grid; }
  .msgs { padding: 8px 12px 20px; }
  .msg .av { width: 26px; height: 26px; }
  .sugs { grid-template-columns: 1fr; }
  .welcome h1 { font-size: 26px; }
  .project-cols { grid-template-columns: 1fr; }
  .composer { padding: 0 10px 8px; }
}

/* terms page */
body.doc { height: auto; }
.terms { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }
.terms h1 { margin-top: 32px; }
.terms h2 { margin-top: 28px; font-size: 19px; }
.callout { background: var(--me); border-radius: 12px; padding: 14px 16px; }
