
:root {
  /* ── Spacing scale (4px base) ── */
  --space-1: 4px;
  --space-2: 8px;
  x
  --space-3: 12px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --accent: #6aab6c;
  --accent-2: #eae023;
  /*--bg: linear-gradient(105deg, #e9e9e5, #b4b4afa6);*/
  --bg: #e5e5e3;
  --text: #5a5a5a;
  --heading-text: #262622;
  --light-bg: #fbfbfb;
  --light-btn: #eae8e6;
  --light-text: #060604;
  --big-panel-raised-bevel:  12px 12px 16px rgb(0 0 0 / 13%), -12px -12px 14px rgb(251 251 251 / 78%);
  --panel-bg: linear-gradient(45deg, #fefefeb5, #e3e3e300);
  --panel: #2A2A2A;
  --border: #333;
  --dark-select-border: #646363;
  --correct: #73976B;
  --wrong: #a25B4e;
  --border-radius: var(--radius);
  --highlight1: #2ec189;
  --highlight2: #f8675e;
  --highlight3: #367bdd;
  --highlight4: #FC97D9;
  --highlight5: #FCBEC0;
  --highlight6: #D28EFF;

  /* BEVELS AND PANELS this is a comment saved in VSCode and now saved in Devtools and again in VS

  -------------------- */
  --highlight7: #FF955A;
  --divider-bevel: 
  0px 1px 0 rgb(239 234 232 / 93%), 
  0px 2px 0px 0px rgb(0 0 0 / 9%);
  --prompt-box-shadow: 12px 12px 22px rgb(0 0 0 / 21%), inset 4px 4px 4px rgb(255 255 255 / 8%), inset -4px -4px 4px rgb(0 0 0 / 8%);
  --box-shadow: 12px 12px 22px rgb(0 0 0 / 21%),  inset 4px 4px 4px rgb(255 255 255 / 78%),  inset -4px -4px 4px rgb(0 0 0 / 13%);
  --smaller-box-shadow: 6px 6px 16px rgb(0 0 0 / 21%),  inset 3px 3px 4px rgb(255 255 255 / 78%),  inset -3px -3px 4px rgb(0 0 0 / 13%);
  --big-panel-raised-bevel:  
    12px 12px 16px rgb(0 0 0 / 13%), 
    -12px -12px 14px rgb(251 251 251 / 78%);
  --small-panel-raised-bevel: 4px 4px 16px rgb(0 0 0 / 14%), -4px -4px 5px rgb(251 251 251);
  --button-bevel: 
-5px -5px 13px 0px rgb(255 255 255 / 67%), 
5px 5px 13px 0 rgba(96, 95, 95, 0.581), 
inset -2px -2px 4px rgb(0 0 0 / 8%);
  --recessed-panel: inset 4px 4px 6px 0px rgb(0 0 0 / 15%), inset -4px -4px 8px rgb(255 253 249 / 96%);
  --recessed-panel-grey: inset 2px 2px 4px 0px rgb(0 0 0 / 20%), inset -2px -2px 4px rgb(255 255 255 / 25%), 2px 2px 2px 0px rgb(0 0 0 / 0%), -1px -1px 0px 0px rgb(226 226 226 / 0%);
  --recessed-panel-subtle: inset 2px 2px 3px 0px rgb(0 0 0 / 15%), inset -3px -3px 4px rgb(255 255 255 / 71%);
  --small-button-bevel: -2px -2px 0 rgb(255 255 255 / 0%), 4px 4px 10px rgb(0 0 0 / 20%), -4px -4px 10px rgb(255 255 255 / 81%), 1px 1px 0 rgb(194 194 194 / 35%);



    /* END BEVELS AND PANELS

  -------------------- */
  --muted: #777;
  --input-bg: #fdfdfc;
  --input-text: #4d4d47;
  --radius: 16px;
  --fade: 200ms ease;
  --new-set-font-weight-light: 500;
  --new-set-font-weight-medium: 700;
  --new-set-font-weight-heavy: 800;
  --new-set-font-weight: var(--new-set-font-weight-medium);
  --sidebar-width: 320px;
  --sidebar-divider: 1px solid #2e2e2e;
  --sidebar-collapsed-width: 66px;
  --content-side-gap: 20px;
  --nav-btn-width: 110px;
}

* {
  box-sizing: border-box;
  /* padding: 5px; */
  /* border-radius: 10px; */
  /* box-shadow: var(--recessed-panel-subtle); */
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.sets-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
  max-width: var(--sidebar-collapsed-width);
  height: 100vh;
  z-index: 35;
  background: #242424;
  border-right: 1px solid #3b3b3b;
  padding: 32px 10px;
  transition: width 180ms ease, min-width 180ms ease, max-width 180ms ease, padding 180ms ease;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  overflow: hidden;
  pointer-events: auto;
}

.sets-sidebar.open {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  padding: 20px 16px 12px;
}

.sets-icons {
  position: fixed;
  top: 22px;
  left: 10px;
  z-index: 50;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 10px;
  background: #2a2a2a;
  border-radius: 10px;
  padding: 6px;
}

.sets-icons-logo {
  display: block;
  width: 21px;
  height: auto;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: calc(var(--sidebar-width) + 8px);
  z-index: 40;
  width: 30px;
  height: 30px;
  border: 1px solid var(--dark-select-border);
  border-radius: 8px;
  background: transparent;
  color: #8f8f8f;
  cursor: pointer;
}

body.sidebar-open .sidebar-toggle {
  display: block;
}

.sets-sidebar.open .sets-icons {
  display: none;
}

.sets-sidebar:not(.open) .sets-icons {
  display: grid;
}

.sets-icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--dark-select-border);
  border-radius: 8px;
  background: transparent;
  color: #8f8f8f;
  padding: 0;
  cursor: pointer;
}

.sets-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: 0 auto;
}

.sets-sidebar:not(.open) .sets-top,
.sets-sidebar:not(.open) .sets-list,
.sets-sidebar:not(.open) .sets-empty {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.sets-top {
  display: grid;
  gap: 20px;
}

.sets-search-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

#sets-search {
  border: 1px solid var(--dark-select-border);
  border-radius: var(--radius);
  background: #1f1f1f;
  color: var(--text);
  box-shadow: none;
  padding: 8px 20px;
  font-size: 0.86rem;
}

#sets-search-clear {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 0 9px;
  cursor: pointer;
}

#new-set-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--dark-select-border);
  border-radius: 8px;
  background: transparent;
  color: #8f8f8f;
  padding: 0;
  justify-self: start;
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}

.sets-list {
  overflow: auto;
  min-height: 0;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.set-item {
  /* border: 1px solid transparent; */
  border-radius: var(--radius);
  padding: 8px;
  transition: background 150ms ease, border-color 150ms ease;
}

.set-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #4b4b4b;
}

.set-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.set-name {
  margin: 0;
  font-size: 0.9rem;
  color: #f2f2f2;
}

.set-meta {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}


