/* Yubaree house style — shared by the community site and every app built on it.
   Taken from Novel Thoughts: a 1970s palette (cream paper, burnt orange, mustard, avocado,
   teal, dark brown ink), chunky borders, hard offset shadows, a soft display serif. */

:root {
  --c-cream: #f3e9d2; --c-paper: #fbf5e6; --c-sand: #e8d9b5; --c-brown: #3b2415; --c-cocoa: #6b4a2b;
  --c-orange: #b94f25; --c-mustard: #e2a92b; --c-avocado: #677733; --c-teal: #3c7a75; --c-rust: #a33d1e;
  /* the same three, a notch deeper, for small text: 4.5:1 or better on the cream page as well as on paper */
  --t-orange: #ae4a23; --t-avocado: #606f2f; --t-teal: #39726e;

  --bg: var(--c-cream); --paper: var(--c-paper); --soft: var(--c-sand);
  --ink: var(--c-brown); --muted: #78664f; --line: var(--c-brown); --line-soft: #d9c8a4;
  --accent: var(--t-orange); --accent-ink: var(--c-paper); --accent-soft: #f5dcc6;
  --primary: var(--c-brown); --primary-ink: var(--c-cream);
  --ok: var(--t-avocado); --danger: var(--c-rust); --link: var(--t-teal);
  --dot: rgba(59, 36, 21, .06);
  --radius: 14px;
  --shadow: 4px 4px 0 var(--line); --shadow-sm: 2px 2px 0 var(--line);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --rainbow: linear-gradient(90deg, var(--c-orange) 0 25%, var(--c-mustard) 25% 50%, var(--c-avocado) 50% 75%, var(--c-teal) 75%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #241810; --paper: #2f2016; --soft: #3d2b1d; --ink: #f3e9d2; --muted: #c2ad8a;
    --line: #e8d9b5; --line-soft: #4e3a28; --accent-soft: #4a2a1a; --accent: #e06a38; --accent-ink: #241810;
    --primary: #f3e9d2; --primary-ink: #241810; --link: #7cc4bd; --ok: #a3b55c; --danger: #ff7b5c;
    --dot: rgba(243, 233, 210, .05);
    --shadow: 4px 4px 0 #e2a92b; --shadow-sm: 2px 2px 0 #e2a92b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans); color: var(--ink); background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 22px 22px;
  line-height: 1.5; font-size: 15px; min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; margin: 0 0 .5rem; letter-spacing: -.01em; font-variation-settings: "SOFT" 100, "opsz" 144; line-height: 1.15; }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); font-weight: 800; line-height: 1.05; }
h1 em, h2 em { font-style: italic; color: var(--accent); }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 .75rem; }
a { color: var(--link); }
code { background: var(--soft); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--sans); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: .78rem; color: var(--accent); margin: 0 0 .6rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.right { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: .6rem; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1; }
.container { max-width: 1120px; margin: 0 auto; padding: 1.75rem 1.5rem; }
.container.narrow { max-width: 760px; }
.rainbow-bar { height: 7px; background: var(--rainbow); border-top: 3px solid var(--line); border-bottom: 3px solid var(--line); }
.stripes { display: inline-flex; width: 120px; height: 14px; border: 3px solid var(--line); border-radius: 999px; overflow: hidden; }
.stripes span { flex: 1; } .stripes span:nth-child(1) { background: var(--c-orange); } .stripes span:nth-child(2) { background: var(--c-mustard); }
.stripes span:nth-child(3) { background: var(--c-avocado); } .stripes span:nth-child(4) { background: var(--c-teal); }

/* ---- buttons ---- */
button, .btn { font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); color: var(--ink);
  padding: .5rem 1.05rem; box-shadow: var(--shadow-sm); transition: transform .06s, box-shadow .06s, background .15s; display: inline-flex; align-items: center; gap: .45rem;
  text-decoration: none; white-space: nowrap; line-height: 1.25; }
