:root {
  --color-bg-1: #100c08;
  --color-bg-2: #1c1712;
  --color-iron: #2b2620;
  --color-iron-light: #3d362c;
  --color-iron-border: #55492f;
  --color-parchment: #e9dcbd;
  --color-parchment-dark: #d8c69b;
  --color-gold: #c9a227;
  --color-gold-bright: #e9c34d;
  --color-blood: #7a1f1f;
  --color-blood-bright: #a52a2a;
  --color-text-dark: #2a1f14;
  --color-text-light: #ece0c8;
  --color-text-muted: #a89a7c;
  --font-display: "Cinzel Decorative", "Cinzel", serif;
  --font-heading: "Cinzel", serif;
  --font-body: "Spectral", Georgia, serif;
  --radius: 6px;
  --shadow-panel: 0 8px 30px rgba(0, 0, 0, 0.6);
  --control-h: 42px;
  --control-h-line: 40px;
  --control-h-sm: 32px;
  --control-h-sm-line: 30px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-text-light);
  background:
    radial-gradient(ellipse at top, rgba(201, 162, 39, 0.06), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(0, 0, 0, 0.5), transparent 60%),
    linear-gradient(180deg, var(--color-bg-2), var(--color-bg-1));
  min-height: 100vh;
}

/* ------------------------------------------------------------ scrollbars */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold) var(--color-bg-2);
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: var(--color-bg-2);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-gold-bright), var(--color-gold));
  border: 3px solid var(--color-bg-2);
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-bright);
}

*::-webkit-scrollbar-corner {
  background: var(--color-bg-2);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  letter-spacing: 0.03em;
  color: var(--color-gold-bright);
  margin: 0 0 8px;
}

hr {
  border: none;
  border-top: 1px solid var(--color-iron-border);
  margin: 16px 0;
}

/* ---------------------------------------------------------------- screens */

.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
}

.screen:not(.hidden) {
  display: flex;
  animation: screenIn 0.3s var(--ease-out);
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#screen-connect:not(.hidden),
#screen-setup:not(.hidden) {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#screen-main:not(.hidden) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.parchment-panel {
  background: linear-gradient(180deg, var(--color-parchment), var(--color-parchment-dark));
  color: var(--color-text-dark);
  border: 3px solid var(--color-gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel), inset 0 0 40px rgba(90, 60, 20, 0.15);
  padding: 32px 36px;
  width: 100%;
  max-width: 480px;
}

.parchment-panel.narrow {
  max-width: 380px;
}

.parchment-panel h1.title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--color-blood);
  text-align: center;
}

.parchment-panel .subtitle {
  text-align: center;
  font-style: italic;
  color: #5a4a30;
  margin-bottom: 20px;
}

/* ------------------------------------------------------------------ forms */

form label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

form label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

form label.checkbox-label input {
  width: auto;
}

form label.checkbox-label:has(input:disabled) {
  color: var(--color-text-muted);
  cursor: not-allowed;
}

input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 18px;
  height: 18px;
  min-width: 18px;
  flex-shrink: 0;
  border: 2px solid var(--color-iron-border);
  border-radius: 50%;
  background: rgba(90, 70, 25, 0.28);
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}

input[type="radio"]:hover {
  border-color: var(--color-gold);
}

input[type="radio"]:checked {
  border-color: var(--color-gold);
}

input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--color-gold-bright), var(--color-gold));
  transform: translate(-50%, -50%);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
select {
  height: var(--control-h);
  line-height: var(--control-h-line);
  padding: 0 12px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: rgba(233, 220, 189, 0.55);
  border: 1px solid #9c8858;
  border-radius: 4px;
  color: var(--color-text-dark);
  transition: border-color 0.15s ease, outline-color 0.15s ease;
}

label > input,
label > textarea,
label > select {
  margin-top: 4px;
}

textarea {
  padding: 9px 12px;
}

.ke-dialog input[type="text"],
.ke-dialog input[type="password"],
.ke-dialog input[type="number"],
.ke-dialog textarea {
  background: rgba(90, 70, 25, 0.28);
  border: 1px solid var(--color-iron-border);
  color: var(--color-text-light);
}

input::placeholder,
textarea::placeholder {
  color: rgba(42, 31, 20, 0.6);
  opacity: 1;
}

.ke-dialog input::placeholder,
.ke-dialog textarea::placeholder {
  color: var(--color-text-muted);
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--color-gold);
  outline-offset: 1px;
}

textarea {
  resize: vertical;
  font-family: var(--font-body);
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--control-h);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0 18px;
  border-radius: 4px;
  border: 1px solid var(--color-iron-border);
  background: linear-gradient(180deg, var(--color-iron-light), var(--color-iron));
  color: var(--color-text-light);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.btn-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.btn:hover {
  filter: brightness(1.2);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(180deg, var(--color-gold-bright), var(--color-gold));
  color: #241a06;
  border-color: #8a6c17;
  font-weight: 700;
}

.btn-danger {
  background: linear-gradient(180deg, var(--color-blood-bright), var(--color-blood));
  color: var(--color-text-light);
  border-color: #4a1212;
}