.set-load-btn {
  opacity: 0;
  pointer-events: none;
  /* border: 1px solid #6f8d65; */
  border-radius: 7px;
  background: var(--accent-2);
  color: #1f281d;
  font-size: 0.76rem;
  padding: 4px 8px;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.set-delete-btn {
  opacity: 0;
  pointer-events: none;
  border: none;
  background: transparent;
  color: rgba(245, 245, 245, 0.52);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 2px 4px;
  transition: opacity 150ms ease, color 150ms ease;
}

.set-item:hover .set-load-btn,
.set-item:hover .set-delete-btn {
  opacity: 1;
  pointer-events: auto;
}

.set-delete-btn:hover {
  color: rgba(245, 245, 245, 0.82);
}

.sets-empty {
  margin: 2px 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.app {
  width: min(750px, calc(100vw - var(--sidebar-collapsed-width) - (var(--content-side-gap) * 2)));
  max-width: 740px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-5) var(--space-6);
  position: relative;
  left: calc(var(--sidebar-collapsed-width) / 2);
  transition: left 180ms ease, width 180ms ease;
}

body.sidebar-open .app {
  left: calc(var(--sidebar-width) / 2);
  width: min(740px, calc(100vw - var(--sidebar-width) - (var(--content-side-gap) * 2)));
}

.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto var(--space-7);
  position: relative;
}

.auth-bar {
  /* position: absolute; */
  top: -6px;
  right: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.app-logo {
  display: block;
  max-width: 320px;
  width: 100%;
  height: auto;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.stage-progress {
  margin: 24px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  width: fit-content;
}

.stage-link {
  position: relative;
  overflow: visible;
  border: 0;
  color: #e6e6e6;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 8px 0;
  width: var(--nav-btn-width);
  cursor: pointer;
}

.stage-link::after {
  content: '';
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: -8px;
  height: 2px;
  border-radius: 999px;
  opacity: 0;
}

.stage-link.is-disabled {
  cursor: default;
  pointer-events: none;
}

.stage-link-build {
  background: var(--highlight1);
  border-radius: 10px 0 0 10px;
}

.stage-link-drill {
  background: var(--highlight2);
  border-radius: 0px;
}

.stage-link-feedback {
  background: var(--highlight3);
  border-radius: 0 10px 10px 0;
}

.stage-link-build::after { background: var(--highlight1); }
.stage-link-drill::after { background: #ff3e3e; }
.stage-link-feedback::after { background: #3f72ff; }

.stage-link.is-current {
  font-weight: 700;
}

.stage-link.is-current::after {
  opacity: 0.6;
  /* height: 3px; */
}

.state {
  display: none;
  opacity: 0;
  transition: opacity var(--fade);
}

.state.active {
  display: block;
  opacity: 1;
}

.action-box {
 /* border: 1px solid var(--border);*/
 /* background: var(--light-bg); */
 color: var(--light-text);
 border-radius: 30px;
 box-shadow: var(--recessed-panel);
 padding: var(--space-5);
  /* 1s ease is the fade-OUT duration (when pulse class is removed) */
 transition: border-color 1s ease, background 1s ease;
}

.action-box-compact {
  padding: 10px 14px;
  margin-bottom: 10px;
}

.action-box.pulse-correct {
  border-color: var(--correct);
  background: #cedbcb;
  /* 0.2s override is the fade-IN duration (when pulse class is added) */
  transition-duration: 0.2s;
}

.action-box.pulse-wrong {
  border-color: var(--wrong);
  background: #dec5c1;
  transition-duration: 0.2s;
}

.quiet {
  margin: 0;
  color: #3f3f3b;
  font-size: 0.9rem;
}

.load-heading {
  margin-bottom: var(--space-3);
  text-align: center;
}

.load-heading h1 {
  margin: 0;
  color: #1a1a1a;
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.load-heading h1 .app-logo {
  display: block;
  width: min(210px, 78vw);
  height: auto;
  padding: 0px 20px 0px 29px;
  /* color: red; */
}

.load-heading h3 {
    margin: var(--space-2) 0 0;
    color: #979292;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.input-format-warning {
  width: min(100%, 980px);
  margin: 8px auto 0;
  padding: 0 4px;
  color: #8f4f45;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
}

.step-caption {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  justify-items: start;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  text-align: left;
}

.step-caption p {
  margin: 0;
  font-size: 0.84rem;
  color: #4a4a45;
  letter-spacing: 0.02em;
}

.lang-caption-wrap {
  width: 100%;
  padding-left: 0;
  margin-bottom: var(--space-2);
}

.cards-caption-wrap {
  width: 100%;
  margin-bottom: var(--space-2);
}

.step-marker {
  margin: var(--space-2) 0 var(--space-4);
  font-size: 0.95rem;
  /* text-align: center; */
  /* margin: -1px 53px -6px 108px; */
  /* width: 40%; */
  /* border-radius: 31px 31px 0px 0px; */
  /* box-shadow: var(--button-bevel); */
  /* background: #d1beca; */
  /* padding: 13px 10px 13px 10px; */
}

.step-marker-cards {
  margin: var(--space-7) 0 var(--space-4);
  /* width: 28%; */
  border-radius: 31px 31px;
  /* color: #F4584C; */
  /* font-size: 1.1rem; */
  /* background: #aec8c6; */
  /* padding: 14px 10px 41px 10px; */
}

.step-marker-langs {
  border: none;
  /* color: #357ADD; */
  /* background: red; */
  /* margin: var(--space-6) var(--space-3) var(--space-5); */
}

.cards-guidance {
  margin: 0 3px 15px 26px;
  padding: 0 20px 0 0;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.25;
}

.cards-guidance li {
  margin: 2px 6px 4px 21px;
  font-size: 0.95rem;
}

.step-shape {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #bab7b4;
  background: #e8e7e5;
}

.generate-shape {
      padding: 10px;
    background: #5c9dad;
    border-color: #b5c0ad;
    border-radius: 8px;
    box-shadow: var(--recessed-panel-subtle);
}

.generator-section {
  display: grid;
  grid-template-rows: auto auto;
  gap: var(--space-3);
}

.lang-section {
  margin: var(--space-6) 0 var(--space-7);
  display: grid;
  grid-template-rows: auto auto;
  /* gap: 8px; */
}

.term-label {
  font-weight: 700;
}

.lang-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--space-4);
  box-sizing: var(--bg);
  box-shadow: var(--small-panel-raised-bevel);
  padding: var(--space-5) var(--space-6) var(--space-6);
  /* padding: 10px var(--space-6) var(--space-6); */
  background: #f5f5f399;
  border-radius: 18px;
  margin-bottom: 0;
  width: 89%;
  margin: 0px auto 0px;
}

.swap-langs-btn {
  align-self: end;
  width: 35px;
  height: 30px;
  margin-bottom: 0;
  border: 1px solid #bab7b4;
  border-radius: 9px;
  background: var(--light-bg);
  /* box-shadow: var(--small-button-bevel); */
  color: #5e5d59;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.swap-langs-btn svg {
  width: 18px;
  height: 18px;
}

.challenge-field {
  margin: 0;
}

.dev-controls {
  margin-top: 275px;
  padding: var(--space-5);
  border-radius: 8px;
  width: 50%;
  box-shadow: var(--recessed-panel-grey);
  background: #d7d5d3;
}

.dev-controls h4 {
  margin: 0 0 var(--space-4);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  /* box-shadow: var(--divider-bevel); */
  padding-bottom: 10x;
  text-transform: uppercase;
  color: #4a4a45;
  font-weight: 700;
}

.dev-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  color: #3f3f3b;
  font-size: 0.9rem;
}

.dev-provider-row {
  gap: 10px;
}

.dev-provider-row select {
  width: auto;
  min-width: 148px;
  font-size: 0.84rem;
  padding: 6px 10px;
}

.dev-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid #a8a7a4;
  border-radius: 999px;
  background: #c6c4c1;
  cursor: pointer;
  padding: 0;
  transition: background 140ms ease, border-color 140ms ease;
}

.dev-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f2f2f2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 140ms ease;
}

