/* Direction component styles — consumes semantic tokens from
   base.css + dark.css/light.css. Same class names across directions. */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family: var(--font-ui);
  font-size: calc(13px * var(--font-scale, 1));
  line-height: 1.5;
  background: var(--surface-0);
  color: var(--text-1);
  overflow: hidden;
}
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}
input,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 5px;
  border: 2px solid var(--surface-1);
}
/* The UA paints the square where the two scrollbars meet; left to itself it
   keeps the browser's light default and reads as a white chip in dark
   schemes (it only exists when both axes scroll). */
::-webkit-scrollbar-corner {
  background: transparent;
}
.spacer {
  flex: 1;
}

.shell {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  background: var(--surface-1-solid);
  border-bottom: 1px solid var(--border);
}
.shell__brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo {
  height: 16px;
  display: block;
}
.logo--light {
  display: none;
}
[data-theme='light'] .logo--dark {
  display: none;
}
[data-theme='light'] .logo--light {
  display: block;
}
.shell__concept {
  font-size: calc(10px * var(--font-scale, 1));
  font-weight: 500;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 7px;
}
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
}
.tab {
  padding: 3px 12px;
  font-size: calc(12px * var(--font-scale, 1));
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-sm);
}
.tab:not(.tab--active):hover {
  color: var(--text-1);
  background: var(--surface-3);
}
.tab--active {
  color: var(--text-1);
  background: var(--surface-1);
  box-shadow: 0 1px 2px rgba(1, 4, 9, 0.2);
}
[data-theme='light'] .tab--active {
  box-shadow: 0 1px 2px rgba(31, 35, 40, 0.1);
}
.tab--add {
  color: var(--text-3);
  padding: 3px 8px;
}
.shell__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.seg {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.seg__btn {
  padding: 3px 9px;
  font-size: calc(11px * var(--font-scale, 1));
  color: var(--text-2);
  border-right: 1px solid var(--border);
}
.seg__btn:last-child {
  border-right: none;
}
.seg__btn:hover {
  color: var(--text-1);
  background: var(--surface-2);
}
.seg__btn--active {
  background: var(--accent-soft);
  color: var(--accent-bright);
}
[data-theme='light'] .seg__btn--active {
  color: var(--accent);
}
.avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: calc(11px * var(--font-scale, 1));
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  border-radius: 999px;
  color: var(--text-on-accent);
  cursor: pointer;
}

.workspace {
  height: calc(100vh - var(--header-h) - var(--statusbar-h));
  display: grid;
  grid-template-columns: 5fr 4fr 4fr;
  grid-template-rows: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}
.win {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface-1-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-win);
  overflow: hidden;
}
.win--headlines {
  grid-row: 1 / 3;
}
.win--calendar {
  grid-column: 2;
  grid-row: 1;
}
.win--chart {
  grid-column: 3;
  grid-row: 1;
}
.win--audio {
  grid-column: 2;
  grid-row: 2;
}
.win--kit {
  grid-column: 3;
  grid-row: 2;
}
.win__bar {
  height: 32px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.win__grip {
  color: var(--text-3);
  font-size: calc(10px * var(--font-scale, 1));
  cursor: grab;
}
.win__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(12px * var(--font-scale, 1));
  font-weight: 600;
  color: var(--text-1);
}
.win__status {
  font-size: calc(11px * var(--font-scale, 1));
  color: var(--text-3);
}
.win__controls {
  display: flex;
  gap: 2px;
}
.wbtn {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  font-size: calc(12px * var(--font-scale, 1));
  border-radius: var(--r-sm);
}
.wbtn:hover {
  background: var(--surface-3);
  color: var(--text-1);
}
.wbtn--close:hover {
  background: var(--negative-soft);
  color: var(--negative);
}
.win__toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}
.win__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: none;
  display: inline-block;
  border-radius: 999px;
  background: var(--text-3);
}
.status-dot--live {
  background: var(--positive);
  animation: dot-pulse 2s infinite;
}
.status-dot--connecting {
  background: var(--warning);
  animation: dot-blink 1s infinite;
}
.status-dot--reconnecting {
  background: var(--warning);
  animation: dot-blink 0.5s infinite;
}
.status-dot--error {
  background: var(--negative);
}
.status-dot--idle {
  background: var(--text-3);
}
@keyframes dot-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}
@keyframes dot-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: calc(12px * var(--font-scale, 1));
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-1);
}
.btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
}
.btn--primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
}
.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
}
.btn--ghost:hover {
  color: var(--text-1);
  background: var(--surface-3);
}
.btn--danger {
  border-color: transparent;
  background: transparent;
  color: var(--negative);
}
.btn--danger:hover {
  background: var(--negative-soft);
}
.btn--sm {
  padding: 2px 8px;
  font-size: calc(11px * var(--font-scale, 1));
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  font-size: calc(11px * var(--font-scale, 1));
  font-weight: 500;
  line-height: 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  background: var(--surface-2);
}
button.chip:hover {
  color: var(--text-1);
  background: var(--surface-3);
}
.chip--active {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: var(--accent-soft);
}
[data-theme='light'] .chip--active {
  color: var(--accent);
}
.chip--positive {
  border-color: transparent;
  background: var(--positive-soft);
  color: var(--positive);
}
.chip--negative {
  border-color: transparent;
  background: var(--negative-soft);
  color: var(--negative);
}
.chip--warning {
  border-color: transparent;
  background: var(--warning-soft);
  color: var(--warning);
}

