/* Atölyenin kabuğu: üst çubuk, katlanabilir paneller, ders/örnek kartları, palet. Sitenin
   (tanıtım sayfasının) yazı tipi ve renkleriyle uyumlu. styles.css'ten sonra yüklenir, onun
   genel kurallarının üstüne yazar. Tuvalin içi (parçalar, teller) styles.css'te kalır. */

.app {
  --ws-radius: 12px;
  --ws-lw: clamp(290px, 23vw, 360px);
  --ws-rw: 284px;
  --font-fun: 'Fredoka', Inter, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --grad: linear-gradient(135deg, #ff7a45, #ff5f6d);
}

/* ---------- üst çubuk ---------- */

.app .topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: nowrap;
}
.app .tb-zone {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.app .tb-center {
  justify-content: safe center;
  overflow: hidden;
}
.app .clock-ctl .muted {
  display: none;
}
.app .tb-right {
  justify-content: flex-end;
  margin-left: 0;
  flex-wrap: nowrap;
}
.app .brand {
  font-family: var(--font-fun);
  font-weight: 600;
  font-size: 18px;
  gap: 9px;
  padding: 4px 6px;
  border-radius: 10px;
}
.app .brand:hover {
  background: var(--panel-2);
}
.app .logo-core {
  fill: #fff;
  opacity: 1;
}
.app .seg {
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.app .seg button {
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 500;
}
.app .seg button.on {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.app .mode-tabs button {
  font-weight: 600;
}
.app .mode-tabs button.on {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 3px 10px rgba(255, 106, 61, 0.35);
}

/* Ortadaki araç kutusu: ikonlar tek bir hapın içinde. */
.app .toolbox {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.app .toolbox .tb,
.app .panel-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: 10px;
  border: 0;
  color: var(--muted);
}
.app .toolbox .tb:hover:not(:disabled),
.app .panel-toggle:hover {
  background: var(--panel);
  color: var(--text);
}
.app .toolbox .seg {
  background: transparent;
  border: 0;
  padding: 0;
}
.app .toolbox .seg button {
  width: 34px;
  height: 28px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
.app .tb-div {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 4px;
  flex: none;
}
.app .tb-div.tall {
  height: 26px;
  margin: 0 2px;
}
.app .panel-toggle.on {
  color: var(--text);
  background: transparent;
  border-color: transparent;
}
.app .panel-toggle:not(.on) {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.app .clock-ctl {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 14px;
  padding: 3px 10px 3px 3px;
  margin: 0;
}
.app .clock-ctl .icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 12px;
}
.app .clock-ctl select {
  border-radius: 8px;
  background: var(--panel);
}

/* Sağdaki hap düğmeler. */
.app .tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  color: var(--text);
}
.app .tb-btn:hover:not(:disabled) {
  border-color: var(--muted);
  background: var(--panel-2);
}
.app .tb-btn.accent {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 106, 61, 0.3);
}
.app .tb-btn.accent:hover:not(:disabled) {
  filter: brightness(1.06);
  background: var(--grad);
}
.app .tb-btn .tb-icon {
  width: 17px;
  height: 17px;
}
.app .linked {
  border-radius: 999px;
}
.app .linked .update {
  height: 34px;
}
.app .linked .unlink {
  border-radius: 0 999px 999px 0;
}

/* Ayarlar (dil, tema). */
.settings-menu {
  position: relative;
}
.settings-menu .icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--muted);
}
.settings-menu .icon-btn:hover {
  color: var(--text);
}
.settings-menu svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-back {
  position: fixed;
  inset: 0;
  z-index: 39;
}
.settings-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  width: 260px;
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.settings-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.settings-pop .seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: 100%;
}
.settings-pop .seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  padding: 6px 8px;
  min-width: 0;
}
.settings-pop .theme-seg svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.app .user-menu .avatar-btn {
  height: 36px;
  padding: 2px 12px 2px 3px;
}
.app .user-menu .avatar {
  width: 30px;
  height: 30px;
}
.app .btn.soft.small {
  height: 36px;
  padding: 0 16px;
  font-size: 13.5px;
  box-shadow: none;
}
.app .btn.soft.small:hover {
  transform: none;
}

/* ---------- paneller: katlanabilir ---------- */

.app .body {
  grid-template-columns: var(--ws-lw) minmax(0, 1fr) var(--ws-rw);
  transition: grid-template-columns 0.22s ease;
}
.app .body.no-left {
  --ws-lw: 0px;
}
.app .body.no-right {
  --ws-rw: 0px;
}
.app .body.lab-mode {
  grid-template-columns: var(--ws-lw) minmax(0, 1fr);
}
.app .body.focus,
.app .body.focus.lab-mode {
  grid-template-columns: minmax(0, 1fr);
}
.app .body.no-left > .left,
.app .body.no-right > .side {
  visibility: hidden;
  border: 0;
  padding: 0;
  overflow: hidden;
}
.app .left,
.app .side {
  background: var(--panel);
}
/* Orta sütun içeriğine göre büyümesin: palet satırı kendi içinde kayar. */
.app .center {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}
.app .palette {
  min-width: 0;
}