.dev-toggle.on {
  background: #ea4023;
  border-color: #8ca589;
}

.dev-toggle.on .dev-toggle-knob {
  transform: translateX(18px);
}

.field {
  display: block;
}

.field span {
  display: block;
  margin-bottom: var(--space-2);
  color: #4a4a45;
  font-size: 0.74rem;
  margin-left: var(--space-4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

select,
input,
textarea,
button {
  font-family: inherit;
  padding: 8px;
  border-radius: 13px;
  /* box-shadow: var(--recessed-panel-subtle); */
  border: none;
}

select,
input[type="text"] {
  width: 100%;
  border: #8d8787;
  background: var(--input-bg);
  color: var(--text);
  box-shadow:   var(--recessed-panel-subtle);
  border-radius: var(--radius);
  padding: 10px 19px;
  font-size: 0.9rem;
}

textarea {/* anchor-name: none; */width: 100%;margin-left: 0px;/* margin: 0px auto 0px 0px; */min-height: 330px;border: none;/* box-shadow: var(--recessed-panel-subtle); *//* background: #f2f2f2; */color: var(--input-text);border-radius: 16px;padding: 27px 33px;font-size: 0.95rem;/* text-align: center; */line-height: 1.4;resize: vertical;}

.word-input-wrap {
  position: relative;
  width: min(100%, 980px);
  margin: 0 auto;
}

.textarea-shell {
  position: relative;
  border-radius: 13px;
  box-shadow: var(--recessed-panel-subtle);
  background: #ffffffe3;
  overflow: hidden;
}

#word-input {
  position: relative;
  z-index: 2;
  background: transparent;
  color: transparent;
  caret-color: var(--input-text);
  font-weight: 400;
  font-kerning: none;
  font-variant-ligatures: none;
}

#word-input::placeholder {
  color: var(--muted);
}

.input-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: auto;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
  width: 100%;
  min-height: 330px;
  border-radius: 16px;
  padding: 27px 33px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  letter-spacing: normal;
  color: var(--input-text);
  font-weight: 400;
  font-kerning: none;
  font-variant-ligatures: none;
}

.input-overlay strong {
  font-weight: inherit;
  /* Width-stable faux bold so caret alignment does not drift linearly. */
  text-shadow:
    0.02em 0 0 currentColor,
    -0.02em 0 0 currentColor,
    0.04em 0 0 currentColor,
    -0.04em 0 0 currentColor;
}

.input-overlay::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.input-overlay {
  scrollbar-width: none;
}

textarea::-webkit-scrollbar-track {
  background: transparent !important;
}

textarea::-webkit-scrollbar-track-piece {
  background: transparent !important;
}

textarea::-webkit-scrollbar {
  width: 12px;
  height: 12px;
  background: transparent !important;
}

textarea::-webkit-scrollbar-corner {
  background: transparent !important;
}

textarea::-webkit-scrollbar-thumb {
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  background-color: rgba(120, 120, 120, 0.75);
}

textarea:focus,
select:focus,
input:focus,
button:focus {
  outline: none;
  border-color: #666;
}

textarea:focus {
  border-color: #bababa;
}

.primary-btn {
     width: 40%;
     display: block;
     margin-left: 30%;
     /* margin-top: var(--space-7); */
     margin-top: -19px;
     border: none;
     /* border: 2px solid #577a5c; */
     box-shadow: var(--button-bevel);
     background: var(--highlight2);
     color: #fff;
     border-radius: 20px;
     padding: var(--space-3) var(--space-5);
     font-weight: 500;
     font-size: 0.95rem;
     cursor: pointer;
}

.saved-panel {
  margin-top: 20px;
      background: #737373 !important;
    border-radius: var(--radius);
box-shadow: inset 2px 2px 3px 0px rgb(0 0 0 / 13%), inset -3px -3px 2px rgba(255, 255, 255, 0.20);}

.saved-head {
    display: grid;
    align-items: center;
    justify-content: end;
    gap: 0px;
    margin-bottom: 20px;
    margin-right: 15px;
  
}

.saved-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.saved-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

#save-name {
  width: 140px;
  font-size: 0.82rem;
  padding: 6px 8px;
}

#saved-select {

    background: #5b5b5b;
  border: 0px solid #777;
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 14px;
}

.small-btn {
  border: 1px solid #f0f0f0;
  /* background: #242424; */
  color: #444444;
  border-radius: 180px;
  padding: var(--space-2) var(--space-4);
  box-shadow: var(--small-button-bevel);
  font-size: 0.8rem;
  cursor: pointer;
}

#auth-open-btn[hidden] {
  display: none !important;
}

#auth-user-wrap[hidden],
#auth-signout-btn[hidden] {
  display: none !important;
}

.small-btn-2D {
  border: 2px solid var(--highlight1);
  /* background: #242424; */
  color: var(--light-text);
  border-radius: 11px;
  padding: var(--space-2) var(--space-4);
  /* box-shadow: var(--small-button-bevel); */
  font-size: 0.8rem;
  cursor: pointer;
}

#save-set-cancel {
  background: none;
  color: var(--highlight1);
}

#save-set-confirm {
  background: var(--highlight1);
  color: var(--bg);
  width: 85px;
}

.relief-controls {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  justify-content: center;
  justify-items: center;
  gap: var(--space-4);
  /* height: 20%; */
  width: fit-content;
  margin: var(--space-6) auto !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

#drill-state.relief-ready .relief-controls {
  opacity: 1;
  pointer-events: auto;
}

#drill-state .action-box {
  min-height: 312px;
  position: relative;
  display: grid;
  width: 110%;
  background: var(--panel-bg);
  margin-left: -35px;
  align-content: center;
  justify-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
}

.end-link {
  position: absolute;
  top: 18px;
  right: 18px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.75rem;
  cursor: pointer;
}

.prompt-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

.prompt-visibility-btn {
  width: 30px;
  height: 30px;
  margin-top: 87px;
  border: 1px solid #9f9f9c;
  border-radius: 999px;
  background: transparent;
  color: #6f6f69;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.prompt-visibility-btn svg {
  width: 16px;
  height: 16px;
}

.prompt-visibility-btn .eye-closed {
  display: none;
}

.prompt-visibility-btn.is-closed .eye-open {
  display: none;
}

.prompt-visibility-btn.is-closed .eye-closed {
  display: block;
}

.prompt-block {
  text-align: center;
  width: 100%;
  opacity: 1;
  transition: opacity 200ms ease;
}

.prompt-block.is-fading {
  opacity: 0;
}

.prompt-label {
  margin: var(--space-5) 0 var(--space-7);
  color: #808080;
  font-size: 1rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  animation: softPulse 2.4s ease-in-out infinite;
}

@keyframes softPulse{
  0%,100% { opacity: 0.55; }
  50%     { opacity: 0.9; }
}

.prep-blobs{
  --c1:#26c281;
  --c2:#ff4d4d;
  --c3:#f377e1;

  width: 180px;
  height: 120px;
  position: relative;
  margin: 40px auto;
}

/* Only show the blob loader on the prep screen */
.prep-blobs {
  display: none;
}

