.ts-app {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0 28px;
  min-width: 0;
}

.ts-loading {
  padding: 24px;
  color: var(--muted);
}

.ts-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.ts-top-label {
  font-weight: 700;
}

.ts-badge {
  font-size: 13px;
}

.ts-app[data-server="running"] .ts-badge::before,
.ts-app[data-server="starting"] .ts-badge::before,
.ts-app[data-server="preparing"] .ts-badge::before,
.ts-app[data-server="downloading"] .ts-badge::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

.ts-app[data-server="starting"] .ts-badge::before,
.ts-app[data-server="preparing"] .ts-badge::before,
.ts-app[data-server="downloading"] .ts-badge::before {
  animation: ts-pulse 1.1s ease-in-out infinite;
}

@keyframes ts-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.ts-filehelp {
  padding: 14px 18px;
  border: 1px solid var(--info);
  border-radius: var(--radius-m);
  background: var(--info-soft);
}

.ts-filehelp[hidden] {
  display: none;
}

.ts-app .ts-filehelp-title {
  margin: 0 0 6px;
  font-size: 17px;
}

.ts-filehelp ol {
  margin: 8px 0;
  padding-left: 22px;
}

.ts-filehelp li {
  margin: 4px 0;
}

.ts-filehelp p {
  margin: 6px 0;
}

.ts-setup {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
}

.ts-panel {
  min-width: 0;
}

.ts-app .ts-panel-title {
  margin: 0;
  font-size: 16px;
}

.ts-panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ts-panel-body > p {
  margin: 0;
}

.ts-plugin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.ts-group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.ts-group-title {
  padding: 0;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ts-pick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-s);
  cursor: pointer;
}

.ts-pick:hover {
  background: var(--raised);
}

.ts-pick input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.ts-pick input:focus-visible,
.ts-eula input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ts-pick-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ts-pick-name {
  overflow-wrap: anywhere;
}

.ts-pick-sub {
  color: var(--muted);
  font-family: var(--font-code);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.ts-app .ts-sub {
  margin: 4px 0 0;
  font-size: 14px;
}

.ts-jar-empty {
  margin: 0;
}

.ts-count {
  margin: 0;
  color: var(--muted);
}

.ts-eula {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg);
  line-height: 1.5;
  cursor: pointer;
}

.ts-eula input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.ts-memory-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ts-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ts-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ts-message {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid var(--info);
  border-radius: var(--radius-s);
  background: var(--info-soft);
  line-height: 1.5;
}

.ts-message[hidden] {
  display: none;
}

.ts-message-ok {
  border-left-color: var(--ok);
  background: var(--ok-soft);
}

.ts-message-warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.ts-message-bad {
  border-left-color: var(--bad);
  background: var(--bad-soft);
}

.ts-loaded:empty {
  display: none;
}

.ts-loaded {
  margin: 0;
}

.ts-console {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ts-app .ts-console-title {
  margin: 0;
  font-size: 16px;
}

.ts-term .term {
  --term-height: 420px;
}

.ts-term .term-body {
  min-height: 200px;
}

.ts-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ts-chip {
  font-family: var(--font-code);
  font-size: 13px;
}

.ts-chip:disabled {
  opacity: 0.5;
  cursor: default;
}

.ts-console-help {
  margin: 0;
}

.ts-join {
  transition: border-color 0.3s ease;
}

.ts-join.ts-join-ready {
  border-color: var(--ok);
  box-shadow: 0 0 0 1px var(--ok);
}

.ts-app .ts-join-steps {
  margin: 0 0 8px;
  padding-left: 22px;
  line-height: 1.6;
}

.ts-join p {
  margin: 0;
}

@container (max-width: 680px) {
  .ts-setup {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ts-app .ts-badge::before {
    animation: none !important;
  }

  .ts-join {
    transition: none;
  }
}
