:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --ink: #172026;
  --muted: #60717d;
  --line: #d8e0e5;
  --panel: #ffffff;
  --accent: #16846b;
  --accent-2: #3267a8;
  --warn: #b26b00;
  --bad: #b72e38;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #111a20;
  color: #ffffff;
  display: flex;
  flex-direction: column;
}

.brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 20px;
}

.brand h1 {
  font-size: 22px;
}

.brand span {
  color: #9fb0ba;
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

.nav-tree {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.nav-item {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #d7e1e7;
  cursor: pointer;
  font: inherit;
  min-height: 40px;
  padding: 0 12px;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: #20313a;
  color: #ffffff;
}

.workspace {
  min-width: 0;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  padding: 16px 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 700;
}

h2 {
  font-size: 15px;
  font-weight: 700;
}

.topbar p,
small,
.status,
.panel-head span {
  color: var(--muted);
}

.status {
  align-items: center;
  display: flex;
  font-size: 14px;
  gap: 10px;
  white-space: nowrap;
}

.language-control {
  align-items: center;
  display: flex;
  gap: 6px;
}

.language-control span {
  color: var(--muted);
  font-size: 13px;
}

.language-control select {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 34px;
  padding: 0 8px;
}

.icon-button,
.login-panel button {
  background: var(--ink);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  min-height: 34px;
  padding: 0 12px;
}

.dot {
  background: var(--warn);
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.dot.ok {
  background: var(--accent);
}

.dot.bad {
  background: var(--bad);
}

main {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 18px 24px 28px;
}

.view {
  display: none;
  gap: 16px;
}

.view.active {
  display: grid;
}

.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics article,
.panel,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics article {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 16px;
}

.metrics span {
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  font-size: 30px;
  line-height: 1;
}

.bar {
  background: #e7edf0;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.bar i {
  background: var(--accent);
  display: block;
  height: 100%;
  width: 0;
}

.bar.subtle i {
  background: var(--accent-2);
}

.split {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.panel {
  min-width: 0;
}

.panel-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 16px;
}

.head-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.compact + .compact {
  margin-top: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
  width: 100%;
}

.mini-table {
  min-width: 560px;
}

.mini-table th,
.mini-table td {
  padding: 8px 10px;
  vertical-align: top;
}

.mini-table-wrap {
  max-height: 220px;
}

th,
td {
  border-bottom: 1px solid #edf1f3;
  padding: 10px 12px;
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 600;
}

td.num,
th.num {
  text-align: right;
}

.list {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.row,
.disk {
  border: 1px solid #edf1f3;
  border-radius: 8px;
  padding: 10px;
}

.row strong,
.disk strong {
  display: block;
  font-size: 14px;
}

.row span,
.disk span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.disk-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 16px;
}

.disk .bar {
  margin-top: 10px;
}

#portBody td:last-child {
  max-width: 480px;
  overflow-wrap: anywhere;
}

.hidden {
  display: none;
}

.table-button {
  background: var(--ink);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  min-height: 32px;
  padding: 0 10px;
}

.table-button.danger {
  background: var(--bad);
}

.table-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.modal {
  align-items: center;
  background: rgba(23, 32, 38, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(23, 32, 38, 0.22);
  display: grid;
  gap: 14px;
  max-width: 420px;
  padding: 18px;
  width: 100%;
}

.action-panel {
  max-width: 460px;
}

.action-status {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 14px minmax(0, 1fr);
  min-height: 44px;
}

.action-status p {
  overflow-wrap: anywhere;
}

.action-detail {
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  margin: 0;
  max-height: 180px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.modal-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.close-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  height: 32px;
  line-height: 1;
  width: 32px;
}

.modal-panel label {
  display: grid;
  gap: 6px;
}

.modal-panel label span {
  color: var(--muted);
  font-size: 13px;
}

.modal-panel input,
.modal-panel select {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  height: 38px;
  padding: 0 10px;
}

.checkline {
  align-items: center;
  display: flex !important;
  gap: 8px !important;
}

.checkline input {
  height: auto;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.form-actions button {
  background: var(--ink);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  min-height: 34px;
  padding: 0 12px;
}

.form-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.form-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  color: var(--bad);
  font-size: 13px;
  padding: 10px;
}

.settings-form {
  display: grid;
  gap: 16px;
  max-width: 680px;
  padding: 16px;
}

.settings-form.compact-settings {
  max-width: none;
}

.rule-grid-form {
  align-items: end;
  grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(120px, 1fr)) auto;
}

.web-rule-form {
  align-items: end;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(140px, 1fr)) auto;
}

.settings-section {
  border: 1px solid #edf1f3;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 14px;
}

.settings-section h3 {
  font-size: 14px;
  margin: 0;
}

.section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.settings-section.locked input,
.settings-section.locked select {
  background: #f7fafb;
  color: var(--muted);
}

.settings-form label {
  display: grid;
  gap: 6px;
}

.settings-form label span,
.muted-line {
  color: var(--muted);
  font-size: 13px;
}

.settings-form input,
.settings-form textarea,
.settings-form select {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  padding: 10px;
}

.settings-group {
  display: grid;
  gap: 14px;
}

.query-bar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
  padding: 14px 16px;
}