button:hover, .btn:hover { background: var(--soft); }
button:active, .btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--line); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
button.primary, .btn.primary { background: var(--primary); color: var(--primary-ink); }
button.primary:hover, .btn.primary:hover { background: var(--c-cocoa); color: var(--c-cream); }
button.accent, .btn.accent { background: var(--c-orange); color: var(--c-paper); }
button.accent:hover, .btn.accent:hover { background: var(--c-rust); }
button.ghost, .btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
button.ghost:hover, .btn.ghost:hover { border-color: var(--line); background: var(--paper); }
button.danger, .btn.danger { color: var(--danger); }
button.big, .btn.big { font-size: 1.1rem; padding: .8rem 1.5rem; box-shadow: var(--shadow); }
button.small, .btn.small { font-size: .82rem; padding: .3rem .75rem; }
button.icon { padding: .35rem .55rem; }
button.on { background: var(--c-orange); color: var(--c-paper); }
button.rec { background: #b8321f; color: #fff; }
button.rec.live { animation: yb-pulse 1.2s infinite; }
@keyframes yb-pulse { 0%,100% { box-shadow: var(--shadow-sm), 0 0 0 0 rgba(184,50,31,.5);} 50% { box-shadow: var(--shadow-sm), 0 0 0 10px rgba(184,50,31,0);} }
:focus-visible { outline: 3px solid var(--c-mustard); outline-offset: 2px; }

/* ---- cards ---- */
.card { background: var(--paper); border: 3px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.35rem; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 1.25rem; }
.card.flat { box-shadow: none; }
.card.hot { box-shadow: 5px 5px 0 var(--c-orange); }
.callout { padding: .7rem 1rem; border-radius: 12px; border: 2px solid var(--line); background: var(--accent-soft); }
.callout.warn { background: var(--c-mustard); color: var(--c-brown); }
.empty { color: var(--muted); padding: 2.5rem 1rem; text-align: center; font-family: var(--serif); font-size: 1.2rem; font-style: italic; }

/* ---- chips and avatars ---- */
.chip { display: inline-flex; align-items: center; gap: .3rem; border: 2px solid var(--line); border-radius: 999px; padding: .08rem .6rem; font-size: .75rem; font-weight: 700;
  background: var(--paper); color: var(--ink); white-space: nowrap; }
.chip.orange, .chip.writing { background: var(--c-orange); color: var(--c-paper); }
.chip.teal, .chip.music { background: var(--c-teal); color: var(--c-paper); }
.chip.mustard, .chip.podcast { background: var(--c-mustard); color: var(--c-brown); }
.chip.avocado, .chip.food { background: var(--c-avocado); color: var(--c-paper); }
.chip.photo { background: var(--c-rust); color: var(--c-paper); }
.chip.art { background: #8a5aa8; color: var(--c-paper); }
.chip.sound { background: var(--c-cocoa); color: var(--c-paper); }
.chip.animation { background: #e86aa6; color: #2a1a10; }
.chip.video { background: #4a6fb0; color: var(--c-paper); }
.chip.game { background: #101010; color: #e8cc5c; }
.chip.drinks { background: #5a1a2a; color: #f6dcc4; }
.chip.melon { background: var(--paper); color: var(--ink); font-variant-numeric: tabular-nums; }
.melon-ring { display: block; flex: none; }
.chip.example { background: var(--soft); color: var(--ink); border-style: dashed; }
.chip.member { background: var(--c-brown); color: var(--c-cream); }
.avatar { --av: var(--c-teal); width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); background: var(--av); color: #fff; display: inline-grid; place-items: center;
  font-family: var(--serif); font-weight: 800; font-size: 1rem; flex: none; text-transform: uppercase; }
.avatar.has-pic { overflow: hidden; background: var(--paper); } .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.sm { width: 28px; height: 28px; font-size: .8rem; }
.avatar.xl { width: 116px; height: 116px; font-size: 2.8rem; border-width: 3px; box-shadow: var(--shadow); }
.avatar.lg { width: 72px; height: 72px; font-size: 1.8rem; border-width: 3px; box-shadow: var(--shadow-sm); }
.av-orange { --av: var(--c-orange); } .av-mustard { --av: var(--c-mustard); color: var(--c-brown); } .av-avocado { --av: var(--c-avocado); }
.av-teal { --av: var(--c-teal); } .av-rust { --av: var(--c-rust); } .av-cocoa { --av: var(--c-cocoa); } .av-sand { --av: var(--c-sand); color: var(--c-brown); }

/* ---- forms ---- */
label { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: .7rem 0; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; margin: 0; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .9rem; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], input[type=time], input[type=month], input[type=tel], input[type=url], input:not([type]), select, textarea {
  width: 100%; margin-top: .3rem; padding: .6rem .75rem; font: inherit; color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 10px;
  font-weight: 400; text-transform: none; letter-spacing: 0; }
textarea { font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; resize: vertical; font-variation-settings: "SOFT" 50, "opsz" 12; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--c-mustard); }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--c-orange); }
.field-error { color: var(--danger); font-weight: 600; font-size: .88rem; min-height: 1.2em; margin: .3rem 0 0; }

/* ---- segmented control ---- */
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; background: var(--paper); box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.seg button { border: 0; box-shadow: none; background: none; padding: .3rem .85rem; font-size: .85rem; }
.seg button.on { background: var(--c-orange); color: var(--c-paper); }

/* ---- modal and toast ---- */
.modal { position: fixed; inset: 0; background: rgba(59, 36, 21, .55); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 1rem; }
.modal-box { background: var(--paper); border: 3px solid var(--line); border-radius: var(--radius); padding: 1.35rem 1.5rem; width: min(560px, 100%); max-height: calc(100vh - 2rem); overflow: auto;
  box-shadow: 6px 6px 0 var(--c-orange); }
.modal-box.wide { width: min(820px, 100%); }
.toast { position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%); background: var(--c-brown); color: var(--c-cream); border: 2px solid var(--c-mustard);
  padding: .6rem 1.2rem; border-radius: 999px; box-shadow: 2px 2px 0 var(--c-mustard); z-index: 80; font-size: .92rem; font-weight: 600; max-width: calc(100vw - 2rem); }
.toast a { color: var(--c-mustard); }
.toast.error { background: var(--c-rust); color: #fff; border-color: var(--c-brown); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--c-orange); border-top-color: transparent; border-radius: 50%; animation: yb-spin .8s linear infinite; vertical-align: middle; }
@keyframes yb-spin { to { transform: rotate(360deg); } }

/* ---- app top bar (shared by site and apps) ---- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--paper); }
.topbar-inner { display: flex; align-items: center; gap: 1rem; padding: .55rem 1.25rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.5rem; font-weight: 800; line-height: 1; display: flex; flex-direction: column; font-variation-settings: "SOFT" 100; white-space: nowrap; }
.brand-name small { font-family: var(--sans); font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-top: .2rem; }

/* ---- Yubaree account chip (used inside apps) ---- */
.yb-account { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; font-weight: 600; color: var(--muted); }
.yb-account a { font-weight: 700; }
.yb-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--c-avocado); border: 1.5px solid var(--line); }
.yb-dot.off { background: var(--c-mustard); }
.yb-banner { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .55rem 1rem; background: var(--c-mustard); color: var(--c-brown); border-bottom: 3px solid var(--line);
  font-weight: 600; font-size: .9rem; }