.form-input {
  height: 26px;
  padding: 0 9px;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-1);
  min-width: 0;
  transition:
    border-color 0.15s ease-out,
    box-shadow 0.15s ease-out;
}
[data-theme='light'] .form-input {
  background: var(--surface-1);
}
.form-input::placeholder {
  color: var(--text-3);
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
select.form-input {
  cursor: pointer;
}

.day-group {
  padding: 5px 12px;
  font-size: calc(11px * var(--font-scale, 1));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: var(--surface-0);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
}
[data-theme='light'] .day-group {
  background: var(--surface-2);
}
.hl {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-subtle);
  border-left: 2px solid transparent;
}
.hl:hover {
  background: var(--surface-2);
}
.hl--new {
  animation: flash-new 3s ease-out forwards;
}
.hl--updated {
  animation: flash-upd 3s ease-out forwards;
}
@keyframes flash-new {
  0%,
  18% {
    background: var(--flash-new-bg);
    border-left-color: var(--accent);
  }
  100% {
    background: transparent;
  }
}
@keyframes flash-upd {
  0%,
  18% {
    background: var(--flash-upd-bg);
    border-left-color: var(--warning);
  }
  100% {
    background: transparent;
  }
}
.hl__time {
  flex: none;
  font-family: var(--font-data);
  font-size: calc(12px * var(--font-scale, 1));
  color: var(--text-3);
}
.chip--section {
  flex: none;
  align-self: center;
}
.hl__text {
  flex: 1;
  color: var(--text-1);
}
.hl__audio {
  flex: none;
  align-self: center;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  font-size: calc(9px * var(--font-scale, 1));
  font-weight: 700;
  color: var(--accent-bright);
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
}
[data-theme='light'] .hl__audio {
  color: var(--accent);
}

.cal-table {
  width: 100%;
  border-collapse: collapse;
}
.cal-table th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 5px 10px;
  font-size: calc(11px * var(--font-scale, 1));
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-0);
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
[data-theme='light'] .cal-table th {
  background: var(--surface-2);
}
.cal-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: calc(12px * var(--font-scale, 1));
}
.cal-table tr:hover td {
  background: var(--surface-2);
}
.cal-table .num {
  font-family: var(--font-data);
  text-align: right;
  font-size: calc(12px * var(--font-scale, 1));
}
.cc {
  display: inline-block;
  padding: 0 5px;
  font-size: calc(10px * var(--font-scale, 1));
  font-weight: 600;
  line-height: 16px;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.imp {
  display: inline-flex;
  gap: 2px;
  align-items: flex-end;
  height: 11px;
}
.imp__bar {
  width: 3px;
  border-radius: 1px;
  background: var(--surface-3);
}
.imp__bar:nth-child(1) {
  height: 4px;
}
.imp__bar:nth-child(2) {
  height: 8px;
}
.imp__bar:nth-child(3) {
  height: 11px;
}
.imp--high .imp__bar {
  background: var(--negative);
}
.imp--med .imp__bar:nth-child(-n + 2) {
  background: var(--warning);
}
.imp--low .imp__bar:nth-child(1) {
  background: var(--text-3);
}
td.actual {
  font-weight: 600;
}
tr.cal-soon td {
  background: var(--accent-soft);
}

.audio-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.audio-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 30px;
}
.eq__bar {
  width: 4px;
  border-radius: 2px;
  background: var(--accent);
  height: 20%;
  animation: eq 1.1s ease-in-out infinite;
  animation-play-state: paused;
}
.eq.playing .eq__bar {
  animation-play-state: running;
}
.eq__bar:nth-child(1) {
  animation-delay: 0s;
}
.eq__bar:nth-child(2) {
  animation-delay: 0.15s;
}
.eq__bar:nth-child(3) {
  animation-delay: 0.3s;
}
.eq__bar:nth-child(4) {
  animation-delay: 0.05s;
}
.eq__bar:nth-child(5) {
  animation-delay: 0.22s;
}
.eq__bar:nth-child(6) {
  animation-delay: 0.37s;
}
.eq__bar:nth-child(7) {
  animation-delay: 0.12s;
}
@keyframes eq {
  0%,
  100% {
    height: 20%;
  }
  50% {
    height: 100%;
  }
}
.progress {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--surface-3);
  position: relative;
  overflow: hidden;
}
.progress__fill {
  position: absolute;
  inset: 0 65% 0 0;
  border-radius: 3px;
  background: var(--accent);
}
.audio-meta {
  font-size: calc(11px * var(--font-scale, 1));
  color: var(--text-3);
}
input[type='range'] {
  accent-color: var(--accent);
  width: 100px;
}

.kit-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kit__group label {
  display: block;
  font-size: calc(10px * var(--font-scale, 1));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 5px;
}
.kit__row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.swatch {
  width: 18px;
  height: 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
}
.kit__type-ui {
  font-family: var(--font-ui);
}
.kit__type-data {
  font-family: var(--font-data);
  font-size: calc(12px * var(--font-scale, 1));
}
.dot-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: calc(11px * var(--font-scale, 1));
  color: var(--text-2);
}

.statusbar {
  height: var(--statusbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  font-size: calc(11px * var(--font-scale, 1));
  color: var(--text-3);
  background: var(--surface-1-solid);
  border-top: 1px solid var(--border);
}
.statusbar .dot-label {
  color: var(--text-2);
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }
  .workspace {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .win--headlines,
  .win--calendar,
  .win--chart,
  .win--audio,
  .win--kit {
    grid-column: auto;
    grid-row: auto;
  }
  .win {
    min-height: 320px;
  }
  .win__body {
    max-height: 40vh;
  }
  .tabs {
    display: none;
  }
}
