:root {
  --page: #101513;
  --page-2: #171b24;
  --ink: #edf7ef;
  --muted: #95a89d;
  --line: rgba(237, 247, 239, .13);
  --line-strong: rgba(237, 247, 239, .24);
  --surface: rgba(18, 25, 23, .82);
  --surface-2: rgba(25, 35, 33, .88);
  --green: #66f2a6;
  --cyan: #62d7ff;
  --amber: #ffd166;
  --red: #ff6b6b;
  --purple: #b693ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(120deg, rgba(102, 242, 166, .10), transparent 30%),
    linear-gradient(245deg, rgba(98, 215, 255, .10), transparent 34%),
    linear-gradient(180deg, var(--page), var(--page-2));
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.dw-app {
  width: min(1320px, calc(100% - 26px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 0 34px;
}

.dw-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 2px 14px;
}

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

.dw-brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(102, 242, 166, .38);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, .42), transparent 30%),
    linear-gradient(145deg, #195e4b, #111a18);
  color: #effff5;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: .04em;
  box-shadow: 0 0 0 4px rgba(102, 242, 166, .09), inset 0 -7px 0 rgba(0, 0, 0, .18);
}

.dw-brand strong,
.dw-brand em {
  display: block;
}

.dw-brand strong {
  font-size: 18px;
  line-height: 1;
}

.dw-brand em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.dw-top-actions {
  display: flex;
  justify-content: flex-end;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--ink);
  padding: 0 15px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .22);
}

button:hover {
  border-color: rgba(102, 242, 166, .46);
  background: rgba(255, 255, 255, .10);
}

.dw-status-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.dw-status-grid div,
.dw-market-card,
.dw-trade-card,
.dw-service-card,
.dw-log-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025)), var(--surface);
  box-shadow: var(--shadow);
}

.dw-status-grid div {
  min-width: 0;
  padding: 10px 11px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

.dw-status-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.dw-status-grid strong {
  display: block;
  min-width: 0;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.dw-scene {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-height: 154px;
  margin: 10px 0;
  border: 1px solid rgba(98, 215, 255, .20);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(98, 215, 255, .10), rgba(102, 242, 166, .07)),
    #0f151a;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .30);
}

.dw-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.045) 0 1px, transparent 1px 8px);
  opacity: .18;
  pointer-events: none;
}

.dw-skyline {
  position: absolute;
  inset: auto 14px 48px;
  display: flex;
  align-items: end;
  gap: 8px;
  height: 92px;
  opacity: .86;
}

.dw-skyline i {
  display: block;
  flex: 1;
  min-width: 38px;
  border: 1px solid rgba(237, 247, 239, .08);
  background:
    repeating-linear-gradient(90deg, transparent 0 11px, rgba(255, 209, 102, .25) 11px 14px),
    linear-gradient(180deg, #27303c, #121713);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.dw-skyline i:nth-child(1) { height: 54px; }
.dw-skyline i:nth-child(2) { height: 78px; }
.dw-skyline i:nth-child(3) { height: 64px; }
.dw-skyline i:nth-child(4) { height: 90px; }
.dw-skyline i:nth-child(5) { height: 58px; }
.dw-skyline i:nth-child(6) { height: 84px; }
.dw-skyline i:nth-child(7) { height: 67px; }
.dw-skyline i:nth-child(8) { height: 76px; }

.dw-route {
  position: relative;
  z-index: 2;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 98px 12px 12px;
}

.dw-route button {
  min-height: 44px;
  border-radius: var(--radius);
  padding: 8px 9px;
  background: rgba(3, 7, 6, .54);
  text-align: left;
}

.dw-route button.active {
  border-color: rgba(102, 242, 166, .72);
  background: rgba(102, 242, 166, .14);
  box-shadow: 0 0 0 3px rgba(102, 242, 166, .10), 0 14px 30px rgba(0,0,0,.28);
}

.dw-route strong,
.dw-route span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dw-route strong {
  font-size: 12px;
}

.dw-route span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.dw-board {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .48fr) minmax(280px, .56fr);
  gap: 10px;
  align-items: start;
}

.dw-market-card,
.dw-trade-card,
.dw-service-card,
.dw-log-card {
  min-width: 0;
}

.dw-market-card {
  overflow: hidden;
}

.dw-trade-card,
.dw-service-card,
.dw-log-card {
  padding: 14px;
}

.dw-side {
  display: grid;
  gap: 10px;
}

.dw-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
}

.dw-card-head.compact {
  padding: 0 0 10px;
}

.dw-kicker {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.dw-net {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 209, 102, .35);
  border-radius: 999px;
  background: rgba(255, 209, 102, .11);
  color: var(--amber);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 1000;
}

.dw-news {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 35px;
  padding: 0 16px 12px;
}

.dw-news span {
  border: 1px solid rgba(98, 215, 255, .25);
  border-radius: 999px;
  background: rgba(98, 215, 255, .08);
  color: #d7f5ff;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 850;
}