.yb-banner a { color: var(--c-brown); font-weight: 800; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* knobs (YubareeApp.knob): drag up or down, scroll, or double-click to reset */
.knob { display: inline-block; cursor: ns-resize; touch-action: none; border-radius: 50%; }
.knob:focus-visible { outline: 3px solid var(--c-mustard); }
.knob svg { width: 100%; height: 100%; display: block; }
.k-track { fill: none; stroke: var(--line-soft); stroke-width: 3.5; stroke-linecap: round; }
.k-val { fill: none; stroke: var(--tc, var(--c-orange)); stroke-width: 3.5; stroke-linecap: round; }
.k-body { fill: var(--paper); stroke: var(--line); stroke-width: 2.5; }
.k-ind { stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
.knob.turning .k-body { fill: var(--c-mustard); }


/* app page basics shared by the apps built on yubaree-app.js */
.crumbs { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .92rem; flex-wrap: wrap; }
.crumbs a { color: var(--ink); text-decoration: none; padding: .2rem .55rem; border-radius: 999px; border: 2px solid transparent; }
.crumbs a:hover { border-color: var(--line); background: var(--paper); }
.crumbs .sep { color: var(--muted); }
.crumbs .here { padding: .2rem .55rem; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-state { font-size: .8rem; color: var(--muted); font-weight: 600; min-width: 4.5rem; text-align: right; }
.section-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 1.8rem 0 1rem; }
.section-head h2 { margin: 0; }
.app-hero { padding: 1.8rem 0 .4rem; }
.app-hero .stripes { margin-bottom: 1.1rem; }
.empty-card { text-align: center; }
.wrap { flex-wrap: wrap; }
.sec-label { font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: .35rem; }
kbd { font-family: var(--mono); font-size: .78em; border: 1.5px solid var(--line); border-radius: 5px; padding: 0 .3em; background: var(--paper); }
.hb { min-width: 24px; height: 22px; padding: 0 .3rem; font-size: .72rem; font-weight: 800; border-radius: 6px; border-width: 2px; box-shadow: none; line-height: 1; }
.hb.on { background: var(--c-mustard); color: var(--c-brown); }
.container.wide-container { max-width: 1320px; }

/* recording a line (YbVideo.recordLine) */
.yv-prompter { font: 600 1.35rem/1.45 var(--serif); background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem; margin: .8rem 0; max-height: 40vh; overflow: auto; }
.yv-meter { height: 12px; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg); }
.yv-meter span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .05s linear; }
.yv-meter span.hot { background: var(--danger); }
.yv-rec-time { font-size: .85rem; color: var(--muted); margin: .5rem 0 .8rem; }
/* picking a sound from the library (YbSound.pick) */
.ys-list { display: grid; gap: .5rem; max-height: 340px; overflow: auto; padding: 2px 4px 4px 2px; }
.ys-item { display: flex; align-items: center; gap: .6rem; border: 2px solid var(--line); border-radius: 10px; padding: .45rem .6rem; background: var(--bg); }
.ys-item svg { width: 28px; height: 28px; flex: none; }
.ys-item button { box-shadow: none; }
.ys-item button.on { background: var(--c-orange); color: var(--c-paper); }

