/* ARGENTICA — quiet, elegant, light mode */

:root {
  --teal: #0f3b3a;
  --teal-soft: #1d5654;
  --rose: #5c2d3f;
  --ivory: #f7f3e9;
  --paper: #fffdf8;
  --line: #e5ddd0;
  --grey: #ddd0c8;
  --ink: #2b2b26;
  --ink-soft: #6b675e;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; color: var(--teal); }
a { color: var(--teal-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Shell ─────────────────────────────────────────── */

.arg-shell { display: flex; min-height: 100vh; }

.arg-side {
  width: 216px;
  flex-shrink: 0;
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.arg-side .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  padding: 0 6px;
}

.arg-side .brand img { width: 34px; height: 34px; object-fit: contain; }

.arg-side .brand .name {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.04em;
  color: var(--teal);
}

.arg-nav { display: flex; flex-direction: column; gap: 2px; }

.arg-nav .section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin: 14px 6px 4px;
}

.arg-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 13.5px;
}

.arg-nav a:hover { background: var(--ivory); text-decoration: none; }
.arg-nav a.active { background: var(--teal); color: #fff; }

.arg-main { flex: 1; min-width: 0; }

.arg-page { padding: 26px 30px 48px; max-width: 1180px; }

.arg-pagehead { margin-bottom: 22px; }
.arg-pagehead h1 { font-size: 25px; }
.arg-pagehead .sub { color: var(--ink-soft); margin-top: 3px; font-size: 13px; }

/* ── Cards ──────────────────────────────────────────── */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}

.card h3 {
  font-size: 15px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h3 .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grey); }
.card h3 .dot.on { background: #3d8b6e; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }

/* ── Forms ──────────────────────────────────────────── */

input[type="text"], input[type="password"], textarea, select {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  width: 100%;
}

textarea { resize: vertical; min-height: 52px; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(15, 59, 58, 0.18); border-color: var(--teal-soft); }

button, .btn {
  font-family: var(--sans);
  font-size: 13.5px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 9px 16px;
  cursor: pointer;
}

button:hover, .btn:hover { background: var(--teal-soft); }
button.ghost { background: transparent; color: var(--teal); border: 1px solid var(--line); }
button.ghost:hover { background: var(--ivory); }
button.rose { background: var(--rose); }
button.small { padding: 5px 11px; font-size: 12.5px; }
button:disabled { opacity: 0.5; cursor: default; }

/* ── Chips, badges, bits ────────────────────────────── */

.badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--ivory);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.badge.teal { background: rgba(15, 59, 58, 0.08); color: var(--teal); border-color: transparent; }
.badge.rose { background: rgba(92, 45, 63, 0.08); color: var(--rose); border-color: transparent; }
.badge.green { background: rgba(61, 139, 110, 0.1); color: #2c6e52; border-color: transparent; }

.muted { color: var(--ink-soft); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt { margin-top: 14px; }

.item-list { display: flex; flex-direction: column; }
.item-list .item {
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.item-list .item:last-child { border-bottom: none; }

/* ── Toast ──────────────────────────────────────────── */

#arg-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--teal);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  box-shadow: 0 6px 24px rgba(15, 59, 58, 0.25);
  display: none;
  z-index: 999;
  max-width: 80vw;
}

/* ── Chat ────────────────────────────────────────────── */

.chat-wrap { display: flex; gap: 16px; height: calc(100vh - 40px); }
.chat-left { width: 210px; flex-shrink: 0; display: flex; flex-direction: column; }
.chat-right { width: 270px; flex-shrink: 0; overflow-y: auto; }
.chat-centre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 1000px) { .chat-left, .chat-right { display: none; } }

.chat-scroll { flex: 1; overflow-y: auto; padding: 6px 4px 18px; }

.msg { max-width: 78%; margin-bottom: 14px; }
.msg.user { margin-left: auto; }
.msg .who { font-size: 11px; color: var(--ink-soft); margin-bottom: 3px; letter-spacing: 0.04em; }
.msg .bubble {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
.msg.user .bubble { background: rgba(15, 59, 58, 0.06); border-color: rgba(15, 59, 58, 0.14); }
.msg .bubble pre { background: var(--ivory); padding: 10px; border-radius: 6px; overflow-x: auto; font-size: 12.5px; margin: 8px 0; }
.msg .bubble code { font-size: 12.5px; background: var(--ivory); padding: 1px 4px; border-radius: 3px; }
.msg .bubble table { border-collapse: collapse; margin: 8px 0; }
.msg .bubble th, .msg .bubble td { border: 1px solid var(--line); padding: 5px 9px; font-size: 12.5px; text-align: left; }

.thinking {
  border-left: 3px solid var(--grey);
  padding: 4px 0 4px 12px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-style: italic;
}
.thinking details summary { cursor: pointer; font-style: normal; }

.chat-inputbar { display: flex; gap: 8px; align-items: stretch; padding-top: 12px; }
.osk-strip { display: flex; gap: 4px; align-items: stretch; }
.osk-strip button {
  min-width: 34px; padding: 0 8px; background: var(--paper);
  color: var(--teal); border: 1px solid var(--line); font-size: 15px;
}
.osk-strip button:hover { background: var(--ivory); }

.thread-item {
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thread-item:hover { background: var(--ivory); }
.thread-item.active { background: var(--teal); color: #fff; }

/* ── Home header ─────────────────────────────────────── */

.home-hero {
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  min-height: 220px;
  margin-bottom: 20px;
  background: var(--teal);
  display: flex;
  align-items: flex-end;
}

.home-hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-hero .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,59,58,0.15) 0%, rgba(15,59,58,0.72) 100%); }
.home-hero .inner { position: relative; padding: 22px 26px; width: 100%; color: #fff; }
.home-hero .greet { font-family: var(--serif); font-size: 27px; }
.home-hero .date { font-size: 13px; opacity: 0.85; margin-top: 2px; }
.home-hero .credit { position: absolute; right: 14px; bottom: 10px; font-size: 10.5px; color: rgba(255,255,255,0.75); }
.home-hero .logo { position: absolute; top: 16px; left: 20px; width: 44px; height: 44px; }

/* ── Viewer ──────────────────────────────────────────── */

.viewer-stage { position: relative; background: #55524a; border-radius: 8px; overflow: auto; max-height: calc(100vh - 210px); }
.viewer-stage canvas { display: block; margin: 0 auto; touch-action: none; }