/* ---------- sol panel: ders ve serbest atölye ---------- */

.app .lesson-nav {
  padding: 10px 12px;
  gap: 8px;
}
.app .lesson-nav .icon {
  border-radius: 10px;
}
.app .lesson-picker {
  border-radius: 12px;
}
.app .lesson-picker:hover {
  background: var(--panel-2);
}
.app .progress i {
  width: 12px;
  height: 5px;
  border-radius: 3px;
}
.app .progress i.cur {
  background: var(--accent);
  outline: none;
}
.app .lesson-scroll {
  padding: 20px 22px 48px;
  font-size: 14.5px;
  line-height: 1.65;
}
.app .lesson-scroll h2 {
  font-family: var(--font-fun);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 12px;
}
.app .lesson-scroll h3 {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  margin: 26px 0 10px;
}
.app .note {
  border-left: 0;
  background: color-mix(in srgb, var(--accent) 7%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: var(--ws-radius);
  padding: 10px 14px;
}
.app .note.warn {
  background: color-mix(in srgb, var(--warn) 10%, var(--panel-2));
  border-color: color-mix(in srgb, var(--warn) 35%, var(--line));
}
.app .goal {
  border-radius: var(--ws-radius);
  padding: 12px 14px;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.app .lesson-actions {
  gap: 8px;
}
.app .lesson-actions button,
.app .result button {
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 600;
}
.app .lesson-actions button.primary,
.app .result button.primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}
.app .result {
  border-radius: var(--ws-radius);
}
.app .lesson-list {
  padding: 8px;
}
.app .lesson-list button {
  border-radius: 10px;
}
.app .free-lead {
  color: var(--muted);
  margin: 0 0 6px;
}
.app .examples {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
/* Örnek kartı: solda kartın yüksekliğini kaplayan renkli simge bloğu, sağda ad ve etiket. */
.example-card {
  --tone: var(--accent);
  width: 100%;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: stretch;
  min-height: 58px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border-radius: var(--ws-radius, 12px);
  background: var(--panel);
  border: 1px solid var(--line);
  white-space: normal;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.example-card:hover {
  border-color: var(--tone);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--tone) 18%, transparent);
}
.ex-icon {
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--tone), color-mix(in srgb, var(--tone) 70%, #000));
  color: #fff;
}
.ex-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ex-text {
  display: grid;
  align-content: center;
  gap: 1px;
  padding: 8px 12px;
  min-width: 0;
}
.ex-text b {
  font-family: var(--font-fun, 'Fredoka', sans-serif);
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.2;
}
.ex-text small {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app .tips {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--ws-radius, 12px);
  padding: 0 14px;
  background: var(--panel);
}
.app .tips summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app .tips summary::-webkit-details-marker {
  display: none;
}
.app .tips summary::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.app .tips[open] summary::after {
  transform: rotate(-135deg);
}
.app .tips[open] {
  padding-bottom: 12px;
}
.app .tips h4 {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 8px;
}

/* Bilgi panelinin başındaki "açık örnek" kartı. */
.example-info {
  --tone: var(--accent);
  margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--tone) 40%, var(--line));
  border-radius: var(--ws-radius, 12px);
  overflow: hidden;
  background: color-mix(in srgb, var(--tone) 7%, var(--panel));
}
.example-info header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: stretch;
}
.example-info .ex-icon.small svg {
  width: 22px;
  height: 22px;
}
.example-info header > div {
  padding: 8px 10px;
  display: grid;
  align-content: center;
}
.app .side .example-info h3 {
  margin: 0;
  font-family: var(--font-fun, 'Fredoka', sans-serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}
.ex-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tone);
}
.example-info header .icon {
  align-self: start;
  margin: 6px 6px 0 0;
}
.example-info p {
  margin: 0;
  padding: 2px 14px 14px;
  font-size: 13px;
  line-height: 1.55;
}
.app .chip-list li {
  border-radius: 10px;
}

/* ---------- sağ panel ---------- */

