:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7fb;
  color: #122033;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(78, 112, 255, 0.16), transparent 38%),
    #f4f7fb;
}

.shell {
  display: grid;
  min-height: 100vh;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  place-items: center;
}

.card {
  width: min(100%, 440px);
  padding: 36px 30px;
  border: 1px solid rgba(18, 32, 51, 0.08);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 60px rgba(34, 52, 84, 0.12);
}

.mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  border-radius: 14px;
  background: #3157f6;
  color: #fff;
  font-size: 25px;
  font-weight: 750;
  place-items: center;
}

.mark--small {
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 12px;
  font-size: 21px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #3157f6;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 9vw, 42px);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.body {
  margin: 20px 0 0;
  color: #556274;
  font-size: 17px;
  line-height: 1.55;
}

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 28px 0 0;
  color: #287549;
  font-size: 14px;
  font-weight: 650;
}

.status span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2eb76f;
  box-shadow: 0 0 0 5px rgba(46, 183, 111, 0.13);
}

.status--error {
  color: #ad2e3f;
}

.status--error span {
  background: #d43b4f;
  box-shadow: 0 0 0 5px rgba(212, 59, 79, 0.13);
}

.cabinet-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.cabinet {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 15px 16px;
  border: 1px solid rgba(18, 32, 51, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.cabinet[aria-pressed="true"] {
  border-color: #3157f6;
  box-shadow: 0 0 0 3px rgba(49, 87, 246, 0.12);
}

.cabinet:disabled {
  cursor: wait;
  opacity: 0.65;
}

.cabinet strong {
  font-size: 16px;
}

.cabinet span {
  color: #6b7687;
  font-size: 13px;
}

.button {
  width: 100%;
  margin-top: 22px;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  background: #3157f6;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button--telegram {
  background: #229ed9;
}

.workspace {
  width: min(100%, 680px);
  padding: 28px;
  border: 1px solid rgba(18, 32, 51, 0.08);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 60px rgba(34, 52, 84, 0.12);
}

.workspace__header,
.workspace__brand {
  display: flex;
  align-items: center;
}

.workspace__header {
  justify-content: space-between;
  gap: 18px;
}

.workspace__brand {
  gap: 14px;
  min-width: 0;
}

.workspace h1 {
  overflow: hidden;
  font-size: clamp(24px, 7vw, 34px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace__meta {
  margin: 18px 0 0;
  color: #6b7687;
  font-size: 14px;
}

.link-button {
  flex: none;
  padding: 9px 12px;
  border: 1px solid rgba(49, 87, 246, 0.2);
  border-radius: 12px;
  background: rgba(49, 87, 246, 0.08);
  color: #3157f6;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 24px -4px 0;
  padding: 0 4px 12px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(18, 32, 51, 0.1);
}

.tab {
  display: flex;
  align-items: center;
  flex: none;
  gap: 8px;
  padding: 10px 13px;
  border: 0;
  border-radius: 12px;
  background: #3157f6;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
}

.tab__count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  text-align: center;
}

.issues-panel {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.panel-state,
.issue-card {
  margin: 0;
  padding: 17px;
  border: 1px solid rgba(18, 32, 51, 0.1);
  border-radius: 16px;
  background: rgba(244, 247, 251, 0.8);
}

.panel-state {
  color: #556274;
  line-height: 1.5;
}

.panel-state--summary {
  white-space: pre-line;
}

.panel-state--error {
  border-color: rgba(173, 46, 63, 0.2);
  color: #ad2e3f;
}

.issue-card h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.issue-card p {
  margin: 8px 0 0;
  color: #556274;
  font-size: 14px;
  line-height: 1.5;
}

.issue-card__meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.issue-copy {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #3157f6;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: copy;
}

.issue-preview {
  display: -webkit-box;
  overflow: hidden;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(18, 32, 51, 0.05);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.issue-publications {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.issue-publications a {
  color: #3157f6;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.issue-card {
  padding: 0;
  overflow: hidden;
}

.issue-card__head {
  padding: 17px;
  cursor: pointer;
  list-style: none;
}

.issue-card__head::-webkit-details-marker {
  display: none;
}

.issue-card__head::after {
  content: "⌄";
  float: right;
  margin-top: -24px;
  color: #6b7788;
  font-size: 20px;
}

.issue-card[open] .issue-card__head::after {
  transform: rotate(180deg);
}

.issue-fix {
  display: grid;
  gap: 12px;
  padding: 17px;
  border-top: 1px solid rgba(18, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.issue-fix h3 {
  margin: 0;
  font-size: 14px;
}

.issue-field {
  display: grid;
  gap: 6px;
  color: #556274;
  font-size: 13px;
}

.issue-field input,
.issue-field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(18, 32, 51, 0.18);
  border-radius: 10px;
  background: #fff;
  color: #122033;
  font: inherit;
  font-size: 16px;
}

.issue-field input:focus,
.issue-field select:focus {
  border-color: #3157f6;
  outline: 3px solid rgba(49, 87, 246, 0.12);
}

.issue-field input[aria-invalid="true"] {
  border-color: #ad2e3f;
}

.issue-fields {
  display: grid;
  gap: 10px;
}

.issue-fields--two {
  grid-template-columns: 1fr 1fr;
}

.issue-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.issue-action {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(18, 32, 51, 0.18);
  border-radius: 10px;
  background: #fff;
  color: #122033;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.issue-action--primary {
  border-color: #3157f6;
  background: #3157f6;
  color: #fff;
}

.issue-action--danger {
  border-color: rgba(173, 46, 63, 0.45);
  color: #ad2e3f;
}

.issue-action:disabled {
  cursor: default;
  opacity: 0.5;
}

.issue-form-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(18, 32, 51, 0.1);
  border-radius: 12px;
}

.issue-form__error {
  color: #ad2e3f;
  font-size: 13px;
}

.issue-suggestions {
  display: grid;
  gap: 4px;
}

.issue-suggestions .issue-action {
  text-align: left;
  font-weight: 500;
}

.issue-saved {
  margin: 0 !important;
  color: #167642 !important;
  font-weight: 700;
}

@media (max-width: 520px) {
  .workspace {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .workspace__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .issue-fields--two {
    grid-template-columns: 1fr;
  }

  .issue-action {
    width: 100%;
    min-height: 44px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    background: #0b1220;
    color: #edf3ff;
  }

  body {
    background:
      radial-gradient(circle at 20% 0%, rgba(78, 112, 255, 0.2), transparent 38%),
      #0b1220;
  }

  .card {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(18, 28, 45, 0.94);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  }

  .workspace {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(18, 28, 45, 0.94);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  }

  .body {
    color: #aebbd0;
  }

  .status {
    color: #78dba3;
  }

  .status--error {
    color: #ff8e9b;
  }

  .cabinet {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
  }

  .cabinet span {
    color: #aebbd0;
  }

  .workspace__meta,
  .panel-state,
  .issue-card p {
    color: #aebbd0;
  }

  .tabs {
    border-color: rgba(255, 255, 255, 0.1);
  }

  .panel-state,
  .issue-card {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
  }

  .panel-state--error {
    border-color: rgba(255, 142, 155, 0.24);
    color: #ff8e9b;
  }

  .issue-fix,
  .issue-form-group {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
  }

  .issue-field {
    color: #aebbd0;
  }

  .issue-field input,
  .issue-field select,
  .issue-action {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #edf3ff;
  }

  .issue-action--primary {
    border-color: #6280ff;
    background: #3157f6;
  }

  .issue-saved {
    color: #78dba3 !important;
  }
}
