/* The same component finishes drive the working site and the non-interactive
   composer samples in the gallery. All three use fonts already shipped on-site. */
.tm-desk95 {
  --t-bg: #b8d4ce; --t-card-solid: #dcdcd1; --t-ink: #17232a; --t-muted: #384e51;
  --t-line: #777e79; --t-accent: #1336a1; --t-accent-ink: #ffffff; --t-accent2: #286969;
  --t-theirs: #eff0e8; --t-mine: #203e8c; --t-mine-ink: #ffffff;
  --t-danger: #a02726; --t-admin: #744000; --t-scheme: light;
  --t-display: "Silkscreen", ui-monospace, monospace; --t-display-weight: 700; --t-h1: 1.6rem;
  --t-tech: "Inter", Tahoma, sans-serif; --t-body: Tahoma, "Inter", sans-serif; --t-radius: 1px;
  --t-input: #fffef3; --t-btn: #dcddd3; --t-btn-ink: #142029; --t-btn-radius: 1px;
  --t-wall: radial-gradient(#6d8e8538 .8px, transparent 1px) 0 0 / 4px 4px, linear-gradient(#b8d4ce,#b8d4ce);
  --ui-panel-border: 1px solid #555e5e;
  --ui-panel-shadow: inset 2px 2px #fffef5, inset -2px -2px #9b9c92, 3px 3px 0 #536767;
  --ui-key-border: 1px solid #394748;
  --ui-key-shadow: inset 2px 2px #fffef5, inset -2px -2px #969b92, 1px 1px 0 #405453;
  --ui-pressed-shadow: inset 2px 2px #7c867f, inset -1px -1px #fffdf1;
  --ui-ghost: #d5d8cf; --ui-ghost-ink: #16282a;
  --ui-field-border: 1px solid #68736e; --ui-field-shadow: inset 2px 2px #a1a69c, 1px 1px 0 #fffdf4;
  --ui-caption: linear-gradient(95deg,#15348a,#24689d); --ui-caption-ink: #fff;
  --ui-sample-bg: #82b6aa;
}
.tm-letterpress {
  --t-bg: #f1ede2; --t-card-solid: #fcf8ed; --t-ink: #25231e; --t-muted: #58554a;
  --t-line: #ada897; --t-accent: #802e28; --t-accent-ink: #fff8e9; --t-accent2: #474938;
  --t-theirs: #e6e2d4; --t-mine: #4c4d39; --t-mine-ink: #fff9e9;
  --t-danger: #95292b; --t-admin: #664b15; --t-scheme: light;
  --t-display: "Instrument Serif", Georgia, serif; --t-display-weight: 400; --t-h1: 2.45rem;
  --t-tech: "Inter", system-ui, sans-serif; --t-body: Georgia, "Times New Roman", serif; --t-radius: 0px;
  --t-input: #fffdf5; --t-btn: #752d26; --t-btn-ink: #fff8eb; --t-btn-radius: 0px;
  --t-wall: linear-gradient(#f1ede2,#f1ede2);
  --ui-panel-border: 1px solid #a8a18e; --ui-panel-shadow: 0 3px 0 -1px #d9d4c5;
  --ui-key-border: 1px solid #64271f; --ui-key-shadow: none;
  --ui-pressed-shadow: inset 0 0 0 2px currentColor;
  --ui-ghost: transparent; --ui-ghost-ink: #652c24;
  --ui-field-border: 1px solid #898675; --ui-field-shadow: none;
  --ui-caption: #fcf8ed; --ui-caption-ink: #25231e;
  --ui-sample-bg: #d8d1bb;
}
.tm-patchbay {
  --t-bg: #1a2225; --t-card-solid: #303b3e; --t-ink: #f3eedc; --t-muted: #c2cbc2;
  --t-line: #687377; --t-accent: #ffc56d; --t-accent-ink: #261b0e; --t-accent2: #94d8c4;
  --t-theirs: #394b50; --t-mine: #2c655e; --t-mine-ink: #fff9e8;
  --t-danger: #ffad99; --t-admin: #ffcd79; --t-scheme: dark;
  --t-display: "Bebas Neue", "Arial Narrow", sans-serif; --t-display-weight: 400; --t-h1: 2.4rem;
  --t-tech: "Chakra Petch", system-ui, sans-serif; --t-body: "Inter", system-ui, sans-serif; --t-radius: 9px;
  --t-input: #172322; --t-btn: linear-gradient(#ffda93,#e9a84d); --t-btn-ink: #282013; --t-btn-radius: 5px;
  --t-wall: repeating-linear-gradient(0deg,#1b2326 0 2px,#1c2528 2px 4px);
  --ui-panel-border: 1px solid #11181a;
  --ui-panel-shadow: inset 0 1px #657074, inset 0 -2px #293033, 0 3px 0 #101719;
  --ui-key-border: 1px solid #111819;
  --ui-key-shadow: inset 0 1px #ffffff70, inset 0 -3px #0003, 0 2px 0 #141c1d;
  --ui-pressed-shadow: inset 0 2px 3px #0009;
  --ui-ghost: linear-gradient(#4a575a,#394447); --ui-ghost-ink: #fff3d9;
  --ui-field-border: 2px solid #131b1c; --ui-field-shadow: inset 0 2px 4px #0007, 0 1px 0 #647070;
  --ui-caption: #2c383a; --ui-caption-ink: #ffd38a;
  --ui-sample-bg: #192225;
}

:is(.tm-desk95,.tm-letterpress,.tm-patchbay) {
  --t-card: var(--t-card-solid); --t-tabs: var(--t-card-solid); --t-sheet: var(--t-card-solid);
  --t-header: var(--t-card-solid); --t-sec: var(--t-ink); --t-link: var(--t-accent);
  --t-tabfont: var(--t-tech); --t-blur: none; --t-h1-track: 0em;
  --t-wall-wide: var(--t-wall); --t-veil: none; --t-veil-wide: none;
  --t-title: linear-gradient(var(--t-ink),var(--t-ink)); --t-card-shadow: var(--ui-panel-shadow);
}

/* Working surfaces, including dialogs appended directly to the document body. */
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay)
  :is(.card,.sheet,.toc,.th-bar,.th-lite,.appban,.mu-row,.tv-gch,.tv-ep,.fitem,.mu-player,.plist),
.if-panel {
  background-color: var(--t-card-solid); color: var(--t-ink);
  border: var(--ui-panel-border); border-radius: var(--t-radius); box-shadow: var(--ui-panel-shadow);
}
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay)
  :is(.btn,.appban .ab-work,.appban .ab-theme,.toc-btn,.actions button,.seg button.on,.fseg button.on),
.if-key {
  font-family: var(--t-tech); font-weight: 700; letter-spacing: .01em;
  background: var(--t-btn); color: var(--t-btn-ink); border: var(--ui-key-border);
  border-radius: var(--t-btn-radius); box-shadow: var(--ui-key-shadow);
}
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay)
  :is(.btn.ghost,.appban .ab-theme,.appban .ab-work,.actions button:not(.on)),
.if-key.ghost { background: var(--ui-ghost); color: var(--ui-ghost-ink); }
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) .btn.danger {
  background: var(--t-danger); color: var(--t-accent-ink);
}
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay)
  :is(.btn,.appban .ab-work,.appban .ab-theme,.actions button,.seg button,.toc-btn):not(:disabled):active {
  box-shadow: var(--ui-pressed-shadow); transform: translateY(1px); filter: none;
}
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) :is(input[type=text],input[type=search],input[type=password],textarea,.select),
.if-field {
  background-color: var(--t-input); color: var(--t-ink); font-family: var(--t-body);
  border: var(--ui-field-border); border-radius: var(--t-btn-radius); box-shadow: var(--ui-field-shadow);
}
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay)
  :is(a,button,textarea,input,select,summary,[role=button]):focus-visible,