.dw-price-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 12px;
}

.dw-price-guide span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 900;
}

.dw-price-guide i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}

.dw-price-guide i.cold {
  background: var(--cyan);
}

.dw-price-guide i.hot {
  background: var(--red);
}

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

.dw-market-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
}

.dw-market-table th,
.dw-market-table td {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  text-align: left;
}

.dw-market-table th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.dw-market-table tr {
  transition: background .15s ease, color .15s ease;
}

.dw-market-table tbody tr:hover,
.dw-market-table tbody tr.selected {
  background: rgba(102, 242, 166, .08);
}

.dw-product {
  display: grid;
  gap: 2px;
}

.dw-product strong {
  font-size: 15px;
}

.dw-product span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.dw-price {
  font-size: 16px;
  font-weight: 1000;
}

.dw-price.hot {
  color: var(--red);
}

.dw-price.cold {
  color: var(--cyan);
}

.dw-market-table button {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.dw-selected {
  min-height: 96px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.dw-selected span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dw-quantity {
  display: grid;
  gap: 6px;
  margin: 14px 0 10px;
}

.dw-quantity span,
.dw-services label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.dw-quantity input,
.dw-services input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .24);
  color: var(--ink);
  padding: 0 11px;
  font-weight: 900;
  outline: none;
}

.dw-quantity input:focus,
.dw-services input:focus {
  border-color: rgba(102, 242, 166, .55);
  box-shadow: 0 0 0 3px rgba(102, 242, 166, .09);
}

.dw-trade-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dw-trade-actions button:nth-child(1) {
  color: #07110c;
  background: var(--green);
}

.dw-trade-actions button:nth-child(2) {
  color: #091018;
  background: var(--cyan);
}

.dw-inventory {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.dw-inv-row,
.dw-service-row,
.dw-log p {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .045);
}

.dw-inv-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 10px;
  font-size: 12px;
}

.dw-inv-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dw-inv-row span {
  color: var(--muted);
  font-weight: 900;
}

.dw-services {
  display: grid;
  gap: 10px;
}

.dw-service-row {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.dw-service-row strong {
  font-size: 13px;
}

.dw-service-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dw-service-row label {
  display: grid;
  gap: 5px;
}

.dw-service-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.dw-service-buttons button {
  min-height: 34px;
  padding: 0 9px;
  font-size: 12px;
}

.dw-log {
  display: grid;
  gap: 7px;
  max-height: 302px;
  overflow: auto;
}

.dw-log p {
  margin: 0;
  padding: 9px 10px;
  color: #d9e7dd;
  font-size: 12px;
  line-height: 1.35;
}

.dw-log p b {
  color: var(--amber);
}

.dw-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  width: min(520px, calc(100vw - 26px));
  margin: 0;
  border: 1px solid rgba(102, 242, 166, .35);
  border-radius: var(--radius);
  background: rgba(11, 17, 15, .92);
  color: var(--ink);
  padding: 12px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 20px 54px rgba(0, 0, 0, .44);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.dw-toast[hidden] {
  display: none;
}

.dw-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 5, .68);
  padding: 18px;
  backdrop-filter: blur(10px);
}

.dw-modal[hidden] {
  display: none;
}

.dw-modal-card {
  width: min(520px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03)),
    #121916;
  padding: 20px;
  box-shadow: 0 28px 86px rgba(0, 0, 0, .56);
}

.dw-modal-card h2 {
  font-size: 25px;
}

.dw-modal-card p:not(.dw-kicker) {
  color: #d4e5d9;
  line-height: 1.5;
}

.dw-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.dw-final-score {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.dw-final-score div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .05);
  padding: 10px;
}

.dw-final-score span,
.dw-final-score strong {
  display: block;
}

.dw-final-score span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.dw-final-score strong {
  margin-top: 4px;
  font-size: 17px;
}

@media (max-width: 1120px) {
  .dw-status-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dw-board {
    grid-template-columns: minmax(0, 1fr) minmax(250px, .5fr);
  }

  .dw-side {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .dw-app {
    width: min(100% - 18px, 1320px);
    padding-top: 10px;
  }

  .dw-top {
    align-items: flex-start;
  }

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

  .dw-route {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 82px;
  }

  .dw-skyline {
    bottom: 142px;
  }

  .dw-scene {
    min-height: 246px;
  }

  .dw-board,
  .dw-side {
    grid-template-columns: 1fr;
  }

  .dw-market-table th,
  .dw-market-table td {
    padding: 11px 12px;
  }
}

@media (max-width: 520px) {
  .dw-brand em {
    display: none;
  }

  .dw-status-grid strong {
    font-size: 14px;
  }

  .dw-card-head {
    display: grid;
  }

  .dw-trade-actions,
  .dw-service-buttons,
  .dw-final-score {
    grid-template-columns: 1fr;
  }
}