#drill-state .action-box.is-prepping .prep-blobs {
  display: block;
}

.prep-blobs{
  --c1: var();
  --c1: var(--);
  --c3: var();
  --c2: var();
  --c1: var(--);
  --c3: var();
  --c1: var(--highlight5);
  --c2: var();
  --c2: var(--highlight3);
  --c3: var();
  --c3: var(--highlight6);
}

.blob{
  position:absolute;
  top:50%;
  left:50%;
  width:40px;
  height:40px;
  transform:translate(-50%,-50%);
  border-radius:999px;

}

.b1{
  background:var(--c1);
  animation:orbit 3s linear infinite;
}
.b2{
  background:var(--c2);
  animation:orbit 3s linear infinite;
  animation-delay:-1s;
}
.b3{
  background:var(--c3);
  animation:orbit 3s linear infinite;
  animation-delay:-2s;
}

@keyframes orbit{
  0%   { transform:translate(-50%,-50%) rotate(0deg)   translateX(20px) rotate(0deg); }
  100% { transform:translate(-50%,-50%) rotate(360deg) translateX(20px) rotate(-360deg); }
}

@media (prefers-reduced-motion: reduce){
  .blob{animation:none;border-radius:999px;}
}


/* ---- END BLOB ANIMATION


*/

.prompt-text {
  margin: 0;
  font-size: 2.1rem;
  line-height: 1.2;
  color: #404244;
  letter-spacing: 0.01em;
}

#drill-state .action-box.is-prepping .prompt-row {
  grid-template-columns: 1fr;
  justify-items: center;
}

#drill-state .action-box.is-prepping .prompt-visibility-btn {
  display: none;
}

#drill-state .action-box.is-prepping .prompt-text {
  white-space: pre-line;
  font-size: 1.1rem;
  line-height: 1.55;
  text-align: center;
  /* margin: 0 0 0 30px; */
  letter-spacing: 0;
  /* max-width: 35ch; */
}

.action-box.prompt-hidden #prompt-block {
  visibility: hidden;
}

.answer-block {
  min-height: 58px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--fade);
}

.answer-block.visible {
  opacity: 1;
}

#answer-text {
  margin: 0;
  color: #474741;
  font-size: 1.25rem;
  text-align: center;
}

.listen-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  opacity: 0;
  transition: opacity var(--fade);
}

.listen-status.active {
  opacity: 1;
  animation: listenPulse 2.2s ease-in-out infinite;
}

@keyframes listenPulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.mobile-start-drill-btn {
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  box-shadow: var(--button-bevel);
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

#drill-state .action-box.is-prepping .mobile-start-drill-btn {
  margin-top: 8px;
}

.speaker-badge {
  margin: 8px 0 10px;
  color: #676761;
  font-size: 0.78rem;
  text-align: center;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wrong);
}

.relief-bar {
width: 100%;
    width: 100%;
    /* display: block; */
    margin-top: 22px;
    margin-bottom: 18px;
    margin-left: 0;
    /* margin-bottom: 15px; */
    border: 0px solid #e9dede;
    background: var(--light-bg);
    color: var(--muted);
    border-radius: var(--radius);
    box-shadow: var(--button-bevel);
    padding: 12px;
    font-size: 0.94rem;
    cursor: pointer;
    transition: background var(--fade), color var(--fade), border-color var(--fade);
    }

.repeat-card-btn,
.next-card-btn,
.loop-word-btn,
.info-card-btn {
  border: 1px solid #bab4b487;
  background: var(--light-btn);
  color: var(--muted);
  border-radius: var(--radius);
  box-shadow: var(--button-bevel);
  width: 128px;
  padding: 9px 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 0.94rem;
  cursor: pointer;
  transition: background var(--fade), color var(--fade), border-color var(--fade);
}

.relief-icon {
  display: inline-flex;
  width: 1.25em;
  justify-content: center;
  color: currentColor;
  filter: grayscale(1);
  /* font-weight: 600; */
  font-size: 1rem;
  line-height: 1;
}

.loop-word-btn.on {
  background: var(--highlight5);
  color: #3d5d4a;
}

.relief-bar.held {
  background: hsl(328, 40%, 79%);
  color: var(--text);
    transition: background-color 1s ease;
 /* border-color: #555; */
}

#relief-bar {
  display: none !important;
}

.revolver-wrap {
  margin-top: 14px;
  border-radius: var(--radius);
  /* background: #909090; */
 background: linear-gradient(to bottom, #b9b9b9, #ababab);
  box-shadow: var(--recessed-panel-grey);
  overflow: hidden;
}

.revolver-hint {
  margin: 0;
  padding: 10px 10px 12px;
  color: #e6e6e6;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  text-align: center;
}

.revolver {
  min-height: 74px;
  display: grid;
  background: transparent;
  border-radius: var(--radius);
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  text-align: center;
  padding: 10px 8px;
  gap: 3px;
}

.revolver-item {
  border: 1px solid transparent;
  background: transparent;
  color: #666;
  border-radius: var(--radius);
  padding: 9px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity var(--fade), filter var(--fade), border-color var(--fade);
}

.revolver-item.level-0 {
  opacity: 1;
  color: #f5f5f5;
  filter: blur(0);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.revolver-item.level-1 {
  opacity: 0.7;
  color: #666;
  filter: blur(0.5px);
}

.revolver-item.level-2 {
  opacity: 0.42;
  color: #444;
  filter: blur(1.1px);
}

.revolver-item.level-3 {
  opacity: 0.25;
  color: #3b3b3b;
  filter: blur(1.5px);
}

.revolver-item.is-latched {
  border-color: #656565;
}

.done-box {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-6) var(--space-7);
  box-shadow: none;
}

.done-title {
  margin: 0;
  font-size: 3rem;
}

.done-subtitle {
    margin-top: calc(-1 * var(--space-4));
  margin-bottom: var(--space-5);
    color: #848483;
    /* font-size: 0.95rem; */
}

.stat-line {
  display: flex;
  justify-content: space-between;
  /* border-bottom: 1px solid var(--border); */
  padding-bottom: 8px;
  font-weight: 400;
    color: #242424c4;
  font-size: 0.92rem;
   box-shadow: var(--divider-bevel);
}

.sticky {
  display: block;
  box-shadow: var(--recessed-panel-grey);
  border-radius: 18px;
  padding: var(--space-5);
  font-weight: 500;
  background: var(--light-bg);
}

.sticky .stat-line {
  margin-bottom: var(--space-3);
}

.sticky-missed {
  display: none;
  margin-top: var(--space-3);
}

.sticky.has-missed .sticky-missed {
  display: block;
}

.sticky p {
  margin: 0 0 var(--space-4);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

#sticky-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
}

#sticky-list li {
  /* border: 1px solid var(--border); */
  border-radius: var(--radius);
  padding: 6px 8px;
  color: #d5766f;
  font-size: 0.86rem;
}

.done-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-6);
  margin-bottom: var(--space-5);
}

.done-primary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  border: none;
  width: min(100%, 68%);
}

.done-primary-row .small-btn {
  width: 100%;
  min-height: 56px;
  border-radius: 25px;
  /* font-size: 0.75rem; */
  font-weight: 600;
  border: none;
}

.results-primary-secondary {
  border: 1px solid #8f8c88;
  background: #999797;
  color: #ededed;
}

.results-primary-accent {
  border: 0;
  background: var(--highlight2);
  color: #ffffffcf;
  box-shadow: var(--small-button-bevel);
}