.th-interfaces .th-card:focus-visible {
  outline: 2px solid var(--t-accent); outline-offset: 2px;
}
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) .appban { min-height: 0; }
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) .appban :is(.ab-art,.ab-ic),
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) .appban::after { display: none; }
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) .appban .ab-text { min-width: min(12rem,100%); }
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) :is(header.top h1,.appban .ab-name,.appban .ab-tag) {
  color: inherit; background: none; filter: none; text-shadow: none;
}
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) .appban .ab-tag {
  font-family: var(--t-body); opacity: 1; color: inherit;
}
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) .appban .ab-ticker {
  color: var(--t-muted); background: var(--t-card-solid); border-top: 1px solid var(--t-line);
}
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) #tabs a .ic {
  width: 1.25rem; height: 1.25rem; background: currentColor; box-shadow: none; opacity: 1;
  transform: none; border-radius: 0; mask: var(--icm) center/contain no-repeat;
  -webkit-mask: var(--icm) center/contain no-repeat;
}
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) #tabs a.on::after { display: none; }
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) .seg,
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) .fseg { border-radius: var(--t-radius); background: var(--t-input); }
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) #toast {
  font-family: var(--t-tech); background: var(--t-sheet); color: var(--t-ink);
  border: var(--ui-panel-border); border-radius: var(--t-radius); box-shadow: var(--ui-panel-shadow);
}
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) .actions { gap: 6px; }
html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) .msg { border-radius: var(--t-radius); }

