
:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --panel: #121720;
  --panel-raised: #171e29;
  --line: #252e3b;
  --accent: #91dce5;
  --accent-dim: #477e89;
  --text: #f1f4f8;
  --muted: #8995a5;
  --danger: #ef929b;
  --radius: 17px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -35%, #203449 0, transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.6 Inter, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  transition: background .2s, border-color .2s, transform .2s;
}

button:active {
  transform: scale(.98);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.shell {
  width: 100%;
  max-width: 1440px;
  margin: auto;
  padding: env(safe-area-inset-top) 36px env(safe-area-inset-bottom);
}

/* HEADER */

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ffffff0d;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: inherit;
}

.orb {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #243c4b, #121e2a);
  border: 1px solid #91dce53a;
  box-shadow: 0 5px 20px #0004;
}

.orb span {
  width: 17px;
  height: 17px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px #91dce54a;
}

.brand strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .19em;
}

.brand small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: .16em;
  margin-top: 1px;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid #ffffff14;
  border-radius: 30px;
  background: #ffffff06;
  color: #bdc8d5;
  font-size: 9px;
  letter-spacing: .12em;
}

.status i,
.chat-indicator,
.empty-indicator,
.security-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #72d6a8;
  display: inline-block;
}

/* WELCOME */

main {
  padding: 45px 0 35px;
}

.welcome {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  margin-bottom: 29px;
  padding: 25px 30px;
  border: 1px solid #ffffff10;
  border-radius: 21px;
  background:
    radial-gradient(ellipse at 90% 40%, #31536545, transparent 38%),
    linear-gradient(110deg, #171f2b, #111925 65%, #152430);
  box-shadow: 0 15px 45px #0002;
}

.welcome-copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .18em;
  margin: 0 0 10px;
}

.welcome h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 43px);
  line-height: 1.15;
  letter-spacing: -.045em;
  font-weight: 650;
  color: #f3f6fa;
}