.app .side {
  padding: 16px;
}
.app .side h3 {
  font-size: 11.5px;
  letter-spacing: 0.08em;
}
.app .table-wrap {
  border-radius: var(--ws-radius);
}
.ws-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ws-stat {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--ws-radius);
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.ws-stat b {
  font-family: var(--font-fun);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ws-stat span {
  font-size: 12px;
  color: var(--muted);
}
.ws-stat.nand b {
  color: var(--accent);
}
.ws-stat.tr b {
  color: #14b8a6;
}

/* ---------- palet: tek satırlık dok + koleksiyon çekmecesi ---------- */

.app .palette {
  position: relative;
  display: block;
  padding: 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.app .pal-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent;
}
.app .pal-row > * {
  flex: none;
}
.app .pal-item,
.app .pal-coll {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--panel-2);
  border: 1px solid transparent;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.app .pal-item:hover {
  background: color-mix(in srgb, var(--chip, var(--accent)) 14%, var(--panel-2));
  border-color: color-mix(in srgb, var(--chip, var(--accent)) 45%, transparent);
}
.app .pal-item:active {
  transform: translateY(1px);
}
.app .pal-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--chip);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--chip) 20%, transparent);
}
.app .pal-coll {
  background: transparent;
  color: var(--muted);
}
.app .pal-coll:hover {
  background: var(--panel-2);
  color: var(--text);
}
.app .pal-coll::after {
  display: none;
}
.app .pal-coll.open {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}
.app .pal-count {
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
}
.app .pal-coll.open .pal-count {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
}
.app .pal-sep {
  width: 1px;
  height: 22px;
  align-self: center;
  background: var(--line);
  margin: 0 6px;
}
.app .pal-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 2px;
}
.app .pal-end {
  margin-left: auto;
  padding-left: 12px;
}
.app .pal-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.app .pal-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch-track {
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: var(--off);
  transition: background 0.15s;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.pal-toggle input:checked + .switch-track {
  background: var(--accent);
}
.pal-toggle input:checked + .switch-track::after {
  transform: translateX(12px);
}
.pal-toggle input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Çekmece: paletin hemen üstünde, tuvalin üzerine açılır. */
.app .pal-drawer {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: min(46vh, 420px);
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: drawer-up 0.16s ease-out;
}
@keyframes drawer-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.pal-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px 16px;
}
.pal-drawer-head h4 {
  margin: 0;
  font-family: var(--font-fun);
  font-weight: 600;
  font-size: 16px;
}
.pal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  padding: 6px 12px 14px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.app .pal-item.tile {
  height: auto;
  display: grid;
  grid-template-columns: 10px 1fr;
  grid-template-rows: auto auto;
  column-gap: 9px;
  row-gap: 2px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 12px;
  text-align: left;
  white-space: normal;
  background: var(--panel-2);
}
.app .pal-item.tile .pal-name {
  font-weight: 600;
}
.app .pal-item.tile .pal-hint {
  grid-column: 2;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- genel düğmeler ve pencereler ---------- */

.app .modal,
.modal {
  border-radius: 18px;
  padding: 18px 20px;
}
.modal h2 {
  font-family: var(--font-fun, 'Fredoka', Inter, sans-serif);
  font-weight: 600;
  font-size: 20px;
}
.modal button.primary {
  background: linear-gradient(135deg, #ff7a45, #ff5f6d);
  border-color: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 7px 18px;
}
.modal .row-end button.ghost {
  border-radius: 999px;
}
.app .toast {
  border-radius: 999px;
}

/* İnce kaydırma çubukları. */
.app .lesson-scroll,
.app .side,
.app .lesson-list,
.app .pal-pop,
.app .table-wrap {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent;
}

/* ---------- dar ekranlar ---------- */

@media (max-width: 1500px) {
  .app .tb-btn .tb-long + .tb-short {
    display: inline;
  }
  .app .tb-btn .tb-long:has(+ .tb-short) {
    display: none;
  }
  .app .tb-btn {
    padding: 0 12px;
  }
}
@media (max-width: 1320px) {
  .app .brand span {
    display: none;
  }
}
@media (max-width: 1250px) {
  .app .tb-long {
    display: none;
  }
  .app .tb-short {
    display: inline;
  }
}
@media (max-width: 1180px) {
  .app .brand span,
  .app .user-name {
    display: none;
  }
  .app .clock-ctl .muted {
    display: none;
  }
  .app .tb-btn .tb-short,
  .app .tb-btn .tb-long + .tb-short {
    display: none;
  }
  .app .tb-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
}
.app .side-scrim {
  display: none;
}
@media (max-width: 960px) {
  .app .body {
    --ws-rw: 0px;
  }
  /* Sağ panel: tuvalin üstüne sağdan açılan çekmece; dışına dokununca kapanır. */
  .app .body > .side,
  .app .body.no-right > .side {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: min(360px, 88vw);
    padding: 16px;
    overflow-y: auto;
    visibility: visible;
    border-left: 1px solid var(--line);
    box-shadow: -18px 0 40px rgb(0 0 0 / 0.25);
    transform: translateX(0);
    transition: transform 0.22s ease, visibility 0.22s;
  }
  .app .body.no-right > .side,
  .app .body.focus > .side {
    transform: translateX(105%);
    visibility: hidden;
    box-shadow: none;
  }
  .app .body:not(.no-right):not(.focus):not(.lab-mode) > .side-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgb(0 0 0 / 0.35);
  }
  .app .topbar {
    grid-template-columns: auto 1fr auto;
  }
}
@media (max-width: 760px) {
  .app .topbar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'l' 'r' 'c';
    gap: 4px;
    min-height: 0;
    padding: 6px 8px;
  }
  .app .tb-zone {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .app .tb-right {
    justify-content: flex-start;
  }
  .app .tb-left {
    grid-area: l;
  }
  .app .tb-right {
    grid-area: r;
  }
  .app .tb-center {
    grid-area: c;
    justify-content: flex-start;
    overflow-x: auto;
  }
  .app .body,
  .app .body.lab-mode {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 42% 58%;
  }
  .app .body.no-left {
    grid-template-rows: 0 100%;
  }
}

/* ---------- tablodan devre ---------- */

.synth-card {
  --tone: #0ea5e9;
  width: 100%;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 58px;
  padding: 0;
  margin: 4px 0 6px;
  overflow: hidden;
  text-align: left;
  border-radius: var(--ws-radius, 12px);
  border: 1px dashed color-mix(in srgb, var(--tone) 60%, var(--line));
  background: color-mix(in srgb, var(--tone) 7%, var(--panel));
  white-space: normal;
}
.synth-card:hover {
  border-style: solid;
  border-color: var(--tone);
}
.synth {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  min-height: min(62vh, 560px);
}
.synth-left,
.synth-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.synth-left h4 {
  margin: 6px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.synth-sizes {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.synth-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 13px;
}
.synth-step span {
  margin-right: 4px;
  color: var(--muted);
}
.synth-step b {
  min-width: 18px;
  text-align: center;
  font-family: var(--font-fun, 'Fredoka', sans-serif);
  font-size: 18px;
}
.synth-step .icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.synth-sizes .small {
  margin-left: auto;
  border-radius: 999px;
}
.synth-table-wrap {
  flex: 1;
  min-height: 160px;
  max-height: min(42vh, 380px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  scrollbar-width: thin;
}
.synth-table td,
.synth-table th {
  padding: 2px 6px;
}
.synth-table td.in.one {
  color: var(--text);
  font-weight: 700;
}
.synth-table .cell {
  width: 30px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
}
.synth-table .cell:hover {
  border-color: var(--line);
  background: var(--panel-2);
}
.synth-table .cell.c-1 {
  color: #22c55e;
  background: color-mix(in srgb, #22c55e 12%, transparent);
}
.synth-table .cell.c-0 {
  color: #ef4444;
}
.synth-table .cell.c-x {
  color: var(--muted);
  font-style: italic;
}
.synth-blocks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.synth-blocks .block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
}
.synth-blocks .block.on {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-2));
}
.synth-blocks input {
  accent-color: var(--accent);
}
.synth-find {
  margin-top: 6px;
  height: 40px;
  font-size: 15px;
}
.synth-right {
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.synth-empty {
  margin: auto 0;
  text-align: center;
  color: var(--muted);
}
.synth-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  flex: 1;
}
.synth-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.synth-count b {
  font-family: var(--font-fun, 'Fredoka', sans-serif);
  font-size: 34px;
  line-height: 1;
}
.synth-badge {
  margin-left: auto;
  align-self: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.synth-badge.ok {
  color: #16a34a;
  border-color: color-mix(in srgb, #16a34a 45%, transparent);
  background: color-mix(in srgb, #16a34a 10%, transparent);
}
.synth-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--code);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  overflow: auto;
  max-height: min(46vh, 420px);
  scrollbar-width: thin;
}
.synth-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  padding: 2px 0;
}
.synth-list .arrow {
  color: var(--muted);
}
.synth-list .to {
  text-align: left;
}
@media (max-width: 860px) {
  .synth {
    grid-template-columns: 1fr;
  }
  .synth-right {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 14px;
  }
}
.synth-view {
  display: flex;
  align-items: center;
  gap: 12px;
}
.synth-view .seg {
  display: inline-flex;
  flex: none;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.synth-view .seg button {
  padding: 4px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 12.5px;
}
.synth-view .seg button.on {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.15);
}
.synth-hint {
  margin: 0;
  line-height: 1.35;
}
.synth-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
}
.synth-text textarea {
  flex: 1;
  min-height: 180px;
  max-height: min(42vh, 380px);
  resize: vertical;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--code);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.55;
  tab-size: 4;
}
.synth-text textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
  outline-offset: 1px;
}
.synth-text-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