.login-query {
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
}

.filter-group {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
  padding: 8px 10px 10px;
}

.filter-group legend {
  color: var(--muted);
  font-size: 13px;
  padding: 0 4px;
}

.filter-group .checkline {
  gap: 6px !important;
}

.filter-group .checkline span {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.pager {
  align-items: center;
  border-top: 1px solid #edf1f3;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  min-height: 48px;
  padding: 8px 16px;
}

.pager span {
  color: var(--muted);
  font-size: 13px;
}

.query-bar label {
  display: grid;
  gap: 6px;
}

.query-bar label span {
  color: var(--muted);
  font-size: 13px;
}

.query-bar input,
.query-bar select {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  min-height: 34px;
  padding: 0 10px;
}

.query-bar select[multiple] {
  min-height: 82px;
  padding: 6px 10px;
}

.security-query {
  grid-template-columns: minmax(180px, 260px) minmax(120px, 180px) auto;
}

.section-divider {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 600;
  gap: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-divider::before,
.section-divider::after {
  border-top: 1px solid var(--line);
  content: "";
  flex: 1;
}

.security-query-inline {
  align-items: center;
  display: flex;
  gap: 8px;
}

.security-query-inline select,
.security-limit-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  height: 32px;
  padding: 0 8px;
}

.security-limit-input {
  width: 68px;
}

.panel-error {
  margin: 0 16px 12px;
}

.split-equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.security-ip-form {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.security-ip-form input {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  min-height: 36px;
  padding: 0 10px;
}

.log-box {
  background: #0f171c;
  color: #d8e7ec;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-box.tall {
  max-height: 520px;
}

.ssh-panel {
  min-height: calc(100vh - 130px);
}

.ttyd-frame {
  border: 0;
  display: block;
  height: calc(100vh - 180px);
  min-height: 520px;
  width: 100%;
}

.ttyd-wrap {
  position: relative;
}

.ttyd-idle {
  align-items: center;
  background: rgba(23, 32, 38, 0.5);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: absolute;
  z-index: 4;
}

.ttyd-idle.hidden {
  display: none;
}

.ttyd-idle-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(23, 32, 38, 0.24);
  display: grid;
  gap: 12px;
  max-width: 360px;
  padding: 18px;
  width: 100%;
}

.ttyd-idle-card h3 {
  font-size: 15px;
  margin: 0;
}

.ttyd-idle-card p {
  color: var(--muted);
  font-size: 14px;
}

.login-page {
  background: var(--bg);
}

.login-shell {
  align-items: center;
  min-height: 100vh;
  max-width: none;
  padding: 24px;
}

.login-panel {
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: 360px;
  padding: 24px;
  width: 100%;
}

.login-panel label {
  display: grid;
  gap: 6px;
}

.login-panel label span {
  color: var(--muted);
  font-size: 13px;
}

.login-panel input {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  height: 40px;
  padding: 0 10px;
}

.webmail-shell {
  background: #eef3f7;
  border: 1px solid #dbe4ec;
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 132px);
  overflow: hidden;
  position: relative;
}