.done-secondary-row {
  width: min(100%, 420px);
  display: grid;
}

.results-secondary-neutral {
  width: 97%;
  margin: auto;
  min-height: 46px;
  border: none;
  background: transparent;
  color: #494945;
}

.done-admin-row {
  display: inline-flex;
  align-items: center;
  /* height: 30%; */
  gap: 10px;
}

.admin-action-btn {
  min-height: 36px;
  padding: 6px 11px;
  font-size: 0.76rem;
  border: 2px solid #b7b4b1;
  background: transparent;
  color: #62615c;
  box-shadow: none;
}

.action-with-icon {
  justify-content: flex-start;
  gap: 8px;
}

.action-icon {
  display: inline-flex;
  width: 16px;
  justify-content: center;
}

#save-set-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.browser-warning {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  max-width: 520px;
  border: 1px solid var(--border);
  background: #202020;
  color: var(--muted);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.82rem;
}

.save-set-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.48);
  display: grid;
  place-items: center;
  /* box-shadow: var(--box-shadow); */
}

.save-set-modal[hidden] {
  display: none !important;
}

.save-set-dialog {
    width: 410px;
    /* height: 180px; */
    /* border: 1px solid var(--border); */
    border-radius: var(--radius);
    box-shadow: var(--prompt-box-shadow);
    background: var(--bg);
    padding: var(--space-5) var(--space-6) var(--space-5);
    display: grid;
    gap: var(--space-4);
}

.save-set-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.inline-link-btn {
  border: 0;
  background: transparent;
  color: #575757;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

#save-set-name {
  width: 100%;
  margin: 0px 0px 10px;
}

.save-set-field {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: #5f5c56;
}

#save-set-category {
  width: 100%;
  min-height: 38px;
}

.save-set-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.save-set-modal .save-set-cancel {
  color: red;
  
}

.auth-dialog {
  width: min(410px, 92vw);
  padding: var(--space-5) var(--space-6);
}

.auth-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.auth-actions-left {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.auth-actions-right {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.auth-error {
  margin: 0;
  color: #9f3d3d;
  font-size: 0.82rem;
}

.auth-inline-link {
  border: 0;
  background: transparent;
  color: #5d5c58;
  font-size: 0.8rem;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.auth-inline-link:hover { text-decoration: underline; }

.import-dialog {
  width: min(430px, 92vw);
}

.anki-dropzone {
  border: 1px dashed #9f8c80;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
  min-height: 150px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 18px;
  cursor: pointer;
}

.anki-dropzone.is-active {
  border-color: #7a5b50;
  background: rgba(255, 255, 255, 0.55);
}

.anki-dropzone-title {
  margin: 0;
  font-size: 0.9rem;
  color: #4f4c47;
}

.anki-dropzone-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: #7c7772;
}

.anki-import-msg {
  margin: 0;
  font-size: 0.8rem;
  color: #7f3f3f;
}

.anki-import-msg.ok {
  color: #2e7b52;
}

.anki-field-picker {
  display: grid;
  gap: 10px;
  border-top: 1px solid #d5cbc4;
  padding-top: 10px;
}

.anki-field-picker[hidden] {
  display: none !important;
}

.anki-field-picker-msg {
  margin: 0;
  font-size: 0.8rem;
  color: #5f5c56;
}

.anki-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Generate box ──────────────────────────────────────────────────────────── */
.generator-section {
  display: none !important;
}

.generate-row {
 display: grid;
grid-template-columns: 1fr auto auto;
background: transparent;
box-shadow: none;
gap: 12px;
width: 100%;
padding: 0;
border-radius: 0;
margin: 0;
align-items: center;
}

.generate-input {
  /* inherits from input[type="text"] */
  min-height: 38px;
  opacity: 1;
  transition: opacity 220ms ease;
}

.generate-input.loading {
  opacity: 0.6;
}

#word-input::placeholder,
.generate-input::placeholder {
  color: #999;
  opacity: 1;
}

.generate-row.extra-mode .generate-input {
  opacity: 0;
  pointer-events: none;
}

.generate-formality {
  width: auto;
  min-width: 0;
  padding: 8px 10px;
  font-size: 0.84rem;
  min-height: 38px;
}

.generate-btn {
    width: 110px;
    height: 28px;
    border: 0px solid #d6acc9;
    border-radius: 26px;
    /* background: linear-gradient(45deg, #d498cd, #97467391); */
    /* box-shadow: 8px 8px 13px rgb(0 0 0 / 13%), inset 2px 2px 4px rgb(255 255 255 / 78%), inset -2px -2px 2px rgb(0 0 0 / 13%); */
    color: var(--accent);
    display: grid;
    place-items: center;
    padding: 0px 36px;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity var(--fade) 1s, width 1000ms cubic-bezier(0.33, -0.04, 0.16, 1.16) 0.5s, color 220ms cubic-bezier(0.32, 0.06, 0, 0.99) .5s;
}

.generate-btn.loading {
  opacity: 0.5;
  pointer-events: none;
}

#generate-btn-label {
  display: inline-block;
  transition: opacity 220ms ease;
}

.generate-row.extra-mode .generate-btn {
  width: 330px;
}

.generate-overlay-btn {
  position: absolute;
  right: 40px;
  bottom: 30px;
  width: 109px;
  height: 38px;
  display: grid;
  grid-template-columns: 1fr auto;
  border-radius: 8px;
  border: 2px solid var(--highlight5);
  background: #fdfdfc;
  align-items: stretch;
  justify-items: end;
  text-align: right;
  overflow: hidden;
  padding: 0 12px 0 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  z-index: 2;
}

.generate-overlay-text {
  align-self: center;
  justify-self: end;
  margin: 0px 7px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  color: var(--highlight5);
}

.generate-overlay-icon {
  align-self: center;
  justify-self: end;
  display: grid;
  place-items: center;
  color: var(--highlight5);
  font-size: 0.92rem;
  line-height: 1;
}

.textarea-fade {
  position: absolute;
  left: 0px;
  right: 0px;
  height: 4px;
  pointer-events: none;
  z-index: 4;
}

.textarea-fade-top {
  top: 0px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  background: linear-gradient(to bottom, rgb(242 242 242 / 45%), rgb(255 255 255 / 0%));
  opacity: 0;
  transition: opacity 180ms ease;
}

.textarea-fade-bottom {
  bottom: 0px;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  background: linear-gradient(to top, rgb(242 242 242), rgba(239, 239, 238, 0));
  opacity: 1;
}

.textarea-shell.show-top-fade .textarea-fade-top {
  opacity: 1;
}

#load-state.text-prompt-off .generator-section {
  display: none;
}

#load-state.text-prompt-off .generate-overlay-btn {
  opacity: 0;
  pointer-events: none;
}

#load-state.text-prompt-off.has-input .generate-overlay-btn {
  opacity: 1;
  pointer-events: auto;
}

.info-card-btn.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Info panel (below drill card) ─────────────────────────────────────────── */

.info-panel {
  margin-top: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--light-bg);
  border-radius: 20px;
  box-shadow: var(--recessed-panel-subtle);
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

.info-panel-word-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: baseline;
  margin-bottom: 5px;
}

.info-panel-word {
  font-weight: 600;
  color: var(--heading-text);
}

.info-panel-arrow {
  color: var(--muted);
  font-size: 0.8rem;
}