.btn-accent {
  background: linear-gradient(180deg, #3d6b4f, #234431);
  border-color: #1b3324;
}

.btn-small {
  height: var(--control-h-sm);
  padding: 0 12px;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
  margin-top: 4px;
}

.btn-link {
  height: auto;
  background: none;
  border: none;
  color: var(--color-text-muted);
  text-decoration: underline;
  padding: 4px 0;
  display: block;
  margin: 12px auto 0;
}

.parchment-panel .btn-link {
  color: #5a4a30;
}

/* ------------------------------------------------------------------ text */

.status-text {
  text-align: center;
  margin-top: 12px;
  color: #5a4a30;
  min-height: 1.2em;
}

.error-text {
  color: var(--color-blood);
  font-weight: 600;
  min-height: 1.2em;
  margin: 8px 0;
}

.ke-dialog .error-text {
  color: #ff8b8b;
}

/* ----------------------------------------------------------------- topbar */

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: linear-gradient(180deg, var(--color-iron-light), var(--color-iron));
  border-bottom: 2px solid var(--color-gold);
}

.shop-identity h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0;
}

.balance-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--color-gold-bright);
  font-weight: 700;
}


.coin-icon {
  font-size: 1.1rem;
}

.gold-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.current-user-name {
  color: var(--color-text-muted);
  font-style: italic;
}

/* ------------------------------------------------------------------- tabs */

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  background: var(--color-bg-2);
  border-bottom: 1px solid var(--color-iron-border);
  overflow-x: auto;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.2s var(--ease-out);
}

.tab-btn:hover {
  color: var(--color-text-light);
}

.tab-btn.active {
  color: var(--color-gold-bright);
  border-bottom-color: var(--color-gold);
}

.content-row {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  gap: 12px;
}

.tab-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-width: 1100px;
  margin: 20px auto;
  overflow-y: auto;
  padding: 24px 28px;
  background: linear-gradient(180deg, rgba(61, 54, 44, 0.35), rgba(43, 38, 32, 0.35));
  border: 1px solid var(--color-iron-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------- chat */

.chat-dock {
  flex-shrink: 0;
  display: flex;
  margin: 20px 0;
}

.chat-toggle {
  flex-shrink: 0;
  width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 16px;
  background: linear-gradient(180deg, var(--color-iron-light), var(--color-iron));
  border: 1px solid var(--color-iron-border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--color-text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.chat-toggle:hover {
  color: var(--color-gold-bright);
  border-color: var(--color-gold);
}

.chat-unread-badge {
  position: absolute;
  top: 8px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--color-blood-bright);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.chat-panel {
  flex-shrink: 0;
  width: 0;
  overflow: hidden;
  transition: width 0.25s var(--ease-out);
}

.chat-panel.open {
  width: 300px;
}

.chat-panel-inner {
  width: 300px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(61, 54, 44, 0.35), rgba(43, 38, 32, 0.35));
  border: 1px solid var(--color-iron-border);
  border-right: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.chat-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-iron-border);
}

.chat-panel-header h3 {
  margin: 0;
  font-size: 1rem;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  max-width: 88%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--color-iron-border);
  border-radius: 8px;
  padding: 6px 10px;
  align-self: flex-start;
}

.chat-message.own {
  align-self: flex-end;
  background: rgba(90, 70, 25, 0.35);
  border-color: var(--color-gold);
}

.chat-message-meta {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.chat-message-text {
  font-size: 0.88rem;
  color: var(--color-text-light);
  white-space: pre-wrap;
  word-break: break-word;
}

@keyframes chatMessageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message-in {
  animation: chatMessageIn 0.2s var(--ease-out);
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-iron-border);
}

.chat-form input {
  flex: 1;
  height: var(--control-h-sm);
  line-height: var(--control-h-sm-line);
  padding: 0 10px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: tabIn 0.22s var(--ease-out);
}

@keyframes tabIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pane-header {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  -webkit-appearance: none;
  appearance: none;
}

/* -------------------------------------------------------------- subtabs */

.subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.subtab-btn {
  background: var(--color-iron);
  border: 1px solid var(--color-iron-border);
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.subtab-btn:hover {
  color: var(--color-text-light);
}

.subtab-btn.active {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: #241a06;
}

/* ------------------------------------------------------------------- list */

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-hint {
  color: var(--color-text-muted);
  font-style: italic;
  padding: 20px 0;
}

.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(180deg, rgba(61, 54, 44, 0.6), rgba(43, 38, 32, 0.6));
  border: 1px solid var(--color-iron-border);
  border-left: 4px solid var(--color-gold);
  border-radius: var(--radius);
  padding: 12px 16px;
  flex-wrap: wrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.card-main {
  flex: 1;
  min-width: 160px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  color: var(--color-text-light);
}

.card-sub {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.card-note {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.transaction-card {
  cursor: pointer;
}

.transaction-card.transaction-in {
  border-left-color: #3d6b4f;
}

.transaction-card.transaction-out {
  border-left-color: var(--color-blood-bright);
}

.transaction-detail-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
  padding-top: 8px;
  border-top: 1px solid var(--color-iron-border);
}

.transaction-detail-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.transaction-amount {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}

.transaction-amount.in {
  color: #6fbf8b;
}

.transaction-amount.out {
  color: #e07a7a;
}

.badge {
  display: inline-block;
  background: var(--color-gold);
  color: #241a06;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ------------------------------------------------------------- combobox --*/

.combobox-slot {
  margin-bottom: 12px;
}

.combobox {
  position: relative;
}

.combobox-input {
  width: 100%;
}

.combobox-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--color-iron);
  border: 1px solid var(--color-gold);
  border-radius: 4px;
  z-index: 50;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.combobox-dropdown.hidden {
  display: none;
}

.combobox-dropdown:not(.hidden) {
  animation: dropdownIn 0.15s var(--ease-out);
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.combobox-option {
  padding: 8px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--color-text-light);
}

.combobox-option:hover {
  background: var(--color-gold);
  color: #241a06;
}

.combobox-empty {
  padding: 8px 10px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* --------------------------------------------------------------- spinbox */

.spinbox {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-iron-border);
  border-radius: 4px;
  overflow: hidden;
}

.spinbox-btn {
  background: var(--color-iron-light);
  color: var(--color-text-light);
  border: none;
  width: 32px;
  height: var(--control-h-sm);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.spinbox-btn:hover {
  background: var(--color-gold);
  color: #241a06;
}

.spinbox .spinbox-input {
  width: 56px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--color-iron-border);
  border-right: 1px solid var(--color-iron-border);
  height: var(--control-h-sm);
  line-height: var(--control-h-sm-line);
  padding: 0;
  background: rgba(0, 0, 0, 0.25);
  color: var(--color-text-light);
  -moz-appearance: textfield;
}

.spinbox-input::-webkit-outer-spin-button,
.spinbox-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ---------------------------------------------------------------- dialog */

dialog {
  border: none;
  padding: 0;
  border-radius: var(--radius);
  background: transparent;
}

.ke-dialog {
  background: linear-gradient(180deg, var(--color-iron-light), var(--color-iron));
  color: var(--color-text-light);
  border: 2px solid var(--color-gold);
  box-shadow: var(--shadow-panel);
  width: 100%;
  max-width: 460px;
  padding: 26px 28px;

  opacity: 0;
  transform: translateY(-14px) scale(0.97);
  transition:
    opacity 0.2s var(--ease-out),
    transform 0.2s var(--ease-out),
    overlay 0.2s var(--ease-out) allow-discrete,
    display 0.2s var(--ease-out) allow-discrete;
}

.ke-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  .ke-dialog[open] {
    opacity: 0;
    transform: translateY(-14px) scale(0.97);
  }
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0);
  transition:
    background 0.2s var(--ease-out),
    overlay 0.2s var(--ease-out) allow-discrete,
    display 0.2s var(--ease-out) allow-discrete;
}

dialog[open]::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

@starting-style {
  dialog[open]::backdrop {
    background: rgba(0, 0, 0, 0);
  }
}

.ke-dialog.wide {
  max-width: 640px;
}

.ke-dialog.narrow {
  max-width: 340px;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.direction-toggle {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.direction-toggle label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.transaction-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.transaction-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.transaction-item-product {
  flex: 1;
}

.transaction-item-product .combobox-input {
  height: var(--control-h-sm);
  line-height: var(--control-h-sm-line);
  padding: 0 10px;
}

.transaction-total {
  text-align: right;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-gold-bright);
  margin: 14px 0 4px;
}

.contract-discount-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.pay-line {
  margin: 6px 0;
}

.pay-total {
  color: var(--color-gold-bright);
  font-size: 1.05rem;
}

.users-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.users-list {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--color-iron-border);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 0.9rem;
}

.user-row .card-actions {
  flex-shrink: 0;
}

.user-row .card-actions .btn {
  min-width: 96px;
}

.backup-settings-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.backup-settings-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.backup-settings-row input[type="number"] {
  width: 80px;
}

.backup-settings-hint {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.backup-list {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--color-iron-border);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 0.9rem;
}

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar .filter-select {
  flex: 1;
  min-width: 200px;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--color-iron-border);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.log-time {
  color: var(--color-text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.log-user {
  color: var(--color-gold-bright);
  font-weight: 600;
  white-space: nowrap;
}

.log-message {
  color: var(--color-text-light);
}

/* ----------------------------------------------------------------- toast */

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--color-iron);
  border: 1px solid var(--color-gold);
  color: var(--color-text-light);
  padding: 12px 16px;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 320px;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-error {
  border-color: var(--color-blood-bright);
}

.hidden {
  display: none !important;
}

/* ------------------------------------------------------ connection banner */

.connection-banner {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--color-iron);
  color: var(--color-text-light);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.connection-banner.show {
  opacity: 1;
  transform: translateY(0);
}

.connection-banner.error {
  border: 1px solid var(--color-blood-bright);
}

.connection-banner.success {
  border: 1px solid #4caf6f;
}