.webmail-header {
  align-items: center;
  background: #f8fbfd;
  border-bottom: 1px solid #dbe4ec;
  display: grid;
  gap: 16px;
  grid-template-columns: 210px minmax(260px, 1fr);
  min-height: 58px;
  padding: 8px 12px 8px 18px;
}

.webmail-header h2 {
  font-size: 17px;
}

.webmail-header span,
.webmail-summary span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.webmail-searchbar {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(180px, 1fr) auto auto;
}

.webmail-searchbar input {
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px #dce5ed;
  font: inherit;
  height: 38px;
  padding: 0 14px;
}

.webmail-searchbar input:focus {
  background: #ffffff;
  border-color: var(--accent-2);
  outline: 0;
}

.webmail-icon-button {
  background: #f8fbfd;
  border: 1px solid #cfdae5;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  min-height: 34px;
  padding: 0 10px;
}

.webmail-icon-button:hover,
.webmail-message-row:hover {
  background: #f3f7fb;
}

.webmail-folder {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #394b57;
  cursor: pointer;
  display: flex;
  font: inherit;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 10px 0 12px;
  width: 100%;
}

.webmail-folder:hover {
  background: rgba(255, 255, 255, 0.72);
}

.webmail-folder.active {
  background: #d8ebff;
  color: #123b5d;
  font-weight: 700;
}

.webmail-folder strong {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  min-width: 24px;
  padding: 2px 7px;
  text-align: center;
}

.webmail-workspace {
  display: grid;
  grid-template-columns: 214px minmax(360px, 0.92fr) minmax(420px, 1.35fr);
  min-height: 0;
}

.webmail-actions {
  background: #eef3f7;
  border-right: 1px solid #dbe4ec;
  display: grid;
  gap: 12px;
  grid-template-rows: auto auto auto 1fr;
  padding: 14px 12px;
}

.webmail-compose-button {
  background: #2f6fa3;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 42px;
  padding: 0 18px;
  text-align: center;
}

.webmail-folder-rail {
  display: grid;
  gap: 3px;
}

.webmail-summary {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid #dbe4ec;
  border-radius: 8px;
  padding: 12px;
}

.webmail-list-pane {
  background: #ffffff;
  border-right: 1px solid #dbe4ec;
  min-width: 0;
  overflow: auto;
}

.webmail-list-toolbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #e8eef3;
  display: flex;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 14px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.webmail-list-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.webmail-list {
  display: grid;
}

.webmail-message-row {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #edf2f6;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 10px;
  grid-template-columns: minmax(116px, 0.7fr) minmax(180px, 1.7fr) auto auto;
  min-height: 52px;
  padding: 7px 14px;
  text-align: left;
}

.webmail-message-row.unread {
  box-shadow: inset 3px 0 0 #2f6fa3;
  font-weight: 700;
}

.webmail-message-row.selected {
  background: #e9f3ff;
}

.webmail-row-sender,
.webmail-row-content,
.webmail-row-content span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webmail-row-content {
  display: flex;
  gap: 6px;
}

.webmail-row-content span,
.webmail-clip,
.webmail-message-row time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.webmail-reader-pane {
  background: #ffffff;
  min-width: 0;
  overflow: auto;
}

.webmail-reader-toolbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #e8eef3;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 52px;
  padding: 8px 16px;
}

.webmail-reader-toolbar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webmail-reader-toolbar div {
  display: flex;
  gap: 8px;
}

.webmail-detail-empty,
.webmail-empty {
  color: var(--muted);
  padding: 28px;
}