.info-panel-translation {
  color: var(--text);
}

.info-panel-grammar {
  color: var(--muted);
  font-style: italic;
  font-size: 0.8rem;
}

.info-panel-divider {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin: 10px 0;
}

.info-panel-literal {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.info-panel-literal-quoted {
  font-style: italic;
}

.info-panel-definition {
  font-style: normal;
  font-weight: 600;
  color: var(--heading-text);
}

/* ── Toast notification ─────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #3a3a3a;
  color: #f0f0f0;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-5);
  font-size: 0.84rem;
  z-index: 200;
  opacity: 0;
  transition: opacity 250ms ease, transform 250ms ease;
  white-space: nowrap;
  pointer-events: none;
}

.toast.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Mobile (≤ 767px) ─────────────────────────────────────────────────────── */
@media (max-width: 767px) {

  /* ── Sidebar: off-canvas drawer, not a persistent icon strip ── */
  .sets-sidebar {
    left: calc(-1 * var(--sidebar-width));
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    /* Switch from width-based to left-based transition */
    transition: left 220ms ease, padding 220ms ease;
  }
.step-marker-langs {
   margin: var(--space-6) var(--space-3) var(--space-5);
}
  

  .sets-sidebar.open {
    left: 0;
  }

  /* Float the sidebar icon strip as a fixed overlay trigger.
     When the sidebar opens, .sets-sidebar.open .sets-icons { display:none }
     hides these — the ❮ close button takes over. */
  .sets-icons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    background: #2a2a2a;
    border-radius: 10px;
    padding: 6px;
  }

  .sets-icons-logo {
    width: 28px;
  }

  /* Close button: move to top-right (conventional drawer UX) */
  .sidebar-toggle {
    left: 335px;
    right: 12px;
    top: 12px;
    color: white;
  }

  /* Dim the page content behind the open sidebar */
  body.sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 34;
    pointer-events: auto;
  }

  /* ── App: full viewport width, top space clears the floating icons ── */
  .app {
    left: 0 !important;
    width: 100%;
    max-width: 100%;
    padding: var(--space-5) var(--space-4) var(--space-6);
    /* Respect iPhone home-indicator safe area */
    padding-bottom: max(var(--space-6), env(safe-area-inset-bottom));
  }

  body.sidebar-open .app {
    left: 0 !important;
    width: 100%;
  }

  /* ── Remove tap highlight & 300ms delay across all interactive elements ── */
  button,
  select,
  input,
  textarea {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* ── Header ── */
  .app-header {
    margin-bottom: var(--space-6);
  }

  .auth-bar {
    position: static;
    width: 100%;
    justify-content: flex-end;
    margin-bottom: var(--space-2);
  }

  .load-heading {
    margin-bottom: var(--space-5);
  }

  .load-heading h1 {
    font-size: 2.2rem;
  }

  .load-heading h1 .app-logo {
    width: min(190px, 72vw);
    margin: 0 0 0 13px;
  }

  .step-caption {
    width: 100%;
    justify-items: start;
    text-align: left;
    margin: 0 0 var(--space-2);
  }

  .lang-caption-wrap {
    padding-left: 0;
  }

  /* ── Lang dropdowns: full-width, tighter gap ── */
  .lang-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 17px;
    margin-bottom: 16px;
    margin: var(--space-1) 0 var(--space-5) 0;
    width: 87%;
    padding: var(--space-4) var(--space-5) var(--space-5);
    border-radius: 22px;
  }

  /* ── Inputs: ≥ 16px prevents iOS auto-zoom on focus ── */
  select,
  input[type="text"] {
    font-size: 1rem;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
  }

  input[type="email"],
  input[type="password"] {
    font-size: 1rem;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
  }

  #auth-open-btn {
    font-size: 0.8rem;
    min-height: 44px;
    width: 104px;
  }

  textarea {
    width: 100%;
    margin-left: 0;
    padding: 23px 25px;
    min-height: 281px;
    font-size: 1rem;
  }

  .input-overlay {
    padding: 23px 25px;
    min-height: 281px;
    font-size: 1rem;
  }

  /* ── Primary button ── */
  .primary-btn {
    width: 90%;
    margin-left: 5%;
    padding: 14px;
    font-size: 1rem;
    min-height: 50px;
    margin-top: var(--space-4);
  }

  /* ── Set list: always show action buttons — hover doesn't exist on touch ── */
  .set-load-btn,
  .set-delete-btn {
    opacity: 1;
    pointer-events: auto;
  }

  .set-load-btn {
    min-height: 34px;
  }

  .set-delete-btn {
    min-height: 34px;
    padding: 4px 8px;
  }

  /* ── Drill card ── */
  #drill-state .action-box {
    min-height: 240px;
    padding: var(--space-5) var(--space-4);
    gap: var(--space-3);
    width: 100%;
    margin-left: 0;
  }

  /* Scale the prompt word for long German compounds on narrow screens */
  .prompt-text {
    font-size: clamp(1.6rem, 5vw, 2.75rem);
  }

  /* ── Generate box: stack formality select below on very small widths ── */
  .generate-formality {
    font-size: 1rem;
    min-height: 44px;
  }

  .generate-btn {
    width: auto;
    padding: 0 7px;
    height: 44px;
  }

  .generate-overlay-btn {
    width: 88px;
    height: 44px;
    right: 12px;
    bottom: 12px;
  }

  /* ── Relief controls: 2-column grid, comfortable tap targets ── */
  .relief-controls {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    gap: var(--space-3);
    margin: var(--space-6) auto !important;
  }

  .repeat-card-btn,
  .next-card-btn,
  .loop-word-btn,
  .info-card-btn {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
  }

  /* ── Relief bar: full-width, spans both columns ── */
  .relief-bar {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1;
  }

  /* ── Revolver: 3 slots on narrow screens ── */
  .revolver {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* ── Done screen ── */
  .done-box {
    padding: var(--space-5) var(--space-4);
    gap: var(--space-4);
  }

  .done-title {
    font-size: 2.2rem;
  }

  .done-actions {
    width: 100%;
  }

  .done-primary-row {
    grid-template-columns: 1fr;
  }

  .done-secondary-row {
    width: 100%;
  }

  /* All small buttons: comfortable 44px tap target */
  .small-btn {
    min-height: 50px;
    padding: var(--space-2) var(--space-3);
    font-size: 0.82rem;
    width: 69%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ── Modal: fluid width so it never clips on small phones ── */
  .save-set-dialog {
    width: calc(100vw - 32px);
    max-width: 380px;
  }

  /* ── Step marker: reduce oversized horizontal margins ── */
  .step-marker-cards {
    margin: var(--space-7) var(--space-3) var(--space-5);
  }

  /* ── Lang section: reduce bottom margin ── */
  .lang-section {
    margin-bottom: var(--space-5);
  }

  /* ── Prompt label: reduce large top/bottom margins inside drill card ── */
  .prompt-label {
    margin: var(--space-3) 0 var(--space-5);
    font-size: 0.8rem;
  }

  /* ── Dev controls: expand from 50% desktop width ── */
  .dev-controls {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 450px;
  }

  .control-panel {
    width: 100%;
  }

  .control-grid {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4) var(--space-5);
  }
}

