@charset "UTF-8";
.audit-command {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 500px;
  line-height: 1.6;
  padding-top: 8px;
  font-size: 12px;
  color: var(--ink);
}
.audit-command.is-collapsed .audit-command-preview::after { content: "…"; }
.audit-command-toggle { display: block; background: none; color: var(--green); font-size: 11px; padding: 5px 0 0; }
.audit-command-toggle:hover { text-decoration: underline; }
.audit-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.audit-filter { display: grid; gap: 7px; min-width: 110px; font-size: 12px; color: var(--muted); }
.audit-filter input, .audit-filter select { min-width: 0; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 13px; }
.audit-search { flex: 1; min-width: min(230px,100%); }
.audit-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 16px; font-size: 12px; }
.audit-pages { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.audit-pages [aria-current="page"], .audit-pages [aria-current="page"]:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
  --ink: #26352d;
  --muted: #778178;
  --line: #e1e6de;
  --green: #446b4e;
  --orange: #e5a44d;
  --paper: #fff;
  --nav: #202b25;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
a {
  color: inherit;
}
button {
  border: 0;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid #be8135;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -1px;
  font-weight: 600;
}
h2 {
  font-size: 20px;
  font-weight: 600;
}
p {
  line-height: 1.65;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 600;
  letter-spacing: -0.5px;
  font-size: 21px;
}
.brand small {
  font-weight: 400;
  font-size: 11px;
  color: #93a398;
  letter-spacing: 1px;
  display: block;
  margin-top: 4px;
}
.brand-mark {
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #243428;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  font-size: 26px;
  line-height: 1;
}
.shell {
  display: grid;
  grid-template-columns: 236px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--nav);
  color: #d5dfd6;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  margin: 0 6px 48px;
}
.sidebar-toggle, .picker-initial { display: none; }
@media (min-width: 701px) {
  .sidebar-toggle { display: grid; place-items: center; align-self: flex-end; flex-shrink: 0; width: 36px; height: 36px; padding: 8px; margin: -18px -8px 12px 0; border-radius: 7px; background: #354b3b; color: #eef3ea; }
  .sidebar-toggle:hover { background: #405b47; }
  .shell.sidebar-collapsed { grid-template-columns: 56px minmax(0,1fr); }
  .sidebar-collapsed .sidebar { padding: 12px 8px; }
  .sidebar-collapsed .sidebar-toggle { align-self: center; width: 40px; height: 40px; margin: 0 0 12px; }
  .sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
  .sidebar-collapsed .sidebar .brand,
  .sidebar-collapsed .sidebar .nav,
  .sidebar-collapsed .sidebar .sidebar-footer { display: none; }
  .sidebar-collapsed .session-picker-trigger { justify-content: center; gap: 5px; height: 40px; padding: 5px; }
  .sidebar-collapsed .picker-name, .sidebar-collapsed .picker-chevron { display: none; }
  .sidebar-collapsed .picker-initial { display: inline; font-size: 12px; }
  .sidebar-collapsed .session-options { right: auto; width: 230px; }
}
.nav-label {
  padding: 0 14px;
  margin-bottom: 12px;
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #819184;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nav a {
  text-decoration: none;
  border-radius: 8px;
  padding: 13px 15px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: #aab8ad;
}
.nav a:hover {
  background: #29382d;
  color: #fff;
}
.nav a.active {
  background: #344a39;
  color: #e4eddd;
}
.nav a.active:before {
  content: "";
  width: 3px;
  height: 16px;
  background: var(--orange);
  border-radius: 3px;
}
.nav a span {
  font-size: 18px;
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid #3a473c;
  padding: 22px 4px 0;
}
.identity {
  display: flex;
  gap: 11px;
  align-items: center;
  font-size: 13px;
  min-width: 0;
}
.identity strong {
  display: block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.identity small {
  display: block;
  color: #8f9e92;
  margin-top: 5px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #405143;
  color: #e4ecdf;
  font-size: 13px;
  flex-shrink: 0;
}
.logout {
  margin-top: 18px;
  color: #9eada1;
  background: none;
  padding: 0;
  font-size: 12px;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 83px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 42px;
}
.topbar .eyebrow {
  font-size: 10px;
  letter-spacing: 1.2px;
}
.topbar .date {
  font-size: 12px;
  color: var(--muted);
}
.content {
  padding: 38px 42px 48px;
  max-width: 1480px;
  margin: auto;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-head h1 {
  margin-bottom: 10px;
}
.page-head p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 0;
}
.btn {
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  background: #f0f3ed;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn.primary:hover {
  background: var(--primary-hover);
}
.btn.soft {
  background: #edf2e9;
  border-color: #edf2e9;
  color: #456a4b;
}
.btn.small {
  padding: 8px 12px;
  font-size: 12px;
}
.btn.danger {
  color: #a34a3d;
  border-color: #e8c9c3;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  color: #69766b;
  background: none;
  font-size: 19px;
}
.icon-btn:hover {
  background: #f0f3ed;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  margin-bottom: 30px;
  overflow: hidden;
}
.stat {
  padding: 23px 26px;
  border-right: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.stat:last-child {
  border: 0;
}
.stat label {
  font-size: 12px;
  color: var(--muted);
}
.stat strong {
  font-size: 27px;
  font-weight: 500;
  display: block;
  margin-top: 9px;
}
.stat-icon {
  font-size: 21px;
  color: #839b83;
  background: #f1f5ed;
  border-radius: 9px;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.section-head h2 {
  font-size: 15px;
  margin: 0;
}
.section-head small {
  font-size: 12px;
  color: var(--muted);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}
.session-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.session-card:hover {
  border-color: #b8c9b5;
  box-shadow: 0 5px 20px #26352d08;
}
.card-top {
  padding: 24px 23px 19px;
}
.card-title {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 22px;
}
.session-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #edf2e9;
  display: grid;
  place-items: center;
  font-size: 23px;
  color: #648264;
}
.card-title h3 {
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 5px;
  overflow-wrap: anywhere;
}
.card-title small {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: #8e978f;
  letter-spacing: 0.6px;
}
.card-title .icon-btn {
  margin-left: auto;
  flex-shrink: 0;
}
.tag {
  border-radius: 5px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 500;
  background: #f1f3ef;
  color: #7b8479;
}
.tag.green {
  background: #edf5e9;
  color: #4e7748;
}
.tag.amber {
  background: #fbf3e5;
  color: #9c7637;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.card-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
}
.card-line strong {
  font-weight: 500;
  color: #465b48;
}
.card-foot {
  border-top: 1px solid #eef0eb;
  background: #fafbf8;
  padding: 13px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #8c958c;
}
.card-foot .btn {
  font-size: 11px;
}
.notice {
  border: 1px solid #dfe6d8;
  background: #edf2e8;
  padding: 16px 20px;
  border-radius: 8px;
  color: #63735d;
  font-size: 12px;
  line-height: 1.7;
  margin-top: 28px;
}
.empty {
  padding: 65px 30px;
  border: 1px dashed #cdd8c6;
  border-radius: 11px;
  text-align: center;
  background: #fafcf7;
}
.empty-symbol {
  margin: 0 auto 22px;
  width: 66px;
  height: 66px;
  border: 1px solid #d8e2d1;
  box-shadow: 0 0 0 10px #f0f5ea;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 31px;
  color: #80977a;
}
.empty h2 {
  font-size: 19px;
  margin-bottom: 9px;
}
.empty p {
  max-width: 400px;
  font-size: 13px;
  margin: 0 auto 23px;
  color: var(--muted);
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
th {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 10px;
  color: #8a9487;
  background: #fafbf8;
  padding: 15px 21px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 17px 21px;
  border-bottom: 1px solid #eef0ea;
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
td strong {
  font-weight: 500;
  display: block;
  margin-bottom: 5px;
}
td small {
  color: var(--muted);
  font-size: 11px;
}
.truncate {
  max-width: 330px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.search {
  max-width: 300px;
  min-width: 220px;
}
.search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  font-size: 12px;
}
.back {
  background: none;
  padding: 0;
  color: #7e8b7b;
  font-size: 12px;
  margin-bottom: 22px;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 22px;
}
.panel-head {
  border-bottom: 1px solid var(--line);
  padding: 20px 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-head h2 {
  margin: 0;
  font-size: 15px;
}
.panel-body {
  padding: 24px;
}
.definition {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 13px;
  margin-bottom: 21px;
  color: var(--muted);
}
.definition:last-child {
  margin-bottom: 0;
}
.definition strong {
  font-weight: 500;
  color: var(--ink);
}
.stack {
  display: grid;
  gap: 22px;
}
.log-line {
  display: flex;
  gap: 18px;
  font-size: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #eef1e9;
}
.log-line time {
  color: #9aa393;
  white-space: nowrap;
  font-family: ui-monospace, monospace;
}
.log-line p {
  margin: 0;
  line-height: 1.5;
  color: #65745e;
}
.code {
  font-family: ui-monospace, monospace;
  background: #f2f5ef;
  border: 1px solid #e0e7db;
  padding: 13px;
  border-radius: 5px;
  font-size: 11px;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  width: min(500px, calc(100vw - 32px));
  max-height: 90vh;
  color: var(--ink);
  box-shadow: 0 30px 100px #0b1c2140;
}
dialog::backdrop {
  background: #17291c80;
  backdrop-filter: blur(3px);
}
.modal-head {
  padding: 25px 28px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.modal-head h2 {
  margin-bottom: 8px;
  font-size: 22px;
}
.modal-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.modal-form {
  padding: 6px 28px 28px;
}
.field {
  display: block;
  margin-bottom: 19px;
  font-size: 12px;
  font-weight: 500;
}
.field input,
.field select {
  margin-top: 8px;
  display: block;
  width: 100%;
  border: 1px solid #dbe3d5;
  border-radius: 6px;
  padding: 12px 13px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
}
.field input:focus,
.field select:focus {
  outline: 2px solid #bfceac;
  outline-offset: 1px;
}
.field small {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  display: block;
  color: #8c9688;
  margin-top: 7px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 13px;
  font-weight: 400;
}
.check input {
  accent-color: var(--green);
  margin-top: 2px;
}
.check span small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.grants {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px 15px;
  max-height: 190px;
  overflow: auto;
  margin-bottom: 21px;
}
.grants .check:last-child {
  margin-bottom: 0;
}
.form-error {
  color: #ac4e37;
  background: #fcf2ec;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 13px;
  margin-bottom: 16px;
}
.form-error:empty {
  display: none;
}
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
.auth-layout {
  display: grid;
  grid-template-columns: 44% 56%;
  min-height: 100vh;
}
.auth-intro {
  background: #24312a;
  color: #e5ebde;
  padding: 45px 11%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.auth-intro:after {
  content: "";
  position: absolute;
  right: -150px;
  bottom: -190px;
  border: 1px solid #40513f;
  border-radius: 50%;
  width: 500px;
  height: 500px;
  box-shadow:
    0 0 0 65px #2a382e,
    0 0 0 66px #40513f,
    0 0 0 130px #2a382e,
    0 0 0 131px #40513f;
  opacity: 0.5;
  pointer-events: none;
}
.auth-copy {
  margin: auto 0;
  position: relative;
  z-index: 1;
}
.auth-copy .eyebrow {
  color: #99ad8c;
  font-size: 10px;
  margin-bottom: 22px;
}
.auth-copy h1 {
  font-size: clamp(32px, 3.2vw, 50px);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -1.5px;
  margin-bottom: 22px;
}
.auth-copy p {
  font-size: 14px;
  color: #a5b29e;
  max-width: 340px;
}
.auth-intro footer {
  font-size: 10px;
  letter-spacing: 1px;
  color: #81957c;
  position: relative;
  z-index: 1;
}
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth-form {
  width: 100%;
  max-width: 350px;
}
.auth-form .eyebrow {
  margin-bottom: 15px;
}
.auth-form h2 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.6px;
  margin-bottom: 12px;
}
.auth-form > p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 30px;
}
.auth-form .btn {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
}
.auth-note {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 20px;
  font-size: 11px !important;
  line-height: 1.8 !important;
}
.initial {
  padding: 50px;
  font-size: 24px;
}
.initial span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 15px;
}
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #293d2d;
  color: #fff;
  padding: 14px 21px;
  border-radius: 8px;
  box-shadow: 0 6px 30px #15251430;
  max-width: 420px;
  font-size: 13px;
  z-index: 100;
}
pre {
  white-space: pre-wrap;
  font-size: 11px;
}
.screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (min-width: 1600px) {
  .content {
    padding-top: 50px;
  }
}
@media (max-width: 1050px) {
  .sidebar {
    padding: 25px 14px;
  }
  .shell {
    grid-template-columns: 205px 1fr;
  }
  .content {
    padding: 30px 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .stat {
    padding: 19px;
  }
  .stat-icon {
    display: none;
  }
  .auth-intro {
    padding: 35px 10%;
  }
}
@media (max-width: 700px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 18px 20px;
    display: block;
  }
  .sidebar .brand {
    margin: 0;
    font-size: 19px;
  }
  .sidebar .brand small,
  .nav-label,
  .sidebar-footer {
    display: none;
  }
  .nav {
    flex-direction: row;
    margin-top: 20px;
    gap: 5px;
  }
  .nav a {
    padding: 9px 12px;
    font-size: 12px;
  }
  .nav a.active:before {
    display: none;
  }
  .nav a span {
    font-size: 14px;
  }
  .topbar {
    height: 59px;
    padding: 0 20px;
  }
  .topbar .date {
    font-size: 10px;
  }
  .topbar .mobile-logout {
    display: block;
  }
  .content {
    padding: 27px 20px;
  }
  h1 {
    font-size: 27px;
  }
  .page-head {
    flex-wrap: wrap;
  }
  .stats {
    margin-bottom: 24px;
  }
  .stat {
    padding: 16px 12px;
  }
  .stat label {
    font-size: 10px;
  }
  .stat strong {
    font-size: 24px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .auth-intro {
    padding: 25px;
    min-height: auto;
  }
  .auth-intro .brand {
    font-size: 19px;
  }
  .auth-copy,
  .auth-intro footer {
    display: none;
  }
  .auth-main {
    padding: 42px 25px;
  }
  .modal-head {
    padding: 23px;
  }
  .modal-form {
    padding: 5px 23px 23px;
  }
  .section-head {
    gap: 15px;
    flex-wrap: wrap;
  }
  th,
  td {
    padding: 14px 16px;
  }
  #toast {
    left: 18px;
    right: 18px;
    bottom: 18px;
  }
  .notice {
    font-size: 11px;
  }
  .page-head .actions {
    width: 100%;
  }
  .identity strong {
    max-width: 140px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
.mobile-logout {
  display: none;
}
.connection-panel {
  margin-bottom: 24px;
}
.connection-panel .definition strong {
  text-align: right;
  overflow-wrap: anywhere;
}
.received-message {
  border-top: 1px solid var(--border, #dce1dc);
  padding: 18px 0;
}
.message-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 10px;
}
.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.message-keyboard {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}
.message-keyboard .tag {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Session workspace */
[hidden] { display: none !important; }
.session-switch { width: 100%; margin-bottom: 22px; min-width: 0; }
.session-tabs { display: flex; gap: 7px; overflow: hidden; border-bottom: 1px solid var(--line); }
.session-tab { flex: 0 0 auto; padding: 13px 22px; text-decoration: none; border-bottom: 3px solid transparent; color: var(--muted); }
.session-tab.current { border-bottom-color: var(--green); color: var(--ink); font-weight: 600; }
.session-select select { width: 100%; padding: 12px 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.chat-panel { position: relative; max-width: 1050px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--paper); }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.chat-head h1 { font-size: 21px; letter-spacing: -.3px; margin: 0 0 5px; }
.chat-head p { margin: 0; color: var(--muted); font-size: 12px; }
#chat-connection { font-size: 12px; text-align: right; }
.chat-online { color: var(--green); }
.chat-scroll { height: clamp(320px, calc(100dvh - 370px), 720px); overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; background: #e9eee6; padding: 16px 24px; scrollbar-gutter: stable; }
.chat-messages { display: flex; flex-direction: column; gap: 10px; min-height: 100%; justify-content: flex-end; }
.chat-history-status { color: var(--muted); font-size: 11px; text-align: center; padding: 3px; }
.chat-message { max-width: min(82%, 690px); min-width: 105px; padding: 12px 15px 7px; box-shadow: 0 1px 2px #26352d0c; }
.chat-message.incoming { align-self: flex-start; background: var(--paper); border-radius: 12px 12px 12px 3px; }
.chat-message.outgoing { align-self: flex-end; background: #d7e8cf; border-radius: 12px 12px 3px 12px; }
.chat-message footer { text-align: right; color: #7d887a; font-size: 10px; margin-top: 6px; }
.chat-message .message-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; font-size: 14px; }
.chat-composer { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); }
.chat-composer input { min-width: 0; flex: 1; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f9faf7; }
.send-button { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--primary); font-size: 22px; }
.chat-notice { min-height: 24px; padding: 0 20px 9px; color: var(--muted); font-size: 12px; }
.chat-keyboard { display: grid; gap: 7px; padding: 12px 18px 0; }
.chat-keyboard:empty { display: none; }
.keyboard-row { display: flex; gap: 7px; }
.keyboard-row button { flex: 1; min-width: 0; padding: 10px 8px; border: 1px solid #dce3d7; border-radius: 7px; background: #f2f5ee; color: var(--ink); overflow-wrap: anywhere; }
.keyboard-row button:hover:not(:disabled) { background: #e3ecdc; }
.new-messages { position: absolute; right: 25px; bottom: 155px; background: var(--paper); color: var(--green); border: 1px solid var(--line); border-radius: 20px; padding: 9px 16px; box-shadow: 0 2px 8px #0001; }
.session-management { display: grid; gap: 18px; max-width: 850px; }
.session-rename { display: flex; gap: 12px; align-items: flex-end; }
.session-rename .field { flex: 1; min-width: 0; margin: 0; }
.session-toggles { display: flex; flex-wrap: wrap; gap: 20px; margin: 22px 0; }
.toggle-control { display: inline-flex; gap: 10px; align-items: center; background: none; color: var(--ink); padding: 0; font-size: 13px; }
.toggle-track { width: 36px; height: 21px; border-radius: 20px; background: #c5ccc1; padding: 3px; transition: background .15s; }
.toggle-track i { display: block; width: 15px; height: 15px; border-radius: 50%; background: var(--paper); transition: transform .15s; }
.toggle-control[aria-checked=true] .toggle-track { background: var(--primary); }
.toggle-control[aria-checked=true] .toggle-track i { transform: translateX(15px); }
.session-login { margin-top: 18px; font-size: 12px; }
.session-login summary { cursor: pointer; color: var(--green); }
.session-login p { margin: 14px 0 8px; }
.add-session-panel { margin-top: 28px; max-width: 850px; }
@media (max-width: 700px) {
  .mobile-logout { display: block; }
  .chat-head { padding: 15px; }
  .chat-scroll { padding: 12px; height: clamp(300px, calc(100dvh - 390px), 600px); }
  .chat-message { max-width: 92%; }
  .chat-composer { padding: 12px; gap: 8px; }
  .chat-keyboard { padding: 10px 12px 0; }
  .keyboard-row button { font-size: 12px; }
}

/* Full-height game view and session selector */
.game-shell { height: 100dvh; min-height: 0; overflow: hidden; }
.game-shell .workspace { height: 100%; min-height: 0; min-width: 0; }
.game-shell .content { height: 100%; padding: 12px; min-height: 0; }
.game-shell .chat-panel { height: 100%; max-width: none; display: flex; flex-direction: column; min-height: 0; }
.game-shell .chat-scroll { flex: 1; height: auto !important; min-height: 0; }
.game-shell .chat-keyboard { max-height: 30dvh; overflow-y: auto; flex-shrink: 0; }
.game-shell .chat-composer, .game-shell .chat-notice { flex-shrink: 0; }
.game-shell .chat-notice:empty { display: none; }
.session-picker { position: relative; margin-bottom: 20px; }
.session-picker-trigger { display: flex; align-items: center; gap: 9px; width: 100%; padding: 12px; border: 1px solid #58685a; border-radius: 8px; background: #2c3c30; color: #eef3ea; text-align: left; }
.picker-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-status { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: #899186; }
.session-status.connected { background: #70c783; box-shadow: 0 0 0 3px #70c78318; }
.session-status.simulated { background: #dca04c; }
.session-options { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 20; padding: 5px; max-height: min(420px,60dvh); overflow-y: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px #0003; }
.session-option { display: flex; gap: 10px; align-items: center; padding: 11px 9px; width: 100%; text-align: left; background: transparent; color: var(--ink); border-radius: 5px; }
.session-option span { overflow-wrap: anywhere; }
.session-option:hover, .session-option[aria-selected=true] { background: #edf3e8; }
.session-order-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.session-order-controls .danger { margin-left: auto; color: #a63b30; }
.mobile-menu, .menu-logout { display: none; }
.chat-message.with-image { width: min(82%, 450px); }
.media-box { width: 100%; max-height: 60dvh; display: flex; align-items: center; justify-content: center; border-radius: 7px; overflow: hidden; background: #e4e9e0; color: var(--muted); margin-bottom: 8px; font-size: 12px; }
.media-box img { display: block; width: 100%; height: 100%; object-fit: contain; }
.media-box button { background: none; color: var(--green); padding: 20px; }
@media (max-width: 700px) {
  .game-shell { grid-template-rows: auto minmax(0,1fr); }
  .game-shell .sidebar { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; height: auto; }
  .game-shell .sidebar .brand { display: none; }
  .game-shell #session-slot { flex: 1; min-width: 0; }
  .game-shell .session-picker { margin: 0; }
  .game-shell .mobile-menu { display: inline-flex; align-items:center; justify-content:center; width:44px; height:44px; flex-shrink:0; padding: 10px; border-radius: 7px; background: #354b3b; color: white; }
  .game-shell .sidebar .nav { display: none; margin: 0; }
  .game-shell .sidebar.menu-open .nav { display: flex; width: 100%; flex-wrap: wrap; }
  .game-shell .sidebar.menu-open .menu-logout { display: block; padding: 8px 12px; }
  .game-shell .content { padding: 0; }
  .game-shell .chat-panel { border-radius: 0; border: none; }
  .game-shell .chat-message.with-image { width: 92%; }
}

/* Character column beside the bounded chat */
.game-shell .content { display: grid; grid-template-columns: minmax(0,720px) minmax(250px,320px); gap: 12px; padding: 8px; justify-content: start; }
.game-shell .chat-panel { max-width: 720px; width: 100%; }
.character-rail { display: flex; flex-direction: column; min-width: 0; height: 100%; overflow-y: auto; scrollbar-gutter: stable; }
.character-rail > .character-card { flex-shrink: 0; }
.character-card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.character-stats { padding: 12px 10px; }
.inventory-overview { padding: 5px 10px; }
.inventory-stat { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 5px 0; text-align: left; font-size: 11px; color: var(--ink); background: none; }
.inventory-stat strong { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.healing-card { padding: 10px; font-size: 12px; }
.healing-card summary { cursor: pointer; font-weight: 600; }
.healing-regeneration { float: right; margin-left: 6px; color: var(--green); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.healing-power { color: var(--muted); }
.healing-items { display: grid; gap: 7px; margin-top: 10px; }
.healing-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; padding: 6px; text-align: left; color: var(--ink); background: var(--page); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; }
.healing-item code { color: var(--green); font-size: 10px; }
.healing-item:not(:disabled):hover { border-color: var(--green); }
.healing-item:disabled { cursor: default; opacity: .5; }
#character-values { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.character-metric { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-size: 14px; }
.character-metric strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.energy-card { padding: 0; }
.energy-card summary { cursor: pointer; padding: 12px 10px; font-size: 12px; font-weight: 600; }
.energy-body { padding: 0 10px 10px; }
.energy-body:empty { display: none; }
.energy-points { display: grid; grid-template-columns: repeat(auto-fit,minmax(36px,1fr)); gap: 5px; }
.energy-point { --energy-track: #f3f4ef; --energy-fill: #dfbd74; position: relative; overflow: hidden; height: 34px; border-radius: 5px; border: 1px solid #d8e0d2; display: grid; place-items: center; font-size: 10px; font-variant-numeric: tabular-nums; background: var(--energy-track); }
.energy-fill { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.energy-fill rect { fill: var(--energy-fill); }
.energy-point > span { position: relative; }
.energy-point.available { color: #3e6849; background: #dfedda; font-size: 18px; border-color: #b8ceb0; }
.energy-point.unknown { color: #8c9785; border-style: dashed; background: #f3f4ef; }
.mobile-state-open, .stats-close { display: none; }
.media-box img { cursor: default; }
.chat-command { display: inline; padding: 0; background: none; color: var(--green); font: inherit; line-height: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.chat-command:hover:not(:disabled) { text-decoration-thickness: 2px; }
.chat-command:disabled { color: var(--muted); opacity: .8; cursor: default; text-decoration: none; }
.quick-commands { margin-top: auto; margin-bottom: 0; padding: 8px 10px 12px; }
.quick-commands-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.quick-commands-head h2 { font-size: 12px; margin: 0; }
.quick-commands-head .icon-btn { color: var(--muted); }
.quick-commands-list { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-commands-list .btn { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.quick-commands-editor { display: block; margin-top: 8px; width: 100%; resize: vertical; padding: 12px; font: 13px/1.6 ui-monospace, monospace; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.errands-card { padding: 10px; }
.scavenger-card { padding: 10px; }
.scavenger-toggle,.walk-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 28px; text-align: left; font-size: 12px; font-weight: 600; }
.scavenger-choice { margin-top: 5px; width: 100%; min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--page); color: var(--ink); font-size: 11px; }
.scavenger-status { margin-top: 5px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.errands-toggle { display: flex; justify-content: space-between; width: 100%; min-height: 28px; text-align: left; font-size: 12px; font-weight: 600; }
.errands-toggle .toggle-track { flex-shrink: 0; }
.errands-controls { display: flex; align-items: center; gap: 9px; margin-left: 8px; }
.errands-daily { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.errands-status { display: flex; align-items: center; gap: 10px; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.errands-status[hidden], .errands-status [hidden] { display: none; }
.errands-countdown { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.errands-progress { appearance: none; flex: 1; min-width: 0; width: 100%; height: 4px; border: 0; border-radius: 4px; overflow: hidden; background: var(--line); accent-color: var(--green); }
.errands-progress::-webkit-progress-bar { border-radius: 4px; background: var(--line); }
.errands-progress::-webkit-progress-value { border-radius: 4px; background: var(--green); }
.errands-progress::-moz-progress-bar { border-radius: 4px; background: var(--green); }
@media (min-width:701px) and (max-width:1050px) {
  .game-shell .content { grid-template-columns: minmax(0,1fr) 250px; }
  .character-metric { font-size: 13px; }
  .character-metric strong { font-size: 12px; }
}
@media (max-width:700px) {
  .game-shell .content { display: block; padding: 0; }
  .game-shell .chat-panel { max-width: none; }
  .character-rail { display: none; }
  .game-shell .mobile-state-open { display: inline-flex; align-items:center; justify-content:center; width:44px; height:44px; flex-shrink:0; padding: 8px; border-radius: 6px; color: #dae5d6; background: #354b3b; font-size: 25px; line-height:1; }
  .game-shell.stats-open .character-rail { display: flex; position: fixed; top: 65px; bottom: 12px; left: 12px; right: 12px; height: auto; padding: 12px; background: var(--page); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 35px #0003; z-index: 35; }
  .stats-close { display: block; margin-left: auto; padding: 7px 0 14px; background: none; color: var(--green); font-size: 12px; }
}
.walk-card { padding:10px; font-size:12px; }
.walk-card summary,.scavenger-card summary { cursor:pointer; font-weight:600; }
.automation-summary-status { float:right; font-size:11px; font-weight:500; color:var(--muted); }
.automation-summary-status.is-active { color:var(--green); }
.walk-body { padding-top:8px; }
.walk-settings { display:grid; gap:8px; margin:6px 0 8px; }
.walk-settings label { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; }
.walk-target { width:80px; min-width:0; padding:5px 8px; }
.walk-settings .walk-return-label { justify-content:flex-start; }
.walk-return { width:auto; margin:0; }
.walk-save { padding:5px 8px; font-size:12px; }
.walk-status { font-size:11px; margin:8px 0; overflow-wrap:anywhere; }
.walk-scavenger .scavenger-card { margin:8px 0 0; padding:8px; }
.scavenger-card[open] summary { margin-bottom:8px; }
.travel-progress { flex:none; display:flex; align-items:center; gap:10px; padding:5px 16px; font-size:11px; color:var(--muted); }
.travel-progress[hidden] { display:none; }
.travel-progress-track { height:4px; border-radius:4px; flex:1; background:var(--line); overflow:hidden; }
.travel-progress-track i { display:block; height:100%; width:0; background:var(--green); }

.walk-delay-label span { display:flex; align-items:center; gap:4px; }
.walk-delay-label input { width:60px; min-width:0; padding:5px; }
.walk-queue { padding:8px; margin:8px 0; border:1px solid var(--line); border-radius:6px; background:var(--page); font-size:11px; }
.walk-queue[hidden],.walk-queue [hidden] { display:none; }
.walk-queue-heading { display:flex; justify-content:space-between; gap:8px; color:var(--muted); }
.walk-queue-countdown { font-variant-numeric:tabular-nums; font-weight:500; }
.walk-queue-command { display:block; margin:5px 0; color:var(--ink); white-space:pre-wrap; overflow-wrap:anywhere; }
.walk-queue-track { height:4px; border-radius:4px; overflow:hidden; background:var(--line); }
.walk-queue-track i { display:block; height:100%; background:var(--green); }
.walk-options { margin:8px 0; padding:8px; border:1px solid var(--line); border-radius:6px; }
.walk-option-count { float:right; color:var(--muted); font-size:11px; font-weight:500; }
.walk-option-list { display:grid; gap:6px; margin-top:8px; }
.walk-option-toggle { display:flex; justify-content:space-between; align-items:center; gap:8px; width:100%; text-align:left; font-size:11px; padding:5px 0; }
.walk-option-toggle small { display:block; color:var(--muted); margin-top:3px; font-size:10px; }
.walk-option-toggle .toggle-track { flex-shrink:0; }
