/* /try: Sanchay's panel, copy card and Settings, in the browser.
   The desk wears the theme picked in its Settings: the build writes all nine themes, light and dark, from
   app/src/themes.css and crates/cp-config/src/colours.rs. Sizes follow crates/cp-panel/ui/theme.slint:
   13 px text, 38 px kind tiles, 20 px panel corners; 1em in the panel is 13 px at Normal text size. */

.desk[data-palette="paper"][data-mode="light"]{--panel:#f1ede7;--rail:#eae7e3;--card:#f9f6f2;--field:#f9f6f2;--edge:#8d8881;--hair:#d7d4cf;--tile:#eae7e3;--hover:#eae7e3;--ink:#231f19;--title:#231f19;--muted:#4e4841;--placeholder:#4e4841;--accent:#5a64be;--accent-ink:#373c8c;--on-accent:#f9f6f2;--selected:#dbe1ff;--selected-edge:#9aa2de;--red:#d25450;--orange:#c36602;--yellow:#8a7300;--green:#258f33;--teal:#018e89;--blue:#006eae;--indigo:#6977e1;--violet:#9a66cf;--pink:#c65491}
.desk[data-palette="paper"][data-mode="dark"]{--panel:#191713;--rail:#33302c;--card:#201e1a;--field:#201e1a;--edge:#6d6861;--hair:#4a4742;--tile:#33302c;--hover:#33302c;--ink:#f0eae3;--title:#f0eae3;--muted:#c6c0b7;--placeholder:#c6c0b7;--accent:#727edb;--accent-ink:#bcc7ff;--on-accent:#201e1a;--selected:#2e3455;--selected-edge:#505998;--red:#d25450;--orange:#d36d00;--yellow:#8b7403;--green:#258f33;--teal:#00908b;--blue:#177bb5;--indigo:#6977e1;--violet:#9a66cf;--pink:#c65491}
.desk[data-palette="butter"][data-mode="light"]{--panel:#faefc4;--rail:#f1edda;--card:#fdf9e7;--field:#fefcf3;--edge:#968666;--hair:#ded8c5;--tile:#f1edda;--hover:#f1edda;--ink:#3d2913;--title:#3d2913;--muted:#5d4b31;--placeholder:#5d4b31;--accent:#a45806;--accent-ink:#673704;--on-accent:#fdf9e7;--selected:#ebd9ba;--selected-edge:#c89860;--red:#d25450;--orange:#c76802;--yellow:#8a7300;--green:#258f33;--teal:#00908b;--blue:#006eae;--indigo:#6977e1;--violet:#9a66cf;--pink:#c65491}
.desk[data-palette="butter"][data-mode="dark"]{--panel:#1f1b0f;--rail:#3a3322;--card:#2d2615;--field:#19150c;--edge:#787264;--hair:#524b3a;--tile:#3a3322;--hover:#3a3322;--ink:#e5ddcd;--title:#e5ddcd;--muted:#c9c2b2;--placeholder:#c9c2b2;--accent:#d6760f;--accent-ink:#f2d5b5;--on-accent:#2d2615;--selected:#5c3c13;--selected-edge:#995911;--red:#d25450;--orange:#d36d00;--yellow:#937e14;--green:#279035;--teal:#00908b;--blue:#2684ba;--indigo:#6977e1;--violet:#9a66cf;--pink:#c65491}
.desk[data-palette="sage"][data-mode="light"]{--panel:#dde7d4;--rail:#e5e9e2;--card:#f2f5ee;--field:#f8faf6;--edge:#748573;--hair:#d0d6ce;--tile:#e5e9e2;--hover:#e5e9e2;--ink:#1f3423;--title:#1f3423;--muted:#3a4d3c;--placeholder:#3a4d3c;--accent:#23742e;--accent-ink:#164a1d;--on-accent:#f2f5ee;--selected:#c9dbc8;--selected-edge:#76a87b;--red:#d25450;--orange:#bf6704;--yellow:#8a7300;--green:#258f33;--teal:#018c87;--blue:#006eae;--indigo:#6876df;--violet:#9a66cf;--pink:#c65491}
.desk[data-palette="sage"][data-mode="dark"]{--panel:#151d16;--rail:#2b372d;--card:#1e2a20;--field:#101712;--edge:#6a746b;--hair:#434f45;--tile:#2b372d;--hover:#2b372d;--ink:#d6e2d7;--title:#d6e2d7;--muted:#bbc6bc;--placeholder:#bbc6bc;--accent:#46a052;--accent-ink:#c6e2c9;--on-accent:#1e2a20;--selected:#294b2e;--selected-edge:#387640;--red:#d25450;--orange:#d36d00;--yellow:#937e14;--green:#299137;--teal:#00908b;--blue:#2b87bc;--indigo:#6977e1;--violet:#9a66cf;--pink:#c65491}
.desk[data-palette="sky"][data-mode="light"]{--panel:#cde5f4;--rail:#dee9f0;--card:#ebf5fb;--field:#f5fafd;--edge:#698292;--hair:#c9d6dd;--tile:#dee9f0;--hover:#dee9f0;--ink:#173142;--title:#173142;--muted:#304a5b;--placeholder:#304a5b;--accent:#0268a3;--accent-ink:#014368;--on-accent:#ebf5fb;--selected:#bcd9e9;--selected-edge:#5fa0c6;--red:#d05450;--orange:#be6607;--yellow:#8a7300;--green:#258f33;--teal:#018c88;--blue:#006eae;--indigo:#6776de;--violet:#9a66cf;--pink:#c65491}
.desk[data-palette="sky"][data-mode="dark"]{--panel:#111d24;--rail:#253640;--card:#182933;--field:#0d171c;--edge:#65737c;--hair:#3d4e58;--tile:#253640;--hover:#253640;--ink:#d0e1ec;--title:#d0e1ec;--muted:#b5c6d0;--placeholder:#b5c6d0;--accent:#4797c5;--accent-ink:#c8e0ee;--on-accent:#182933;--selected:#25485c;--selected-edge:#367090;--red:#d25450;--orange:#d36d00;--yellow:#927d12;--green:#279035;--teal:#00908b;--blue:#2b87bc;--indigo:#6977e1;--violet:#9a66cf;--pink:#c65491}
.desk[data-palette="lilac"][data-mode="light"]{--panel:#d9dafe;--rail:#e5e4f3;--card:#f0f0fe;--field:#f7f8ff;--edge:#7d7897;--hair:#d2d0e0;--tile:#e5e4f3;--hover:#e5e4f3;--ink:#322843;--title:#322843;--muted:#483f5b;--placeholder:#483f5b;--accent:#744f9b;--accent-ink:#4d3466;--on-accent:#f0f0fe;--selected:#d7d0ea;--selected-edge:#a690c2;--red:#cf5350;--orange:#be6409;--yellow:#8a7300;--green:#258e33;--teal:#038a87;--blue:#006eae;--indigo:#6673d9;--violet:#9764cb;--pink:#c55490}
.desk[data-palette="lilac"][data-mode="dark"]{--panel:#1b1828;--rail:#333046;--card:#262339;--field:#15131f;--edge:#706e80;--hair:#4b485d;--tile:#333046;--hover:#333046;--ink:#dddcef;--title:#dddcef;--muted:#c2c1d3;--placeholder:#c2c1d3;--accent:#a77ad5;--accent-ink:#e3d4f2;--on-accent:#262339;--selected:#4a3b65;--selected-edge:#785a9d;--red:#d25450;--orange:#d36d00;--yellow:#917b0f;--green:#258f33;--teal:#00908b;--blue:#2684ba;--indigo:#6977e1;--violet:#9a66cf;--pink:#c65491}
.desk[data-palette="rose"][data-mode="light"]{--panel:#f9d2d9;--rail:#f1e1e4;--card:#fcedf0;--field:#fef6f7;--edge:#957278;--hair:#decdd0;--tile:#f1e1e4;--hover:#f1e1e4;--ink:#432329;--title:#432329;--muted:#5b3a40;--placeholder:#5b3a40;--accent:#97426c;--accent-ink:#622b46;--on-accent:#fcedf0;--selected:#e8cbd6;--selected-edge:#c086a1;--red:#ce534f;--orange:#bd6206;--yellow:#8a7300;--green:#258e33;--teal:#048985;--blue:#006eae;--indigo:#6772d6;--violet:#9764ca;--pink:#c3538f}
.desk[data-palette="rose"][data-mode="dark"]{--panel:#241618;--rail:#412d30;--card:#342023;--field:#1d1213;--edge:#7f6d6f;--hair:#594548;--tile:#412d30;--hover:#412d30;--ink:#eed7da;--title:#eed7da;--muted:#d2bcbf;--placeholder:#d2bcbf;--accent:#ce6ca0;--accent-ink:#efd0e1;--on-accent:#342023;--selected:#5f3546;--selected-edge:#965073;--red:#d25450;--orange:#d36d00;--yellow:#927d12;--green:#258f33;--teal:#00908b;--blue:#2482b9;--indigo:#6977e1;--violet:#9a66cf;--pink:#c65491}
.desk[data-palette="stone"][data-mode="light"]{--panel:#e2ded9;--rail:#e9e6e4;--card:#f4f2f0;--field:#f9f8f7;--edge:#837c74;--hair:#d5d2cf;--tile:#e9e6e4;--hover:#e9e6e4;--ink:#352c22;--title:#352c22;--muted:#4b433a;--placeholder:#4b433a;--accent:#136d66;--accent-ink:#0c4742;--on-accent:#f4f2f0;--selected:#c7d7d4;--selected-edge:#6da29d;--red:#d05450;--orange:#be6504;--yellow:#8a7300;--green:#258f33;--teal:#038b86;--blue:#006eae;--indigo:#6774d9;--violet:#9965cd;--pink:#c65491}
.desk[data-palette="stone"][data-mode="dark"]{--panel:#1d1b19;--rail:#363331;--card:#292624;--field:#171514;--edge:#73706e;--hair:#4e4b48;--tile:#363331;--hover:#363331;--ink:#e0ddda;--title:#e0ddda;--muted:#c5c2bf;--placeholder:#c5c2bf;--accent:#219e9a;--accent-ink:#bae1e0;--on-accent:#292624;--selected:#274845;--selected-edge:#247370;--red:#d25450;--orange:#d36d00;--yellow:#927d12;--green:#279035;--teal:#00908b;--blue:#2684ba;--indigo:#6977e1;--violet:#9a66cf;--pink:#c65491}
.desk[data-palette="high-contrast"][data-mode="light"]{--panel:#faf4ed;--rail:#f1efec;--card:#fefcfa;--field:#ffffff;--edge:#746d63;--hair:#dcd9d6;--tile:#f1efec;--hover:#f1efec;--ink:#2c2419;--title:#2c2419;--muted:#453d32;--placeholder:#453d32;--accent:#0e5780;--accent-ink:#07293c;--on-accent:#fefcfa;--selected:#e0e7eb;--selected-edge:#779fb6;--red:#a54741;--orange:#975309;--yellow:#786405;--green:#27732c;--teal:#0d7069;--blue:#0468a2;--indigo:#575fa7;--violet:#7b549c;--pink:#9c4771}
.desk[data-palette="high-contrast"][data-mode="dark"]{--panel:#1d1b19;--rail:#363331;--card:#292624;--field:#171514;--edge:#908f8e;--hair:#53514f;--tile:#363331;--hover:#363331;--ink:#fbfbfa;--title:#fbfbfa;--muted:#dcdcda;--placeholder:#dcdcda;--accent:#85b9d8;--accent-ink:#f9fcfd;--on-accent:#292624;--selected:#323435;--selected-edge:#5c7686;--red:#e2908d;--orange:#df9445;--yellow:#b4a55c;--green:#6fb578;--teal:#4fb2af;--blue:#6eacd1;--indigo:#96a0ea;--violet:#ba97de;--pink:#d98eb6}
.desk[data-palette="classic"][data-mode="light"]{--panel:#f2f3fa;--rail:#dedff4;--card:#fcfcff;--field:#ffffff;--edge:#87899e;--hair:#cecfe8;--tile:#dedff4;--hover:#dedff4;--ink:#3a3d4a;--title:#3a3d4a;--muted:#434653;--placeholder:#434653;--accent:#4f46e5;--accent-ink:#3f38b7;--on-accent:#fcfcff;--selected:#e9e9fb;--selected-edge:#9c98f0;--red:#d25450;--orange:#ca6a04;--yellow:#8a7300;--green:#258f33;--teal:#00908b;--blue:#006eae;--indigo:#6977e1;--violet:#9a66cf;--pink:#c65491}
.desk[data-palette="classic"][data-mode="dark"]{--panel:#1f2230;--rail:#31354c;--card:#25283b;--field:#26283b;--edge:#707385;--hair:#32364d;--tile:#31354c;--hover:#31354c;--ink:#d6d7da;--title:#d6d7da;--muted:#c5c6cc;--placeholder:#c5c6cc;--accent:#a5b4fc;--accent-ink:#a9b7fc;--on-accent:#25283b;--selected:#282c46;--selected-edge:#6670a1;--red:#d35754;--orange:#d36d00;--yellow:#958017;--green:#2e933b;--teal:#00908b;--blue:#2e88bd;--indigo:#6c7ae2;--violet:#9c69d0;--pink:#c85994}
.desk[data-mode="light"] .sw-paper{--g:#f1ede7;--a:#5a64be}
.desk[data-mode="light"] .sw-butter{--g:#faefc4;--a:#a45806}
.desk[data-mode="light"] .sw-sage{--g:#dde7d4;--a:#23742e}
.desk[data-mode="light"] .sw-sky{--g:#cde5f4;--a:#0268a3}
.desk[data-mode="light"] .sw-lilac{--g:#d9dafe;--a:#744f9b}
.desk[data-mode="light"] .sw-rose{--g:#f9d2d9;--a:#97426c}
.desk[data-mode="light"] .sw-stone{--g:#e2ded9;--a:#136d66}
.desk[data-mode="light"] .sw-high-contrast{--g:#faf4ed;--a:#0e5780}
.desk[data-mode="light"] .sw-classic{--g:#f2f3fa;--a:#4f46e5}
.desk[data-mode="dark"] .sw-paper{--g:#191713;--a:#727edb}
.desk[data-mode="dark"] .sw-butter{--g:#1f1b0f;--a:#d6760f}
.desk[data-mode="dark"] .sw-sage{--g:#151d16;--a:#46a052}
.desk[data-mode="dark"] .sw-sky{--g:#111d24;--a:#4797c5}
.desk[data-mode="dark"] .sw-lilac{--g:#1b1828;--a:#a77ad5}
.desk[data-mode="dark"] .sw-rose{--g:#241618;--a:#ce6ca0}
.desk[data-mode="dark"] .sw-stone{--g:#1d1b19;--a:#219e9a}
.desk[data-mode="dark"] .sw-high-contrast{--g:#1d1b19;--a:#85b9d8}
.desk[data-mode="dark"] .sw-classic{--g:#1f2230;--a:#a5b4fc}

.desk[data-mode="light"] {
  color-scheme: light;
  --float-win: 0 2px 4px rgb(20 24 48 / 0.08), 0 30px 60px -24px rgb(20 24 48 / 0.45);
  --danger: #6f2119;
  --danger-soft: rgb(192 57 43 / 0.09);
}

.desk[data-mode="dark"] {
  color-scheme: dark;
  --float-win: 0 2px 4px rgb(0 0 0 / 0.35), 0 30px 60px -24px rgb(0 0 0 / 0.8);
  --danger: #fad3cf;
  --danger-soft: rgb(242 139 130 / 0.12);
}

/* The bar above the desk: sample copies, your own text, and the two windows */

.demo {
  max-width: var(--wide);
  margin: 28px auto 0;
}

.demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 12px 14px;
  border: 1px solid var(--hair);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: var(--card);
}

.demo-samples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.demo-said {
  margin-right: 2px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: 500 0.875rem/1.2 var(--ui);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pill:hover {
  border-color: var(--ink);
}

.pill .ic {
  width: 16px;
  height: 16px;
}

.pill.main {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.pill.main kbd {
  border-color: color-mix(in srgb, var(--on-accent) 50%, transparent);
  background: transparent;
  color: inherit;
}

.pill[aria-expanded="true"]:not(.main) {
  border-color: var(--accent);
  background: var(--selected);
  color: var(--accent-ink);
}

.demo-own {
  display: flex;
  flex: 1 1 300px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.demo-own input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  font: 400 0.9375rem/1.2 var(--ui);
}

.demo-own input::placeholder {
  color: var(--muted);
}

.demo-windows {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.demo-keys {
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.9;
}

/* The desk: the backdrop the windows sit on, in the chosen theme */

.desk {
  --zoom: 1;
  position: relative;
  height: clamp(560px, 80vh, 720px);
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: 0 0 18px 18px;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--selected) 55%, var(--accent)) 0%, transparent 62%),
    var(--selected);
  color: var(--ink);
  touch-action: manipulation;
}

.desk[data-size="small"] {
  --zoom: 0.92;
}

.desk[data-size="large"] {
  --zoom: 1.08;
}

.desk[data-size="larger"] {
  --zoom: 1.16;
}

.desk-wait,
.desk-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: var(--ink);
  font-weight: 600;
  text-align: center;
}

.desk-hint[hidden] {
  display: none;
}

.desk-note,
.pnote {
  position: absolute;
  z-index: 9;
  bottom: 14px;
  left: 50%;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--panel);
  font: 500 calc(13px * var(--zoom)) / 1.35 var(--ui);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 160ms ease,
    transform 200ms ease;
}

.desk-note.on,
.pnote.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.win {
  position: absolute;
}

.win[hidden] {
  display: none;
}

.desk .i {
  display: block;
  flex: none;
  width: 1.3em;
  height: 1.3em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.desk kbd {
  font-size: 0.85em;
}

.desk button {
  -webkit-tap-highlight-color: transparent;
}

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

/* The panel */

.panel {
  z-index: 3;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: 1.55em;
  background: var(--panel);
  box-shadow: var(--float-win);
  font: 400 calc(13px * var(--zoom)) / 1.385 var(--ui);
  animation: rise 120ms ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.p-top {
  position: relative;
  z-index: 2;
  flex: none;
  padding: 0 0.85em;
  background: var(--panel);
  transition:
    margin-top 220ms ease,
    box-shadow 150ms ease;
}

.p-top.lifted {
  box-shadow: 0 1px 0 var(--hair);
}

.p-top.away {
  margin-top: calc(-1 * var(--top-h, 0px));
  box-shadow: none;
}

.grab {
  width: 2.75em;
  height: 0.3em;
  margin: 0.55em auto 0.6em;
  border-radius: 1em;
  background: var(--edge);
}

.p-head {
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.search {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.65em;
  min-width: 0;
  height: 2.75em;
  padding: 0 0.9em;
  border: 1px solid var(--accent);
  border-radius: 0.95em;
  background: var(--field);
}

.search:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  outline: 0;
}

.search input::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.qcount {
  flex: none;
  color: var(--muted);
  font-size: 0.85em;
  white-space: nowrap;
}

.ib {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.45em;
  height: 2.45em;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.ib:hover {
  background: var(--hover);
  color: var(--ink);
}

.ib.danger {
  color: var(--danger);
}

.filters {
  display: flex;
  align-items: center;
  gap: 0.2em;
  margin: 0.7em 0 0;
  padding: 0 0 0.5em;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.chip {
  display: grid;
  flex: none;
  place-items: center;
  min-width: 2.65em;
  height: 2.3em;
  padding: 0 0.55em;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.chip:hover {
  background: var(--hover);
}

.chip.word {
  padding: 0 1em;
  font-weight: 600;
}

.chip.on {
  background: var(--selected);
  color: var(--accent-ink);
}

.chip[class*="k-"].on {
  background: color-mix(in srgb, var(--card) 80%, var(--h));
  color: var(--h);
}

.list {
  flex: 1;
  min-height: 0;
  padding: 0 0.85em 0.6em;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.when {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin: 0.75em 0 0.45em;
  color: var(--muted);
  font-size: 0.846em;
  font-weight: 600;
}

.when::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hair);
}

.item {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0 1em;
  margin-bottom: 0.55em;
  padding: 0.8em 0.95em;
  border-radius: 1.2em;
  background: var(--card);
}

.item:hover {
  background: color-mix(in srgb, var(--card) 70%, var(--hover));
}

.item.sel {
  background: var(--selected);
}

.item.sel::before {
  content: "";
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 0.22em;
  height: 2.2em;
  border-radius: 0 0.2em 0.2em 0;
  background: var(--accent);
}

.desk[data-density="compact"] .item {
  padding-block: 0.55em;
}

.desk[data-density="comfortable"] .item {
  padding-block: 1em;
}

.kt {
  width: 2.92em;
  height: 2.92em;
  border-radius: 0.92em;
}

.kt .i {
  width: 1.55em;
  height: 1.55em;
}

.kt.thumb {
  border-radius: 0.25em;
}

.hills,
.c-pic.hills {
  background:
    radial-gradient(130% 75% at 55% 118%, #3d7b58 0 50%, transparent 51%),
    linear-gradient(#7cc4ec, #bcd8ee 55%, #e9cdbd);
}

.sea,
.c-pic.sea {
  background:
    linear-gradient(transparent 58%, #1f6f8b 58% 70%, #2a8aa8 70%),
    radial-gradient(40% 30% at 70% 38%, #ffd58a 0 40%, transparent 42%),
    linear-gradient(#f6b37a, #f3d6b4 60%);
}

.ibody {
  flex: 1;
  min-width: 0;
}

.it {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0.4em;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.iname {
  display: block;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.itext {
  display: block;
  overflow-wrap: anywhere;
}

.itext.one {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.itext.sub {
  color: var(--muted);
}

.itext.clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.desk[data-density="compact"] .itext.clamp {
  -webkit-line-clamp: 1;
}

.desk[data-density="comfortable"] .itext.clamp {
  -webkit-line-clamp: 3;
}

.itext.full {
  white-space: pre-wrap;
}

.mono {
  font-family: var(--mono);
  font-size: 0.95em;
}

.itext.clamp.mono {
  white-space: pre-wrap;
}

.masked {
  color: var(--muted);
  letter-spacing: 0.12em;
}

.it mark {
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  color: inherit;
}

.im {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0.5em 0 0;
  color: var(--muted);
  font-size: 0.846em;
}

.im i {
  margin: 0 0.55em;
  font-style: normal;
}

.ms {
  margin-right: 0.75em;
}

.ms b {
  margin-right: 0.3em;
  color: var(--accent);
  font-weight: 700;
}

.sel .ms b {
  color: var(--accent-ink);
}

.ipin {
  margin-left: auto;
  color: var(--accent-ink);
}

.ipin .i {
  width: 1.2em;
  height: 1.2em;
}

.lstats,
.c-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin: 0.6em 0 0;
}

.st {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  max-width: 100%;
  padding: 0.15em 0.65em 0.15em 0.2em;
  border-radius: 999px;
  background: var(--tile);
  color: var(--ink);
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

.st .g {
  display: grid;
  place-items: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 0.3em;
  border-radius: 999px;
  background: var(--selected);
  color: var(--accent-ink);
  font-weight: 700;
}

/* The selected item's buttons get a row of their own, so they never cover its text */
.acts {
  display: flex;
  flex-basis: 100%;
  justify-content: flex-end;
  gap: 0.15em;
  margin: 0.55em 0 -0.35em;
  padding-top: 0.35em;
  border-top: 1px solid var(--selected-edge);
}

.acts .ib {
  width: 2.3em;
  height: 2.3em;
  color: var(--ink);
}

.acts .ib.danger {
  color: var(--danger);
}

.editor {
  display: block;
  width: 100%;
  min-height: 5.6em;
  padding: 0.5em 0.7em;
  resize: none;
  border: 2px solid var(--accent);
  border-radius: 0.8em;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  outline: 0;
}

.enote {
  margin: 0.4em 0 0;
  color: var(--muted);
  font-size: 0.85em;
}

.rename {
  display: block;
  width: 100%;
  padding: 0.15em 0;
  border: 0;
  border-bottom: 2px solid var(--accent);
  background: transparent;
  color: var(--ink);
  font: 600 1em/1.385 var(--ui);
  outline: 0;
}

.empty {
  padding: 2.4em 1em;
  color: var(--muted);
  text-align: center;
}

.empty p {
  margin: 0.2em 0;
}

.empty b {
  color: var(--ink);
}

/* Menus, the key list and the pinned-item question */

.pop,
.pop-wrap,
.sheet,
.asking {
  position: absolute;
  z-index: 6;
  border: 1px solid var(--hair);
  border-radius: 1.2em;
  background: var(--card);
  box-shadow: var(--float-win);
}

.pop {
  min-width: 16em;
  padding: 0.4em;
}

.pop.at-more {
  top: 3.7em;
  right: 0.7em;
}

.pop-wrap {
  min-width: 16em;
  max-height: 70%;
  padding: 0.4em;
  overflow-y: auto;
}

.pop-wrap.at-filters {
  left: 0.7em;
}

.pop-wrap.at-middle {
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
}

.pop-wrap .pop {
  position: static;
  min-width: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.pop-title {
  margin: 0;
  padding: 0.45em 0.75em;
  color: var(--accent-ink);
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pop-hint {
  margin: 0.3em -0.4em -0.4em;
  padding: 0.55em 0.95em 0.6em;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 0.8em;
}

.mi {
  display: flex;
  align-items: center;
  gap: 0.7em;
  width: 100%;
  min-height: 2.6em;
  padding: 0.4em 0.75em;
  border: 0;
  border-radius: 0.8em;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mi:hover,
.mi:focus-visible {
  background: var(--hover);
}

.mi small {
  margin-left: auto;
  color: var(--muted);
}

.mi.on {
  color: var(--accent-ink);
  font-weight: 600;
}

.mi kbd,
.mi .kb {
  min-width: 1.6em;
  text-align: center;
}

.mk {
  color: var(--h, var(--ink));
}

.mswitch {
  position: relative;
  flex: none;
  width: 2.4em;
  height: 1.45em;
  margin-left: 0.5em;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--tile);
}

.mswitch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.2em;
  width: 0.9em;
  height: 0.9em;
  border-radius: 50%;
  background: var(--edge);
  transform: translateY(-50%);
  transition: left 140ms ease;
}

.mswitch.on {
  border-color: var(--accent);
  background: var(--accent);
}

.mswitch.on::after {
  left: 1.25em;
  background: var(--on-accent);
}

.sheet {
  inset: 0.6em;
  display: flex;
  flex-direction: column;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4em 0.4em 0.2em 1em;
}

.sheet-head p {
  margin: 0;
  color: var(--accent-ink);
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  padding: 0 0.6em 0.6em;
  overflow-y: auto;
}

.keys2 {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
}

.keys2 td {
  padding: 0.35em 0.5em;
  border-top: 1px solid var(--hair);
  vertical-align: middle;
}

.keys2 td:first-child {
  width: 40%;
}

.keys2 kbd {
  margin: 0.1em 0;
}

.asking {
  top: 34%;
  left: 50%;
  width: min(18em, calc(100% - 2em));
  padding: 1.1em;
  border-color: var(--selected-edge);
  text-align: center;
  transform: translateX(-50%);
}

.asking p {
  margin: 0 0 1em;
  font-weight: 600;
}

.choices {
  display: flex;
  justify-content: center;
  gap: 1.2em;
}

.asking .choice {
  display: grid;
  place-items: center;
  width: 3.7em;
  height: 2.8em;
  border: 1px solid var(--field-border, var(--edge));
  border-radius: 0.9em;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.asking .choice.chosen {
  border: 2px solid var(--accent);
  color: var(--ink);
}

.asking .choice.danger.chosen {
  color: var(--danger);
}

/* The copy card */

.card {
  z-index: 7;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 32px);
  padding: 6px 12px 12px;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--float-win);
  color: var(--ink);
  font: 400 calc(13px * var(--zoom)) / 1.4 var(--ui);
  touch-action: none;
  animation: rise 120ms ease-out;
}

.card.dragging {
  cursor: grabbing;
}

.c-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: 400 0.846em/1.3 var(--ui);
  text-align: left;
  cursor: pointer;
}

.c-head .kind {
  width: 14px;
  height: 14px;
  color: var(--h, var(--muted));
}

.card.editing .c-head span {
  color: var(--accent-ink);
  font-weight: 600;
}

.c-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.c-text {
  display: -webkit-box;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
  cursor: text;
}

.c-text.muted {
  color: var(--muted);
}

.c-pic {
  height: 100%;
  min-height: 120px;
  border-radius: 11px;
}

.c-close {
  position: absolute;
  top: -13px;
  right: -13px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--hair);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease-out;
}

.c-close .i {
  width: 14px;
  height: 14px;
}

.card:hover .c-close,
.card:focus-within .c-close {
  opacity: 1;
}

@media (hover: none) {
  .c-close {
    opacity: 1;
  }
}

/* Settings, beside the panel */

.settings {
  z-index: 4;
  top: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100% - 32px));
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--float-win);
  color: var(--ink);
  font: 400 14px/1.45 var(--ui);
  animation: rise 120ms ease-out;
}

.s-chrome {
  display: flex;
  flex: none;
  align-items: center;
  height: 36px;
  padding-left: 13px;
  border-bottom: 1px solid var(--hair);
  background: var(--rail);
}

.s-chrome span {
  flex: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.s-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.s-close:hover {
  background: var(--hover);
  color: var(--ink);
}

.s-close .i {
  width: 14px;
  height: 14px;
}

.s-shell {
  display: grid;
  flex: 1;
  grid-template-columns: 60px minmax(0, 1fr);
  min-height: 0;
}

.s-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 10px;
  border-right: 1px solid var(--hair);
  background: var(--rail);
}

.s-rail button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--title);
  cursor: pointer;
}

.s-rail button:hover {
  background: var(--hover);
}

.s-rail button[aria-current="true"] {
  background: var(--selected);
  color: var(--accent-ink);
}

.s-rail .i {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.s-pane {
  min-height: 0;
  padding: 10px 20px 24px;
  overflow-y: auto;
}

.s-pane h3 {
  margin: 8px 0 0;
  font: 600 20px/1.2 var(--display);
  letter-spacing: -0.01em;
}

.s-band {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.s-band::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hair);
}

.line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair);
}

.line:last-child {
  border-bottom: 0;
}

.line .what {
  flex: 1 1 200px;
  min-width: 0;
}

.line .what b {
  display: block;
  font-size: 13px;
  font-weight: 500;
}

.line .what span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.line .does {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.said {
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
}

.knob {
  position: relative;
  flex: none;
  width: 40px;
  height: 23px;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--tile);
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease;
}

.knob::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
  transition: transform 140ms ease;
}

.knob[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent);
}

.knob[aria-checked="true"]::after {
  background: var(--on-accent);
  transform: translateX(17px);
}

.choice {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.choice label:hover {
  background: var(--hover);
}

.choice label.on {
  border-color: var(--selected-edge);
  background: var(--selected);
  color: var(--accent-ink);
}

.choice label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.choice label:has(input:disabled) {
  opacity: 0.55;
  cursor: default;
}

.choice input,
.swatch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.choice .i {
  width: 14px;
  height: 14px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.swatch {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--g) 0 55%, var(--a) 55% 100%);
  box-shadow: inset 0 0 0 1px var(--edge);
  cursor: pointer;
  outline-offset: 2px;
}

.swatch.on {
  outline: 2px solid var(--ink);
}

.swatch:has(input:focus-visible) {
  outline: 2px solid var(--accent);
}

.pair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.settings select {
  padding: 5px 8px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: 13px/1.3 var(--ui);
}

.settings input[type="range"] {
  width: 180px;
  max-width: 100%;
  accent-color: var(--accent);
}

.amount {
  min-width: 82px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mild,
.grave {
  padding: 6px 11px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  font: 13px/1.3 var(--ui);
  cursor: pointer;
}

.mild:hover {
  background: var(--hover);
}

.grave {
  border-color: color-mix(in srgb, var(--danger) 38%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table th,
.stats-table td {
  padding: 8px 4px;
  border-top: 1px solid var(--hair);
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.stats-table thead th {
  border-top: 0;
  color: var(--muted);
  font-weight: 600;
}

.stats-table td {
  width: 76px;
  text-align: center;
}

.stats-table thead th + th {
  text-align: center;
}

.stats-table tbody th {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.stat-said b {
  display: block;
  font-size: 13px;
  font-weight: 500;
}

.stat-said span {
  color: var(--muted);
}

.stats-table .knob {
  display: inline-block;
}

/* Phones: the panel fills the desk, Settings covers it, and the bar's samples scroll sideways */

@media (max-width: 47.99em) {
  .demo-bar {
    padding: 10px;
  }

  .demo-samples {
    flex-wrap: nowrap;
    width: 100%;
    margin: 0 -10px;
    padding: 2px 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .demo-own,
  .demo-windows {
    width: 100%;
    margin-left: 0;
  }

  .demo-windows .pill {
    flex: 1;
    justify-content: center;
  }

  .panel {
    top: 8px;
    left: 8px;
    font-size: calc(14px * var(--zoom));
  }

  .acts .ib {
    width: 2.6em;
    height: 2.6em;
  }

  .settings {
    inset: 0;
    width: auto;
    border: 0;
    border-radius: 0;
  }

  .s-shell {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .s-rail {
    padding: 10px 6px;
  }

  .s-pane {
    padding: 8px 14px 20px;
  }

  .stats-table td {
    width: 52px;
  }
}