/* ── Very small phones (≤ 380px) ─────────────────────────────────────────── */
@media (max-width: 380px) {
  .done-admin-row {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   Sidebar v2 — Swiss Typographic Style
   ══════════════════════════════════════════════════════════════════════════ */

/* Hide old sidebar elements that no longer exist */
.sets-top, .sets-list, .sets-empty { display: none !important; }

/* Hide sb-content when sidebar is collapsed */
.sets-sidebar:not(.open) .sb-content {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.sb-content {
  --sb-section-gap: 36px;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto auto;
  height: 100%;
  min-height: 0;
  grid-row: 1 / -1;
  gap: 0;
  opacity: 1;
  transition: opacity 160ms ease;
}

/* ── Logo ─────────────────────────────────────────────────────────────────── */
.sb-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f0f0f0;
  letter-spacing: -0.01em;
  padding: 0 6px 11px;
  border-bottom: var(--sidebar-divider);
  flex-shrink: 0;
}

.sb-logo img {
  display: block;
  width: 90px;
  max-width: 100%;
  height: auto;
}

/* ── Sidebar Search ───────────────────────────────────────────────────────── */
.sb-search-wrap {
  position: relative;
  padding: 10px 0 8px;
  border-bottom: 1px solid #2e2e2e;
}

.sb-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 1.2rem;
  pointer-events: none;
}

.sb-search-wrap #sets-search {
  width: 100%;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  background: #1a1a1a;
  color: #d0d0d0;
  box-shadow: none;
  font-size: 0.82rem;
  padding: 8px 10px 8px 28px;
}

.sb-search-wrap #sets-search::placeholder {
  color: #7a7a7a;
}

.sb-new-deck-btn {
  display: flex;
  align-items: center;
  margin: 13px 0px 4px;
  gap: 6px;
  width: 40%;
  background: transparent;
  border: 1px solid #97999c;
  /* border-bottom: 1px solid #2e2e2e; */
  color: #666;
  font-size: 0.78rem;
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: color 150ms ease;
}

.sb-new-deck-btn:hover { color: #aaa; }

.sb-new-deck-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* ── Field Selector ───────────────────────────────────────────────────────── */
.sb-field-row {
  padding: 12px 0;
  border-bottom: var(--sidebar-divider);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sb-field-select-wrap {
  flex: 1;
  position: relative;
}

.sb-field-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #242424;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: #d0d0d0;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 7px 10px;
  text-align: left;
}

.sb-field-btn:hover {
  color: #f0f0f0;
  border-color: #555;
}

.sb-field-btn-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.sb-field-chevron {
  flex-shrink: 0;
  color: #666;
  font-size: 0.7rem;
  line-height: 1;
}

.sb-add-field-btn {
  background: transparent;
  border: none;
  color: #555;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
}

.sb-add-field-btn:hover { color: #aaa; }

.sb-del-field-btn {
  background: transparent;
  border: none;
  color: #555;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
}

.sb-del-field-btn:hover { color: #aaa; }
.sb-del-field-btn:disabled { color: #333; cursor: not-allowed; }

/* Field dropdown */
.sb-field-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 160px;
  background: #1a1a1a;
  border: 1px solid #333;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.sb-field-option {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 0.8rem;
  padding: 9px 12px;
  cursor: pointer;
}

.sb-field-option:hover { background: #2a2a2a; color: #f0f0f0; }
.sb-field-option.active { color: #f0f0f0; font-weight: 600; }

/* ── Scrollable body ──────────────────────────────────────────────────────── */
.sb-body {
  display: flex;
  flex-direction: column;
  gap: var(--sb-section-gap);
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding: 8px 0 4px;
}

.sb-auth-footer {
  margin-top: 8px;
  padding-top: 10px;
  border-top: var(--sidebar-divider);
  display: grid;
  gap: 15px;
}

.sb-feedback-btn {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed #5a5a5a;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: #d6d6d6;
  font-size: 0.74rem;
  line-height: 1.35;
  text-decoration: none;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.sb-feedback-btn:hover {
  border-color: #fc9da0;
  color: #f2f2f2;
  background: rgba(252, 158, 160, 0.08);
}

.sb-auth-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sb-auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #5a5a5a;
  background: #5f5f5f;
  color: #e2e2e2;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sb-auth-email {
  color: #c4c4c4;
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-auth-signout {
  width: fit-content;
  padding: 7px 12px;
  box-shadow: none;
  background: none;
  border: 1px solid #dcdee0;
  color: var(--light-bg);
}

/* ── Section labels ───────────────────────────────────────────────────────── */
.sb-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 11px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FCBEC0;
  padding: 0 0px;
}

.sb-section-icon {
  width: 11px;
  height: 11px;
  display: inline-flex;
  color: #666;
}

.sb-section-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  color: #9b9b9b;
}

/* ── Recents ──────────────────────────────────────────────────────────────── */
.sb-recents {
  margin: 0;
  padding: 10px 0 8px;
  border-bottom: var(--sidebar-divider);
}

.sb-recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  cursor: pointer;
  border-radius: 0;
  /* border-bottom: var(--sidebar-divider); */
}

.sb-recent-item:hover { background: rgba(255,255,255,0.04); }
.sb-recent-item.is-active { color: #f0f0f0; }

.sb-recent-name {
  flex: 1;
  font-size: 0.85rem;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-recent-item.is-active .sb-recent-name { color: #f0f0f0; }

.sb-recent-time {
  font-size: 0.7rem;
  color: #444;
  flex-shrink: 0;
}

/* ── Divider between sections ─────────────────────────────────────────────── */
.sb-divider {
  height: 1px;
  background: #2a2a2a;
  margin: 8px 0 12px;
  display: none;
}

/* ── Categories ───────────────────────────────────────────────────────────── */
.sb-categories {
  padding: 10px 0 8px;
  border-bottom: var(--sidebar-divider);
}

.sb-category {
  margin-bottom: 2px;
}

/* Category header row */
.sb-cat-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 4px;
  cursor: pointer;
  user-select: none;
}

.sb-cat-header:hover { background: rgba(255,255,255,0.04); }

.sb-triangle {
  flex-shrink: 0;
  font-size: 0.5rem;
  color: #c1c0c0;
  width: 10px;
  text-align: center;
  transition: transform 150ms ease;
}

.sb-category.expanded .sb-triangle {
  transform: rotate(90deg);
}

.sb-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  /* color set via inline style */
}

.sb-dot-placeholder {
  flex-shrink: 0;
  width: 6px;
}

.sb-cat-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-cat-name-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid #444;
  color: #f0f0f0;
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  padding: 0 2px;
  min-width: 0;
}

.sb-three-dot {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #dedddd;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 100ms ease, color 100ms ease;
}

.sb-cat-header:hover .sb-three-dot,
.sb-category.menu-open .sb-three-dot {
  opacity: 1;
}

.sb-three-dot:hover { color: #aaa; }

/* Category deck list */
.sb-cat-body {
  display: none;
  position: relative;
  padding-left: 16px;
  min-height: 2px;
}

.sb-category.expanded .sb-cat-body {
  display: block;
}

.sb-category.expanded.has-decks .sb-cat-body::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 6px;
  width: 1px;
  background: var(--sb-cat-accent, #3a3a3a);
  opacity: 0.95;
}

/* ── Deck rows ────────────────────────────────────────────────────────────── */
.sb-deck-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 2px;
  cursor: pointer;
}

.sb-deck-row:hover { background: rgba(255,255,255,0.04); }
.sb-deck-row.is-active { background: rgba(255,255,255,0.06); }

/* Drag grip handle */
.sb-drag-handle {
  flex-shrink: 0;
  width: 12px;
  font-size: 12px;
  line-height: 1;
  color: #ded3d3;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.1s;
  user-select: none;
  -webkit-user-select: none;
}

.sb-deck-row:hover .sb-drag-handle {
  opacity: 1;
}

.sb-drag-handle:active {
  cursor: grabbing;
}

.sb-deck-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 400;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-deck-row.is-active .sb-deck-name { color: #d4d4d4; }

.sb-deck-row .sb-three-dot {
  opacity: 0;
}

.sb-deck-row:hover .sb-three-dot,
.sb-deck-row.menu-open .sb-three-dot {
  opacity: 1;
}

/* Deck name inline edit */
.sb-deck-name-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid #444;
  color: #f0f0f0;
  font-size: 0.8rem;
  outline: none;
  padding: 0 2px;
  min-width: 0;
}

/* ── Loose decks ──────────────────────────────────────────────────────────── */
.sb-loose {
  margin-top: 4px;
}

/* ── Drop zones (drag-and-drop) ───────────────────────────────────────────── */

/* While any drag is active: force all category bodies open and give them hit area */
body.sb-dragging-active .sb-cat-body {
  display: block !important;
  min-height: 32px;
}

body.sb-dragging-active .sb-category {
  /* subtle indicator that categories are droppable */
}

.sb-cat-body.drag-over,
.sb-loose.drag-over {
  outline: 1px solid rgba(180,180,180,0.35);
  background: rgba(255,255,255,0.065);
  border-radius: 2px;
  min-height: 32px;
}

.sb-deck-row.dragging {
  opacity: 0.25;
}

/* Floating ghost card that follows the pointer */
.sb-drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  background: #2c2c2c;
  border: 1px solid #505050;
  padding: 5px 10px 5px 8px;
  font-size: 0.8rem;
  font-family: Inter, sans-serif;
  color: #c0c0c0;
  white-space: nowrap;
  transform: rotate(1.5deg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
  letter-spacing: 0.01em;
  top: 0;
  left: 0;
  will-change: transform;
}

/* ── + New Category button ────────────────────────────────────────────────── */
.sb-new-cat-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid #2e2e2e;
  color: #555;
  font-size: 0.78rem;
  padding: 10px 4px 4px;
  cursor: pointer;
  text-align: left;
  transition: color 150ms ease;
  margin-top: 6px;
}

.sb-new-cat-btn:hover { color: #888; }

.sb-new-cat-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ── Control panel ─────────────────────────────────────── */
.control-panel {
  margin: var(--space-7) auto var(--space-5);
  width: 80%;
  max-width: 600px;
}

.control-grid {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-4);
  /* box-shadow: inset 0px 2px 0px 0px #6b6b6b29; */
  /* padding: 31px 0px; */
  /* border-radius: 20px; */
}

/* ── Save button (standalone) ── */
.cp-save {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 34px;
  padding: 0 var(--space-3);
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: var(--small-button-bevel);
  background-color: #edebe9;
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
  white-space: nowrap;
  align-self: flex-end;
}

.cp-save:hover {
  background-color: #e3e1de;
  color: #4a4946;
  border-color: #b5b3b0;
}

.cp-save.cloud-saved {
  border-color: #78a97d;
  color: #3d7a43;
}

.cp-save .cp-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
}

/* ── Column (label + control) ── */
.cp-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

/* ── Heading row (icon + text) ── */
.cp-heading {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9a9894;
  cursor: default;
  white-space: nowrap;
  line-height: 1;
}

.cp-heading-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  display: block;
}

