﻿:root {
  --bg0: #0b0f1a;
  --bg1: rgba(255,255,255,0.06);
  --bg2: rgba(255,255,255,0.09);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.62);
  --line: rgba(255,255,255,0.12);
  --accent: #7c5cff;
  --accent2: #22c55e;
  --danger: #ef4444;
  --shadow: 0 18px 55px rgba(0,0,0,0.45);
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg0);
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1000px 700px at 15% 10%, rgba(124,92,255,0.20), transparent 50%),
    radial-gradient(900px 650px at 85% 20%, rgba(34,197,94,0.16), transparent 55%),
    radial-gradient(900px 650px at 45% 90%, rgba(124,92,255,0.12), transparent 55%);
  filter: saturate(1.1);
}

.container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  position: relative;
}

main.container {
  padding-bottom: 20px;
}

.header {
  padding: 28px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: white;
  background: linear-gradient(135deg, rgba(124,92,255,1), rgba(34,197,94,0.95));
  box-shadow: var(--shadow);
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }

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

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 14px 0;
}

.controls {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.control label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
  appearance: none;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

textarea { resize: vertical; }

select {
  cursor: pointer;
  padding-right: 34px;
  background-color: #111827;
  color-scheme: dark;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(1em + 2px), calc(100% - 13px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
/* Keep dropdown menus and scrollbars visually aligned with the dark UI. */
select,
select option,
select optgroup {
  background: #111827;
  color: var(--text);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(124,92,255,0.85) rgba(255,255,255,0.06);
}

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

*::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.06);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(124,92,255,0.95), rgba(34,197,94,0.9));
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.06);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(124,92,255,1), rgba(34,197,94,1));
}

.control-inline {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

.btn {
  border: 1px solid rgba(255,255,255,0.16);
  background: linear-gradient(135deg, rgba(124,92,255,1), rgba(124,92,255,0.70));
  color: white;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#tokenCalcPanel {
  position: relative;
  z-index: 30;
  overflow: visible;
}

.table-wrap {
  position: relative;
  z-index: 1;
  padding: 0;
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.table thead th {
  position: sticky;
  top: 0;
  background: rgba(0,0,0,0.22);
  backdrop-filter: blur(12px);
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 650;
}

.table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr {
  cursor: pointer;
}

.table tbody tr:hover {
  background: rgba(255,255,255,0.06);
}

.right { text-align: right; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.dot.green { background: var(--accent2); }
.dot.red { background: var(--danger); }

.dev {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dev img {
  width: 28px;
  height: 28px;
  padding: 4px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
}

.empty { padding: 18px; }

.dialog::backdrop { background: rgba(0,0,0,0.55); }

.dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  width: min(820px, calc(100% - 28px));
  box-shadow: var(--shadow);
  background: var(--bg0);
  color: var(--text);
}

.dialog-inner { margin: 0; padding: 16px; }

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dialog-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dialog-logo img {
  width: 52px;
  height: 52px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: rgba(255,255,255,0.06);
}

.h2 { font-size: 18px; font-weight: 750; }

.icon-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.dialog-body {
  padding: 14px 0;
  display: grid;
  gap: 14px;
}

.kv {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
}

.k { color: var(--muted); font-size: 12px; padding-top: 4px; }
.v { font-size: 14px; }

.notes {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text);
}

.code {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.22);
  overflow: auto;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.span2 { grid-column: span 2; }

.calc-title {
  margin: 0 0 12px;
  font-size: 18px;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.calc-model-control {
  position: relative;
}

.calc-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111827;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  z-index: 25;
  padding: 6px;
}

.calc-menu-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px;
  cursor: pointer;
  display: grid;
  gap: 3px;
}

.calc-menu-item:hover,
.calc-menu-item:focus-visible {
  border-color: var(--line);
  background: rgba(124,92,255,0.18);
  outline: none;
}

.calc-menu-name {
  font-size: 14px;
}

.calc-menu-dev {
  font-size: 12px;
  color: var(--muted);
}
.calc-result {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 42px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-result { white-space: normal; }
  .grid2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody tr { border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .table tbody td { border: 0; padding: 6px 0; }
  .table tbody td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 2px;
  }
}






select:focus-visible {
  border-color: rgba(124,92,255,0.75);
  box-shadow: 0 0 0 3px rgba(124,92,255,0.20);
}