.sub {
  margin: 11px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.welcome-mark {
  width: 145px;
  height: 145px;
  position: relative;
  display: grid;
  place-items: center;
  margin-right: 25px;
  flex-shrink: 0;
  opacity: .9;
}

.welcome-ring {
  position: absolute;
  border: 1px solid #8edce52d;
  border-radius: 50%;
}

.ring-one {
  width: 140px;
  height: 140px;
}

.ring-two {
  width: 105px;
  height: 105px;
  border-color: #8edce54d;
}

.welcome-core {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  background: linear-gradient(145deg, #33596b, #192e3d);
  border: 1px solid #9be3eb65;
  color: #b3edf2;
  font-size: 25px;
  font-weight: 750;
  box-shadow: 0 0 35px #64cad329;
}

/* MAIN WORKSPACE */

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.chat-panel,
.memory-panel,
.lower {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #151d29, #111721);
  box-shadow: 0 15px 40px #0003;
  overflow: hidden;
}

/* CHAT */

.chat-panel {
  min-width: 0;
}

.chat-head {
  min-height: 72px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #ffffff03;
}

.chat-heading {
  display: flex;
  align-items: center;
  gap: 11px;
}

.chat-heading strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.chat-heading small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

.chat-indicator {
  background: var(--accent);
  box-shadow: 0 0 10px #91dce54a;
}

.quiet {
  padding: 7px 10px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.quiet:hover {
  color: var(--accent);
  background: #ffffff08;
}

.messages {
  height: min(57vh, 600px);
  min-height: 320px;
  padding: 25px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: #3b4b5d transparent;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.avatar {
  flex: 0 0 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #233b49;
  border: 1px solid #ffffff17;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
}

.user .avatar {
  background: #30394a;
  color: #e7edf5;
}

.bubble {
  max-width: 88%;
  padding: 13px 16px;
  border: 1px solid #ffffff10;
  border-radius: 5px 15px 15px 15px;
  background: #1c2634;
  box-shadow: 0 5px 18px #0002;
}

.user .bubble {
  background: #253143;
  border-radius: 15px 5px 15px 15px;
}

.bubble b {
  display: block;
  color: var(--accent);
  font-size: 9px;
  letter-spacing: .15em;
}

.user .bubble b {
  color: #d4deeb;
}

.bubble p {
  margin: 5px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* MESSAGE INPUT */

.composer {
  margin: 0 17px 10px;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 9px;
  border: 1px solid #344354;
  border-radius: 15px;
  background: #0d131d;
  transition: border-color .2s, box-shadow .2s;
}

.composer:focus-within {
  border-color: #6eafb9;
  box-shadow: 0 0 0 3px #91dce510;
}

.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 130px;
  resize: none;
  padding: 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.composer textarea::placeholder,
.memory-form input::placeholder,
.memory-form textarea::placeholder {
  color: #778596;
}

.composer button {
  width: 41px;
  height: 41px;
  flex: 0 0 41px;
  border: 1px solid #ffffff12;
  border-radius: 11px;
  cursor: pointer;
}

.mic {
  background: #202c3b;
  color: #fff;
}

.mic:hover {
  background: #2c3b4c;
}

.send {
  border: 0;
  background: var(--accent);
  color: #101820;
  font-size: 23px;
  font-weight: 800;
}

.send:hover {
  background: #b0edf0;
}

.voice-status {
  padding: 0 20px 15px;
  color: var(--muted);
  font-size: 10px;
}

.chat-footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 19px;
  border-top: 1px solid #ffffff0c;
  color: #728093;
  font-size: 9px;
  letter-spacing: .08em;
}

/* SIDE PANELS */

.workspace-side {
  display: flex;
  flex-direction: column;
  gap: 17px;
  min-width: 0;
}

.memory-panel,
.lower {
  padding: 19px;
}

.side-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.side-icon {
  width: 39px;
  height: 39px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid #91dce52b;
  border-radius: 12px;
  background: #203541;
  color: var(--accent);
  font-size: 20px;
}

.approval-icon {
  background: #26352f;
  color: #a5d7ba;
  border-color: #a5d7ba2b;
}

.side-heading .eyebrow {
  font-size: 8px;
  margin: 0 0 3px;
}

.side-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.side-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 17px 0;
}

.memory-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid #344b59;
  border-radius: 10px;
  background: #1c2c38;
  color: #b0e1e8;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.memory-toggle:hover {
  border-color: var(--accent-dim);
  background: #243b49;
}

.button-arrow {
  font-size: 16px;
}

.memory-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.memory-heading h2 {
  margin: 0;
  font-size: 17px;
}

.memory-list {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.memory-card {
  padding: 14px;
  border: 1px solid #ffffff12;
  border-radius: 11px;
  background: #1a2431;
  overflow-wrap: anywhere;
}

.memory-card h3 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
}

.memory-card p {
  margin: 0;
  color: #c5ceda;
  font-size: 12px;
  white-space: pre-wrap;
}

.memory-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.memory-actions button,
.memory-cancel {
  padding: 7px 12px;
  border: 1px solid #39495a;
  border-radius: 8px;
  background: #202b39;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.memory-actions .memory-edit:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.memory-actions .memory-delete {
  color: var(--danger);
  border-color: #69414a;
  background: #2b2028;
}

.memory-actions .memory-delete:hover {
  background: #39242d;
}

.memory-form {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.memory-form h3 {
  margin: 0;
  font-size: 14px;
}

.memory-form input,
.memory-form textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid #303e4e;
  border-radius: 9px;
  background: #0d141e;
  color: var(--text);
  font: inherit;
  outline: 0;
}

.memory-form input:focus,
.memory-form textarea:focus {
  border-color: var(--accent);
}

.memory-form textarea {
  min-height: 70px;
  resize: vertical;
}

.memory-form .send {
  width: 100%;
  min-height: 42px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
}

.memory-form button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.memory-cancel {
  width: 100%;
}

/* APPROVAL */

.empty {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 19px;
  padding: 12px;
  border: 1px solid #ffffff0d;
  border-radius: 10px;
  background: #ffffff04;
  color: #b5c1cf;
  font-size: 11px;
}

.empty-indicator {
  background: #75d5a6;
  width: 6px;
  height: 6px;
}

.rule {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.rule p {
  margin: 0;
}

.rule b {
  display: block;
  color: #e3eaf2;
  margin-bottom: 3px;
}

.shield {
  color: #a5d7ba;
  font-size: 19px;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: #9eacba;
  font-size: 10px;
}

.security-dot {
  width: 6px;
  height: 6px;
  background: #8acfb1;
}

[hidden] {
  display: none !important;
}

/* FOOTER */

footer {
  display: flex;
  justify-content: space-between;
  padding: 18px 2px 25px;
  color: #758194;
  font-size: 9px;
  letter-spacing: .12em;
}

/* TABLET */

@media (max-width: 900px) {
  .shell {
    padding-left: 22px;
    padding-right: 22px;
  }

  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) 275px;
    gap: 14px;
  }

  .memory-panel,
  .lower {
    padding: 15px;
  }
}

/* MOBILE */

@media (max-width: 680px) {
  .shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    height: 69px;
  }

  main {
    padding: 23px 0;
  }

  .welcome {
    min-height: 150px;
    padding: 22px 19px;
    margin-bottom: 17px;
    border-radius: 17px;
  }

  .welcome h1 {
    font-size: clamp(27px, 7vw, 35px);
  }

  .welcome-mark {
    width: 85px;
    height: 85px;
    margin-right: -9px;
  }

  .ring-one {
    width: 85px;
    height: 85px;
  }

  .ring-two {
    width: 65px;
    height: 65px;
  }

  .welcome-core {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 19px;
  }

  .workspace-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .chat-panel,
  .workspace-side {
    width: 100%;
  }

  .messages {
    height: 48vh;
    min-height: 300px;
    padding: 17px;
  }

  .bubble {
    max-width: 91%;
  }

  .chat-head {
    padding: 13px 15px;
  }

  .workspace-side {
    gap: 13px;
  }

  .memory-panel,
  .lower {
    padding: 16px;
  }

  .chat-footer {
    font-size: 8px;
  }
}

@media (max-width: 380px) {
  .welcome-mark {
    opacity: .55;
    margin-right: -20px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand small {
    font-size: 8px;
  }

  .status {
    font-size: 8px;
    padding: 5px 8px;
  }
}