/* ── Toggle button (Shuffle / Straight) ── */
.cp-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-width: 80px;
  padding: 0 var(--space-3);
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  box-shadow: var(--small-button-bevel);
  appearance: none;
  -webkit-appearance: none;
  background-color: #edebe9;
  color: #6b6a66;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
  white-space: nowrap;
}

.cp-toggle:hover {
  background-color: #e3e1de;
  color: #4a4946;
  border-color: #b5b3b0;
}

.cp-toggle.active {
  background-color: #ecebe8;
  color: var(--text);
  /* border-color: #3d3d3a; */
}

.cp-toggle.active:hover {
  background-color: #4a4a46;
  color: #f0efec;
  border-color: #4a4a46;
}

/* ── Dropdown (challenge, timer) ── */
.cp-dropdown {
  height: 34px;
  padding: 1px var(--space-5) 0 var(--space-3);
  border: 1px solid #c8c6c3;
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  background-color: #edebe9;
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
  white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239a9894' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.cp-dropdown:hover {
  background-color: #e3e1de;
  color: #4a4946;
  border-color: #b5b3b0;
}

.response-timer {
  margin-top: 10px;
  width: 42%;
  height: 4px;
  /* border-radius: 999px; */
  background: rgba(30, 30, 30, 0.12);
  overflow: hidden;
}

.response-timer-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: #5b6167;
  transform-origin: left center;
  transform: scaleX(1);
}

.response-timer.is-timeout .response-timer-bar {
  background: #c96464;
}

.silence-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.25);
  z-index: 8;
}

.silence-overlay[hidden] {
  display: none !important;
}

.silence-overlay-card {
  background: #eceae8;
  border: 1px solid #b7b4b1;
  border-radius: 14px;
  padding: 16px 18px;
  min-width: 220px;
  text-align: center;
}

.silence-overlay-card p {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: #474642;
}

/* ── Context menus ────────────────────────────────────────────────────────── */
.sb-menu {
  position: fixed;
  background: #1a1a1a;
  border: 1px solid #333;
  z-index: 300;
  min-width: 140px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

.sb-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #bbb;
  font-size: 0.8rem;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.sb-menu-item:hover { background: #252525; color: #f0f0f0; }
.sb-menu-item.danger { color: #c06060; }
.sb-menu-item.danger:hover { background: #2a1a1a; color: #e07070; }

/* ── Color picker ─────────────────────────────────────────────────────────── */
.sb-color-picker {
  position: fixed;
  background: #1a1a1a;
  border: 1px solid #333;
  z-index: 310;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, 20px);
  gap: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

.sb-color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 100ms ease, transform 100ms ease;
}

.sb-color-swatch:hover {
  border-color: rgba(255,255,255,0.4);
  transform: scale(1.15);
}

.sb-color-swatch.active {
  border-color: rgba(255,255,255,0.7);
}

.sb-color-swatch-none {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 0.65rem;
}

.sb-color-swatch-none:hover { border-color: #888; color: #aaa; }

/* Move-to submenu */
.sb-move-submenu {
  position: fixed;
  background: #1a1a1a;
  border: 1px solid #333;
  z-index: 310;
  min-width: 150px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

/* ── New field inline input ───────────────────────────────────────────────── */
.sb-new-field-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid #444;
  color: #f0f0f0;
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
  padding: 4px 2px;
  flex: 1;
  min-width: 0;
}

/* ── Mobile tweaks ────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  /* On mobile: three-dot always slightly visible, not opacity 0 */
  .sb-three-dot {
    opacity: 0.3;
  }
  .sb-cat-header:hover .sb-three-dot,
  .sb-deck-row:hover .sb-three-dot,
  .sb-category.menu-open .sb-three-dot,
  .sb-deck-row.menu-open .sb-three-dot {
    opacity: 1;
  }
}