/* Desk 95: raised frames, a cobalt caption, inset edit wells and a button taskbar. */
html.tm-desk95 :is(.appban .ab-body,.toc .toc-h,.sheet h2,.sheet .sheet-title,.te-head),
.th-card.tm-desk95 .if-caption {
  background: var(--ui-caption); color: var(--ui-caption-ink);
  font-family: var(--t-display); margin: 3px; padding: .46rem .68rem;
}
html.tm-desk95 .appban .ab-btns { align-self: center; }
html.tm-desk95 .appban .ab-name { font-size: clamp(1.45rem,4vw,2.3rem); }
html.tm-desk95 .sheet h2 { font-size: 1.05rem; }
html.tm-desk95 .te-head h2, html.tm-desk95 .te-head button { color: #fff; }
html.tm-desk95 .card > .compose-tools { border-top: 1px solid #969c91; padding-top: 10px; }
html.tm-desk95 article.card > .row:first-child {
  border-bottom: 2px groove #f7f8ed; padding-bottom: .55rem;
}
html.tm-desk95 :is(.msg,.comment .bubble) { border: 1px solid #778783; box-shadow: 2px 2px #758883; }
html.tm-desk95 :is(.post-img,.media-img,.avatar,.seg,.seg button,.toc a) { border-radius: 1px; }
html.tm-desk95 #tabs {
  border-top: 2px solid #fffef3; background: #cdd2c8; box-shadow: 0 -1px #64716e;
  padding: 3px 3px max(3px,env(safe-area-inset-bottom)); gap: 2px;
}
html.tm-desk95 #tabs a {
  background: var(--t-btn); color: var(--t-ink); border: var(--ui-key-border); box-shadow: var(--ui-key-shadow);
}
html.tm-desk95 #tabs a.on {
  color: #fff; background: #234b87; box-shadow: inset 2px 2px #142f5b; font-weight: 750;
}
@media (min-width: 700px) {
  html.tm-desk95 .sheet-bg { align-items: center; padding: 1.5rem; }
  html.tm-desk95 .sheet { max-width: 36rem; margin: 0; }
}
@media (min-width: 1050px) {
  html.tm-desk95 #tabs a { flex-direction: row; justify-content: center; gap: 5px; min-height: 38px; }
  html.tm-desk95 #tabs a .ic { margin: 0; }
}

