/* /mods/ — мастерская. Токены nordic-home. Движение живёт на сцене, не в хроме. */

.mods-page {
  background: var(--bg);
  color: var(--ink);
}

@media (min-width: 961px) {
  .mods-page {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .mods-top {
    flex: 0 0 auto;
  }

  .mods-body {
    flex: 1;
    min-height: 0;
  }
}

.mods-top .nav {
  flex: 1;
}

.mods-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: calc(100dvh - 58px);
}

.mods-rail {
  border-right: 1px solid var(--line);
  background: var(--bg);
  min-height: 0;
}

.mods-rail-label {
  margin: 0;
  padding: 14px 14px 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.mods-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mods-pick strong {
  font-weight: 700;
  letter-spacing: -0.03em;
}

.mods-pick span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.mods-pick[aria-current="true"] {
  background: var(--ink);
  color: var(--bg);
}

.mods-pick[aria-current="true"] span {
  color: var(--line);
}

.mods-work {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 200px;
}

.mods-split {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(320px, 3fr);
}

.mods-stage-wrap {
  background: var(--ink);
  color: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.mods-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 14px;
}

.mods-task {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}

.mods-stage-switch {
  display: flex;
  flex: 0 0 auto;
}

.mods-stage-switch button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent);
  background: transparent;
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.mods-stage-switch button + button {
  margin-left: -1px;
}

.mods-stage-switch button.is-on {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--bg);
}

.mods-sheet {
  flex: 1;
  min-height: 0;
  margin: 0 14px 14px;
  background: var(--bg);
}

.mods-sheet iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
}

.mods-settings,
.mods-code {
  min-height: 0;
  min-width: 0;
}

.mods-settings {
  padding: 14px 16px 16px;
  background: var(--surface);
  overflow: auto;
}

.mods-settings h2,
.mods-code h2,
.mods-icons-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.mods-code {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.mods-code-head,
.mods-icons-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mods-code-head {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 8px 16px;
}

.mods-icons-head {
  margin: 14px 0 8px;
}

.mods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-top: 12px;
}

.mods-page [hidden] {
  display: none !important;
}

.mods-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.mods-field-wide {
  margin-top: 12px;
}

.mods-input,
.mods-color {
  height: 40px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  padding: 0 10px;
}

.mods-area {
  height: auto;
  min-height: 72px;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.45;
}

.mods-color {
  padding: 4px;
}

.mods-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  font-size: 0.95rem;
}

.mods-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.mods-warn {
  margin: 0;
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.mods-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.mods-icon-row .mods-input:first-child {
  width: 132px;
  flex: 0 0 132px;
}

.mods-icon-row .mods-input:nth-child(2) {
  flex: 1 1 140px;
  width: auto;
}

.mods-page .btn {
  height: 40px;
  padding: 0 14px;
  transition: background 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

.mods-page .btn:hover {
  transform: none;
}

.mods-page .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
}

.mods-out {
  flex: 1;
  min-height: 0;
  width: 100%;
  margin: 0;
  border: 0;
  resize: none;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 16px;
  font: 13px/1.5 ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
}

.mods-page :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 960px) {
  .mods-body {
    display: block;
    min-height: 0;
  }

  .mods-rail {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mods-rail-label {
    display: none;
  }

  #mods-list {
    display: flex;
  }

  .mods-pick {
    width: auto;
    min-width: 168px;
    border-top: 0;
    border-right: 1px solid var(--line);
  }

  .mods-work {
    display: flex;
    flex-direction: column;
  }

  .mods-split {
    display: contents;
  }

  .mods-stage-wrap {
    order: 1;
  }

  .mods-settings {
    order: 2;
    overflow: visible;
  }

  .mods-code {
    order: 3;
  }

  .mods-grid {
    grid-template-columns: 1fr;
  }

  .mods-sheet {
    height: 420px;
    flex: none;
  }

  .mods-out {
    min-height: 180px;
  }

  .mods-top .top-phone {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mods-page .btn {
    transition: none;
  }
}