/* ---------- the guest notice can be put away for the visit ---------- */
.yb-banner .yb-short { display: none; }
.yb-banner-x { margin-left: auto; background: transparent; border: 0; box-shadow: none; color: var(--c-brown); font-size: 1.25rem; line-height: 1; padding: .15rem .5rem; border-radius: 999px; cursor: pointer; }
.yb-banner-x:hover { background: rgba(59, 36, 21, .14); }

/* ---------- phones: an app's header and guest notice stay out of the way of the work ---------- */
@media (max-width: 700px) {
  .yb-app .topbar-inner { gap: .3rem .5rem; padding: .4rem .75rem; }
  .yb-app .topbar-inner .brand { flex: 1 1 auto; min-width: 0; gap: .45rem; }
  .yb-app .topbar-inner .brand svg { width: 30px; height: 30px; }
  .yb-app .topbar-inner .brand-name { font-size: 1.2rem; }
  .yb-app .topbar-inner .brand-name small { display: none; }
  .yb-app .topbar-inner .spacer { display: none; }
  .yb-app .topbar-inner .crumbs { order: 5; flex-basis: 100%; font-size: .85rem; }
  .yb-app .topbar-inner .crumbs:empty { display: none; }
  .yb-banner { padding: .35rem .5rem .35rem .8rem; font-size: .82rem; gap: .15rem .7rem; }
  .yb-banner .yb-long { display: none; } .yb-banner .yb-short { display: inline; }
}

/* pop-ups fit the part of a phone screen that is actually visible (the address bar comes and goes) */
.modal-box { max-height: calc(100dvh - 2rem); }