/* Letterpress: a masthead, double rules and a reading measure for long posts. */
html.tm-letterpress .appban, .th-card.tm-letterpress .if-panel {
  border-width: 4px 0 3px; border-style: double none solid; border-color: #28291f; box-shadow: none;
}
html.tm-letterpress .appban .ab-body { padding: .88rem 1.25rem .72rem; align-items: baseline; }
html.tm-letterpress .appban .ab-name {
  font: 400 clamp(2.65rem,5vw,4.4rem)/.98 var(--t-display); letter-spacing: -.04em;
}
html.tm-letterpress .appban .ab-tag { font-style: italic; font-size: 1.05rem; }
html.tm-letterpress :is(.th-ed h2,.section-title,.sheet h2,.te-head h2,.toc .toc-h),
.th-card.tm-letterpress .if-caption { font: 400 2rem/1.05 var(--t-display); letter-spacing: -.02em; }
html.tm-letterpress :is(.sheet,.toc,.th-bar,.th-lite,article.card) {
  border-top: 4px double #302f26; border-bottom: 1px solid #676858;
}
html.tm-letterpress article.card { padding: clamp(1rem,2vw,1.55rem); }
html.tm-letterpress article.card .post-body {
  max-width: 66ch; font: 1.125rem/1.62 var(--t-body); margin-block: .8rem;
}
html.tm-letterpress article.card .name { font: 600 1.4rem/1.1 "Cormorant Garamond",Georgia,serif; }
html.tm-letterpress :is(input[type=text],input[type=password],input[type=search],textarea,.select),
.th-card.tm-letterpress .if-field { border-width: 0 0 2px; }
html.tm-letterpress :is(.btn,.actions button,.appban .ab-work,.appban .ab-theme),
.th-card.tm-letterpress .if-key {
  text-transform: uppercase; letter-spacing: .075em; font-size: .8125rem; padding: .65em 1.05em;
}
html.tm-letterpress .actions { border-top: 1px solid var(--t-ink); }
html.tm-letterpress .actions button:not(.on) { border-width: 0 0 1px; }
html.tm-letterpress .msg { border-left: 3px solid #81796c; }
html.tm-letterpress .msg.mine { border-left: 0; border-right: 3px solid #242b20; }
html.tm-letterpress .sheet { border-inline: 0; padding-inline: clamp(1rem,4vw,2.5rem); }
html.tm-letterpress .sheet-bg { background: #27231980; }
html.tm-letterpress #tabs {
  border-block-start: 4px double #2b2b24; box-shadow: none; background: var(--t-card-solid);
}
html.tm-letterpress #tabs a { color: var(--t-muted); border-inline-end: 1px solid #d0cbbd; }
html.tm-letterpress #tabs a.on { background: #efe1d3; color: #742e26; box-shadow: inset 0 -3px currentColor; }
@media (min-width: 901px) {
  html.tm-letterpress #tabs a { font: 600 .875rem/1.2 var(--t-body); padding-block: 1rem; }
  html.tm-letterpress #tabs a .ic { display: none; }
  html.tm-letterpress body[data-page=feed] #app > div:has(>article.card) { column-width: 30rem; column-rule: 1px solid #bdb5a6; column-gap: 2rem; }
}

/* Patchbay: flanged metal rails, inset readouts, backlit keys and a channel strip. */
.tm-patchbay {
  --rack-bolt: radial-gradient(circle,#152022 0 1px,#849090 1.4px 2.4px,#10191c 2.9px 3.7px,transparent 4px);
}
html.tm-patchbay :is(.appban,.sheet,.th-bar,.th-lite,article.card[data-vis^="post:"],.card:has(>.compose-tools),.card.te), .th-card.tm-patchbay .if-panel {
  background: var(--rack-bolt) left 6px top 6px / 8px 8px no-repeat,
    var(--rack-bolt) right 6px top 6px / 8px 8px no-repeat, var(--t-card-solid);
  border-inline: 3px solid #232d30;
}
html.tm-patchbay .appban .ab-body { padding: 1.15rem 1.4rem .7rem; }
html.tm-patchbay .appban .ab-name { color: var(--t-accent); font-size: clamp(2.55rem,5vw,3.65rem); letter-spacing: .035em; }
html.tm-patchbay .appban .ab-body::after, .th-card.tm-patchbay .if-caption::after {
  content: ""; display: inline-block; width: 3.5rem; height: .6rem;
  background: repeating-linear-gradient(90deg,transparent 0 4px,#293638 4px 6px),linear-gradient(90deg,#a0d4ab 55%,#e8ba6c 55% 80%,#c88972 80%);
}
html.tm-patchbay .appban .ab-body::after { order: -1; height: 2.7rem; width: 1.15rem;
  background: repeating-linear-gradient(0deg,transparent 0 3px,#293638 3px 5px),linear-gradient(0deg,#a0d4ab 55%,#e8ba6c 55% 80%,#c88972 80%);
}
html.tm-patchbay :is(.section-title,.sheet h2,.te-head h2,.th-ed h2,.toc .toc-h), .th-card.tm-patchbay .if-caption {
  color: var(--t-accent); font: 400 1.8rem/1 var(--t-display); letter-spacing: .05em;
}
html.tm-patchbay :is(input[type=text],input[type=password],input[type=search],textarea,.select),
.th-card.tm-patchbay .if-field { font-family: ui-monospace,monospace; color: #c0ebce; }
html.tm-patchbay :is(input,textarea)::placeholder { color: #a3bbae; opacity: 1; }
html.tm-patchbay .sheet-bg { background: #0c1519b8; }
html.tm-patchbay .sheet { padding: 1.4rem max(1.2rem,3%) max(1.4rem,env(safe-area-inset-bottom)); }
html.tm-patchbay .msg { border: 1px solid #728485; border-radius: 8px 8px 8px 2px; }
html.tm-patchbay .msg.mine { border-radius: 8px 8px 2px 8px; }
html.tm-patchbay .sendbar { box-shadow: inset 0 2px #728184; }
html.tm-patchbay #tabs { gap: 2px; padding: 3px 3px max(3px,env(safe-area-inset-bottom)); border-top: 3px ridge #536065; background: #1c2527; }
html.tm-patchbay #tabs a {
  border: 1px solid #172124; border-top-color: #6a7576; border-radius: 4px;
  background: #374346; color: #dee5dd; box-shadow: inset 0 -2px #293235;
}
html.tm-patchbay #tabs a.on { background: #272e2b; color: #ffd088; box-shadow: inset 0 3px #f8bb64; }

@media (max-width: 600px) {
  html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) #tabs {
    grid-template-columns: repeat(5,minmax(0,1fr));
  }
  html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) #tabs a {
    justify-content: center; min-height: 44px; padding: 2px 1px; font-size: .75rem; line-height: 1.1;
  }
  html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) .mu-player {
    bottom: calc(150px + env(safe-area-inset-bottom));
  }
  html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) body.music-mode #app {
    padding-bottom: calc(325px + env(safe-area-inset-bottom));
  }
}
/* Gallery samples share the actual field, button, panel and caption finishes. */
.th-interfaces .th-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,250px),1fr)); }
.th-interfaces .th-card { background: var(--t-card-solid); border-radius: var(--t-radius); }
.th-interfaces .th-meta { padding: .8rem 1rem 1rem; }
.th-interfaces .th-meta b { font-size: 1.45rem; }
.th-interfaces .th-meta p { font: .9375rem/1.45 var(--t-body); }
.th-interfaces .th-sw { display: none; }
.if-demo { display: grid; place-items: center; min-height: 12rem; padding: 1.4rem; background: var(--ui-sample-bg); }
.if-panel { width: min(100%,19rem); text-align: left; }
.if-caption { font-family: var(--t-display); background: var(--ui-caption); color: var(--ui-caption-ink); }
.if-demo-body { padding: .65rem .85rem .8rem; }
.if-field { padding: .55rem .65rem; font-size: .875rem; }
.if-demo-tools { display: flex; justify-content: space-between; margin-top: .6rem; }
.if-key { padding: .3rem .8rem; font-size: .8125rem; line-height: 1.25; }
.th-card.tm-letterpress .if-caption { margin: .4rem .85rem 0; border-bottom: 1px solid #343328; }
.th-card.tm-patchbay .if-caption { display: flex; align-items: center; justify-content: space-between; margin: .65rem 1rem 0; }
@media (prefers-reduced-motion:reduce) {
  html:is(.tm-desk95,.tm-letterpress,.tm-patchbay) :is(.btn,.actions button,.appban .ab-theme,.appban .ab-work) { transition: none; }
}