.webmail-empty {
  display: grid;
  gap: 4px;
}

.webmail-message-detail {
  padding: 22px 28px 36px;
}

.webmail-message-detail header {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.webmail-message-detail h3 {
  font-size: 21px;
  font-weight: 600;
  margin: 0;
}

.webmail-message-detail time {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
}

.webmail-addresses {
  border-bottom: 1px solid #edf1f5;
  display: grid;
  gap: 6px;
  margin-bottom: 22px;
  padding-bottom: 14px;
}

.webmail-addresses p {
  display: grid;
  gap: 12px;
  grid-template-columns: 48px minmax(0, 1fr);
}

.webmail-addresses strong {
  color: var(--muted);
  font-size: 12px;
}

.webmail-addresses span {
  overflow-wrap: anywhere;
}

.webmail-message-body {
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.webmail-attachment-block {
  border-bottom: 1px solid #edf1f5;
  margin-bottom: 22px;
  padding-bottom: 14px;
}

.webmail-attachments {
  margin: 8px 0 0;
  padding-left: 18px;
}

.webmail-compose-panel {
  background: #ffffff;
  border: 1px solid #c9d5df;
  border-radius: 8px 8px 0 0;
  bottom: 0;
  box-shadow: 0 18px 45px rgba(23, 32, 38, 0.24);
  display: grid;
  position: absolute;
  right: 24px;
  width: min(560px, calc(100% - 48px));
  z-index: 5;
}

.webmail-compose-panel.hidden {
  display: none;
}

.webmail-compose-head {
  align-items: center;
  background: #22313b;
  border-radius: 8px 8px 0 0;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px 0 16px;
}

.webmail-compose-head h3 {
  font-size: 14px;
  margin: 0;
}

.webmail-compose-form {
  display: grid;
}

.webmail-compose-form input,
.webmail-compose-form textarea {
  border: 0;
  border-bottom: 1px solid #edf1f5;
  font: inherit;
  min-height: 40px;
  padding: 0 14px;
}

.webmail-compose-form textarea {
  min-height: 240px;
  padding-top: 12px;
  resize: vertical;
}

.webmail-compose-form input:focus,
.webmail-compose-form textarea:focus {
  outline: 0;
}

.webmail-compose-foot {
  align-items: center;
  display: flex;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
}

.webmail-compose-foot button {
  background: var(--accent-2);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  min-height: 34px;
  padding: 0 16px;
}

.webmail-attach {
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  gap: 8px;
}

.webmail-attach input {
  border: 0;
  padding: 0;
}

@media (max-width: 1180px) {
  .webmail-workspace {
    grid-template-columns: 180px minmax(320px, 1fr);
  }

  .webmail-reader-pane {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav-tree {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metrics,
  .split,
  .split-equal,
  .disk-grid,
  .query-bar,
  .rule-grid-form,
  .web-rule-form {
    grid-template-columns: 1fr;
  }

  .webmail-header,
  .webmail-workspace {
    grid-template-columns: 1fr;
  }

  .webmail-actions {
    border-bottom: 1px solid #e4e9f0;
    border-right: 0;
    grid-template-columns: auto minmax(220px, 1fr);
    grid-template-rows: auto;
  }

  .webmail-folder-rail {
    display: flex;
    gap: 4px;
    overflow-x: auto;
  }

  .webmail-folder {
    flex: 0 0 auto;
    gap: 12px;
    width: auto;
  }

  .webmail-summary {
    display: none;
  }

  .webmail-list-pane {
    border-right: 0;
  }

  .webmail-message-row {
    grid-template-columns: minmax(90px, 0.65fr) minmax(140px, 1fr) auto;
  }

  .webmail-clip {
    display: none;
  }

  .webmail-reader-pane {
    grid-column: auto;
  }

  .security-query-inline {
    flex-wrap: wrap;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .status {
    flex-wrap: wrap;
    white-space: normal;
  }
}

@media (max-width: 700px) {
  .webmail-searchbar {
    grid-template-columns: 1fr;
  }

  .webmail-message-row {
    align-items: start;
    grid-template-columns: 1fr auto;
  }

  .webmail-row-content {
    grid-column: 1 / -1;
  }

  .webmail-compose-panel {
    right: 8px;
    width: calc(100% - 16px);
  }
}

/* MyAgent Local dark red theme. */
:root {
  color-scheme: dark;
  --bg: #16090b;
  --ink: #f6e9e8;
  --muted: #c9aaa7;
  --line: #4b2428;
  --panel: #211012;
  --accent: #c7464f;
  --accent-2: #8f2b33;
  --warn: #d19a4a;
  --bad: #ff6b76;
}

body,
.login-page {
  background: #16090b;
}

.sidebar {
  background: #240d10;
}

.brand,
.topbar,
.panel-head,
.webmail-header,
.webmail-list-toolbar,
.webmail-reader-toolbar {
  border-color: var(--line);
}

.brand span,
.topbar p,
small,
.status,
.panel-head span,
.muted-line,
.query-bar label span,
.settings-form label span,
.modal-panel label span,
.webmail-header span,
.webmail-summary span,
.webmail-list-toolbar span,
.webmail-row-content span,
.webmail-clip,
.webmail-message-row time,
.webmail-detail-empty,
.webmail-empty {
  color: var(--muted);
}

.topbar,
.metrics article,
.panel,
.login-panel,
.modal-panel,
.ttyd-idle-card,
.webmail-list-pane,
.webmail-reader-pane,
.webmail-compose-panel,
.webmail-searchbar input,
.webmail-message-row {
  background: var(--panel);
  border-color: var(--line);
}

.nav-item {
  color: #ead3d1;
}

.nav-item.active,
.nav-item:hover {
  background: #5b1c24;
}

.icon-button,
.login-panel button,
.table-button,
.form-actions button,
.webmail-compose-button,
.webmail-compose-foot button {
  background: var(--accent-2);
}

.icon-button:hover,
.login-panel button:hover,
.table-button:hover,
.form-actions button:hover,
.webmail-compose-button:hover,
.webmail-compose-foot button:hover {
  background: var(--accent);
}

.bar,
.settings-section,
.row,
.disk,
.filter-group,
.webmail-summary {
  background: #2a1518;
  border-color: var(--line);
}

.bar i,
.dot.ok {
  background: var(--accent);
}

.bar.subtle i {
  background: #b0535a;
}

th,
td,
.webmail-message-row,
.webmail-list-toolbar,
.webmail-reader-toolbar {
  border-color: #3a1b1f;
}

input,
select,
textarea,
.language-control select,
.query-bar input,
.query-bar select,
.settings-form input,
.settings-form textarea,
.settings-form select,
.modal-panel input,
.modal-panel select,
.security-ip-form input,
.webmail-searchbar input {
  background: #16090b;
  border-color: var(--line);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus,
.webmail-searchbar input:focus {
  border-color: var(--accent);
  outline: 0;
}

.log-box,
.webmail-compose-head {
  background: #120708;
  color: #f4dedc;
}

.modal {
  background: rgba(12, 4, 5, 0.68);
}

.action-detail {
  background: #170a0c;
  border-color: var(--line);
  color: var(--muted);
}

.form-error {
  background: #3a1015;
  border-color: #7d2a32;
  color: #ffb7bd;
}

.webmail-shell,
.webmail-actions {
  background: #1a0b0d;
  border-color: var(--line);
}

.webmail-icon-button,
.webmail-folder strong {
  background: #2a1518;
  border-color: var(--line);
  color: var(--ink);
}

.webmail-icon-button:hover,
.webmail-message-row:hover,
.webmail-folder:hover {
  background: #35191d;
}

.webmail-folder {
  color: #ead3d1;
}

.webmail-folder.active,
.webmail-message-row.selected {
  background: #5b1c24;
  color: #ffffff;
}
