/* ==========================================================================
   Amelio Services: member drawers (draft 7)
   A wall of neutral wooden drawers, each with a brass label holder.
   Inside, the member's own dashboard: paper panels on a background
   in the member's chosen style. Words always sit on paper.
   ========================================================================== */

/* ---------- page shell ---------- */
.theme-drawers body { background-color: #ece6dc; background-image: var(--grain), var(--linen); }
.app-header .wrap { display: flex; align-items: center; gap: var(--space-4); min-height: 64px; }
.app-header .brand img { height: 46px; width: auto; }
.app-header-slot { flex: 1; display: flex; align-items: center; justify-content: flex-end; min-width: 0; }
.app-title { display: inline-flex; align-items: center; gap: .45em; font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); margin-right: auto; }
.m-app { min-height: 60vh; padding-block: var(--space-5) var(--space-8); }
.m-app > section, .m-app > div, .m-inside { width: min(100% - 2 * var(--gutter, 16px), 72rem); margin-inline: auto; }
.m-inside { position: relative; } /* a soft re-render draws the new view into a hidden twin placed over this box (views/drawer.mjs) */
.m-loading { display: grid; place-items: center; gap: var(--space-3); padding: var(--space-8) 0; text-align: center; }
.m-loading-key { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: #fffdf7; box-shadow: var(--shadow); color: #8a6440; }
.m-loading-key .icon { width: 30px; height: 30px; animation: m-wiggle 1.2s ease-in-out infinite; }
.m-notice { background: #fffdf7; color: #23180f; border-radius: 14px; padding: var(--space-5) var(--space-6); box-shadow: var(--shadow); max-width: 44rem; margin: var(--space-5) auto; border-left: 6px solid #2f6f7d; }
.m-notice h1, .m-notice h2 { font-size: var(--step-2); margin-bottom: var(--space-2); }
.m-error { border-left-color: #a3171b; }
.m-error-text { color: #a3171b; font-weight: 700; background: #fce2e2; border-radius: 8px; padding: .5em .8em; }
.m-back { margin-bottom: var(--space-4); }
.m-back a { display: inline-flex; align-items: center; gap: .4em; font-weight: 700; color: var(--ink); background: #fffdf7; padding: .4em .9em; border-radius: 999px; box-shadow: var(--shadow); text-decoration: none; --ink: #23180f; }
.m-back a:hover { text-decoration: underline; }
.m-preview-note { display: flex; gap: var(--space-3); align-items: flex-start; background: #e7f0f6; color: #13324a; border: 2px dashed #2f6f9d; border-radius: 12px; padding: var(--space-3) var(--space-4); margin: 0 auto var(--space-5); max-width: 52rem; }
.m-preview-note .icon { flex: none; margin-top: .2em; color: #2f6f9d; }
.m-preview-note code { background: #fff; padding: .05em .35em; border-radius: 4px; font-weight: 800; color: #13324a; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn.danger { color: #a3171b; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--link); text-decoration: underline; cursor: pointer; }
.m-tag { display: inline-block; font-size: .8em; font-weight: 800; padding: .1em .55em; border-radius: 999px; background: var(--c-tint, #efe4d0); color: var(--c-ink, #5a4836); text-transform: capitalize; }
.spin { animation: m-spin 1s linear infinite; }
.turn { animation: m-turn .9s ease-in-out infinite; }
@keyframes m-spin { to { transform: rotate(360deg); } }
@keyframes m-turn { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(80deg); } }
@keyframes m-wiggle { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }

/* ---------- the wall ---------- */
.m-wall-head { text-align: center; max-width: 46rem; margin: 0 auto var(--space-5); }
.m-wall-head h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); margin-bottom: var(--space-2); }
.m-wall-head .lead { margin-inline: auto; }
.drawer-grid { list-style: none; padding: var(--space-5); margin: 0 auto; display: grid; gap: clamp(.75rem, .4rem + 1.4vw, 1.5rem); grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 62rem;
  background: linear-gradient(#6f4f33, #5c402a); border-radius: 18px; box-shadow: inset 0 0 0 6px #7d5a3c, inset 0 10px 22px rgba(0, 0, 0, .35), 0 24px 40px -24px rgba(40, 25, 10, .8); }
.drawer-grid li { margin: 0; max-width: none; }
@media (max-width: 479px) { .drawer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--space-3); } }
/* the wall's search (draft 11, A10) */
.m-wall-search { max-width: 34rem; margin: 0 auto var(--space-4); padding: var(--space-4) var(--space-5); border-radius: 18px; background: #fffdf7; color: #23180f; box-shadow: var(--shadow); display: grid; gap: var(--space-2); }
.m-wall-search label { font-weight: 800; font-size: var(--step-1); display: flex; align-items: center; gap: .4em; }
.m-wall-search-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.m-wall-search-row input { flex: 1 1 14rem; min-width: 0; font: inherit; font-size: var(--step-1); padding: .55em .8em; border-radius: 12px; border: 2px solid #a3865c; background: #fff; color: #23180f; }
.m-wall-search .hint { color: #47372a; margin: 0; }
.m-wall-result { margin: 0; font-weight: 700; }
.m-wall-result:empty { display: none; }
.drawer-grid.is-searchonly { grid-template-columns: minmax(0, 16rem); justify-content: center; }
.m-wall-help { max-width: 46rem; margin: var(--space-5) auto 0; display: grid; gap: var(--space-2); }
.m-wall-help p { display: flex; gap: .5em; align-items: flex-start; background: #fffdf7; color: #3b2c1f; padding: .6em .9em; border-radius: 10px; box-shadow: var(--shadow); margin: 0; max-width: none; }
.m-wall-help .icon { flex: none; margin-top: .25em; color: #2f6f7d; }

/* One drawer front: neutral oak, brass label holder, brass pull */
.drawer-front { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; text-decoration: none; color: #23180f; transform-origin: 50% 100%;
  background-color: #c79a68;
  background-image: repeating-linear-gradient(92deg, rgba(120, 80, 40, .10) 0 2px, transparent 2px 9px, rgba(255, 255, 255, .06) 9px 10px, transparent 10px 17px), linear-gradient(180deg, #d6ab7a, #b98955);
  box-shadow: inset 0 0 0 3px rgba(255, 240, 210, .25), inset 0 -8px 14px rgba(80, 50, 20, .28), 0 4px 0 #8a6440, 0 10px 18px -8px rgba(30, 18, 6, .7);
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.2), box-shadow .25s ease; }
.df-face { position: absolute; inset: 9%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10%; border-radius: 8px; box-shadow: inset 0 0 0 2px rgba(110, 72, 38, .35), inset 0 2px 0 rgba(255, 255, 255, .15); }
.df-label { width: 86%; padding: 5px; border-radius: 6px; background: linear-gradient(145deg, #e9cf7c, #b48a2c 55%, #d9bb62); box-shadow: 0 2px 3px rgba(60, 40, 10, .45), inset 0 1px 0 rgba(255, 255, 255, .6); }
.df-card { display: flex; flex-direction: column; align-items: center; gap: .35em; padding: .55em .4em .5em; border-radius: 3px; background-color: #fffaf0; text-align: center; min-height: 3.2em; justify-content: center; position: relative; overflow: hidden; }
.df-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--dc); }
.df-icon { width: 2.4em; height: 2.4em; display: grid; place-items: center; border-radius: 50%; background: var(--dc); color: var(--dc-on); box-shadow: 0 2px 0 rgba(0, 0, 0, .15); position: relative; }
.df-icon .icon { width: 58%; height: 58%; }
.df-code { font-family: var(--font-display); font-weight: 700; font-size: clamp(.8rem, .6rem + .6vw, 1.05rem); line-height: 1.15; color: #23180f; overflow-wrap: anywhere; position: relative; }
.df-pull { width: 44%; height: 11%; min-height: 10px; border-radius: 999px; background: linear-gradient(180deg, #e9cf7c, #a07b2c); box-shadow: 0 3px 4px rgba(50, 30, 10, .5), inset 0 1px 0 rgba(255, 255, 255, .6); }
/* label patterns, tinted with the drawer color */
.df-pattern-dots { background-image: radial-gradient(color-mix(in srgb, var(--dc) 22%, transparent) 1.5px, transparent 1.8px); background-size: 9px 9px; }
.df-pattern-stripes { background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--dc) 13%, transparent) 0 5px, transparent 5px 11px); }
.df-pattern-stars { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Cpath d='M6 2l1 2.6 2.6 1-2.6 1L6 9.2 5 6.6 2.4 5.6 5 4.6z' fill='%23c9a24a' fill-opacity='.45'/%3E%3Cpath d='M16 12l.7 1.8 1.8.7-1.8.7-.7 1.8-.7-1.8-1.8-.7 1.8-.7z' fill='%23c9a24a' fill-opacity='.35'/%3E%3C/svg%3E"); }
.df-pattern-grid { background-image: linear-gradient(color-mix(in srgb, var(--dc) 15%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--dc) 15%, transparent) 1px, transparent 1px); background-size: 10px 10px; }
.df-pattern-waves { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='10'%3E%3Cpath d='M0 5 Q6 0 12 5 T24 5' fill='none' stroke='%237a9ab0' stroke-opacity='.35' stroke-width='1.5'/%3E%3C/svg%3E"); }
a.drawer-front:hover, a.drawer-front:focus-visible { transform: translateY(-3px) scale(1.03); box-shadow: inset 0 0 0 3px rgba(255, 240, 210, .25), inset 0 -8px 14px rgba(80, 50, 20, .28), 0 4px 0 #8a6440, 0 18px 28px -10px rgba(30, 18, 6, .8), 0 0 0 4px rgba(255, 220, 140, .55); }
a.drawer-front:focus-visible { outline: 3px solid #ffd25c; outline-offset: 4px; }
.drawer-new { background: rgba(255, 250, 240, .12); background-image: none; box-shadow: inset 0 0 0 3px rgba(255, 240, 210, .55); border: 3px dashed rgba(255, 240, 210, .75); }
.drawer-new .df-face { box-shadow: none; gap: .4em; color: #fff8ea; }
.df-new-icon { width: 3em; height: 3em; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 248, 234, .2); }
.df-new-icon .icon { width: 1.6em; height: 1.6em; }
.df-new-text { font-weight: 800; text-align: center; font-size: clamp(.85rem, .7rem + .5vw, 1.1rem); }
.drawer-front.big { width: min(100%, 300px); margin: 0 auto; font-size: 1.15rem; }
/* phones: a small front above the password form, so the form is on the first screen (draft 10, screenshots 08 and 09) */
@media (max-width: 859px) { .drawer-front.big { width: min(44%, 150px); font-size: .8rem; } .m-unlock-stage { padding: var(--space-3) var(--space-4); } .m-unlock-grid { gap: var(--space-3); } .m-unlock-form .lead { font-size: var(--step-0); } }

/* ---------- wizard ---------- */
.m-wizard { max-width: 60rem; }
.m-steps { list-style: none; padding: 0; margin: 0 0 var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; }
.m-steps li { margin: 0; display: inline-flex; align-items: center; gap: .45em; padding: .35em .8em .35em .4em; border-radius: 999px; background: #fffdf7; color: #47372a; font-weight: 700; font-size: var(--step--1); box-shadow: var(--shadow); }
.m-step-n { width: 1.7em; height: 1.7em; display: grid; place-items: center; border-radius: 50%; background: #efe4d0; color: #23180f; font-weight: 800; }
.m-step-n .icon { width: 1em; height: 1em; }
.m-steps li.now { background: #23180f; color: #fffdf7; }
.m-steps li.now .m-step-n { background: #ffd25c; }
.m-steps li.done .m-step-n { background: #3e690e; color: #fff; }
@media (max-width: 640px) { .m-steps .m-step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .m-steps li.now .m-step-label { position: static; width: auto; height: auto; clip: auto; } }
.m-wizard-card { position: relative; background: #fffdf7; color: #23180f; border-radius: 18px; padding: clamp(1.25rem, .9rem + 2vw, 2.5rem); box-shadow: var(--shadow-lift); background-image: var(--fiber); }
.m-form { display: flex; flex-direction: column; gap: var(--space-4); }
.m-form h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
.pw-wrap { display: flex; gap: var(--space-2); align-items: stretch; flex-wrap: wrap; }
.pw-wrap input { flex: 1 1 14rem; min-width: 0; }
.pw-meter { height: 10px; border-radius: 999px; background: #efe4d0; overflow: hidden; max-width: 24rem; }
.pw-meter span { display: block; height: 100%; width: 0; background: #a3171b; transition: width .3s ease; }
.pw-meter span[data-s="1"] { background: #b06a3f; } .pw-meter span[data-s="2"] { background: #765600; } .pw-meter span[data-s="3"], .pw-meter span[data-s="4"] { background: #3e690e; }
.m-design-grid { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .m-design-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; } .m-design-preview { position: sticky; top: var(--space-5); } }
.m-design-preview { background: linear-gradient(#6f4f33, #5c402a); border-radius: 16px; padding: var(--space-5); box-shadow: inset 0 10px 22px rgba(0, 0, 0, .35); text-align: center; }
.m-sparkle-note { color: #fff3d0; font-family: var(--font-display); font-style: italic; margin: var(--space-3) auto 0; display: inline-flex; gap: .4em; align-items: center; }
.m-design-controls { display: flex; flex-direction: column; gap: var(--space-4); }
.m-pick { border: 0; padding: 0; margin: 0; min-width: 0; }
.m-pick legend { font-weight: 800; margin-bottom: var(--space-2); }
.m-pick-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.m-pick input:is([type="radio"], [type="checkbox"]) { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-chip-pick span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: #fffaf0; border: 2px solid #dcc8a6; color: #47372a; cursor: pointer; transition: transform .15s ease; }
.m-chip-pick span .icon { width: 24px; height: 24px; }
.m-chip-pick input:checked + span { background: #23180f; color: #ffd25c; border-color: #23180f; transform: scale(1.06); }
.m-chip-pick input:focus-visible + span, .m-swatch-pick input:focus-visible + span, .m-pattern-pick input:focus-visible + span, .m-mood-pick input:focus-visible + span { outline: 3px solid #29298e; outline-offset: 3px; }
.m-swatch-pick span { display: block; width: 40px; height: 40px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .5), 0 1px 2px rgba(0, 0, 0, .3); cursor: pointer; }
.m-swatch-pick input:checked + span { box-shadow: 0 0 0 3px #fffdf7, 0 0 0 6px #23180f; }
.m-pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.m-pattern-pick span { display: inline-flex; align-items: center; min-height: 44px; padding: .3em .9em; border-radius: 10px; border: 2px solid #dcc8a6; background-color: #fffaf0; font-weight: 700; color: #23180f; cursor: pointer; }
.m-pattern-pick input:checked + span { border-color: #23180f; box-shadow: inset 0 0 0 2px #23180f; }
.m-mood-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.m-mood-pick span.m-mood-swatch { display: flex; align-items: center; gap: .5em; padding: .7em .8em; border-radius: 12px; background: var(--mb); border: 3px solid transparent; cursor: pointer; box-shadow: var(--shadow); min-height: 56px; }
.m-mood-swatch .mm-dot { width: 2.2em; height: 2.2em; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--ma); color: #fff; box-shadow: 4px 4px 0 var(--ma2); }
.m-mood-swatch .mm-name { font-weight: 800; color: #23180f; background: rgba(255, 253, 247, .9); padding: .1em .4em; border-radius: 6px; }
.m-mood-pick input:checked + span { border-color: #23180f; transform: translateY(-2px); }
.m-building { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: var(--space-3); background: rgba(255, 253, 247, .96); border-radius: 18px; text-align: center; z-index: 5; padding: var(--space-5); }
.m-building-art { display: flex; gap: .4em; color: #8a6440; }
.m-building-art .icon { width: 44px; height: 44px; animation: m-wiggle 1s ease-in-out infinite; }
.m-building-art .icon + .icon { color: #c9a24a; animation-delay: .3s; }

/* ---------- unlock ---------- */
.m-unlock-grid { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 860px) { .m-unlock-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); } }
.m-unlock-stage { position: relative; padding: var(--space-6) var(--space-4); border-radius: 18px; background: linear-gradient(#6f4f33, #5c402a); box-shadow: inset 0 10px 22px rgba(0, 0, 0, .35); overflow: hidden; }
.m-cabinet { position: relative; }
.m-drawer-glow { position: absolute; inset: 15% 10%; border-radius: 50%; background: radial-gradient(rgba(255, 228, 150, .9), rgba(255, 228, 150, 0) 70%); opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.m-sparkles { position: absolute; inset: 0; pointer-events: none; }
.m-sparkles .icon { position: absolute; color: #ffe08a; width: 26px; height: 26px; opacity: 0; }
.m-sparkles .icon:nth-child(1) { left: 12%; top: 18%; } .m-sparkles .icon:nth-child(2) { right: 12%; top: 26%; } .m-sparkles .icon:nth-child(3) { left: 20%; bottom: 16%; } .m-sparkles .icon:nth-child(4) { right: 18%; bottom: 20%; }
.is-trying .drawer-front { animation: m-try 1s ease-in-out infinite; }
@keyframes m-try { 0%, 100% { transform: translateX(0); } 50% { transform: translateY(2px); } }
.is-open .drawer-front { transform: translateY(14px) scale(1.12); transition: transform .9s cubic-bezier(.2, .9, .3, 1.15); box-shadow: 0 30px 40px -12px rgba(0, 0, 0, .6); }
.is-open .m-drawer-glow { opacity: 1; }
.is-open .m-sparkles .icon { animation: m-twinkle 1.2s ease-out forwards; }
.is-open .m-sparkles .icon:nth-child(2) { animation-delay: .15s; } .is-open .m-sparkles .icon:nth-child(3) { animation-delay: .3s; } .is-open .m-sparkles .icon:nth-child(4) { animation-delay: .45s; }
@keyframes m-twinkle { 0% { opacity: 0; transform: scale(.4) rotate(0); } 40% { opacity: 1; transform: scale(1.2) rotate(20deg); } 100% { opacity: 0; transform: scale(.8) translateY(-24px) rotate(45deg); } }
.is-wrong .drawer-front { animation: m-shake .5s ease; }
@keyframes m-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.m-unlock-form { background: #fffdf7; color: #23180f; border-radius: 18px; padding: clamp(1.25rem, .9rem + 2vw, 2.5rem); box-shadow: var(--shadow-lift); }
.m-help-fold { background: #faf4e8; border-radius: 10px; padding: .5em .9em; }
.m-help-fold summary { font-weight: 700; cursor: pointer; }

/* ---------- inside a drawer ---------- */
.m-drawer-head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; justify-content: flex-end; width: 100%; }
.m-drawer-chip { display: inline-flex; align-items: center; gap: .5em; font-weight: 800; padding: .3em .9em .3em .35em; border-radius: 999px; background: #fffdf7; color: #23180f; box-shadow: var(--shadow); margin-right: auto; }
.m-drawer-chip .chip-ico { width: 2em; height: 2em; display: grid; place-items: center; border-radius: 50%; background: var(--dc); color: var(--dc-on); }
.m-save { display: inline-flex; align-items: center; gap: .35em; font-size: var(--step--1); font-weight: 700; color: var(--ink-2); }
.m-save[data-state="error"] { color: #a3171b; background: #fce2e2; padding: .2em .6em; border-radius: 999px; }
.m-save[data-state="saving"] .icon { animation: m-spin 1.2s linear infinite; }
@media (max-width: 560px) { .m-save { order: 3; width: 100%; justify-content: flex-end; } }
.m-tabs { background: #fffdf7; border-radius: 16px; box-shadow: var(--shadow); padding: 6px; margin-bottom: var(--space-5); overflow-x: auto; }
.m-tabs ul { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0; }
.m-tabs li { margin: 0; flex: 1 0 auto; }
.m-tabs a { display: flex; flex-direction: column; align-items: center; gap: .2em; min-height: 56px; justify-content: center; padding: .45em .8em; border-radius: 12px; text-decoration: none; color: #3b2c1f; font-weight: 800; font-size: var(--step--1); white-space: nowrap; border-bottom: 4px solid transparent; }
.m-tabs a .icon { width: 1.4em; height: 1.4em; color: var(--c-ink-paper, #47372a); }
.m-tabs a:hover { background: #faf4e8; }
.m-tabs a[aria-current="page"] { background: var(--c-tint-paper, #f5ead7); border-bottom-color: var(--c, #a3865c); color: #23180f; }
.m-tab-more { flex: 0 0 auto; }
.m-remote-note { background: #e7f0f6; color: #13324a; border-radius: 10px; padding: .5em .9em; margin-bottom: var(--space-4); }
.m-view { min-width: 0; }

/* ---------- style of each drawer (set in the Style studio) ---------- */
:root[data-drawer-mood] body { background-color: var(--m-bg) !important; }
:root[data-drawer-mood] body::before { display: none; } /* inside a drawer, the member's own style replaces the page backdrop */
:root[data-drawer-pattern="dots"] body { background-image: radial-gradient(color-mix(in srgb, var(--m-accent) 22%, transparent) 1.6px, transparent 2px) !important; background-size: 22px 22px !important; }
:root[data-drawer-pattern="grid"] body { background-image: linear-gradient(color-mix(in srgb, var(--m-accent) 14%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--m-accent) 14%, transparent) 1px, transparent 1px) !important; background-size: 26px 26px !important; }
:root[data-drawer-pattern="stars"] body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='%23f3c34a'%3E%3Cpath d='M15 10l1.6 4 4 1.6-4 1.6-1.6 4-1.6-4-4-1.6 4-1.6z' fill-opacity='.55'/%3E%3Cpath d='M62 44l1 2.6 2.6 1-2.6 1-1 2.6-1-2.6-2.6-1 2.6-1z' fill-opacity='.45'/%3E%3Ccircle cx='40' cy='75' r='1.4' fill-opacity='.6'/%3E%3Ccircle cx='80' cy='14' r='1.1' fill-opacity='.5'/%3E%3C/g%3E%3C/svg%3E") !important; background-size: 90px 90px !important; }
:root[data-drawer-pattern="waves"] body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='24'%3E%3Cpath d='M0 12 Q15 2 30 12 T60 12' fill='none' stroke='%232f6f9d' stroke-opacity='.16' stroke-width='2'/%3E%3C/svg%3E") !important; }
:root[data-drawer-pattern="leaves"] body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M20 20c8-10 22-8 24 0-8 8-20 8-24 0z' fill='%234f7f3a' fill-opacity='.16'/%3E%3Cpath d='M56 58c6-8 16-6 18 0-6 6-15 6-18 0z' fill='%234f7f3a' fill-opacity='.12'/%3E%3C/svg%3E") !important; }
:root[data-drawer-pattern="confetti"] body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Crect x='10' y='12' width='8' height='3' rx='1.5' transform='rotate(25 14 13)' fill='%23e0644f' fill-opacity='.35'/%3E%3Ccircle cx='60' cy='20' r='3' fill='%232f6f9d' fill-opacity='.3'/%3E%3Crect x='70' y='70' width='8' height='3' rx='1.5' transform='rotate(-30 74 71)' fill='%23c97a1c' fill-opacity='.4'/%3E%3Ccircle cx='25' cy='75' r='2.5' fill='%23b23a6f' fill-opacity='.3'/%3E%3Crect x='40' y='45' width='7' height='3' rx='1.5' transform='rotate(70 43 46)' fill='%234f7f3a' fill-opacity='.35'/%3E%3C/svg%3E") !important; }
:root[data-drawer-pattern="plaid"] body { background-image: repeating-linear-gradient(0deg, color-mix(in srgb, var(--m-accent) 10%, transparent) 0 14px, transparent 14px 28px), repeating-linear-gradient(90deg, color-mix(in srgb, var(--m-accent2) 10%, transparent) 0 14px, transparent 14px 28px) !important; }
:root[data-drawer-pattern="plain"] body { background-image: var(--grain) !important; }
/* In dark color mode, the background goes dark but panels stay paper */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"])[data-drawer-mood] body { background-color: color-mix(in srgb, var(--m-accent) 16%, #1b1612) !important; } }
:root[data-theme="dark"][data-drawer-mood] body, :root[data-drawer-dark="yes"] body { background-color: color-mix(in srgb, var(--m-accent) 14%, #161b30) !important; }
:root[data-drawer-dark="yes"] .m-tabs, :root[data-drawer-dark="yes"] .m-home-bar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .25), var(--shadow); }

/* ---------- dashboard ---------- */
.m-home-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); justify-content: space-between; background: #fffdf7; color: #23180f; border-radius: 14px; padding: var(--space-3) var(--space-4); box-shadow: var(--shadow); margin-bottom: var(--space-5); }
.m-arrange-help { margin: 0; display: flex; gap: .4em; align-items: center; font-size: var(--step--1); color: #47372a; max-width: none; }
.m-tour { display: flex; gap: var(--space-4); align-items: flex-start; background: #fff3b0; color: #23180f; border-radius: 6px; padding: var(--space-5); margin-bottom: var(--space-5); box-shadow: var(--shadow); transform: rotate(-.4deg); }
.m-tour h2 { font-size: var(--step-2); }
.m-tour ol { margin: var(--space-2) 0 var(--space-3); padding-left: 1.3em; }
.m-tour-art { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--m-accent); color: var(--m-on-accent); }
.m-tour-art .icon { width: 28px; height: 28px; }
.m-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; align-items: start; }
@media (max-width: 1000px) { .m-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .m-grid { grid-template-columns: minmax(0, 1fr); } }
.m-panel { --pa: var(--m-accent, #2f6f7d); position: relative; background-color: #fffdf7; background-image: var(--fiber); color: #23180f; border-radius: 18px; box-shadow: var(--shadow); padding: var(--space-4) var(--space-5) var(--space-5); min-width: 0; border-top: 6px solid var(--pa); }
:root[data-drawer-mood="rainbow"] .m-panel { --pa: var(--p-accent); }
.m-panel.size-M { grid-column: span 2; }
.m-panel.size-L { grid-column: 1 / -1; }
@media (max-width: 1000px) { .m-panel.size-M, .m-panel.size-L { grid-column: 1 / -1; } }
.m-panel-head { display: flex; align-items: center; gap: .6em; margin-bottom: var(--space-3); }
.m-panel-head h2 { font-size: var(--step-1); margin: 0; flex: 1; min-width: 0; }
.m-panel-ico { width: 2.3em; height: 2.3em; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--pa); background: color-mix(in srgb, var(--pa) 14%, #fffdf7); }
:root[data-drawer-stickers="on"] .m-panel-ico { background: var(--pa); color: #fff; box-shadow: 0 0 0 3px #fffdf7, 0 3px 6px rgba(0, 0, 0, .25); transform: rotate(-8deg); }
:root[data-drawer-stickers="on"] .m-panel:nth-child(even) .m-panel-ico { transform: rotate(7deg); }
.m-panel-more { font-weight: 800; font-size: var(--step--1); display: inline-flex; align-items: center; gap: .25em; color: #1b5ca2; white-space: nowrap; }
.m-panel-body > * + * { margin-top: var(--space-3); }
.m-panel-body p { max-width: none; }
.m-panel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: var(--space-4); padding-top: var(--space-3); border-top: 2px dashed #dcc8a6; }
.m-grip { color: #8d755a; cursor: grab; display: inline-flex; }
.m-size-pick { display: inline-flex; border: 2px solid #a3865c; border-radius: 10px; overflow: hidden; }
.m-size-pick button { min-width: 40px; min-height: 36px; border: 0; background: #fffdf7; font-weight: 800; color: #23180f; cursor: pointer; }
.m-size-pick button + button { border-left: 2px solid #a3865c; }
.m-size-pick button[aria-pressed="true"] { background: #23180f; color: #fffdf7; }
.m-grid.is-arranging .m-panel { outline: 2px dashed #a3865c; outline-offset: 3px; }
.m-panel.is-dragging { opacity: .5; }
.m-panel.is-target { outline: 3px solid #29298e !important; }
/* panel shapes */
:root[data-drawer-shape="craft"] .m-panel { border-radius: var(--sketch); }
:root[data-drawer-shape="craft"] .m-panel::before { content: ""; position: absolute; top: -14px; left: 50%; width: 80px; height: 22px; transform: translateX(-50%) rotate(-3deg); background: var(--tape); box-shadow: 0 1px 2px rgba(70, 45, 20, .18); }
:root[data-drawer-shape="craft"] .m-panel:nth-child(3n+1) { transform: rotate(-.5deg); }
:root[data-drawer-shape="craft"] .m-panel:nth-child(3n+2) { transform: rotate(.4deg); }
:root[data-drawer-shape="crisp"] .m-panel { border-radius: 6px; background-image: none; }
/* heading fonts */
:root[data-drawer-font="friendly"] .m-view h1, :root[data-drawer-font="friendly"] .m-view h2, :root[data-drawer-font="friendly"] .m-view h3 { font-family: var(--font-body); font-weight: 800; letter-spacing: 0; }
:root[data-drawer-font="handwritten"] .m-panel-head h2, :root[data-drawer-font="handwritten"] .m-view h1 { font-family: var(--font-hand); font-weight: 700; font-size: 1.6em; letter-spacing: 0; }

/* panel contents */
.m-avatar { border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 4px #fffdf7, 0 0 0 7px var(--pa, #a3865c); background: #faf4e8; }
.m-avatar.sm { width: 44px; height: 44px; } .m-avatar.md { width: 72px; height: 72px; } .m-avatar.lg { width: 112px; height: 112px; } .m-avatar.xl { width: 168px; height: 168px; }
.m-avatar-icon { display: grid; place-items: center; background: var(--pa, #2f6f7d); color: #fff; }
.m-avatar-icon .icon { width: 50%; height: 50%; }
.m-welcome { display: flex; gap: var(--space-5); align-items: center; flex-wrap: wrap; }
.m-today-date { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; margin: 0; }
.m-agenda { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.m-agenda-row { margin: 0; display: grid; grid-template-columns: 7.2em minmax(0, 1fr); gap: 2px 10px; align-items: start; padding: .55em .7em; border-radius: 10px; background: #faf4e8; border-left: 5px solid var(--k); max-width: none; }
.ag-time { font-weight: 800; font-size: var(--step--1); color: #47372a; padding-top: .15em; }
.ag-title { display: inline-flex; gap: .4em; align-items: center; font-weight: 700; }
.ag-place { grid-column: 2; }
.m-agenda-row.is-done .ag-check span { text-decoration: line-through; color: #5a4836; }
.m-week-strip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 760px) { .m-week-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.m-week-strip li { margin: 0; background: #faf4e8; border-radius: 10px; padding: .5em; min-height: 6em; display: flex; flex-direction: column; gap: 4px; max-width: none; }
.m-week-strip li.is-today { background: color-mix(in srgb, var(--pa) 16%, #fffdf7); box-shadow: inset 0 0 0 2px var(--pa); }
.wk-day { font-weight: 800; display: flex; justify-content: space-between; font-size: var(--step--1); }
.wk-item { font-size: .8rem; background: #fffdf7; border-radius: 6px; padding: .15em .4em; border-left: 3px solid #a3865c; overflow-wrap: anywhere; }
.wk-item.kind-shift { border-left-color: #4f7f3a; } .wk-item.kind-appointment { border-left-color: #a3171b; } .wk-item.kind-task { border-left-color: #c97a1c; }
.wk-more { font-size: .78rem; color: #5a4836; }
.m-summary-mini p { font-size: var(--step-0); }
.m-badge-line { display: inline-flex; gap: .4em; align-items: center; font-weight: 800; background: #fff0d9; color: #8a4b00; padding: .2em .7em; border-radius: 999px; }
.m-mini-profile { display: flex; gap: var(--space-3); align-items: center; }
.m-name { font-weight: 800; font-size: var(--step-1); margin: 0; }
.m-vital-mini { display: grid; gap: 6px; margin: 0; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.m-vital-mini div { background: #faf4e8; border-radius: 8px; padding: .4em .7em; }
.m-vital-mini dt { font-weight: 800; font-size: var(--step--1); color: #a3171b; }
.m-vital-mini dd { margin: 0; }
.m-goal-mini { background: color-mix(in srgb, var(--gc) 12%, #fffdf7); border-radius: 12px; padding: var(--space-3); border-left: 6px solid var(--gc); }
.gm-cat { display: inline-flex; align-items: center; gap: .3em; font-weight: 800; font-size: var(--step--1); color: color-mix(in srgb, var(--gc) 70%, #000); }
.gm-title { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); margin: .3em 0; }
.gm-cheer { font-style: italic; }
.m-meter { height: 12px; border-radius: 999px; background: #efe4d0; overflow: hidden; }
.m-meter span { display: block; height: 100%; background: var(--pa, #3e690e); border-radius: 999px; }
.m-dose-list, .m-people-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.m-dose-list li, .m-people-mini li { margin: 0; max-width: none; }
.m-big-num { font-family: var(--font-display); font-size: var(--step-3); font-weight: 700; margin: 0; }
.m-big-num span { font-family: var(--font-body); font-size: var(--step--1); font-weight: 700; color: #47372a; }
.m-sos { background: #fce2e2; color: #a3171b; border-radius: 10px; padding: .5em .8em; }
.m-sos a, .m-panel.type-emergency a { color: #8a1013; font-weight: 800; }
.m-shelf { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.m-shelf li { margin: 0; max-width: none; }
.m-shelf a { display: flex; align-items: center; gap: .5em; padding: .55em .7em; border-radius: 10px; background: var(--c-tint-paper, #faf4e8); color: #23180f; font-weight: 700; text-decoration: none; border-left: 5px solid var(--c, #a3865c); min-height: 48px; }
.m-shelf a .icon { color: var(--c-ink-paper, #47372a); flex: none; }
.m-shelf a:hover { text-decoration: underline; }
.m-sticky { width: 100%; background: #fff3b0; border: 0; border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); font-family: var(--font-hand); font-size: 1.35rem; line-height: 1.35; padding: .7em .8em; color: #23180f; resize: vertical; }
.m-breathe { display: grid; place-items: center; gap: var(--space-3); text-align: center; }
.m-breathe-btn { display: grid; place-items: center; width: 150px; height: 150px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; position: relative; font: inherit; }
.m-breathe-circle { position: absolute; inset: 22px; border-radius: 50%; background: radial-gradient(color-mix(in srgb, var(--pa) 45%, #fff), color-mix(in srgb, var(--pa) 20%, #fff)); transition: transform 3.8s ease-in-out; box-shadow: 0 0 0 6px color-mix(in srgb, var(--pa) 18%, transparent); }
.m-breathe-label { position: relative; font-weight: 800; color: #23180f; background: rgba(255, 253, 247, .9); padding: .2em .6em; border-radius: 999px; }
.m-breathe-btn.is-on[data-phase="0"] .m-breathe-circle, .m-breathe-btn.is-on[data-phase="1"] .m-breathe-circle { transform: scale(1.32); }
.m-breathe-btn:focus-visible { outline: 3px solid #29298e; outline-offset: 2px; }
.m-breathe-cue { font-weight: 700; min-height: 1.6em; }

/* little celebration */
.m-burst { position: fixed; width: 0; height: 0; pointer-events: none; z-index: 90; }
.m-burst i { position: absolute; width: 8px; height: 8px; border-radius: 2px; background: var(--c); animation: m-pop .85s ease-out forwards; transform: rotate(var(--a)) translateY(0); }
@keyframes m-pop { to { transform: rotate(var(--a)) translateY(-46px); opacity: 0; } }

/* ---------- dialogs ---------- */
/* Dialogs size to the visible screen (dvh: the part of a phone screen not under the browser bars), the body takes
   whatever height is left and scrolls, and the buttons always sit at the bottom (draft 10, screenshot 11).
   height: fit-content is stated on purpose: a modal dialog has top and bottom pinned to the screen, so without it an
   older browser (and any browser given height: auto) stretches the box to its max-height and leaves a blank area under the buttons. */
.m-dialog { --dlg-max: min(92vh, 52rem); border: 0; padding: 0; border-radius: 18px; width: min(100% - 24px, 34rem); height: fit-content; height: -moz-fit-content; max-height: var(--dlg-max); background: #fffdf7; color: #23180f; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); }
@supports (height: 1dvh) { .m-dialog { --dlg-max: min(100dvh - 28px, 52rem); } }
/* Belt and braces: a dialog that somehow opened without showModal() still sits centred on the screen, never in the page flow */
dialog.m-dialog[open]:not(:modal) { position: fixed; inset: 0; margin: auto; z-index: 1000; }
.m-dialog.wide { width: min(100% - 24px, 56rem); }
.m-dialog::backdrop { background: rgba(30, 20, 10, .55); }
.m-dialog-inner { display: flex; flex-direction: column; max-height: var(--dlg-max); min-height: 0; }
.m-dialog-head { flex: none; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 2px solid #efe4d0; }
.m-dialog-head h2 { flex: 1; font-size: var(--step-2); margin: 0; }
.m-dialog-body { flex: 1 1 auto; min-height: 0; padding: var(--space-4) var(--space-5); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: var(--space-3); }
.m-dialog-actions { flex: none; display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; padding: var(--space-3) var(--space-5) var(--space-4); border-top: 2px solid #efe4d0; }
@media (max-width: 540px) { .m-dialog { width: calc(100% - 16px); border-radius: 16px; } .m-dialog-head { padding: var(--space-3) var(--space-4); } .m-dialog-body { padding: var(--space-3) var(--space-4); } .m-dialog-actions { padding: var(--space-3) var(--space-4); } }
.btn-danger { background: #a3171b; color: #fff; border-color: #a3171b; }
.btn-danger:hover { background: #7f1013; }
.m-add-h { font-size: var(--step-1); margin-top: var(--space-2); }
.m-add-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.m-add-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-add-opt > span { display: grid; grid-template-columns: auto 1fr; gap: 0 .6em; align-items: center; padding: .6em .8em; border-radius: 12px; border: 2px solid #dcc8a6; background: #fffaf0; cursor: pointer; height: 100%; }
.m-add-opt > span > .icon { grid-row: span 2; width: 1.6em; height: 1.6em; color: var(--c-ink-paper, #47372a); }
.m-add-opt small { color: #5a4836; }
.m-add-opt input:checked + span { border-color: #23180f; box-shadow: inset 0 0 0 2px #23180f; background: #fff3b0; }
.m-add-opt input:focus-visible + span { outline: 3px solid #29298e; outline-offset: 2px; }

/* ---------- printing one sheet from a tool ---------- */
.print-sheet { display: none; }
@media print {
  body.printing-sheet > *:not(.print-sheet) { display: none !important; }
  body.printing-sheet .print-sheet { display: block; color: #000; font-size: 12pt; }
}

/* ---------- reduced motion, Simple view and high contrast ---------- */
@media (prefers-reduced-motion: reduce) {
  .drawer-front, .is-open .drawer-front, .m-breathe-circle { transition: none !important; animation: none !important; }
  .is-trying .drawer-front, .is-wrong .drawer-front, .m-loading-key .icon, .m-building-art .icon { animation: none !important; }
}
:root[data-motion="reduce"] .drawer-front, :root[data-motion="reduce"] .m-breathe-circle { transition: none !important; animation: none !important; }
:root[data-look="simple"] .drawer-front { background-image: none; background-color: #d9c4a6; }
:root[data-look="simple"] .m-panel { background-image: none; transform: none !important; }
:root[data-look="simple"] .m-panel::before { display: none; }
:root[data-look="simple"][data-drawer-mood] body { background-image: none !important; }
:root[data-contrast="high"] .m-panel, :root[data-contrast="high"] .m-tabs, :root[data-contrast="high"] .m-home-bar { box-shadow: none; border: 2px solid #000; }

/* ==========================================================================
   Shared pieces for the drawer pages (profile, calendar, log, summary, library, tools)
   ========================================================================== */
.m-app input:not([type]), .m-app input[type="tel"], .m-app input[type="password"], .m-app input[type="url"],
.m-dialog input:not([type]), .m-dialog input[type="tel"], .m-dialog input[type="password"], .m-dialog input[type="url"] {
  font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line-strong); border-radius: 12px; padding: .6em .8em; min-height: 48px; width: 100%;
}
.m-app input:focus-visible, .m-dialog input:focus-visible, .m-app textarea:focus-visible, .m-dialog textarea:focus-visible, .m-app select:focus-visible, .m-dialog select:focus-visible { border-color: var(--focus); outline: 3px solid var(--focus); outline-offset: 1px; }
.hint { font-size: var(--step--1); color: var(--ink-2); margin: 0; max-width: 60ch; }
/* Paper is paper in every world: anything that sits on a cream card, sheet, dialog or shelf piece uses the paper inks,
   so muted words ("3 this month", hints, small print) stay dark enough to read when the Colors setting or a dark world
   turns the page's own ink light (draft 10, screenshot set: the faint hint text everywhere). */
:is(.m-panel, .m-card, .m-sheet, .m-notice, .m-wizard-card, .m-tour, .m-lib-item, .m-dialog, .m-unlock-form, .gd-guide, .m-habit, .toast, .k-update, .w > .ob, .sw-card, .m-agenda-row, .m-wk-day, .m-mo-day) { --ink: #23180f; --ink-2: #47372a; --ink-3: #5a4836; --line: #dcc8a6; --line-strong: #a3865c; }
:is(.m-panel, .m-card, .m-sheet, .m-notice, .m-wizard-card, .m-lib-item, .m-dialog, .m-unlock-form, .gd-guide, .m-habit) :is(.muted, .hint) { color: #47372a; }
.ob .muted, .ob .hint { color: #47372a; }
.m-page { display: flex; flex-direction: column; gap: var(--space-5); }
.m-sheet { background-color: #fffdf7; background-image: var(--fiber); color: #23180f; border-radius: 18px; box-shadow: var(--shadow); padding: clamp(1rem, .7rem + 1.4vw, 1.75rem); }
.m-toolbar { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4); }
.m-jump { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.m-jump li { margin: 0; }
.m-jump a { display: inline-flex; align-items: center; min-height: 40px; padding: .25em .8em; border-radius: 999px; background: #f5ead7; color: #23180f; font-weight: 700; font-size: var(--step--1); text-decoration: none; }
.m-jump a:hover { text-decoration: underline; background: #efe4d0; }
.m-eyebrow { display: inline-flex; align-items: center; gap: .4em; font-weight: 800; font-size: var(--step--1); text-transform: uppercase; letter-spacing: .06em; color: #5a4836; margin: 0; }
.m-privacy-note { display: flex; gap: .5em; align-items: center; justify-content: center; font-size: var(--step--1); font-weight: 700; color: #23180f; background: rgba(255, 253, 247, .92); border-radius: 999px; padding: .4em 1em; margin: 0 auto; width: fit-content; max-width: 100%; box-shadow: var(--shadow); }
.m-field-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.m-two { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.m-sub { display: flex; align-items: center; gap: .4em; font-size: var(--step-0); font-family: var(--font-body); font-weight: 800; margin: 0 0 var(--space-2); }

/* cards: paper with a colored top edge (the color comes from c-* classes) */
.m-card-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.m-card-grid > .m-card.is-wide, .m-card-grid > .m-card.is-editing { grid-column: 1 / -1; }
@media (max-width: 860px) { .m-card-grid { grid-template-columns: minmax(0, 1fr); } }
.m-card { position: relative; background-color: #fffdf7; background-image: var(--fiber); color: #23180f; border-radius: 18px; box-shadow: var(--shadow); padding: var(--space-4) var(--space-5) var(--space-5); border-top: 6px solid var(--c, #a3865c); min-width: 0; scroll-margin-top: var(--space-5); }
.m-card:focus { outline: none; }
.m-card:focus-visible { outline: 3px solid #29298e; outline-offset: 3px; }
.m-card-head { display: flex; align-items: center; gap: .6em; margin-bottom: var(--space-3); flex-wrap: wrap; }
.m-card-head h2 { font-size: var(--step-1); margin: 0; flex: 1; min-width: 10rem; }
.m-card-ico { width: 2.3em; height: 2.3em; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--c-tint-paper, #f5ead7); color: var(--c-ink-paper, #47372a); }
:root[data-drawer-stickers="on"] .m-card-ico { background: var(--c-ink-paper, #47372a); color: #fff; box-shadow: 0 0 0 3px #fffdf7, 0 3px 6px rgba(0, 0, 0, .25); transform: rotate(-6deg); }
.m-card-body > * + * { margin-top: var(--space-3); }
.m-card-body p { max-width: 70ch; }
.m-card-actions { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 2px dashed #e4d4b8; }
.m-card.is-editing { box-shadow: 0 0 0 3px var(--c-ink-paper, #a3865c), var(--shadow); }
.m-edit-btn { flex: none; }
:root[data-drawer-shape="craft"] .m-card { border-radius: var(--sketch); }
:root[data-drawer-shape="crisp"] .m-card, :root[data-drawer-shape="crisp"] .m-sheet { border-radius: 6px; background-image: none; }

/* chips and list editors */
.m-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.m-chips li { margin: 0; display: inline-flex; align-items: center; gap: .2em; max-width: 100%; background: #f5ead7; color: #23180f; border-radius: 999px; padding: .3em .35em .3em .9em; font-weight: 700; border: 2px solid transparent; }
.m-chips li > span { overflow-wrap: anywhere; padding-right: .5em; }
.m-chips.is-like li { background: #e9f5da; border-color: #b8d89a; }
.m-chips.is-dislike li { background: #fce2e2; border-color: #efb3b3; }
.m-chips li.m-chips-empty { background: none; padding-left: 0; font-weight: 400; }
.m-chip-x { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(35, 24, 15, .08); color: #23180f; cursor: pointer; flex: none; }
.m-chip-x:hover { background: #a3171b; color: #fff; }
.m-chip-x .icon { width: 16px; height: 16px; }
.m-list-edit { display: flex; flex-direction: column; gap: var(--space-2); }
.m-list-title { font-size: var(--step-0); font-family: var(--font-body); font-weight: 800; margin: 0; }
.m-add-row { display: flex; gap: 8px; align-items: stretch; }
.m-add-row input { flex: 1; min-width: 0; }

/* profile */
.m-profile-hero { display: flex; gap: clamp(1rem, .5rem + 2.5vw, 2.5rem); align-items: flex-start; flex-wrap: wrap; }
.m-hero-pic { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); flex: none; margin-inline: auto; }
.m-hero-text { flex: 1 1 22rem; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.m-hero-text h1 { font-size: clamp(2rem, 1.4rem + 2.5vw, 3.2rem); margin: 0; overflow-wrap: anywhere; }
.m-pronouns { font-family: var(--font-body); font-size: .45em; font-weight: 700; color: #47372a; }
.m-glance { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); margin: 0; }
.m-glance div { background: #faf4e8; border-radius: 12px; padding: .5em .8em; border-left: 4px solid var(--m-accent, #a3865c); }
.m-glance dt { display: flex; align-items: center; gap: .35em; font-weight: 800; font-size: var(--step--1); color: #5a4836; }
.m-glance dt .icon { width: 1em; height: 1em; }
.m-glance dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.m-avatar.frame-rounded { border-radius: 24%; }
.m-avatar.frame-arch { border-radius: 999px 999px 16px 16px; }
.m-avatar.frame-blob { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
.m-bubble { position: relative; background: #fff3e2; border-radius: 22px; padding: var(--space-4) var(--space-5); font-size: var(--step-1); line-height: 1.5; border: 2px solid #f0c9a0; }
.m-bubble p { margin: 0; max-width: none; }
.m-bubble p + p { margin-top: .6em; }
.m-bubble::after { content: ""; position: absolute; left: 34px; bottom: -14px; width: 26px; height: 26px; background: #fff3e2; border-right: 2px solid #f0c9a0; border-bottom: 2px solid #f0c9a0; transform: rotate(45deg) skew(10deg, 10deg); border-radius: 0 0 6px 0; }
.m-prompt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.m-prompt { display: inline-flex; align-items: center; gap: .35em; min-height: 40px; padding: .3em .8em; border-radius: 999px; border: 2px dashed #a3865c; background: #fffaf0; color: #23180f; font: inherit; font-size: var(--step--1); font-weight: 700; cursor: pointer; }
.m-prompt:hover { border-style: solid; background: #fff3b0; }
.m-hearts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: h; }
.m-hearts li { display: flex; gap: .6em; align-items: flex-start; margin: 0; max-width: none; background: #fdf0f0; border-radius: 12px; padding: .55em .8em; font-weight: 700; font-size: var(--step-0); }
.m-hearts .icon { color: #a3171b; flex: none; margin-top: .2em; fill: #f4b8b8; }
.m-vital .m-card-body { position: relative; }
.m-vital-flag { display: inline-flex; gap: .4em; align-items: center; font-weight: 800; color: #8a1013; background: #fce2e2; border-radius: 999px; padding: .25em .8em; margin: 0; }
.m-vital-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); margin: 0; }
.m-vital-list > div { background: #fdf6f0; border-radius: 10px; padding: .5em .8em; border-left: 4px solid #e3a1a1; }
.m-vital-list > div.is-key { background: #fce2e2; border-left-color: #a3171b; }
.m-vital-list dt { font-weight: 800; font-size: var(--step--1); color: #8a1013; }
.m-vital-list dd { margin: 0; }
.m-vital-list dd p { margin: 0; }
.m-ticks, .m-crosses { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.m-ticks li, .m-crosses li { position: relative; margin: 0; padding: .4em .7em .4em 2.2em; border-radius: 10px; max-width: none; }
.m-ticks li { background: #e9f5da; }
.m-crosses li { background: #fce2e2; }
.m-ticks li::before, .m-crosses li::before { position: absolute; left: .7em; top: .35em; font-weight: 900; }
.m-ticks li::before { content: "✓"; color: #1f6a2a; }
.m-crosses li::before { content: "✕"; color: #a3171b; }
.m-qa { display: grid; gap: var(--space-3); margin: var(--space-4) 0 0; }
.m-qa div { background: #eef5fb; border-radius: 12px; padding: .6em .9em; }
.m-qa dt { font-weight: 800; color: #0b4f7d; }
.m-qa dd { margin: .2em 0 0; }
.m-qa dd p { margin: 0; }
.m-people { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.m-person { margin: 0; max-width: none; background: #f6f0fa; border-radius: 14px; padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: .35em; }
.m-person p { margin: 0; overflow-wrap: anywhere; }
.m-person a { display: inline-flex; align-items: center; gap: .35em; font-weight: 700; }
.m-person-top { display: flex; gap: .6em; align-items: center; }
.m-person-ico { width: 2.4em; height: 2.4em; flex: none; display: grid; place-items: center; border-radius: 50%; background: #5b2486; color: #fff; font-weight: 800; font-size: 1.1em; }
.m-person-name { font-weight: 800; }
.m-tag-sos { background: #fce2e2; color: #8a1013; text-transform: none; display: inline-flex; gap: .25em; align-items: center; }
.m-tag-sos .icon { width: 1em; height: 1em; }
.m-pic-layout { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .m-pic-layout { grid-template-columns: 12rem minmax(0, 1fr); align-items: start; } .m-pic-preview { position: sticky; top: 0; } }
.m-pic-preview { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-4); border-radius: 14px; background: #f5ead7; }
.m-pick-scroll { max-height: 13rem; overflow: auto; padding: 4px; }
.m-file-btn { position: relative; cursor: pointer; width: fit-content; }
.m-file-btn:focus-within { outline: 3px solid #29298e; outline-offset: 2px; }
.m-inline-check { width: fit-content; }

/* page heads and small controls */
.m-page-head { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: center; justify-content: space-between; border-top: 6px solid var(--c, #a3865c); }
.m-page-title { display: flex; gap: var(--space-3); align-items: center; min-width: 0; flex: 1 1 22rem; }
.m-page-title .m-card-ico { width: 3em; height: 3em; }
.m-page-title h1 { font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.4rem); margin: 0; }
.m-page-title .hint { margin-top: .2em; }
.m-seg { display: inline-flex; flex-wrap: wrap; border: 2px solid #a3865c; border-radius: 12px; overflow: hidden; background: #fffdf7; }
.m-seg button { display: inline-flex; align-items: center; gap: .35em; min-height: 42px; padding: .3em .9em; border: 0; background: transparent; font: inherit; font-weight: 800; font-size: var(--step--1); color: #23180f; cursor: pointer; }
.m-seg button + button { border-left: 2px solid #e4d4b8; }
.m-seg button[aria-pressed="true"] { background: #23180f; color: #fffdf7; }
.m-seg button:focus-visible { outline: 3px solid #29298e; outline-offset: -3px; }
.m-count { margin: 0; font-weight: 700; font-size: var(--step--1); color: #23180f; background: rgba(255, 253, 247, .9); width: fit-content; padding: .2em .8em; border-radius: 999px; }
.m-empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-4); }
.m-empty p { margin: 0; max-width: 42ch; }
.m-empty-art { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: #f5ead7; color: #8a6440; }
.m-empty-art .icon { width: 30px; height: 30px; }
.m-search-box { position: relative; }
.m-search-box > .icon { position: absolute; left: .8em; top: 50%; transform: translateY(-50%); color: #5a4836; pointer-events: none; }
.m-search-box input { padding-left: 2.6em; }
.m-dl { display: grid; gap: 6px; margin: 0; }
.m-dl > div { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr); gap: .2em 1em; background: #faf4e8; border-radius: 8px; padding: .4em .7em; }
.m-dl dt { font-weight: 800; }
.m-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .m-dl > div { grid-template-columns: minmax(0, 1fr); } }
.m-quote { margin: 0; padding: .6em 1em; border-left: 5px solid #8e1167; background: #fbeef6; border-radius: 0 12px 12px 0; font-size: var(--step-1); font-family: var(--font-display); font-style: italic; }
.m-quote p { margin: 0; }
.m-quote + .m-quote { margin-top: var(--space-3); }
.m-table { width: 100%; border-collapse: collapse; margin-top: var(--space-2); }
.m-table th, .m-table td { text-align: left; padding: .35em .6em; border-bottom: 1px solid #e4d4b8; }
.m-tag { --c-tint: #efe4d0; }

/* calendar */
.m-cal-bar { display: grid; gap: var(--space-3); grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.m-cal-nav { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.m-cal-label { font-size: var(--step-1); margin: 0; min-width: 12ch; text-align: center; }
.m-filter { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.m-filter-chip { display: inline-flex; align-items: center; gap: .35em; min-height: 40px; padding: .25em .8em; border-radius: 999px; border: 2px solid var(--k); background: #fffdf7; color: #23180f; font: inherit; font-weight: 700; font-size: var(--step--1); cursor: pointer; }
.m-filter-chip .icon { color: var(--k); }
.m-filter-chip[aria-pressed="false"] { border-style: dashed; opacity: .75; text-decoration: line-through; }
.m-filter-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--k) 12%, #fffdf7); }
@media (max-width: 760px) { .m-cal-bar { grid-template-columns: minmax(0, 1fr); } .m-cal-nav { justify-content: space-between; } }
.m-wk-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.m-wk-day { position: relative; margin: 0; max-width: none; min-height: 13rem; background: #faf4e8; border-radius: 12px; padding: 6px 6px 46px; display: flex; flex-direction: column; gap: 6px; }
.m-wk-day.is-today { background: color-mix(in srgb, var(--m-accent, #2f6f7d) 10%, #fffdf7); box-shadow: inset 0 0 0 2px var(--m-accent, #2f6f7d); }
.m-wk-head { margin: 0; font-size: 1rem; font-family: var(--font-body); }
.m-wk-head button { width: 100%; display: flex; align-items: baseline; gap: .35em; flex-wrap: wrap; padding: .3em .45em; border: 0; border-radius: 8px; background: transparent; font: inherit; color: #23180f; cursor: pointer; text-align: left; }
.m-wk-head button:hover { background: #efe4d0; }
.wk-dow { font-weight: 800; font-size: var(--step--1); text-transform: uppercase; letter-spacing: .04em; color: #47372a; }
.wk-num { font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); line-height: 1; }
.wk-today { font-size: .72rem; font-weight: 800; background: var(--m-accent, #2f6f7d); color: var(--m-on-accent, #fff); padding: .05em .45em; border-radius: 999px; }
.wk-empty { color: #5a4836; font-size: var(--step--1); margin: 0 .45em; }
.m-wk-add { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 34px; border-radius: 8px; border: 2px dashed #c9b28d; background: transparent; color: #5a4836; cursor: pointer; display: grid; place-items: center; }
.m-wk-add:hover { border-style: solid; background: #fffdf7; color: #23180f; }
@media (max-width: 900px) {
  .m-wk-grid { grid-template-columns: minmax(0, 1fr); }
  .m-wk-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: flex-start; padding: 8px; }
  .m-wk-head { flex: 0 0 6.5rem; }
  .m-wk-day .m-ci-list, .m-wk-day .wk-empty { flex: 1 1 12rem; }
  .m-wk-add { position: static; width: 44px; height: 44px; flex: none; margin-left: auto; }
}
.m-ci-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.m-ci { display: flex; gap: 6px; align-items: flex-start; margin: 0; max-width: none; background: #fffdf7; border-radius: 8px; padding: 6px 8px; border-left: 4px solid var(--k); box-shadow: 0 1px 2px rgba(70, 45, 20, .12); }
.ci-check { width: 1.25rem; height: 1.25rem; margin: .1em 0 0; flex: none; accent-color: var(--k); }
.ci-ico { color: var(--k); flex: none; display: inline-flex; margin-top: .1em; }
.ci-ico .icon { width: 1.1em; height: 1.1em; }
.ci-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.ci-time { font-size: .78rem; font-weight: 800; color: #47372a; display: inline-flex; gap: .3em; align-items: center; }
.ci-rep .icon { width: .95em; height: .95em; }
.ci-title { text-align: left; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: #23180f; cursor: pointer; overflow-wrap: anywhere; line-height: 1.3; }
.ci-title:hover { text-decoration: underline; }
.ci-staff, .ci-place { font-size: .8rem; color: #47372a; display: inline-flex; gap: .3em; align-items: center; }
.ci-staff .icon, .ci-place .icon { width: 1em; height: 1em; }
.m-ci.is-done .ci-title { text-decoration: line-through; color: #5a4836; }
.m-ci-list.is-day .m-ci { padding: .6em .8em; font-size: var(--step-0); }
.m-ci-list.is-day .ci-time { font-size: var(--step--1); }
.m-staff-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-staff-list li { margin: 0; max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; background: #eef6e7; border-radius: 10px; padding: .5em .8em; }
.sf-name { font-weight: 800; }
.sf-hours { font-weight: 800; color: #2f5410; }
.sf-times { grid-column: 1 / -1; font-size: var(--step--1); color: #3b2c1f; }
.m-day-grid { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .m-day-grid { grid-template-columns: minmax(0, 1fr); } }
.m-day-list { display: flex; flex-direction: column; gap: var(--space-3); }
.m-day-side { display: flex; flex-direction: column; gap: var(--space-5); }
.m-top3 { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.m-top3 li { max-width: none; }
.m-mo-heads, .m-mo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.m-mo-heads li { margin: 0; text-align: center; font-weight: 800; font-size: var(--step--1); color: #47372a; padding-bottom: 4px; }
.m-mo-cell { margin: 0; max-width: none; min-height: 6.2rem; background: #faf4e8; border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.m-mo-cell.is-out { opacity: .55; }
.m-mo-cell.is-today { box-shadow: inset 0 0 0 2px var(--m-accent, #2f6f7d); background: #fffdf7; }
.m-mo-num { align-self: flex-start; min-width: 34px; min-height: 34px; border-radius: 50%; border: 0; background: transparent; font: inherit; font-weight: 800; color: #23180f; cursor: pointer; }
.m-mo-num:hover { background: #efe4d0; }
.m-mo-cell.is-today .m-mo-num { background: var(--m-accent, #2f6f7d); color: var(--m-on-accent, #fff); }
.m-mo-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.m-mo-items li { margin: 0; font-size: .72rem; line-height: 1.25; padding: 1px 4px; border-left: 3px solid var(--k, #a3865c); background: #fffdf7; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-mo-items .mo-more { border-left-color: transparent; background: none; color: #47372a; font-weight: 700; }
/* Draft 11 (D1c): fixed-height month cells with up to five chips; a phone gets dots and the picked day's list below */
.m-mo-cell { height: 9.4rem; min-height: 0; overflow: hidden; cursor: pointer; }
.m-mo-cell:hover { background: #f3e9d6; }
.m-mo-cell.is-picked { box-shadow: inset 0 0 0 2px #23180f; }
.m-mo-items li b { font-weight: 800; }
.mo-dots { display: none; }
.mo-agenda { display: none; }
@media (max-width: 640px) {
  .m-mo-cell { height: 3.6rem; align-items: center; padding: 3px 2px; }
  .m-mo-items { display: none; }
  .mo-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
  .mo-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--k, #a3865c); }
  .mo-dots b { font-size: 10px; line-height: 7px; }
  .mo-agenda { display: block; margin-top: var(--space-4); }
}
/* Week columns: fixed rows, long names on two lines at most, "+3 more" opens the day */
.m-wk-day { cursor: pointer; }
.m-wk-day.is-picked:not(.is-today) { box-shadow: inset 0 0 0 2px #23180f; }
.m-ci { cursor: pointer; }
.wk-more { align-self: flex-start; border: 0; background: #efe4d0; border-radius: 999px; padding: .25em .7em; font: inherit; font-weight: 800; font-size: var(--step--1); color: #23180f; cursor: pointer; min-height: 32px; }
.wk-more:hover { background: #e3d4b8; }
[data-drop-day].is-drop { outline: 3px dashed #2c56c9; outline-offset: 2px; background: #e8efff !important; }
.ce-remind .m-check-chips input:disabled + span { opacity: .5; }
.m-month .hint { margin-top: var(--space-3); }
/* The Blocks panel (D2a): a drawer from the right, a sheet from the bottom on a phone */
.blk-panel { position: fixed; z-index: 900; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: #fffdf7; color: #23180f; border-left: 3px solid #23180f; box-shadow: -10px 0 30px rgba(0, 0, 0, .25); animation: blk-in .25s ease both; }
@keyframes blk-in { from { transform: translateX(30px); opacity: 0; } }
.blk-head { display: flex; align-items: center; justify-content: space-between; }
.blk-head h2 { margin: 0; display: inline-flex; gap: .35em; align-items: center; font-size: var(--step-1); }
.blk-hint { margin: 0; }
.blk-body { flex: 1; overflow: auto; padding-right: 4px; }
.blk-group { margin: 0 0 10px; }
.blk-group h3 { display: inline-flex; gap: .35em; align-items: center; margin: 4px 0 6px; font-size: var(--step-0); }
details.blk-group > summary { cursor: pointer; }
details.blk-group > summary h3 { display: inline-flex; margin: 0; }
.blk-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.blk-list .sp-block { min-height: 72px; touch-action: none; }
.blk-saved .sp-block { --bg: #eef3ff; --sp: #2c56c9; }
.blk-ghost { position: fixed; z-index: 2147483000; width: 150px; min-height: 60px; pointer-events: none; transform: rotate(-3deg); opacity: .92; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
body.is-blk-dragging, body.is-blk-dragging * { cursor: grabbing !important; }
/* draft 12: the floating copy carries a tag saying where it would land (carry.mjs); nothing can leave it behind */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 2147483000; pointer-events: none; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; will-change: transform; }
.drag-ghost-body { margin: 0; transform: rotate(-3deg); opacity: .94; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); pointer-events: none; }
.drag-ghost .drag-tag { display: inline-block; max-width: 260px; padding: 4px 10px; border-radius: 999px; background: #23180f; color: #fffaf0; font-size: 13px; font-weight: 800; line-height: 1.25; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.drag-ghost .drag-tag:empty { display: none; }
.drag-ghost.is-nowhere .drag-ghost-body { opacity: .7; filter: grayscale(.4); }
.drag-ghost.is-nowhere .drag-tag { background: #6b5d4f; }
body.is-carrying .drag-ghost-body { box-shadow: 0 0 0 3px #ffd34f, 0 12px 26px rgba(0, 0, 0, .32); }
/* Undo (undo.mjs): a bar at the bottom for 15 seconds, in the top layer */
.undo-host { position: fixed; z-index: 2147483001; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 32px), 540px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.undo-host[popover] { inset: auto; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); margin: 0; border: 0; padding: 0; background: none; overflow: visible; color: inherit; }
.undo-bar { pointer-events: auto; position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 8px 13px 14px; border-radius: 14px; border: 3px solid #23180f; background: #2b211a; color: #fffaf0; box-shadow: 0 6px 0 rgba(0, 0, 0, .25), 0 14px 30px rgba(0, 0, 0, .25); font-weight: 800; line-height: 1.3; overflow: hidden; animation: undo-in .22s cubic-bezier(.2, .9, .3, 1.3); transition: opacity .18s, transform .18s; }
.undo-ico .icon { width: 20px; height: 20px; color: #ffd34f; }
.undo-msg { flex: 1; min-width: 0; }
.undo-bar .undo-go { flex: none; background: #ffd34f; color: #23180f; border: 2px solid #ffd34f; min-height: 40px; }
.undo-bar .undo-go:hover { background: #ffe27f; }
.undo-bar .undo-x { flex: none; color: #fffaf0; background: transparent; border: 2px solid rgba(255, 250, 240, .45); min-width: 40px; min-height: 40px; box-shadow: none; }
.undo-bar .undo-x:hover { background: rgba(255, 250, 240, .12); }
.undo-bar .undo-go:focus-visible, .undo-bar .undo-x:focus-visible { outline: 3px solid #8fc5ff; outline-offset: 2px; }
.undo-time { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .14); }
.undo-time b { display: block; height: 100%; background: #ffd34f; transform-origin: left center; transition: transform .2s linear; }
.undo-bar.is-going { opacity: 0; transform: translateY(8px); }
@keyframes undo-in { from { transform: translateY(14px); opacity: 0; } }
body:has(.undo-bar) .toast { bottom: calc(var(--space-5) + 84px); }
@media (prefers-reduced-motion: reduce) { .undo-bar { animation: none; transition: none; } .undo-time b { transition: none; } }
:root[data-motion="reduce"] .undo-bar { animation: none; transition: none; }
.blk-foot { margin: 8px 0 0; }
@media (min-width: 1100px) { body.has-blk-panel { padding-right: 380px; } }
@media (max-width: 640px) { .blk-panel { top: auto; left: 0; width: auto; height: 62vh; border-left: 0; border-top: 3px solid #23180f; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .25); animation-name: blk-up; } @keyframes blk-up { from { transform: translateY(40px); opacity: 0; } } .blk-list .sp-block { touch-action: pan-y; } }
@media (prefers-reduced-motion: reduce) { .blk-panel { animation: none; } }
.m-kind-row { display: flex; flex-wrap: wrap; gap: 8px; }
.m-kind-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-kind-pick span { display: inline-flex; align-items: center; gap: .4em; min-height: 46px; padding: .3em .9em; border-radius: 12px; border: 2px solid #dcc8a6; background: #fffaf0; font-weight: 800; cursor: pointer; }
.m-kind-pick span .icon { color: var(--k); }
.m-kind-pick input:checked + span { border-color: var(--k); background: color-mix(in srgb, var(--k) 14%, #fffdf7); box-shadow: inset 0 0 0 2px var(--k); }
.m-kind-pick input:focus-visible + span { outline: 3px solid #29298e; outline-offset: 2px; }

/* daily log */
.m-log-filters { display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: end; }
.m-log-filters .m-inline-check { grid-column: 1 / -1; }
@media (max-width: 640px) { .m-log-filters { grid-template-columns: minmax(0, 1fr); } }
.m-log-day { display: flex; flex-direction: column; gap: var(--space-2); }
.m-log-date { display: flex; align-items: center; gap: .5em; font-size: var(--step-1); margin: var(--space-2) 0 0; background: rgba(255, 253, 247, .92); color: #23180f; width: fit-content; padding: .2em .8em; border-radius: 10px; }
.m-entry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.m-entry { margin: 0; max-width: none; }
.m-entry-link { display: flex; flex-direction: column; gap: .4em; padding: var(--space-3) var(--space-4); background: #fffdf7; color: #23180f; border-radius: 14px; box-shadow: var(--shadow); text-decoration: none; border-left: 6px solid #3e690e; }
.m-entry-link:hover { box-shadow: var(--shadow-lift); }
.m-entry-link:hover .m-entry-who { text-decoration: underline; }
.m-entry-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3em 1em; }
.m-entry-who { font-weight: 800; font-size: var(--step-1); }
.m-entry-time { font-weight: 700; color: #47372a; }
.m-entry-text { color: #3b2c1f; }
.m-entry-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.m-mood-chip { display: inline-flex; align-items: center; gap: .35em; font-weight: 800; font-size: var(--step--1); padding: .2em .7em; border-radius: 999px; color: var(--mc); background: color-mix(in srgb, var(--mc) 12%, #fffdf7); border: 2px solid color-mix(in srgb, var(--mc) 40%, #fffdf7); }
.m-flag { display: inline-flex; align-items: center; gap: .3em; font-weight: 800; font-size: var(--step--1); padding: .2em .7em; border-radius: 999px; margin: 0; width: fit-content; }
.m-flag .icon { width: 1em; height: 1em; }
.m-flag.is-fu { background: #fff0d9; color: #8a4b00; }
.m-flag.is-med { background: #fce2e2; color: #8a1013; }
.m-flag.is-bath { background: #e7f0f6; color: #13324a; }
.m-fu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.m-fu-list li { margin: 0; max-width: none; }
.m-entry-sub { font-weight: 700; color: #47372a; margin: .2em 0 0; }
.m-entry-stamp { text-align: center; color: #23180f; background: rgba(255, 253, 247, .9); width: fit-content; margin: 0 auto; padding: .2em .8em; border-radius: 999px; }
.m-done-note { display: inline-flex; gap: .4em; align-items: center; color: #1f6a2a; font-weight: 800; }
.m-dose-read { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.m-dose-read li { margin: 0; max-width: none; padding: .4em .7em; border-radius: 8px; background: #faf4e8; border-left: 4px solid #a3865c; }
.m-dose-read li.is-taken { border-left-color: #3e690e; }
.m-dose-read li.is-refused, .m-dose-read li.is-missed { border-left-color: #a3171b; background: #fdf0f0; }
.m-dose-read li.is-prn { border-left-color: #0b5f96; background: #eef6fc; }
.m-check-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.m-check-chips label { position: relative; }
.m-check-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-check-chips span { display: inline-flex; align-items: center; gap: .35em; min-height: 42px; padding: .3em .85em; border-radius: 999px; border: 2px solid #c9b28d; background: #fffdf7; font-weight: 700; cursor: pointer; text-transform: none; }
.m-check-chips input:checked + span { background: #23180f; color: #fffdf7; border-color: #23180f; }
.m-check-chips input:focus-visible + span { outline: 3px solid #29298e; outline-offset: 2px; }
.m-mood-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .m-mood-scale { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.m-mood-scale label { position: relative; }
.m-mood-scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-mood-scale span { display: flex; flex-direction: column; align-items: center; gap: .3em; padding: .6em .3em; border-radius: 14px; border: 2px solid #dcc8a6; background: #fffdf7; cursor: pointer; text-align: center; height: 100%; }
.m-mood-scale span .icon { width: 2rem; height: 2rem; color: var(--mc); }
.m-mood-scale b { font-size: var(--step--1); }
.m-mood-scale input:checked + span { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 12%, #fffdf7); box-shadow: inset 0 0 0 2px var(--mc); }
.m-mood-scale input:focus-visible + span { outline: 3px solid #29298e; outline-offset: 2px; }
.m-dose-form { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-dose-form li { margin: 0; max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem); gap: 8px; align-items: center; background: #faf4e8; border-radius: 10px; padding: .4em .6em; }
@media (max-width: 560px) { .m-dose-form li { grid-template-columns: minmax(0, 1fr); } }
.m-prn { display: flex; flex-direction: column; gap: var(--space-2); }
.m-prn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.m-prn-list li { margin: 0; max-width: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #eef6fc; border-radius: 10px; padding: .3em .4em .3em .8em; }
.m-scale5 { display: flex; gap: 6px; }
.m-scale5 label { position: relative; }
.m-scale5 input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-scale5 span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 2px solid #c9b28d; background: #fffdf7; font-weight: 800; cursor: pointer; }
.m-scale5 input:checked + span { background: #23180f; color: #fffdf7; border-color: #23180f; }
.m-scale5 input:focus-visible + span { outline: 3px solid #29298e; outline-offset: 2px; }
.m-save-bar { position: sticky; bottom: 10px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); box-shadow: 0 -2px 0 rgba(70, 45, 20, .05), 0 12px 30px -10px rgba(70, 45, 20, .55); }
.m-save-bar .m-error-text { margin: 0; }
.m-custom-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-custom-list li { margin: 0; max-width: none; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: #faf4e8; border-radius: 10px; padding: .4em .6em; }
.m-custom-list li.is-archived .cl-name { opacity: .6; }
.cl-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.m-custom-list li input { flex: 1; min-width: 0; }

/* support summary */
.m-range { margin: 0; font-weight: 700; color: #47372a; }
.m-summary-text p { font-size: var(--step-1); line-height: 1.55; margin: 0; max-width: 64ch; }
.m-summary-text p + p { margin-top: .6em; }
.m-ai { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 2px dashed #e4d4b8; display: flex; flex-direction: column; gap: var(--space-2); }
.m-ai-out { background: #f4eefb; border-radius: 12px; padding: .7em 1em; font-size: var(--step-1); margin: 0; }
.m-who-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.m-who-list li { margin: 0; max-width: none; display: flex; justify-content: space-between; gap: 1em; background: #eef6e7; border-radius: 8px; padding: .4em .8em; }
.wl-name { font-weight: 800; }
.m-highlights { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.m-highlights li { max-width: none; }
.m-chart { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.m-chart svg { width: 100%; height: auto; max-height: 300px; }
.ch-grid { stroke: #e4d4b8; stroke-width: 1.5; }
.ch-label, .ch-tick, .ch-avg-label { font-family: var(--font-body); fill: #3b2c1f; }
.ch-label { font-size: 12.5px; font-weight: 700; }
.ch-tick { font-size: 12.5px; }
.ch-avg { stroke: #5b2486; stroke-width: 2; stroke-dasharray: 6 5; }
.ch-avg-label { font-size: 12px; font-weight: 800; fill: #5b2486; }
.ch-line { fill: none; stroke: #23180f; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { stroke: #fffdf7; stroke-width: 3; }

/* resource library */
.m-lib-filters { display: flex; flex-direction: column; gap: var(--space-3); }
.m-lib-search input { font-size: var(--step-1); min-height: 56px; }
.m-lib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.m-cat-chip { display: inline-flex; align-items: center; gap: .4em; min-height: 42px; padding: .3em .85em; border-radius: 999px; border: 2px solid var(--c, #a3865c); background: #fffdf7; color: #23180f; font: inherit; font-weight: 800; font-size: var(--step--1); cursor: pointer; }
.m-cat-chip .icon { color: var(--c-ink-paper, #47372a); }
.m-cat-chip[aria-pressed="true"] { background: var(--c-tint-paper, #23180f); box-shadow: inset 0 0 0 2px var(--c-ink-paper, #23180f); border-color: var(--c-ink-paper, #23180f); }
.m-cat-chip[data-cat=""][aria-pressed="true"] { background: #23180f; color: #fffdf7; }
.m-cat-chip[data-cat=""][aria-pressed="true"] .icon { color: #fffdf7; }
.m-lib-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; }
.m-lib-cat { display: flex; flex-direction: column; gap: var(--space-3); }
.m-lib-cat-h { display: flex; align-items: center; gap: .5em; font-size: var(--step-2); margin: var(--space-3) 0 0; background: #fffdf7; color: #23180f; width: fit-content; padding: .25em .9em .25em .35em; border-radius: 999px; box-shadow: var(--shadow); border-left: 0; }
.lc-ico { width: 2em; height: 2em; display: grid; place-items: center; border-radius: 50%; background: var(--c-tint-paper); color: var(--c-ink-paper); }
.lc-n { font-family: var(--font-body); font-size: var(--step--1); font-weight: 800; background: var(--c-tint-paper); color: var(--c-ink-paper); border-radius: 999px; padding: .1em .6em; }
.m-lib-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.m-lib-item { margin: 0; max-width: none; display: flex; flex-direction: column; gap: .5em; background: #fffdf7; color: #23180f; border-radius: 16px; box-shadow: var(--shadow); padding: var(--space-4); border-top: 6px solid var(--c, #a3865c); }
.m-lib-item.is-hidden { opacity: .6; }
.li-top { display: flex; align-items: center; justify-content: space-between; gap: .5em; }
.li-ico { width: 2.6em; height: 2.6em; display: grid; place-items: center; border-radius: 14px; background: var(--c-tint-paper); color: var(--c-ink-paper); }
.li-type { display: inline-flex; align-items: center; gap: .3em; font-size: .78rem; font-weight: 800; color: var(--c-ink-paper, #47372a); background: var(--c-tint-paper, #f5ead7); border-radius: 999px; padding: .15em .6em; }
.li-type .icon { width: 1em; height: 1em; }
.li-title { font-size: var(--step-1); margin: 0; }
.li-title a { color: #23180f; text-decoration: none; }
.li-title a:hover { text-decoration: underline; }
.li-title a::after { content: ""; position: absolute; inset: 0; } /* the whole card opens the item */
.m-lib-item { position: relative; }
.li-desc { margin: 0; color: #3b2c1f; font-size: var(--step--1); flex: 1; }
.li-org { margin: 0; color: #47372a; }
.li-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: .3em; }
.li-actions .icon-btn { width: 40px; height: 40px; }
.icon-btn.is-on, .icon-btn[aria-pressed="true"] { background: #23180f; color: #ffd25c; border-color: #23180f; }
.m-shelf-card .m-shelf { margin-top: 0; }

/* style studio */
.m-bg-pick input, .m-shape-pick input, .m-font-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-bg-pick span, .m-shape-pick span, .m-font-pick span { display: inline-flex; align-items: center; gap: .5em; min-height: 48px; padding: .3em .8em .3em .4em; border-radius: 12px; border: 2px solid #dcc8a6; background: #fffaf0; font-weight: 700; cursor: pointer; }
.m-bg-pick input:checked + span, .m-shape-pick input:checked + span, .m-font-pick input:checked + span { border-color: #23180f; box-shadow: inset 0 0 0 2px #23180f; background: #fff3b0; }
.m-bg-pick input:focus-visible + span, .m-shape-pick input:focus-visible + span, .m-font-pick input:focus-visible + span { outline: 3px solid #29298e; outline-offset: 2px; }
.bgp { width: 34px; height: 34px; border-radius: 8px; background-color: #efe4d0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.bgp-dots { background-image: radial-gradient(#a3865c 1.6px, transparent 2px); background-size: 9px 9px; }
.bgp-grid { background-image: linear-gradient(#c9b28d 1px, transparent 1px), linear-gradient(90deg, #c9b28d 1px, transparent 1px); background-size: 8px 8px; }
.bgp-stars { background-color: #2a3366; background-image: radial-gradient(#ffd25c 1.3px, transparent 1.8px); background-size: 10px 12px; }
.bgp-waves { background-image: repeating-radial-gradient(circle at 0 100%, transparent 0 6px, #7fb2d4 6px 8px); }
.bgp-leaves { background-color: #dfe9d2; background-image: radial-gradient(ellipse 5px 3px, #4f7f3a 98%, transparent); background-size: 12px 12px; }
.bgp-confetti { background-image: radial-gradient(#e0644f 1.6px, transparent 2px), radial-gradient(#2f6f9d 1.6px, transparent 2px); background-size: 11px 11px, 13px 13px; background-position: 0 0, 5px 6px; }
.bgp-plaid { background-image: repeating-linear-gradient(0deg, rgba(176, 106, 63, .3) 0 4px, transparent 4px 8px), repeating-linear-gradient(90deg, rgba(79, 127, 58, .3) 0 4px, transparent 4px 8px); }
.shp { width: 34px; height: 26px; background: #fffdf7; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); border-top: 4px solid #2f6f9d; }
.shp-soft { border-radius: 8px; }
.shp-craft { border-radius: 12px 3px 10px 4px / 4px 10px 3px 12px; transform: rotate(-3deg); }
.shp-crisp { border-radius: 1px; }
.fnt { font-size: 1.15rem; }
.fnt-classic { font-family: var(--font-display); font-weight: 700; }
.fnt-friendly { font-family: var(--font-body); font-weight: 800; }
.fnt-handwritten { font-family: var(--font-hand); font-weight: 700; font-size: 1.5rem; }
.m-swatch-auto span { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .5), 0 1px 2px rgba(0, 0, 0, .3); background-image: linear-gradient(135deg, transparent 45%, rgba(255, 255, 255, .85) 45% 55%, transparent 55%); }

/* printable sheets made from drawer pages */
@media print {
  .ps-page { font-family: var(--font-body); color: #000; }
  .ps-page h1 { font-family: var(--font-display); font-size: 22pt; margin: 0; }
  .ps-head { display: flex; gap: 14pt; align-items: center; border-bottom: 2pt solid #000; padding-bottom: 8pt; margin-bottom: 10pt; }
  .ps-photo { width: 84pt; height: 84pt; object-fit: cover; border-radius: 50%; }
  .ps-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: 9pt; font-weight: 700; margin: 0; }
  .ps-glance { list-style: none; padding: 0; margin: 4pt 0 0; columns: 2; font-size: 10pt; }
  .ps-box { border: 1pt solid #888; border-radius: 6pt; padding: 6pt 9pt; margin: 0 0 8pt; break-inside: avoid; }
  .ps-box h3 { font-size: 11pt; margin: 0 0 3pt; }
  .ps-box p, .ps-box li { font-size: 10pt; margin: 0 0 2pt; }
  .ps-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10pt; }
  .ps-vital { margin: 0 0 8pt; }
  .ps-vrow { display: grid; grid-template-columns: 1.5in 1fr; gap: 8pt; border-bottom: .5pt solid #bbb; padding: 3pt 0; font-size: 10pt; break-inside: avoid; }
  .ps-vrow dt { font-weight: 700; }
  .ps-vrow dd { margin: 0; }
  .ps-vrow dd p { margin: 0; }
  .ps-week { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9pt; }
  .ps-week th, .ps-week td { border: 1pt solid #777; padding: 4pt; vertical-align: top; }
  .ps-week td { height: 5in; }
  .ps-week p { margin: 0 0 4pt; }
  .ps-foot { font-size: 8pt; color: #333; margin-top: 10pt; }
}
.li-pin[aria-pressed="true"] { background: #fff3b0; color: #23180f; border-color: #23180f; box-shadow: inset 0 0 0 1px #23180f; }
.m-lib-more { margin-top: 0; }

/* ---------- tools from the resource library ---------- */
.m-tool-head { background-color: #fffdf7; background-image: var(--fiber); color: #23180f; border-radius: 18px; box-shadow: var(--shadow); padding: clamp(1rem, .7rem + 1.4vw, 1.75rem); border-top: 6px solid var(--c, #a3865c); display: flex; flex-direction: column; gap: var(--space-3); }
.m-tool-head .m-back { margin: 0; }
.m-tool-head .m-back a { box-shadow: none; background: #f5ead7; }
.m-tool-title { display: flex; gap: var(--space-4); align-items: flex-start; }
.m-tool-title h1 { font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.6rem); margin: .1em 0 0; }
.m-tool-title .lead { margin-top: .4em; color: #3b2c1f; font-size: var(--step-0); max-width: 62ch; }
.m-tool-ico { width: 3.2rem; height: 3.2rem; flex: none; display: grid; place-items: center; border-radius: 16px; background: var(--c-tint-paper, #f5ead7); color: var(--c-ink-paper, #47372a); }
.m-tool-ico .icon { width: 1.7rem; height: 1.7rem; }
.m-tool-actions { gap: 8px; }
.m-meter.big { height: 16px; }
.m-meter.is-over span, .is-over .m-meter span { background: #a3171b; }
.m-big-num.is-over { color: #a3171b; }
.m-progress { display: flex; flex-direction: column; gap: var(--space-2); }
.m-progress-text { margin: 0; font-size: var(--step-1); }
.m-tip { display: flex; gap: .5em; align-items: flex-start; background: #e7f0f6; color: #13324a; border-radius: 12px; padding: .6em .9em; }
.m-tip .icon { flex: none; margin-top: .2em; }
.m-num-list { margin: 0; padding-left: 1.4em; display: grid; gap: .5em; }
.m-num-list li { max-width: none; }
.m-call-list > div { grid-template-columns: minmax(9rem, 16rem) minmax(0, 1fr); }
.m-call-list a { font-weight: 800; }
.m-read-box { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; }
.m-read-box p { margin: 0; }
.m-tips { display: flex; flex-direction: column; gap: var(--space-2); }

/* checklists */
.m-steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.m-step-card { margin: 0; max-width: none; background: #fffdf7; color: #23180f; border-radius: 16px; box-shadow: var(--shadow); padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: .5em; border-left: 6px solid #dcc8a6; }
.m-step-card.is-done { border-left-color: #3e690e; background: #f6faef; }
.sc-top { display: flex; align-items: center; gap: .7em; }
.sc-num { width: 2.2em; height: 2.2em; flex: none; display: grid; place-items: center; border-radius: 50%; background: #efe4d0; font-weight: 800; }
.m-step-card.is-done .sc-num { background: #3e690e; color: #fff; }
.sc-check { display: flex; align-items: center; gap: .6em; flex: 1; min-width: 0; cursor: pointer; }
.sc-check input { width: 1.4rem; height: 1.4rem; flex: none; accent-color: #3e690e; }
.sc-title { font-weight: 800; font-size: var(--step-1); }
.m-step-card.is-done .sc-title { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(62, 105, 14, .6); }
.sc-ico { color: #8a6440; flex: none; }
.sc-detail, .sc-link, .sc-date { margin: 0; }
.sc-detail { color: #3b2c1f; }
.sc-notes summary { cursor: pointer; font-weight: 700; display: inline-flex; gap: .3em; align-items: center; min-height: 36px; }
.sc-notes textarea { margin-top: .4em; min-height: 4rem; }

/* journey */
.m-bloom { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.m-bloom-art { width: min(100%, 360px); height: auto; }
.m-journey-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.m-journey-stage { margin: 0; max-width: none; background: #fffdf7; color: #23180f; border-radius: 14px; box-shadow: var(--shadow); border-left: 6px solid var(--c, #a3865c); }
.m-journey-stage details { padding: var(--space-3) var(--space-4); }
.m-journey-stage summary { display: flex; align-items: center; gap: .7em; cursor: pointer; min-height: 44px; }
.js-num { width: 2.2em; height: 2.2em; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--f) 30%, #fffdf7); font-weight: 800; flex: none; }
.m-journey-stage.is-done .js-num { background: var(--f); }
.js-title { font-weight: 800; font-size: var(--step-1); flex: 1; }
.js-count { font-size: var(--step--1); font-weight: 700; color: #47372a; }
.m-journey-stage details > *:not(summary) { margin-top: var(--space-3); }
.js-links { display: flex; flex-wrap: wrap; gap: .4em 1.2em; }

/* glossary */
.m-glossary-list { margin: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.m-word { background: #fffdf7; color: #23180f; border-radius: 14px; box-shadow: var(--shadow); padding: var(--space-3) var(--space-4); scroll-margin-top: var(--space-5); }
.m-word.is-starred { box-shadow: inset 0 0 0 2px #c97a1c, var(--shadow); }
.m-word dt { display: flex; justify-content: space-between; align-items: center; gap: .5em; font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }
.m-word dd { margin: .3em 0 0; }

/* questions */
.m-q-list { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; counter-reset: q; }
.m-q-list li { margin: 0; max-width: none; display: flex; flex-direction: column; gap: 6px; }
.m-q-list li.is-picked .check { border-color: var(--action); }

/* medicines */
.m-card-head .m-cal-nav { margin-left: auto; }
.m-dose-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-dose-rows li { margin: 0; max-width: none; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; background: #faf4e8; border-radius: 12px; padding: .5em .7em; border-left: 5px solid #dcc8a6; }
.m-dose-rows li.is-taken { border-left-color: #3e690e; background: #f1f8e9; }
.m-dose-rows li.is-refused, .m-dose-rows li.is-missed { border-left-color: #a3171b; background: #fdf0f0; }
.dr-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.m-status-btn { display: inline-flex; align-items: center; gap: .3em; min-height: 40px; padding: .25em .75em; border-radius: 999px; border: 2px solid #c9b28d; background: #fffdf7; color: #23180f; font: inherit; font-weight: 800; font-size: var(--step--1); cursor: pointer; }
.m-status-btn[aria-pressed="true"].st-taken { background: #3e690e; border-color: #3e690e; color: #fff; }
.m-status-btn[aria-pressed="true"].st-refused, .m-status-btn[aria-pressed="true"].st-missed { background: #a3171b; border-color: #a3171b; color: #fff; }
.m-table-wrap { overflow-x: auto; position: relative; }
.m-table-wrap:focus-visible { outline: 3px solid #29298e; outline-offset: 2px; }
.m-med-week th, .m-med-week td { text-align: center; white-space: nowrap; }
.m-med-week tbody th { text-align: left; white-space: normal; font-weight: 700; }
.m-med-week td.is-taken { color: #3e690e; }
.m-med-week td.is-refused, .m-med-week td.is-missed { color: #a3171b; background: #fdf0f0; }
/* Medicines (draft 11, C2-C4): one goal for every dose, as-needed doses with a safe-again wait, the dose history */
.med-goal { display: flex; flex-wrap: wrap; align-items: center; gap: .4em 1em; padding: .7em 1em; }
.med-goal-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff1c9; color: #6b4a00; border: 2px solid #23180f; flex: none; }
.med-goal .field { margin: 0; flex: 1 1 16rem; }
.med-goal p { margin: 0; flex: 1 1 100%; }
.prn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.prn-card { margin: 0; max-width: none; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: start; padding: 12px; border-radius: 16px; background: #fffdf7; color: #23180f; border: 2.5px solid #23180f; box-shadow: 0 4px 0 #23180f; }
.prn-card.is-waiting { background: #fff6e0; }
.prn-main p { margin: 0 0 .25em; }
.prn-last { display: flex; align-items: center; gap: .3em; color: #5a4836; }
.prn-last .icon, .prn-safe .icon { width: 1.05em; height: 1.05em; flex: none; }
.prn-safe { display: flex; align-items: center; flex-wrap: wrap; gap: .3em; padding: .3em .6em; border-radius: 10px; font-size: var(--step--1); }
.prn-safe.is-wait { background: #ffe1c2; color: #7a3300; }
.prn-safe.is-ok { background: #dff3e4; color: #145c2c; }
.prn-btns { grid-column: 1 / -1; }
.safe-seg { flex-wrap: wrap; margin: .3em 0 .6em; }
.safe-own { max-width: 22rem; }
.pb-at { display: block; font-size: 10px; font-weight: 800; color: #1d7a3a; line-height: 1; }
.dh { max-height: min(60vh, 34rem); overflow: auto; padding-right: 4px; }
.dh-day h3 { margin: .8em 0 .3em; font-size: var(--step-0); position: sticky; top: 0; background: var(--dlg-bg, #fffdf7); padding: .2em 0; }
.dh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dh-row { margin: 0; max-width: none; display: grid; grid-template-columns: 5.5em 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: #f6efe1; border-left: 5px solid #c9b791; font-size: var(--step--1); }
.dh-row.is-taken { border-left-color: #1d7a3a; } .dh-row.is-late { border-left-color: #c97a1c; } .dh-row.is-refused, .dh-row.is-missed { border-left-color: #a3171b; } .dh-row.is-not-marked { border-left-color: #8a7b66; opacity: .85; }
.dh-time { font-weight: 800; }
.dh-med { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dh-status { text-align: right; font-weight: 700; } .dh-status small { display: block; font-weight: 500; color: #5a4836; }
@media (max-width: 520px) { .dh-row { grid-template-columns: 4.6em 1fr; } .dh-status { grid-column: 2; text-align: left; } }
.m-med-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.m-med { margin: 0; max-width: none; background: #fdf6f0; border-radius: 14px; padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: .4em; border-top: 4px solid #a3171b; }
.m-med.is-stopped { opacity: .7; border-top-color: #8d755a; }
.m-med p { margin: 0; }
.mm-top { display: flex; gap: .6em; align-items: flex-start; }
.mm-ico { width: 2.3em; height: 2.3em; flex: none; display: grid; place-items: center; border-radius: 50%; background: #fce2e2; color: #8a1013; }
.mm-name { font-weight: 800; font-size: var(--step-1); }
.mm-dose { font-weight: 700; font-size: var(--step--1); color: #47372a; }
.mm-times { display: flex; flex-wrap: wrap; gap: 6px; }
.m-time-chip { display: inline-flex; align-items: center; gap: .3em; font-weight: 700; font-size: var(--step--1); background: #fffdf7; border: 1.5px solid #dcc8a6; border-radius: 999px; padding: .1em .6em; }
.m-time-chip .icon { width: 1em; height: 1em; }
.m-time-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.m-time-list li { margin: 0; max-width: none; display: flex; gap: 6px; align-items: center; }
.m-time-list li input { flex: 1; min-width: 0; }

/* budget */
.m-quick-add { gap: var(--space-3); }
.m-cat-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.m-cat-bars li { margin: 0; max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.m-cat-bars .m-meter { grid-column: 1 / -1; }
.cb-name { font-weight: 800; }
.cb-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.cb-over { grid-column: 1 / -1; color: #a3171b; font-weight: 800; }
.m-cat-bars li.is-extra { background: #faf4e8; border-radius: 8px; padding: .3em .6em; }
.m-money-day + .m-money-day { margin-top: var(--space-3); }
.m-money-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.m-money-list li { margin: 0; max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; background: #faf4e8; border-radius: 10px; padding: .3em .4em .3em .8em; }
.m-money-list li.is-in { background: #eef6e7; }
.m-money-list li > span:first-child { display: inline-flex; gap: .4em; align-items: center; flex-wrap: wrap; }
.ml-amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.m-save-goals { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.m-save-goals li { margin: 0; max-width: none; background: #f6f0fa; border-radius: 12px; padding: var(--space-3); display: flex; flex-direction: column; gap: .4em; }
.m-save-goals p { margin: 0; }
.sg-title { font-weight: 800; font-size: var(--step-1); }
.m-plan-rows { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.m-plan-rows li { margin: 0; max-width: none; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(5rem, .8fr) auto; gap: 6px; align-items: center; }

/* goal cards */
.m-goal-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); align-items: start; }
.m-goal-card { margin: 0; max-width: none; background: #fffdf7; color: #23180f; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; gap: .6em; padding: 0 var(--space-4) var(--space-4); border: 2px solid color-mix(in srgb, var(--gc) 35%, #fffdf7); }
.gc-band { display: flex; justify-content: space-between; align-items: center; gap: .5em; margin: 0 calc(-1 * var(--space-4)); padding: .55em var(--space-4); background: color-mix(in srgb, var(--gc) 16%, #fffdf7); border-bottom: 2px solid color-mix(in srgb, var(--gc) 35%, #fffdf7); }
.gc-cat { display: inline-flex; align-items: center; gap: .35em; font-weight: 800; font-size: var(--step--1); color: color-mix(in srgb, var(--gc) 75%, #000); }
.gc-pin { display: inline-flex; align-items: center; gap: .25em; font-size: .75rem; font-weight: 800; color: #47372a; }
.gc-pin .icon { width: 1em; height: 1em; }
.gc-title { font-size: var(--step-1); margin: .2em 0 0; }
.gc-why, .gc-cheer { margin: 0; }
.gc-cheer { font-family: var(--font-display); font-style: italic; color: color-mix(in srgb, var(--gc) 70%, #000); }
.gc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gc-steps li { margin: 0; max-width: none; }
.gc-steps .check { padding: .45em .7em; }
.m-goal-card .m-meter span { background: var(--gc); }
.gc-actions { margin-top: .2em; gap: 6px; }
.m-gc-chip .icon { color: color-mix(in srgb, var(--gc) 75%, #000); }
.m-gc-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--gc) 14%, #fffdf7); border-color: color-mix(in srgb, var(--gc) 75%, #000); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gc) 75%, #000); }

/* calm and grounding */
.m-calm-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.m-calm-grid li { margin: 0; max-width: none; }
.m-calm-tile { width: 100%; display: flex; align-items: center; gap: .6em; min-height: 64px; padding: .6em .9em; border-radius: 14px; border: 2px solid #c7dfe8; background: #f1f8fb; color: #23180f; font: inherit; font-weight: 800; text-align: left; cursor: pointer; position: relative; }
.m-calm-tile > .icon:first-child { width: 1.6rem; height: 1.6rem; color: #08678a; flex: none; }
.m-calm-tile:hover, .m-calm-tile.is-open { border-color: #08678a; background: #dbf3fa; }
.m-fav-mark { margin-left: auto; color: #8e1167; width: 1em; height: 1em; }
.m-calm-player { text-align: center; }
.m-calm-player .m-card-head { text-align: left; }
.m-calm-step { font-size: var(--step-2); font-family: var(--font-display); line-height: 1.35; margin: var(--space-3) auto; max-width: 30ch; }
.m-calm-player .btn-row { justify-content: center; }
.m-breathe.big { width: 200px; height: 200px; margin: 0 auto; position: relative; }
.m-breathe.big .m-breathe-circle { position: absolute; inset: 30px; --pa: #2f8f8a; }
.m-breathe.big .m-breathe-circle[data-phase="0"], .m-breathe.big .m-breathe-circle[data-phase="1"] { transform: scale(1.35); }

/* emergency plan */
.m-sos-lead { font-size: var(--step-1); font-weight: 700; margin: 0; }
.m-sos-lead a { color: #8a1013; font-weight: 900; }
.m-call-grid { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.m-call-grid li { margin: 0; max-width: none; }
.m-call-grid a { display: flex; align-items: center; gap: .6em; min-height: 60px; padding: .5em .8em; border-radius: 12px; background: #fce2e2; color: #6b0d10; text-decoration: none; border: 2px solid #efb3b3; }
.m-call-grid a:hover { border-color: #a3171b; }
.m-call-grid a .icon { width: 1.5rem; height: 1.5rem; flex: none; }
.m-call-grid a span { display: flex; flex-direction: column; font-size: var(--step--1); font-weight: 700; }
.m-call-grid strong { font-size: var(--step-1); }
.m-bag { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.m-bag li { margin: 0; max-width: none; display: flex; gap: 6px; align-items: center; }
.m-bag li .check { flex: 1; padding: .45em .7em; }
.m-proc-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); align-items: start; }
.m-proc { margin: 0; max-width: none; background: #eef5fb; border-radius: 12px; }
.m-proc details { padding: .5em .8em; }
.m-proc summary { display: flex; gap: .5em; align-items: center; font-weight: 800; cursor: pointer; min-height: 40px; }
.m-proc summary .icon { color: #0b5f96; }
/* Emergency plan (draft 11, E): pictures on sections and steps, my own sections, the behaviour page */
.em-pic { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #fffdf7; border: 2px solid #23180f; overflow: hidden; color: #0b5f96; }
.em-pic .icon { width: 20px; height: 20px; }
.em-pic.is-art svg { width: 100%; height: 100%; }
img.em-pic { object-fit: cover; }
.em-pic.is-sec { width: 44px; height: 44px; }
.em-pic.is-step { width: 40px; height: 40px; }
.em-steps { list-style: none; margin: .5em 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: es; }
.em-steps li { counter-increment: es; display: flex; align-items: center; gap: 8px; margin: 0; max-width: none; padding: 4px 6px; border-radius: 10px; background: #fffdf7; }
.em-steps li > span:not(.em-pic)::before { content: counter(es) ". "; font-weight: 800; }
.em-steps li > span:not(.em-pic) { flex: 1; }
.em-pic-btn { flex: none; opacity: .7; } .em-pic-btn:hover, .em-pic-btn:focus-visible { opacity: 1; }
.em-sec.is-mine { background: #f2ecfb; }
.em-sec.is-hidden { opacity: .7; }
.em-sec { display: flex; align-items: flex-start; }
.em-sec > details { flex: 1; min-width: 0; }
.em-grip { flex: none; padding: .55em 0 0 .45em; }
.em-sec-text { margin: .5em 0 0; }
.em-sec-call { margin: .5em 0 0; display: flex; gap: .35em; align-items: center; }
.em-sec-btns { margin-top: .5em; }
.em-bh-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.em-bh-read { display: grid; gap: 8px; margin: 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.em-bh-read div { background: #f2ecfb; border-radius: 12px; padding: .5em .8em; } .em-bh-read dt { font-weight: 800; } .em-bh-read dd { margin: 0; }
.em-ps-sec h3 { display: flex; align-items: center; gap: 6px; }
.em-pic.is-print { width: 28px; height: 28px; } .em-pic.is-print-step { width: 22px; height: 22px; vertical-align: middle; border-width: 1px; }
.em-ps-steps li { margin-bottom: 4px; }
.m-proc ol { margin: .4em 0 .2em; padding-left: 1.3em; display: grid; gap: 4px; }
.m-emergency.is-easy .m-proc ol, .m-emergency.is-easy .m-ticks { font-size: var(--step-1); }
.m-emergency.is-easy .m-proc summary { font-size: var(--step-1); }
.m-emergency.is-easy .m-proc summary .icon { width: 1.8rem; height: 1.8rem; }
.m-emergency.is-easy .m-proc-grid { grid-template-columns: minmax(0, 1fr); }

/* IPP */
.m-ipp-goals { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.m-ipp-goals li { margin: 0; max-width: none; background: color-mix(in srgb, var(--ac) 9%, #fffdf7); border-radius: 14px; padding: var(--space-3) var(--space-4); border-top: 5px solid var(--ac); display: flex; flex-direction: column; gap: .4em; }
.m-ipp-goals p { margin: 0; }
.ig-area { display: inline-flex; gap: .35em; align-items: center; font-weight: 800; font-size: var(--step--1); color: color-mix(in srgb, var(--ac) 80%, #000); }
.ig-goal { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }
.m-step-add { flex-wrap: wrap; }
.m-step-add input:first-of-type { flex: 2 1 14rem; }
.m-step-add input { flex: 1 1 8rem; }

/* spending plan */
.m-spend-grid { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr); align-items: start; }
@media (max-width: 1000px) { .m-spend-grid { grid-template-columns: minmax(0, 1fr); } }
.m-spend-sum { position: sticky; top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
@media (max-width: 1000px) { .m-spend-sum { position: static; } }
.m-plan-lines { display: grid; gap: var(--space-3); }
.m-plan-line { margin: 0; padding: var(--space-3); border-radius: 14px; background: #fff7ef; border: 1.5px solid #f1d7bd; display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.m-plan-line .pl-svc { grid-column: 1 / -1; }
.pl-total { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .3em 1em; }
.pl-total [data-total] { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }
.m-cat-sum { display: flex; flex-direction: column; gap: 4px; }
.cs-row { display: flex; justify-content: space-between; gap: 1em; font-weight: 700; }

/* social and ideas */
.m-mini-dl { margin: 0; display: grid; gap: 4px; font-size: var(--step--1); }
.m-mini-dl div { display: grid; grid-template-columns: 4em minmax(0, 1fr); gap: .5em; }
.m-mini-dl dt { font-weight: 800; }
.m-mini-dl dd { margin: 0; }
.m-social-item .li-title, .m-ideas .li-title { font-size: var(--step-0); }
.m-lib-item.is-spot { box-shadow: 0 0 0 4px #c97a1c, var(--shadow-lift); }
.m-source { display: flex; gap: .5em; align-items: flex-start; }
.m-source .icon { flex: none; margin-top: .2em; }

/* note helper */
.m-pairs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.m-pairs li { margin: 0; max-width: none; display: grid; gap: 4px; }
.m-pairs p { margin: 0; display: flex; gap: .5em; align-items: flex-start; padding: .5em .8em; border-radius: 10px; }
.m-pairs .icon { flex: none; margin-top: .2em; }
.pr-good { background: #e9f5da; }
.pr-good .icon { color: #1f6a2a; }
.pr-bad { background: #fdf0f0; color: #47372a; }
.pr-bad .icon { color: #a3171b; }

/* ---------- office ---------- */
.m-office { max-width: 60rem; }
.m-office.is-wide { max-width: 72rem; display: flex; flex-direction: column; gap: var(--space-5); }
.m-office .m-preview-note { margin: 0; }
.m-office-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-office-list li { margin: 0; max-width: none; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; background: #faf4e8; border-radius: 12px; padding: .6em .8em; }
.m-office-list li.is-archived { opacity: .7; }
.od-chip { width: 2.6em; height: 2.6em; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--dc); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .4); }
.od-main { display: flex; flex-direction: column; flex: 1 1 12rem; min-width: 0; }
.od-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.m-tool-head .m-tag, .m-lib-item .m-tag { text-transform: none; }
.m-prn > .btn { align-self: flex-start; }
.m-tool-actions [data-pin][aria-pressed="true"] { background: #fff3b0; color: #23180f; border-color: #23180f; box-shadow: inset 0 0 0 1px #23180f; }
/* checkboxes inside dashboard lists stay light and compact */
.m-agenda .check, .m-dose-list .check { padding: .15em .3em; border: 0; background: transparent; gap: .5em; }
.m-agenda .check:has(input:checked), .m-dose-list .check:has(input:checked) { background: transparent; }
.m-dose-list li { background: #faf4e8; border-radius: 10px; padding: .3em .4em; }

/* ==========================================================================
   Draft 8: header tools, motion, weather crests, My day, choice board,
   medicine photos, incident notes, Aurora look
   ========================================================================== */
/* Header: My style, Settings and Close as compact buttons */
.m-head-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.m-head-btn, .m-close { display: inline-flex; align-items: center; gap: .4em; }
.m-head-btn[aria-current="page"] { background: #23180f; color: #fffdf7; }
@media (max-width: 700px) { .m-head-btn span, .m-close span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .m-head-btn, .m-close { padding: .55em .7em; } .m-head-btn .icon, .m-close .icon { width: 1.3em; height: 1.3em; } }

/* Tabs: six, evenly spread, with a sliding feel */
.m-tabs a { transition: background-color .18s ease, transform .18s ease, border-color .18s ease; }
.m-tabs a:hover { transform: translateY(-2px); }
.m-tabs a:active { transform: translateY(0) scale(.98); }
.m-tabs a[aria-current="page"] .icon { transform: scale(1.12); }
.m-tabs a .icon { transition: transform .25s cubic-bezier(.2, .9, .3, 1.3); }

/* Views and panels settle in */
@keyframes m-view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes m-panel-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.m-view.is-in > * { animation: m-view-in .26s ease-out both; }
.m-grid:not(.is-arranging) .m-panel { animation: m-panel-in .42s cubic-bezier(.2, .9, .3, 1.05) both; animation-delay: calc(min(var(--n, 0), 9) * 45ms); }
.m-panel { transition: box-shadow .2s ease, transform .2s ease; }
.m-grid:not(.is-arranging) .m-panel:hover { box-shadow: 0 2px 3px rgba(60, 40, 20, .1), 0 14px 30px -14px rgba(60, 40, 20, .45); }
.btn, .icon-btn, .m-choice-card, .m-status-btn { transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease; }
.btn:active, .icon-btn:active, .m-status-btn:active { transform: translateY(1px) scale(.97); }
.m-panel-more .icon { transition: transform .2s ease; }
.m-panel-more:hover .icon { transform: translateX(3px); }

/* Weather panel */
.wx-panel { display: flex; flex-direction: column; gap: var(--space-3); }
.wx-date { margin: 0; display: flex; flex-wrap: wrap; gap: .3em 1em; align-items: baseline; }
.wx-sun-line { display: inline-flex; align-items: center; gap: .35em; font-size: var(--step--1); color: #47372a; }
.wx-sun-line .icon { width: 1.1em; height: 1.1em; }
.wx-today { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; }
.wx-today .wx-crest { flex: none; filter: drop-shadow(0 3px 4px rgba(40, 30, 20, .22)); }
.wx-today-text { flex: 1 1 14rem; min-width: 0; }
.wx-today-kind { margin: 0; font-family: var(--font-display, "Fraunces", Georgia, serif); font-size: var(--step-2); font-weight: 700; line-height: 1.15; }
.wx-today-temps { margin: .15em 0 0; font-size: var(--step-1); }
.wx-today-temps b { font-weight: 800; }
.wx-pop { margin: .25em 0 0; font-weight: 700; color: #1b5ca2; }
.wx-detail { margin: .35em 0 0; font-size: var(--step--1); color: #47372a; }
.wx-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.wx-day { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; }
.wx-day-name { font-size: var(--step--2); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #47372a; }
.wx-day-temps { font-size: var(--step--1); display: flex; gap: .4em; }
.wx-day-temps b { font-weight: 800; }
.wx-day-temps span { color: #5a4836; }
.wx-day .wx-crest { width: 100%; height: auto; max-width: 72px; }
.wx-foot { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5em; font-size: var(--step--1); }
.wx-city { padding: .3em .6em; border-radius: 8px; border: 1.5px solid #c9b791; background: #fff; color: #23180f; font: inherit; font-size: var(--step--1); max-width: 14rem; }
.wx-crest .wx-arc { font-family: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif; }
.wx-loading { display: flex; align-items: center; gap: .4em; margin: 0; }
.wx-loading .icon { animation: m-float 1.6s ease-in-out infinite; }
@keyframes m-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (max-width: 520px) { .wx-week { grid-template-columns: repeat(3, minmax(0, 1fr)); } .wx-today { justify-content: center; text-align: center; } }
/* the crests breathe: rays turn, clouds drift, rain falls */
.wx-crest .wx-rays { animation: wx-turn 90s linear infinite; }
@keyframes wx-turn { to { transform: rotate(360deg); } }
.wx-crest .wx-drift { animation: wx-drift 9s ease-in-out infinite; }
.wx-crest .wx-drift-slow { animation: wx-drift 14s ease-in-out infinite reverse; }
@keyframes wx-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
.wx-crest .wx-rain { stroke-dasharray: 6 5; animation: wx-rain 1.1s linear infinite; }
@keyframes wx-rain { to { stroke-dashoffset: -11; } }
.wx-crest .wx-bolt { animation: wx-flash 4s ease-in-out infinite; }
@keyframes wx-flash { 0%, 88%, 100% { opacity: 1; } 92% { opacity: .2; } 96% { opacity: 1; } }
.wx-crest .wx-waves { animation: wx-waves 5s ease-in-out infinite; }
@keyframes wx-waves { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-2px); } }
.wx-crest .wx-stars { animation: wx-twinkle 3.2s ease-in-out infinite; }
@keyframes wx-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
:root[data-drawer-dark="yes"] .wx-crest { --wx-paper: #fffdf7; }

/* My day: big cards in a row */
.m-day-strip { list-style: none; margin: 0; padding: 4px 2px 8px; display: flex; gap: var(--space-3); overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.m-day-card { --k: var(--m-accent); position: relative; flex: 0 0 11.5rem; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35em; padding: var(--space-4) var(--space-3) var(--space-3); border-radius: 16px; background: #fffdf7; color: #23180f; border: 2px solid color-mix(in srgb, var(--k) 45%, #fffdf7); box-shadow: var(--shadow); min-height: 11rem; transition: transform .2s ease, box-shadow .2s ease; }
.m-day-card.is-now { border-color: var(--k); box-shadow: 0 0 0 4px color-mix(in srgb, var(--k) 25%, transparent), var(--shadow); transform: translateY(-3px); }
.m-day-card.is-done { opacity: .72; }
.m-day-card.is-done .m-day-title { text-decoration: line-through; text-decoration-thickness: 2px; }
.m-day-flag { position: absolute; top: -.75em; left: 50%; transform: translateX(-50%); background: var(--k); color: #fff; font-weight: 800; font-size: var(--step--2); letter-spacing: .06em; text-transform: uppercase; padding: .2em .7em; border-radius: 999px; }
.m-day-flag.is-next { background: #fffdf7; color: #23180f; border: 2px solid var(--k); }
.m-day-ico { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--k) 18%, #fffdf7); color: var(--k); }
.m-day-ico .icon { width: 36px; height: 36px; }
.m-day-time { font-weight: 800; font-size: var(--step--1); }
.m-day-title { font-weight: 700; font-size: var(--step-0); line-height: 1.25; }
.m-day-place { color: #47372a; display: inline-flex; align-items: center; gap: .3em; }
.m-day-check { margin-top: auto; }
:root[data-drawer-dark="yes"] .m-day-flag.is-next { color: #23180f; }

/* My choice board */
.m-choice-mini { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 8px; }
.m-choice-btn, .m-choice-card { --cc: #2f6f9d; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3em; width: 100%; min-height: 5.2rem; padding: .6em .4em; border: 0; border-radius: 14px; background: var(--cc); color: #fff; font: inherit; font-weight: 800; font-size: var(--step--1); line-height: 1.15; cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .18), var(--shadow); text-align: center; }
.m-choice-btn .icon, .m-choice-card .icon { width: 1.9em; height: 1.9em; }
.m-choice-btn:hover, .m-choice-card:hover { transform: translateY(-2px); filter: brightness(1.06); }
.m-choice-btn:focus-visible, .m-choice-card:focus-visible { outline: 3px solid #23180f; outline-offset: 3px; }
.m-choice-btn.is-pressed, .m-choice-card.is-pressed { animation: m-pressed .35s ease; }
@keyframes m-pressed { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
.m-choice-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: var(--space-3); }
.m-choice-grid.is-big { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.m-choice-grid.is-big .m-choice-card { min-height: 9rem; font-size: var(--step-1); }
.m-choice-grid.is-big .m-choice-card .icon { width: 2.6em; height: 2.6em; }
.m-choice-grid .m-choice-card { min-height: 7rem; font-size: var(--step-0); border-radius: 18px; }
.m-choice-grid li { display: flex; flex-direction: column; gap: 6px; }
.m-choice-tools { display: flex; justify-content: center; gap: 4px; }
.m-choice-big { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(20, 14, 10, .55); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.m-choice-big.is-on { opacity: 1; pointer-events: auto; }
.m-choice-big-card { --cc: #2f6f9d; display: flex; flex-direction: column; align-items: center; gap: .3em; padding: 1.2em 1.6em; border-radius: 28px; background: var(--cc); font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; line-height: 1.1; text-align: center; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); animation: m-pop-in .3s cubic-bezier(.2, .9, .3, 1.3); max-width: min(90vw, 36rem); }
.m-choice-big-card .icon { width: 1.4em; height: 1.4em; }
@keyframes m-pop-in { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Medicine photos */
.m-med-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #f3ebdc; border: 1.5px solid #e1d3b6; display: inline-grid; place-items: center; vertical-align: middle; color: #8a6440; flex: none; }
.m-med-thumb.sm { width: 34px; height: 34px; border-radius: 8px; margin-right: .5em; }
.m-med-thumb.lg { width: 64px; height: 64px; border-radius: 12px; }
.m-med-thumb.is-empty .icon { width: 55%; height: 55%; }
.m-med-thumb-btn { border: 0; background: none; padding: 0; cursor: zoom-in; border-radius: 10px; line-height: 0; display: inline-block; vertical-align: middle; margin-right: .5em; }
.m-med-thumb-btn:focus-visible { outline: 3px solid #29298e; outline-offset: 2px; }
.m-med-thumb-btn:hover img { transform: scale(1.06); }
.m-med-thumb-btn img { transition: transform .15s ease; margin: 0; }
.mm-top { display: flex; gap: var(--space-3); align-items: flex-start; }
.dr-name { display: inline-flex; align-items: center; gap: .2em; }
.m-med-rowhead { display: inline-flex; align-items: center; gap: .2em; }
.m-med-figure { margin: 0; text-align: center; }
.m-med-figure img { max-width: min(100%, 520px); max-height: 60vh; border-radius: 14px; border: 1px solid #e1d3b6; }
.m-med-figure figcaption { margin-top: .5em; color: #47372a; }
.m-pic-row { display: flex; gap: var(--space-4); align-items: flex-start; flex-wrap: wrap; }
.m-pic-row .m-pic-preview img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 1.5px solid #e1d3b6; }
.ps-thumb { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; vertical-align: middle; border: 1px solid #ccc; }
.ps-pill { display: inline-block; vertical-align: middle; } .ps-pill .pill, .ps-fill-list .pill { vertical-align: middle; }
.ps-wide { max-width: none; }
.ps-fill td { vertical-align: top; padding: 4px; } .ps-fill th { font-size: 12px; }
.ps-fill-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; } .ps-fill-list li { display: flex; gap: 4px; align-items: flex-start; font-size: 11px; line-height: 1.15; } .ps-fill-list small { color: #555; }
.ps-dash { color: #aaa; }
@media print { .ps-wide { font-size: 11px; } }
.m-dose-list .m-med-thumb.sm { width: 28px; height: 28px; margin-right: .4em; }

/* Handoff from the staff app, incident flags */
.m-handoff { display: flex; gap: .5em; align-items: center; background: #e6f3ea; color: #0d3b2a; border-radius: 10px; padding: .55em .9em; margin: 0 0 var(--space-4); }
.m-flag.is-incident { background: #fce2e2; color: #7a1010; }
.ps-sign { margin-top: 2.5em; }
.ps-table { width: 100%; border-collapse: collapse; margin-top: 1em; }
.ps-table th { text-align: left; width: 28%; vertical-align: top; padding: .45em .6em; border-bottom: 1px solid #ddd; }
.ps-table td { padding: .45em .6em; border-bottom: 1px solid #ddd; vertical-align: top; }

/* Plan pictures */
.m-pick-plan { max-height: 11rem; }

/* Aurora: a glassy, glowing look (panels stay light so words stay easy to read) */
:root[data-drawer-mood="aurora"] body { background-color: #121a30 !important; background-image: radial-gradient(60% 50% at 10% 10%, rgba(31, 143, 132, .55), transparent 60%), radial-gradient(50% 45% at 90% 20%, rgba(122, 79, 209, .5), transparent 60%), radial-gradient(60% 50% at 50% 100%, rgba(31, 143, 132, .35), transparent 60%) !important; background-attachment: fixed !important; }
:root[data-drawer-mood="aurora"] body::after { content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none; background: conic-gradient(from 0deg at 50% 50%, rgba(126, 232, 216, .14), rgba(196, 140, 255, .14), rgba(255, 209, 102, .1), rgba(126, 232, 216, .14)); filter: blur(60px); animation: m-aurora 24s linear infinite; }
@keyframes m-aurora { to { transform: rotate(360deg); } }
:root[data-drawer-glass="yes"] .m-panel, :root[data-drawer-glass="yes"] .m-card, :root[data-drawer-glass="yes"] .m-sheet, :root[data-drawer-glass="yes"] .m-home-bar, :root[data-drawer-glass="yes"] .m-tabs, :root[data-drawer-glass="yes"] .m-tour { background-color: rgba(255, 253, 247, .9); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 20px 40px -24px rgba(0, 0, 0, .7); }
:root[data-drawer-glass="yes"] .m-panel { border-top-color: color-mix(in srgb, var(--pa) 70%, #fff); box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 0 24px -6px color-mix(in srgb, var(--pa) 50%, transparent), 0 20px 40px -24px rgba(0, 0, 0, .7); }
.mood-aurora { background: linear-gradient(135deg, #121a30, #1f8f84 60%, #7a4fd1) !important; }

/* Less movement: stop every animation added in draft 8 */
@media (prefers-reduced-motion: reduce) {
  .m-view.is-in > *, .m-grid:not(.is-arranging) .m-panel, .wx-crest .wx-rays, .wx-crest .wx-drift, .wx-crest .wx-drift-slow, .wx-crest .wx-rain, .wx-crest .wx-bolt, .wx-crest .wx-waves, .wx-crest .wx-stars, .wx-loading .icon, .m-choice-big-card, :root[data-drawer-mood="aurora"] body::after { animation: none !important; }
  .m-tabs a, .m-panel, .btn, .m-choice-card, .m-choice-btn, .m-day-card { transition: none !important; }
  .m-tabs a:hover, .m-choice-card:hover, .m-choice-btn:hover { transform: none; }
}
:root[data-motion="reduce"] .m-view.is-in > *, :root[data-motion="reduce"] .m-grid:not(.is-arranging) .m-panel, :root[data-motion="reduce"] .wx-crest *, :root[data-motion="reduce"] .wx-loading .icon, :root[data-motion="reduce"] .m-choice-big-card { animation: none !important; }
:root[data-motion="reduce"] .m-tabs a, :root[data-motion="reduce"] .m-panel, :root[data-motion="reduce"] .btn, :root[data-motion="reduce"] .m-choice-card, :root[data-motion="reduce"] .m-day-card { transition: none !important; }
:root[data-motion="reduce"][data-drawer-mood="aurora"] body::after { animation: none !important; }
:root[data-look="simple"] .wx-crest .wx-rays, :root[data-look="simple"] .wx-crest .wx-drift, :root[data-look="simple"] .wx-crest .wx-rain { animation: none !important; }
:root[data-contrast="high"] .m-choice-btn, :root[data-contrast="high"] .m-choice-card { border: 2px solid #000; }

/* Office tabs */
.m-office-tabs { margin-bottom: var(--space-4); }
.m-office-tab { display: flex; flex-direction: column; gap: var(--space-4); }
.m-loading-inline { display: flex; align-items: center; gap: .4em; }
.m-loading-inline .icon { animation: m-spin 1.2s linear infinite; }
.s-live-line { background: #e6f3ea; color: #0d3b2a; border-radius: 10px; padding: .55em .9em; display: flex; gap: .5em; align-items: flex-start; flex-wrap: wrap; }
.s-filter { display: inline-flex; align-items: center; gap: .4em; font-weight: 700; }
.s-filter select { padding: .3em .6em; border-radius: 8px; border: 1.5px solid #c9b791; background: #fff; color: #23180f; font: inherit; }
.m-office .m-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); margin: 0 0 var(--space-3); }

/* ---------- Draft 9 fixes and comfort ---------- */
/* Hidden radios stay inside their chip, so picking a picture never adds blank space to a dialog */
.m-pick-grid, .m-pick-scroll, .m-chip-pick, .m-swatch-pick, .m-pattern-pick, .m-mood-pick { position: relative; }
.m-pick input:is([type="radio"], [type="checkbox"]) { inset: 0; margin: 0; }
.m-pick-plan { max-height: none; overflow: visible; }
/* Big, easy click areas: a panel with one destination is clickable all over */
.m-panel:has(.m-stretch):not([draggable="true"]) { cursor: pointer; }
.m-panel:not([draggable="true"]) .m-stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.m-panel:not([draggable="true"]):has(.m-stretch):hover { transform: translateY(-3px); box-shadow: 0 2px 2px rgba(70,45,20,.14), 0 22px 36px -18px rgba(70,45,20,.55); }
.m-panel:has(.m-stretch:focus-visible) { outline: 3px solid #29298e; outline-offset: 3px; }
.m-panel .m-panel-more { position: relative; z-index: 2; padding: .5em .7em; margin: -.5em -.4em -.5em auto; border-radius: 10px; }
.m-panel .m-panel-more:hover { background: rgba(0,0,0,.05); }
.m-shelf a { min-height: 56px; padding: .7em .9em; }
.m-shelf a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.m-agenda a, .m-day-card a { display: block; }
@media (prefers-reduced-motion: reduce) { .m-panel:has(.m-stretch):hover, .m-shelf a:hover { transform: none; } }

/* ---------- Draft 9: bold "room" looks (dark first) ---------- */
:root[data-drawer-mood="quest"] body { background-color: #14231a !important; background-image: radial-gradient(55% 45% at 15% 10%, rgba(201, 162, 39, .35), transparent 60%), radial-gradient(50% 50% at 85% 85%, rgba(47, 125, 79, .55), transparent 65%), linear-gradient(180deg, #14231a, #0d1711) !important; background-attachment: fixed; }
:root[data-drawer-mood="starship"] body { background-color: #0b1022 !important; background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 70% 60%, #cfe 50%, transparent 51%), radial-gradient(1.5px 1.5px at 40% 80%, #fff 50%, transparent 51%), radial-gradient(60% 50% at 90% 0%, rgba(224, 64, 251, .4), transparent 60%), radial-gradient(60% 50% at 0% 100%, rgba(34, 195, 230, .4), transparent 60%) !important; background-size: 240px 240px, 300px 300px, 360px 360px, auto, auto; background-attachment: fixed; }
:root[data-drawer-mood="romance"] body { background-color: #2a1420 !important; background-image: radial-gradient(55% 45% at 10% 15%, rgba(214, 51, 108, .5), transparent 60%), radial-gradient(45% 45% at 90% 80%, rgba(244, 162, 97, .4), transparent 60%) !important; background-attachment: fixed; }
:root[data-drawer-mood="spooky"] body { background-color: #160f1f !important; background-image: radial-gradient(18% 18% at 85% 12%, rgba(255, 236, 179, .55), rgba(255, 236, 179, .12) 45%, transparent 70%), radial-gradient(60% 50% at 0% 100%, rgba(255, 140, 26, .3), transparent 60%), radial-gradient(50% 45% at 50% 50%, rgba(142, 68, 173, .3), transparent 70%) !important; background-attachment: fixed; }
:root[data-drawer-mood="winter"] body { background-color: #101c2c !important; background-image: radial-gradient(2px 2px at 10% 20%, rgba(255,255,255,.8) 50%, transparent 51%), radial-gradient(2px 2px at 60% 40%, rgba(255,255,255,.6) 50%, transparent 51%), radial-gradient(1.5px 1.5px at 80% 75%, rgba(255,255,255,.7) 50%, transparent 51%), radial-gradient(70% 50% at 50% 0%, rgba(111, 183, 232, .35), transparent 60%) !important; background-size: 180px 180px, 260px 260px, 220px 220px, auto; background-attachment: fixed; animation: m-snow 30s linear infinite; }
@keyframes m-snow { to { background-position: 0 180px, 0 260px, 0 220px, 0 0; } }
:root[data-motion="reduce"][data-drawer-mood="winter"] body { animation: none; }
@media (prefers-reduced-motion: reduce) { :root[data-drawer-mood="winter"] body { animation: none; } }
.mood-quest { background: linear-gradient(135deg, #14231a, #2f7d4f 60%, #c9a227) !important; }
.mood-starship { background: linear-gradient(135deg, #0b1022, #22c3e6 60%, #e040fb) !important; }
.mood-romance { background: linear-gradient(135deg, #2a1420, #d6336c 60%, #f4a261) !important; }
.mood-spooky { background: linear-gradient(135deg, #160f1f, #8e44ad 55%, #ff8c1a) !important; }
.mood-winter { background: linear-gradient(135deg, #101c2c, #6fb7e8 60%, #e9f3fb) !important; }

/* Cleaner home bar: a quiet row of tools, not a separate card */
/* The home bar is just a row of toy buttons over the world: no box, no board, no border (draft 10, item 13) */
.m-home-bar { background: transparent !important; box-shadow: none !important; backdrop-filter: none !important; border: 0 !important; padding: 0 !important; justify-content: flex-end; gap: 8px; }
.m-home-bar .btn-row { gap: 8px; }
/* the ½ and ⅓ view switch (phones): three small buttons in the home bar */
.zoom-seg { border-radius: 999px; border-width: 2px; }
.zoom-seg button { min-height: 36px; padding: .2em .7em; gap: .25em; font-size: 15px; }
.zoom-seg button .icon { width: 1.05em; height: 1.05em; }
.m-home-bar .btn { background: #fffdf7; color: #23180f; }
.m-home-bar .btn:hover { background: #fff3c4; color: #23180f; }
.m-music-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 8px; margin-bottom: var(--space-4); }
.m-music-pick { position: relative; display: block; }
.m-music-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.m-music-pick > span { display: grid; grid-template-columns: auto 1fr; column-gap: .6em; align-items: center; padding: .7em .8em; border-radius: 14px; border: 2px solid #dcc8a6; background: #fffaf0; color: #23180f; cursor: pointer; height: 100%; transition: transform .15s ease; }
.m-music-pick > span .icon { grid-row: span 2; width: 28px; height: 28px; color: #5a4836; }
.m-music-pick > span small { color: #47372a; line-height: 1.3; }
.m-music-pick input:checked + span { background: #23180f; color: #fffdf7; border-color: #23180f; }
.m-music-pick input:checked + span small, .m-music-pick input:checked + span .icon { color: #ffd25c; }
.m-music-pick input:focus-visible + span { outline: 3px solid #29298e; outline-offset: 3px; }
.m-music-pick:hover > span { transform: translateY(-2px); }
[data-music][aria-pressed="true"] .icon { animation: s-pulse 2s ease-in-out infinite; }
@keyframes s-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { [data-music][aria-pressed="true"] .icon { animation: none; } }
/* Habit tracker */
.m-habit-score { margin: 0; font-size: var(--step-1); display: flex; align-items: center; gap: .4em; }
.m-habit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.m-habit { display: grid; grid-template-columns: auto auto minmax(8rem, 1fr) auto auto; align-items: center; gap: .7em; padding: .7em .9em; border-radius: 16px; background: #fffdf7; color: #23180f; box-shadow: var(--shadow); border-left: 8px solid var(--hc); max-width: none; transition: transform .15s ease, box-shadow .15s ease; }
.m-habit.is-dragging { opacity: .5; } .m-habit.is-over { box-shadow: 0 0 0 3px var(--hc), var(--shadow); }
.m-habit-grip { cursor: grab; color: #8a7a68; }
.m-habit-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--hc); color: #fff; }
.m-habit-main h2 { font-size: var(--step-1); margin: 0; }
.m-habit-main p { margin: 0; color: #5a4836; display: flex; align-items: center; gap: .3em; }
.m-habit-days { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.m-habit-days li { margin: 0; }
.m-habit-day { width: 44px; height: 52px; border-radius: 12px; border: 2px solid color-mix(in srgb, var(--hc) 45%, #e4dccd); background: #fff; color: #47372a; font: inherit; font-weight: 800; font-size: var(--step--1); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; transition: transform .12s ease; }
.m-habit-day .icon { width: 18px; height: 18px; }
.m-habit-day.is-today { box-shadow: 0 0 0 2px #23180f inset; }
.m-habit-day.is-done { background: var(--hc); border-color: var(--hc); color: #fff; }
.m-habit-day:hover { transform: translateY(-2px); }
.m-habit-day:focus-visible { outline: 3px solid #29298e; outline-offset: 2px; }
.m-habit-move { display: flex; gap: 2px; }
@media (max-width: 760px) { .m-habit { grid-template-columns: auto minmax(0, 1fr) auto; } .m-habit-grip { display: none; } .m-habit-days { grid-column: 1 / -1; justify-content: space-between; } .m-habit-move { grid-column: 3; grid-row: 1; } }
@media (prefers-reduced-motion: reduce) { .m-habit-day:hover { transform: none; } }

/* ---------- My mini arcade ---------- */
.arc-cabinet { --neon1: #22e6ff; --neon2: #ff4fd8; max-width: 920px; margin: 0 auto; padding: 18px 18px 14px; border-radius: 28px 28px 18px 18px; background: linear-gradient(180deg, #2b1a5c, #160d33 60%, #0d0822); box-shadow: 0 0 0 4px #3d2a7a, 0 0 0 7px #120a2a, 0 30px 60px -20px rgba(20, 0, 60, .8), inset 0 2px 0 rgba(255,255,255,.15); color: #f3edff; display: flex; flex-direction: column; gap: 14px; }
.arc-marquee { text-align: center; font-weight: 900; letter-spacing: .25em; font-size: clamp(1rem, .8rem + 1vw, 1.5rem); padding: .5em; border-radius: 14px; background: linear-gradient(90deg, #ff4fd8, #7b45c4, #22e6ff); color: #fff; text-shadow: 0 0 8px rgba(255,255,255,.8); display: flex; justify-content: center; align-items: center; gap: .6em; animation: arc-glow 3s ease-in-out infinite; }
@keyframes arc-glow { 0%, 100% { box-shadow: 0 0 14px rgba(255, 79, 216, .6); } 50% { box-shadow: 0 0 26px rgba(34, 230, 255, .8); } }
.arc-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.arc-game { display: grid; grid-template-columns: auto 1fr; column-gap: .6em; align-items: center; text-align: left; padding: .7em 1em; border-radius: 14px; border: 2px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #f3edff; font: inherit; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.arc-game .icon { grid-row: span 2; width: 30px; height: 30px; color: var(--neon1); }
.arc-game small { color: #cfc4f0; }
.arc-game.is-on { background: rgba(34, 230, 255, .16); border-color: var(--neon1); box-shadow: 0 0 16px rgba(34, 230, 255, .5); }
.arc-game:hover { transform: translateY(-2px); }
.arc-game:focus-visible, .arc-pad button:focus-visible, .arc-start:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.arc-screen { position: relative; border-radius: 16px; overflow: hidden; border: 6px solid #05030f; box-shadow: inset 0 0 40px rgba(0,0,0,.8), 0 0 0 2px #3d2a7a; background: #070a1f; }
.arc-screen canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; touch-action: none; }
.arc-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, rgba(255,255,255,.035) 0 2px, transparent 2px 4px); }
.arc-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(7, 10, 31, .72); text-align: center; padding: 1rem; z-index: 1; }
.arc-overlay[hidden] { display: none; }
.arc-overlay p { margin: 0; font-size: var(--step-1); font-weight: 800; color: #fff; max-width: 32ch; }
.arc-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.arc-pad { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.arc-pad.p2 { justify-content: flex-end; }
.arc-who { font-weight: 900; width: 100%; font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase; }
.arc-pad.p1 .arc-who { color: var(--neon1); } .arc-pad.p2 .arc-who { color: var(--neon2); text-align: right; }
.arc-pad button { width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: #120a2a; box-shadow: 0 6px 0 rgba(0,0,0,.45), inset 0 -4px 0 rgba(0,0,0,.2); touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .06s ease, box-shadow .06s ease; }
.arc-pad.p1 button { background: radial-gradient(circle at 35% 30%, #b9f6ff, var(--neon1)); }
.arc-pad.p2 button { background: radial-gradient(circle at 35% 30%, #ffd1f4, var(--neon2)); }
.arc-pad button:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0,0,0,.45); }
.arc-pad button .icon { width: 30px; height: 30px; }
.arc-keys { font-size: var(--step--1); color: #cfc4f0; font-weight: 700; }
.arc-score { font-family: ui-monospace, monospace; font-weight: 900; font-size: var(--step-2); padding: .3em .8em; border-radius: 12px; background: #05030f; color: #ffd25c; text-shadow: 0 0 8px rgba(255, 210, 92, .7); white-space: nowrap; }
.arc-best { margin: 0; text-align: center; color: #cfc4f0; }
.arc-pad-note { margin: 6px 0 0; color: #d9d9e4; text-align: center; display: flex; align-items: center; justify-content: center; gap: .4em; flex-wrap: wrap; }
.arc-keys .pg, .arc-lanes .pg, .arc-pad-note .pg { width: 22px; height: 22px; vertical-align: middle; max-width: none; }
.arc-keys small { font-weight: 600; opacity: .85; }
/* Shelf Hero (draft 10): a song picker on the overlay, four lane pads per player */
.arc-songs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 10px; }
.arc-songs label { font-weight: 800; color: #fff; }
.arc-songs select { min-height: 44px; max-width: 260px; border-radius: 10px; border: 2px solid #23180f; background: #fffdf7; color: #23180f; font: inherit; font-weight: 700; padding: 0 .6em; }
.arc-songs .btn { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.08); }
.arc-lanepads { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 12px; }
.arc-lanepads[hidden], .arc-controls[hidden] { display: none; }
.arc-lanes { display: flex; gap: 6px; }
.arc-lanes.p2 { justify-content: flex-end; }
.arc-lanes button { width: 56px; height: 56px; border-radius: 14px; border: 0; background: radial-gradient(circle at 35% 30%, #fff 0, var(--lc, #22e6ff) 60%); color: #07061a; font: 900 20px/1 system-ui, sans-serif; box-shadow: 0 5px 0 rgba(0,0,0,.45); cursor: pointer; touch-action: none; }
.arc-lanes button:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.45); }
.arc-lanes button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.arc-score-rh { font-size: var(--step-1); }
.arc-solo .arc-lanes.p2 { visibility: hidden; }
@media (max-width: 600px) { .arc-lanepads { grid-template-columns: 1fr; } .arc-lanes, .arc-lanes.p2 { justify-content: center; } .arc-lanes button { width: 52px; height: 52px; } .arc-solo .arc-lanes.p2 { display: none; } }
@media (max-width: 600px) { .arc-pick { grid-template-columns: 1fr; } .arc-controls { grid-template-columns: 1fr 1fr; } .arc-score { grid-column: 1 / -1; grid-row: 1; justify-self: center; } .arc-pad button { width: 56px; height: 56px; } }
@media (prefers-reduced-motion: reduce) { .arc-marquee { animation: none; } }
:root[data-motion="reduce"] .arc-marquee { animation: none; }
/* The arcade's dashboard panel looks like a little arcade machine */
.m-panel.type-item:has(.m-stretch[href$="/tool/arcade"]) { background: linear-gradient(180deg, #2b1a5c, #120a2a) !important; color: #f3edff; border-top-color: #ff4fd8; }
.m-panel.type-item:has(.m-stretch[href$="/tool/arcade"]) h2, .m-panel.type-item:has(.m-stretch[href$="/tool/arcade"]) p { color: #f3edff; }
.m-panel.type-item:has(.m-stretch[href$="/tool/arcade"]) .m-panel-ico { background: linear-gradient(135deg, #22e6ff, #ff4fd8); color: #120a2a; }
.m-panel.type-item:has(.m-stretch[href$="/tool/arcade"]) .btn { background: #22e6ff; color: #120a2a; border-color: #22e6ff; }
/* The bold room looks paint their own full-screen art; patterns must not tile it into squares */
:root[data-drawer-mood="quest"] body, :root[data-drawer-mood="romance"] body, :root[data-drawer-mood="spooky"] body { background-size: auto !important; }
:root[data-drawer-mood="starship"] body { background-size: 240px 240px, 300px 300px, 360px 360px, auto, auto !important; }
:root[data-drawer-mood="winter"] body { background-size: 180px 180px, 260px 260px, 220px 220px, auto !important; }
/* Drag-to-reorder grips (Today's list, My day, My shelf) */
.m-grip { flex: none; display: inline-grid; place-items: center; width: 32px; height: 40px; margin: -4px 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #8a7a68; cursor: grab; touch-action: none; }
.m-grip:hover { background: rgba(0,0,0,.06); color: #23180f; }
.m-grip:focus-visible { outline: 3px solid #29298e; outline-offset: 1px; }
.m-grip .icon { width: 20px; height: 20px; }
.is-lifted { box-shadow: 0 18px 30px -10px rgba(0,0,0,.45) !important; opacity: .95; cursor: grabbing; }
.m-sort-ph { list-style: none; border: 2px dashed #c9b791; border-radius: 12px; background: rgba(255, 243, 176, .35); }
[data-sort-id].is-dropped { animation: row-drop .4s cubic-bezier(.2,.9,.3,1.4); }
@keyframes row-drop { 0% { transform: translateY(-6px) scale(1.02); } 60% { transform: translateY(1px); } 100% { transform: none; } }
.is-sorting { touch-action: none; }
.m-agenda-row[data-sort-id] { display: grid; grid-template-columns: auto auto 1fr; align-items: center; column-gap: .5em; }
.m-agenda-row[data-sort-id] .ag-place { grid-column: 3; }
.m-shelf li[data-sort-id] { position: relative; }
.m-shelf li[data-sort-id] > .m-grip { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); z-index: 2; }
.m-shelf li[data-sort-id] > a { padding-right: 40px; }
.m-day-card[data-sort-id] { position: relative; }
.m-day-card[data-sort-id] > .m-grip { position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; }

/* World cards in My style and in the new-dashboard steps: each shows its scene */
.mood-w-snow { background: radial-gradient(circle at 78% 26%, #fffdf2 0 10%, transparent 12%), linear-gradient(180deg, #dfeefc, #bcd7f2 55%, #e9f2fb 56%, #c7d8ee) !important; }
.mood-w-autumn { background: radial-gradient(circle at 78% 26%, #fff3c4 0 11%, transparent 13%), linear-gradient(180deg, #ffe3a3, #f7c77a 55%, #b8692a 56%, #8f4a1f) !important; }
.mood-w-island { background: radial-gradient(circle at 78% 26%, #fffbe0 0 11%, transparent 13%), linear-gradient(180deg, #8fe3ff, #5ccfff 50%, #1aa9c9 51% 75%, #f6dca3 76%) !important; }
.mood-w-city { background: radial-gradient(circle at 76% 24%, #fff6d6 0 8%, transparent 10%), linear-gradient(90deg, transparent 0 20%, #1a1d33 20% 30%, transparent 30% 45%, #1a1d33 45% 60%, transparent 60% 70%, #1a1d33 70% 85%, transparent 85%) 0 60% / 100% 40% no-repeat, linear-gradient(180deg, #1c2140, #2b3350) !important; }
.mood-w-cloud { background: radial-gradient(circle at 30% 70%, #fff 0 16%, transparent 18%), radial-gradient(circle at 70% 60%, #fff 0 20%, transparent 22%), linear-gradient(180deg, #d9ecff, #bfe3ff 50%, #ffe9f4) !important; }
.mood-w-jungle { background: radial-gradient(circle at 50% 100%, #1c5c32 0 30%, transparent 32%), radial-gradient(circle at 15% 100%, #154a28 0 26%, transparent 28%), radial-gradient(circle at 85% 100%, #154a28 0 26%, transparent 28%), linear-gradient(180deg, #bde98c, #8fd36b 60%, #3f8f4a) !important; }
.mood-w-space { background: radial-gradient(circle at 76% 28%, #ff9a5a 0 10%, transparent 12%), radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 45% 65%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 65% 20%, #fff 50%, transparent 51%), radial-gradient(circle at 100% 110%, #2b1a66 0 36%, transparent 38%), linear-gradient(180deg, #05030f, #0b0620) !important; }
.mood-w-arcade { background: linear-gradient(90deg, rgba(34,230,255,.25) 1px, transparent 1px) 0 0 / 14px 14px, linear-gradient(0deg, rgba(34,230,255,.25) 1px, transparent 1px) 0 0 / 14px 14px, radial-gradient(circle at 50% 30%, #ff4fd8 0 12%, transparent 14%), linear-gradient(180deg, #0b0620, #1a0b40) !important; }
.mood-w-harbor { background: radial-gradient(circle at 76% 26%, rgba(255,252,240,.9) 0 9%, transparent 14%), linear-gradient(180deg, #d3d9dc, #b8c2c8 55%, #9aa7ae) !important; }
.mood-w-swan { background: radial-gradient(circle at 78% 24%, #fff 0 10%, #fbf5df 12%, transparent 16%), linear-gradient(180deg, #fff, #f3f1ec 55%, #e2e4e3) !important; }
.mood-w-rooftop { background: radial-gradient(circle at 74% 40%, #ff5a4a 0 11%, transparent 13%), linear-gradient(180deg, #1a0608, #5a0f16 55%, #a31b24) !important; }
.mood-w-midnight { background: radial-gradient(circle at 76% 26%, transparent 0 7%, #e9c84a 8% 11%, transparent 12%), radial-gradient(1.5px 1.5px at 20% 30%, #e9c84a 50%, transparent 51%), radial-gradient(1.5px 1.5px at 50% 20%, #fff1b8 50%, transparent 51%), linear-gradient(180deg, #000, #0a0a0d 60%, #1a1608) !important; }
.mood-w-aurora { background: linear-gradient(100deg, transparent 0 20%, rgba(125,249,255,.35) 24% 34%, transparent 38% 48%, rgba(255,143,216,.3) 52% 60%, transparent 64% 74%, rgba(170,120,255,.35) 78% 86%, transparent 90%), radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent 51%), linear-gradient(180deg, #0b0620, #2a1660 55%, #4a2a84) !important; }
.mood-w-sunrise { background: radial-gradient(circle at 80% 30%, #fff6c2 0 12%, transparent 13%), linear-gradient(180deg, #ffcf5c, #ff9a5a 50%, #ff6f8a) !important; }
.mood-w-ocean { background: radial-gradient(circle at 20% 70%, transparent 0 4px, rgba(220,250,255,.7) 5px 6px, transparent 7px), radial-gradient(circle at 70% 40%, transparent 0 3px, rgba(220,250,255,.6) 4px 5px, transparent 6px), linear-gradient(180deg, #0a5f86, #021a33) !important; }
.mood-w-meadow { background: radial-gradient(circle at 80% 25%, #f4ffd9 0 9%, transparent 22%), radial-gradient(circle at 30% 60%, #e9ff7a 0 2px, transparent 8px), radial-gradient(circle at 60% 75%, #fff59a 0 2px, transparent 8px), linear-gradient(180deg, #123a2c, #06150f) !important; }
.mood-w-dusk { background: radial-gradient(circle at 78% 30%, #ffd0f5 0, #b55cff 9%, transparent 10%), radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 45% 70%, #fff 50%, transparent 51%), linear-gradient(180deg, #3c1a78, #120531) !important; }
.mood-w-canyon { background: radial-gradient(circle at 70% 55%, #fff1b8 0 9%, transparent 14%), linear-gradient(0deg, #3d1810 0 22%, transparent 22%), linear-gradient(180deg, #2b1d4f, #a6395b 40%, #f07b3f 70%, #ffc15e) !important; }
.mood-w-berry { background: radial-gradient(circle at 82% 30%, #fff, #7afcff 9%, transparent 10%), repeating-linear-gradient(-45deg, #ff7ac2 0 10px, #ff9fd4 10px 20px) !important; }
.mood-w-moon { background: radial-gradient(circle at 78% 30%, #fff8e1 0 11%, transparent 12%), radial-gradient(5px 5px at 25% 85%, #ff9a3c 50%, transparent 55%), linear-gradient(180deg, #2a1640, #0b0710) !important; }
.m-world-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 12px; }
.m-world-pick { position: relative; display: block; }
.m-world-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.m-world-card { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-height: 9rem; padding: .8em; border-radius: 16px; border: 3px solid transparent; color: #fff; cursor: pointer; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; position: relative; overflow: hidden; }
.m-world-card b, .m-world-card small, .m-world-card .mw-song { position: relative; background: rgba(15, 10, 30, .62); padding: .1em .45em; border-radius: 6px; width: fit-content; }
.m-world-card b { font-size: var(--step-1); }
.m-world-card .mw-song { display: inline-flex; align-items: center; gap: .3em; font-size: var(--step--1); }
.m-world-card .mw-song .icon { width: 14px; height: 14px; }
.m-world-pick:hover .m-world-card { transform: translateY(-3px); }
.m-world-pick input:checked + .m-world-card { border-color: #fff; box-shadow: 0 0 0 3px #23180f, 0 0 26px rgba(255, 220, 120, .6); }
.m-world-pick input:focus-visible + .m-world-card { outline: 3px solid #29298e; outline-offset: 4px; }
.m-look-sub { margin: var(--space-4) 0 var(--space-2); font-size: var(--step-0); }
.m-music-group { margin: var(--space-3) 0 var(--space-2); font-size: var(--step-0); text-transform: uppercase; letter-spacing: .08em; color: #5a4836; }

/* ---------- My style: the world stage (a continuation of the start page picker) ---------- */
.m-world-stage { position: relative; padding: clamp(1.25rem, 1rem + 2vw, 2.5rem); border-radius: 26px; background: rgba(12, 9, 32, .62); color: #fff; backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 30px 60px -30px rgba(0,0,0,.8); display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-5); }
:root:not([data-world]) .m-world-stage { background: linear-gradient(135deg, #2a1640, #1f4e6b); }
.ws-kicker { margin: 0; display: inline-flex; gap: .4em; align-items: center; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: var(--step--1); color: #ffe08a; }
.m-world-stage h1 { margin: 0; color: #fff; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); text-shadow: 0 2px 20px rgba(0,0,0,.5); }
.ws-lead { margin: 0; color: #f1ecff; max-width: 60ch; font-size: var(--step-1); }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); gap: 12px; }
.ws-card { min-height: 11rem !important; border-radius: 20px !important; }
.ws-card-wrap:nth-child(1) { grid-column: span 1; }
.ws-check { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; display: none; place-items: center; background: #fff; color: #23180f; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.m-world-pick input:checked + .ws-card .ws-check { display: grid; }
.m-world-pick input:checked + .ws-card { transform: translateY(-4px) scale(1.02); border-color: #fff; box-shadow: 0 0 0 3px #ffe08a, 0 0 40px rgba(255, 224, 138, .55); }
.ws-now { margin: 0; padding: .7em 1em; border-radius: 14px; background: rgba(255,255,255,.12); color: #fff; font-size: var(--step-1); }
.ws-actions .btn-quiet { background: rgba(255,255,255,.92); }
.m-section-title { display: flex; align-items: center; gap: .4em; font-size: var(--step-2); margin: var(--space-5) 0 var(--space-3); padding: .3em .8em; width: fit-content; border-radius: 14px; background: rgba(255, 253, 247, .9); color: #23180f; }
.m-classic-looks > summary { cursor: pointer; font-weight: 800; font-size: var(--step-1); display: flex; align-items: center; gap: .4em; padding: .2em 0; }
.m-classic-looks[open] > summary { margin-bottom: var(--space-3); }
@media (prefers-reduced-motion: reduce) { .m-world-pick input:checked + .ws-card { transform: none; } }

/* ---------- Each world's own character inside My dashboard ---------- */
:root[data-drawer-mood] { --w-tint: #fffdf7; }
:root[data-drawer-mood][data-world] :is(.m-panel, .m-card, .m-sheet) { background-color: color-mix(in srgb, var(--w-tint) 90%, transparent) !important; }
/* Golden sunrise: warm cream, golden glow, sunbeam stripe */
:root[data-drawer-mood][data-world="sunrise"] { --w-tint: #fff6e3; --tile-glow: rgba(255, 196, 70, .8); }
:root[data-drawer-mood][data-world="sunrise"] :is(.m-panel, .m-card) { border-top: 6px solid transparent !important; border-image: linear-gradient(90deg, #f6a91c, #ef7d2d, #e5484d) 1; box-shadow: 0 18px 36px -20px rgba(180, 70, 20, .55), 0 0 0 1px rgba(255, 200, 120, .5) !important; }
/* Deep sea: cool aqua glass, big round corners, bubble ring on icons */
:root[data-drawer-mood][data-world="ocean"] { --w-tint: #eefaff; --tile-glow: rgba(80, 220, 255, .7); }
:root[data-drawer-mood][data-world="ocean"] :is(.m-panel, .m-card) { border-radius: 26px !important; border-top-color: #14b8a6 !important; box-shadow: 0 0 0 1px rgba(160, 240, 255, .55), 0 22px 40px -22px rgba(0, 20, 40, .8) !important; }
:root[data-drawer-mood][data-world="ocean"] .m-panel-ico { box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(20, 184, 166, .5); }
/* Enchanted forest: mossy paper, gold leaf edge, firefly glow */
:root[data-drawer-mood][data-world="meadow"] { --w-tint: #f3f8ea; --tile-glow: rgba(220, 255, 120, .65); }
:root[data-drawer-mood][data-world="meadow"] :is(.m-panel, .m-card) { border-top-color: #c9a227 !important; box-shadow: inset 0 0 0 2px rgba(201, 162, 39, .35), 0 0 26px -8px rgba(220, 255, 120, .55), 0 22px 40px -22px rgba(0, 0, 0, .8) !important; }
/* Galaxy: crisp neon edges, cosmic glow */
:root[data-drawer-mood][data-world="dusk"] { --w-tint: #f6f1ff; --tile-glow: rgba(200, 120, 255, .8); }
:root[data-drawer-mood][data-world="dusk"] :is(.m-panel, .m-card) { border-top: 5px solid transparent !important; border-image: linear-gradient(90deg, #22e6ff, #7c3aed, #ff4fd8) 1; box-shadow: 0 0 0 1px rgba(200, 150, 255, .7), 0 0 28px -6px rgba(124, 58, 237, .7), 0 22px 40px -22px rgba(0,0,0,.85) !important; }
/* Desert canyon: sandy paper, terracotta double stripe */
:root[data-drawer-mood][data-world="canyon"] { --w-tint: #fff3e6; --tile-glow: rgba(255, 170, 80, .8); }
:root[data-drawer-mood][data-world="canyon"] :is(.m-panel, .m-card) { border-top: 8px double #b45309 !important; box-shadow: 0 0 0 1px rgba(255, 200, 140, .6), 0 22px 40px -22px rgba(60, 15, 5, .85) !important; }
/* Candy pop: chunky rounded, candy-stripe edge, a little bounce */
:root[data-drawer-mood][data-world="berry"] { --w-tint: #fff1f8; --tile-glow: rgba(122, 252, 255, .9); }
:root[data-drawer-mood][data-world="berry"] :is(.m-panel, .m-card) { border-radius: 28px !important; border-top: 8px solid transparent !important; border-image: repeating-linear-gradient(-45deg, #ff4fa3 0 10px, #fff 10px 20px) 8; box-shadow: 0 0 0 3px #fff, 0 16px 30px -16px rgba(150, 20, 90, .55) !important; }
:root[data-drawer-mood][data-world="berry"] .m-panel:hover { transform: translateY(-4px) rotate(-.4deg); }
/* Haunted moon: lavender paper, pumpkin glow */
:root[data-drawer-mood][data-world="moon"] { --w-tint: #f7f2ff; --tile-glow: rgba(255, 160, 60, .75); }
:root[data-drawer-mood][data-world="moon"] :is(.m-panel, .m-card) { border-top-color: #ea7a1c !important; box-shadow: 0 0 0 1px rgba(255, 179, 71, .5), 0 0 30px -10px rgba(255, 140, 26, .6), 0 22px 40px -22px rgba(0,0,0,.85) !important; }
@media (prefers-reduced-motion: reduce) { :root[data-world="berry"] .m-panel:hover { transform: none; } }
:root[data-contrast="high"][data-drawer-mood] :is(.m-panel, .m-card) { border-image: none !important; background-color: #fff !important; }

/* ---------- The arcade machine panel on My dashboard ---------- */
.m-panel.is-arcade { background: linear-gradient(180deg, #2b1a5c, #120a2a) !important; color: #f3edff; border: 0 !important; border-image: none !important; border-radius: 26px 26px 14px 14px !important; box-shadow: 0 0 0 4px #3d2a7a, 0 0 0 7px #120a2a, 0 0 30px -4px rgba(255, 79, 216, .55), 0 24px 40px -20px rgba(0,0,0,.8) !important; }
.m-panel.is-arcade .m-panel-head h2 { color: #fff; }
.m-panel.is-arcade .m-panel-ico { background: linear-gradient(135deg, #22e6ff, #ff4fd8) !important; color: #120a2a !important; }
.arc-mini { display: flex; flex-direction: column; gap: 8px; }
.arc-mini-marquee { text-align: center; font-weight: 900; letter-spacing: .25em; font-size: var(--step--1); padding: .45em; border-radius: 10px; background: linear-gradient(90deg, #ff4fd8, #7b45c4, #22e6ff); color: #fff; text-shadow: 0 0 6px rgba(255,255,255,.8); animation: arc-glow 3s ease-in-out infinite; }
.arc-mini-screen { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; background: #070a1f; border: 5px solid #05030f; box-shadow: inset 0 0 26px rgba(0,0,0,.9); overflow: hidden; }
.arc-mini-screen::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(255,255,255,.04) 0 2px, transparent 2px 4px); }
.am-net { position: absolute; left: 50%; top: 6%; bottom: 6%; border-left: 3px dashed rgba(255,255,255,.25); }
.am-pad { position: absolute; top: 40%; width: 4%; height: 26%; border-radius: 3px; animation: am-pad 2.4s ease-in-out infinite alternate; }
.am-l { left: 5%; background: #22e6ff; box-shadow: 0 0 10px #22e6ff; }
.am-r { right: 5%; background: #ff4fd8; box-shadow: 0 0 10px #ff4fd8; animation-delay: -1.2s; }
.am-ball { position: absolute; width: 4.5%; aspect-ratio: 1; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; animation: am-ball-x 2.4s linear infinite alternate, am-ball-y 1.7s ease-in-out infinite alternate; left: 10%; top: 20%; }
@keyframes am-pad { from { transform: translateY(-60%); } to { transform: translateY(60%); } }
@keyframes am-ball-x { from { left: 10%; } to { left: 86%; } }
@keyframes am-ball-y { from { top: 12%; } to { top: 80%; } }
.arc-mini-deck { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: linear-gradient(180deg, #3d2a7a, #241650); }
.am-stick { width: 14px; height: 14px; border-radius: 50%; background: #e5484d; box-shadow: 0 6px 0 -2px #555, 0 0 0 3px #1a0f3a; }
.am-btn { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 3px 0 rgba(0,0,0,.5); }
.am-btn.b1 { background: #22e6ff; } .am-btn.b2 { background: #ff4fd8; }
.am-coin { margin-left: auto; font-family: ui-monospace, monospace; font-weight: 800; font-size: var(--step--2); color: #ffd25c; animation: sc-twinkle 1.6s steps(2) infinite; }
.arc-mini-games { margin: .4em 0 0; color: #cfc4f0; font-weight: 700; }
.m-panel.is-arcade .btn-primary { background: #22e6ff; border-color: #22e6ff; color: #120a2a; }
@media (prefers-reduced-motion: reduce) { .am-pad, .am-ball, .am-coin, .arc-mini-marquee { animation: none !important; } }
:root[data-motion="reduce"] :is(.am-pad, .am-ball, .am-coin, .arc-mini-marquee) { animation: none !important; }
/* Mode buttons in the arcade */
.arc-modes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.arc-start-2 { background: #ff4fd8 !important; border-color: #ff4fd8 !important; color: #120a2a !important; }
.arc-solo .arc-pad.p2 { visibility: hidden; }

/* ==========================================================================
   My routines: collectible step cards
   ========================================================================== */
.rt-pat-dots { --pat: radial-gradient(rgba(255,255,255,.22) 2px, transparent 2.6px) 0 0 / 18px 18px; }
.rt-pat-waves { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='16'%3E%3Cpath d='M0 8 Q12 0 24 8 T48 8' fill='none' stroke='white' stroke-opacity='.22' stroke-width='2'/%3E%3C/svg%3E") 0 0 / 48px 16px; }
.rt-pat-stars { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M15 8l1.5 3.5 3.5 1.5-3.5 1.5-1.5 3.5-1.5-3.5-3.5-1.5 3.5-1.5z' fill='white' fill-opacity='.3'/%3E%3Ccircle cx='44' cy='40' r='1.6' fill='white' fill-opacity='.35'/%3E%3C/svg%3E") 0 0 / 60px 60px; }
.rt-pat-grid { --pat: linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px) 0 0 / 22px 22px, linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px) 0 0 / 22px 22px; }
.rt-pat-stripes { --pat: repeating-linear-gradient(-45deg, rgba(255,255,255,.14) 0 10px, transparent 10px 20px); }
.rt-pat-plain { --pat: linear-gradient(transparent, transparent); }
.rt-pat-pick span { width: 46px; height: 46px; border-radius: 12px; background: var(--pat), linear-gradient(135deg, var(--c1), var(--c2)) !important; border: 2px solid #fff; }

/* The collection */
.rt-col-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-5) 0 var(--space-3); }
.rt-col-head h2 { margin: 0; display: flex; align-items: center; gap: .4em; padding: .25em .8em; border-radius: 14px; background: rgba(255, 253, 247, .92); color: #23180f; }
.rt-covers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr)); gap: 18px; }
.rt-cover { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 14px 0; min-height: 21rem; border-radius: 20px; color: #fff; overflow: hidden; background: var(--pat), linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: 0 0 0 3px rgba(255,255,255,.85) inset, 0 0 0 1px rgba(0,0,0,.08), 0 18px 32px -18px rgba(30, 10, 40, .65); transition: transform .25s cubic-bezier(.2,.9,.3,1.2), box-shadow .25s ease; max-width: none; }
.rt-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 45%, transparent 60%); transform: translateX(-120%); transition: transform .8s ease; pointer-events: none; }
.rt-cover:hover { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 0 0 3px rgba(255,255,255,.95) inset, 0 26px 40px -18px rgba(30, 10, 40, .75); }
.rt-cover:hover::after { transform: translateX(120%); }
.rt-cover-top { align-self: stretch; display: flex; justify-content: space-between; align-items: center; font-size: var(--step--1); font-weight: 800; }
.rt-cover-count { background: rgba(0,0,0,.28); padding: .15em .6em; border-radius: 999px; }
.rt-stamp { display: inline-flex; align-items: center; gap: .2em; background: #fff3b0; color: #5a4300; padding: .15em .55em; border-radius: 999px; transform: rotate(4deg); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.rt-cover-ico { width: 96px; height: 96px; margin: 6px 0 2px; border-radius: 50%; display: grid; place-items: center; background: #fffdf7; color: var(--c1); box-shadow: 0 0 0 6px rgba(255,255,255,.3), 0 10px 20px -8px rgba(0,0,0,.45); }
.rt-cover-ico .icon { width: 48px; height: 48px; }
.rt-cover h3 { margin: 0; color: #fff; font-size: var(--step-1); text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.rt-cover p { margin: 0; font-size: var(--step--1); color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.rt-cover-meta { display: inline-flex; gap: .3em; align-items: center; font-size: var(--step--1); font-weight: 700; background: rgba(0,0,0,.25); padding: .15em .6em; border-radius: 999px; }
.rt-cover-meta .icon { width: 1em; height: 1em; }
.rt-cover-actions { margin-top: auto; align-self: stretch; justify-content: center; padding: 10px; margin-inline: -14px; background: rgba(255, 253, 247, .95); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--link, #1b5ca2); text-decoration: underline; cursor: pointer; }

/* The journey */
.rt-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: .6em .9em; border-radius: 16px; background: rgba(255, 253, 247, .92); color: #23180f; margin-bottom: var(--space-4); }
.rt-title { margin: 0; font-size: var(--step-2); display: flex; align-items: center; gap: .35em; flex: 1 1 auto; }
.rt-speak { margin-left: auto; }
.rt-trail { list-style: none; margin: 0 auto var(--space-4); padding: 10px 14px; display: flex; align-items: center; gap: 0; max-width: 100%; overflow-x: auto; justify-content: safe center; }
.rt-trail li { display: flex; align-items: center; margin: 0; flex: none; }
.rt-trail li + li::before { content: ""; width: clamp(14px, 3vw, 34px); height: 4px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.9) 0 6px, transparent 6px 10px); filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.rt-trail li.is-done + li::before { background: #fff; }
.rt-trail button { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; background: rgba(255, 253, 247, .85); color: #5a4836; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 10px -4px rgba(0,0,0,.5); transition: transform .2s ease; }
.rt-trail button .icon { width: 20px; height: 20px; }
.rt-trail .is-done button { background: var(--c1); color: #fff; }
.rt-trail .is-here button { width: 56px; height: 56px; background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.5), 0 0 24px var(--c2); }
.rt-trail button:focus-visible { outline: 3px solid #29298e; outline-offset: 3px; }
.rt-flag { width: 44px; height: 44px; border-radius: 50%; display: grid !important; place-items: center; background: #fff3b0; color: #5a4300; box-shadow: 0 4px 10px -4px rgba(0,0,0,.5); }
.rt-card { position: relative; max-width: 640px; margin: 0 auto; padding: 18px 22px 22px; border-radius: 26px; background: #fffdf7; color: #23180f; text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--space-3); box-shadow: 0 0 0 6px #fff inset, 0 0 0 9px var(--c1) inset, 0 30px 60px -26px rgba(20, 10, 40, .75); }
.rt-card.is-dealt { animation: rt-deal .5s cubic-bezier(.2,.9,.3,1.15); }
@keyframes rt-deal { from { transform: translateX(60px) rotate(4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.rt-card-no { align-self: flex-start; font-weight: 800; font-size: var(--step--1); letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--c1); padding: .25em .8em; border-radius: 999px; margin-left: 4px; }
.rt-art { display: grid; place-items: center; border-radius: 22px; background: var(--pat), linear-gradient(150deg, var(--c1), var(--c2)); color: #fff; overflow: hidden; flex: none; }
.rt-art img { width: 100%; height: 100%; object-fit: cover; }
.rt-art-lg { width: min(100%, 360px); aspect-ratio: 4 / 3; box-shadow: inset 0 0 0 4px rgba(255,255,255,.4); }
.rt-art-lg .rt-art-ico { width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: #fffdf7; color: var(--c1); box-shadow: 0 0 0 10px rgba(255,255,255,.25), 0 12px 26px -10px rgba(0,0,0,.5); }
.rt-art-lg .rt-art-ico .icon { width: 68px; height: 68px; }
.rt-art-sm { width: 56px; height: 56px; border-radius: 14px; }
.rt-art-sm .rt-art-ico .icon { width: 28px; height: 28px; }
.rt-card h2 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
.rt-text { margin: 0; font-size: var(--step-1); max-width: 36ch; line-height: 1.5; }
.rt-need { align-self: stretch; text-align: left; background: #f3f0fa; border-radius: 14px; padding: .7em 1em; }
.rt-need h3 { margin: 0 0 .3em; font-size: var(--step-0); display: flex; align-items: center; gap: .3em; }
.rt-need ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rt-need li { margin: 0; padding: .25em .7em; border-radius: 999px; background: #fff; border: 1.5px solid #d9cfee; font-weight: 700; font-size: var(--step--1); }
.rt-tip { margin: 0; align-self: stretch; text-align: left; background: #fff3b0; color: #3b2a00; border-radius: 12px; padding: .55em .9em; display: flex; gap: .4em; align-items: flex-start; }
.rt-timer { align-self: stretch; display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; text-align: left; padding: .7em .9em; border-radius: 16px; background: #eef7fb; }
.rt-timer.is-ringing { background: #fff3b0; animation: rt-ring 1s ease-in-out 3; }
@keyframes rt-ring { 0%, 100% { transform: none; } 25% { transform: rotate(-1deg); } 75% { transform: rotate(1deg); } }
.rt-ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; flex: none; background: radial-gradient(closest-side, #fffdf7 78%, transparent 80%), conic-gradient(var(--c1) calc(var(--p) * 360deg), #d7e7ef 0); font-family: ui-monospace, monospace; font-weight: 800; }
.rt-timer-text { display: flex; flex-direction: column; flex: 1 1 10rem; }
.rt-controls { display: flex; justify-content: center; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-4) auto 0; max-width: 640px; padding: .7em; border-radius: 18px; background: rgba(255, 253, 247, .92); }
.rt-next { flex: 1 1 14rem; justify-content: center; }
.rt-finish .rt-finish-stamp { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle, var(--c1), var(--c2)); box-shadow: 0 0 0 6px #fff, 0 0 0 10px var(--c1), 0 14px 30px -10px rgba(0,0,0,.5); transform: rotate(-8deg); animation: rt-stamp .6s cubic-bezier(.2,.9,.3,1.5); }
.rt-finish .rt-finish-stamp .icon { width: 64px; height: 64px; }
@keyframes rt-stamp { from { transform: scale(2.2) rotate(-30deg); opacity: 0; } to { transform: rotate(-8deg); opacity: 1; } }
.rt-collected { margin: 0; display: inline-flex; gap: .35em; align-items: center; font-weight: 800; background: #fff3b0; color: #5a4300; padding: .35em .9em; border-radius: 999px; }
.rt-break-text { display: flex; gap: .5em; align-items: center; font-size: var(--step-1); }

/* The editor */
.rt-edit-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: var(--space-4); align-items: start; }
@media (max-width: 900px) { .rt-edit-grid { grid-template-columns: 1fr; } }
.rt-edit-cards { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rt-edit-card { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: .6em; padding: .5em .6em; border-radius: 14px; background: #faf6ee; border: 1.5px solid #e4dccd; max-width: none; margin: 0; }
.rt-ec-main { display: flex; flex-direction: column; min-width: 0; }
.rt-ec-main .small { color: #47372a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-ec-timer { display: inline-flex; gap: .3em; align-items: center; font-size: var(--step--1); font-weight: 700; color: #0e5a6b; }
.rt-ec-timer .icon { width: 1em; height: 1em; }
.rt-danger { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px dashed #d8cbb4; }
.rt-photo-row { display: flex; align-items: center; gap: .6em; flex-wrap: wrap; }
.rt-photo-prev { width: 96px; height: 72px; object-fit: cover; border-radius: 12px; }

/* Dashboard panel: a fanned little stack of my decks */
.rt-mini { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 10px; }
.rt-mini-cover { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px 10px; border-radius: 16px; text-align: center; color: #fff; background: var(--pat), linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: 0 0 0 2px rgba(255,255,255,.8) inset, 0 10px 18px -12px rgba(0,0,0,.6); margin: 0; max-width: none; transition: transform .2s ease; }
.rt-mini-cover:nth-child(odd) { transform: rotate(-1.5deg); } .rt-mini-cover:nth-child(even) { transform: rotate(1.5deg); }
.rt-mini-cover:hover { transform: translateY(-3px) rotate(0); }
.rt-mini-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #fffdf7; color: var(--c1); }
.rt-mini-name { font-weight: 800; font-size: var(--step--1); text-shadow: 0 1px 6px rgba(0,0,0,.45); line-height: 1.2; }
.rt-mini-go { background: #fffdf7; color: #23180f; border-color: #fffdf7; }
.rt-mini-go::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
@media (prefers-reduced-motion: reduce) { .rt-card.is-dealt, .rt-finish .rt-finish-stamp, .rt-timer.is-ringing { animation: none; } .rt-cover:hover, .rt-mini-cover, .rt-mini-cover:hover { transform: none; } .rt-cover::after { display: none; } }
:root[data-motion="reduce"] :is(.rt-card.is-dealt, .rt-finish-stamp, .rt-timer.is-ringing) { animation: none !important; }
:root[data-contrast="high"] :is(.rt-cover, .rt-mini-cover) { background: #000 !important; }
.rt-cover-actions { color: #23180f; } .rt-cover-actions .btn-quiet { color: #23180f; background: #fffdf7; } .rt-cover-actions .btn-quiet .icon { color: #23180f; }
/* Routine cards keep their own dark-on-paper ink in every world */
:is(.rt-card, .rt-controls, .rt-bar, .rt-edit-card, .rt-cover-actions) { --ink: #23180f; --ink-2: #47372a; --ink-3: #5a4836; --link: #1b5ca2; color: #23180f; }
.rt-card h2, .rt-bar h1, .rt-col-head h2 { color: #23180f; }
.rt-controls .btn-quiet, .rt-bar .btn-quiet { color: #23180f; background: #fffdf7; }
.rt-day-go { align-self: center; } .m-agenda-row .rt-day-go { grid-column: 3; justify-self: start; margin-top: 4px; } .rt-goal-line { margin: 0; display: inline-flex; align-items: center; gap: .35em; } .rt-plan { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px dashed #d8cbb4; } .rt-plan h3 { margin: 0 0 .2em; font-size: var(--step-0); display: flex; gap: .35em; align-items: center; } .rt-plan-form { display: flex; flex-wrap: wrap; gap: .6em; align-items: flex-end; } .rt-plan-form .field { margin: 0; }

/* ---------- Goals woven through everything ---------- */
.gl-chip { display: inline-flex; align-items: center; gap: .3em; max-width: 100%; padding: .12em .55em; border-radius: 999px; background: color-mix(in srgb, var(--gc, #2c56c9) 14%, #fff); color: #23180f; border: 1.5px solid color-mix(in srgb, var(--gc, #2c56c9) 55%, #fff); font-size: var(--step--2); font-weight: 800; line-height: 1.3; }
.gl-chip .icon { width: 1em; height: 1em; color: var(--gc, #2c56c9); flex: none; }
.gl-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-day-card .gl-chip { align-self: center; margin: 2px 0; }
.m-agenda-row .gl-chip { grid-column: 3; justify-self: start; }
.gl-week { display: inline-flex; gap: 3px; vertical-align: middle; }
.gl-week i { width: 10px; height: 10px; border-radius: 50%; background: #e4dccd; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.gl-week i.on { background: var(--gc, #2f7d4f); }
.gm-week, .gc-week { display: flex; align-items: center; gap: .5em; flex-wrap: wrap; margin: .3em 0; font-size: var(--step--1); }
.gc-progress { display: flex; flex-direction: column; gap: .5em; padding-top: .6em; border-top: 1px dashed #d8cbb4; }
.gc-wins summary { cursor: pointer; font-weight: 800; display: inline-flex; gap: .3em; align-items: center; }
.gc-wins ul, .gc-helps ul { list-style: none; margin: .4em 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gc-wins li, .gc-helps li { display: flex; gap: .4em; align-items: baseline; font-size: var(--step--1); margin: 0; }
.gc-wins li .icon, .gc-helps li .icon { width: 1em; height: 1em; flex: none; color: var(--gc, #2c56c9); position: relative; top: .12em; }
.gc-helps h4 { margin: 0; font-size: var(--step--1); text-transform: uppercase; letter-spacing: .06em; color: #5a4836; }
.gc-link-actions .btn { font-size: var(--step--1); }
/* Goal cards: what I do for this goal (draft 11, batch B) */
.gc-things { display: flex; flex-direction: column; gap: .45em; }
.gc-things h4 { margin: 0; display: flex; align-items: center; gap: .35em; font-size: var(--step--1); text-transform: uppercase; letter-spacing: .06em; color: #5a4836; }
.gc-things h4 .icon { width: 1.05em; height: 1.05em; color: var(--gc); }
.gt-count { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .35em; border-radius: 999px; background: var(--gc); color: #fff; font-size: .9em; letter-spacing: 0; }
.gt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gt-row { display: flex; align-items: center; gap: .3em; margin: 0; max-width: none; padding: 4px 4px 4px 6px; border-radius: 12px; background: color-mix(in srgb, var(--gc) 7%, #fffdf7); border: 2px solid color-mix(in srgb, var(--gc) 22%, #fffdf7); }
.gt-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5em; color: inherit; text-decoration: none; cursor: pointer; min-height: 40px; }
a.gt-main:hover b { text-decoration: underline; }
.gt-main input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.gt-box { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 3px solid #5a4a36; background: #fff; box-shadow: 0 3px 0 #5a4a36; transition: transform .2s var(--toy-spring, ease); }
.gt-box .icon { width: 16px; height: 16px; stroke-width: 3.5; color: #fff; opacity: 0; }
.gt-main input:checked + .gt-box { background: var(--gc); border-color: color-mix(in srgb, var(--gc) 55%, #000); box-shadow: 0 3px 0 color-mix(in srgb, var(--gc) 55%, #000); }
.gt-main input:checked + .gt-box .icon { opacity: 1; }
.gt-main input:focus-visible + .gt-box { outline: 3px solid #29298e; outline-offset: 3px; }
.gt-main:hover .gt-box { transform: translateY(-2px) rotate(-4deg); }
.gt-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--gc); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gc) 35%, #fff); }
.gt-ico .icon { width: 17px; height: 17px; }
.gt-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.gt-text b { font-size: var(--step--1); overflow-wrap: anywhere; }
.gt-where { font-size: 12.5px; color: #6a5a46; }
.gt-row.is-done .gt-text b { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .75; }
.gt-won { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #ffd84a; color: #6b4a00; box-shadow: 0 2px 0 #b38600; }
.gt-won .icon { width: 15px; height: 15px; fill: currentColor; }
.gt-unlink { flex: none; opacity: .55; }
.gt-row:hover .gt-unlink, .gt-unlink:focus-visible { opacity: 1; }
.gt-empty { margin: 0; }
.gc-notice p { margin: 0 0 .5em; }
.gc-notice p:last-child { margin: 0; }
/* The link dialog: everything that can be linked, grouped by tool */
.gl-search { margin: .3em 0 .6em; }
.gl-search label { display: inline-flex; gap: .3em; align-items: center; }
.gl-pick-group { margin: .5em 0 .8em; }
.gl-pick-group h3 { display: inline-flex; align-items: center; gap: .4em; margin: 0 0 .3em; font-size: var(--step-0); }
details.gl-pick-group > summary { cursor: pointer; list-style: revert; }
details.gl-pick-group > summary h3 { display: inline-flex; margin: 0; }
.gl-pick-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.gl-pick-row { margin: 0; max-width: none; }
.gl-pick-row .check { display: flex; align-items: flex-start; gap: .5em; padding: .35em .5em; border-radius: 10px; min-height: 40px; }
.gl-pick-row .check:hover { background: #f6efe1; }
.gl-pick-row .check > span .icon { width: 1em; height: 1em; position: relative; top: .14em; color: #5a4836; }
.gl-elsewhere { display: inline-flex; gap: .25em; align-items: center; padding: 0 .5em; border-radius: 999px; background: #fff1c9; color: #6b4a00; font-weight: 700; }
.gl-new-kinds .m-kind-pick .gn-k { display: flex; flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.15; text-align: left; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.gl-new-kinds .m-kind-pick small { font-weight: 600; font-size: 12.5px; color: #6a5a46; }
.gl-new-kinds .m-kind-pick > span { --k: #2c56c9; padding: .4em .8em; }
@media (prefers-reduced-motion: reduce) { .gt-box { transition: none; } .gt-main:hover .gt-box { transform: none; } }
/* Support summary: progress on goals */
.sg-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 10px; }
.sg-goal { margin: 0; padding: .7em .9em; border-radius: 14px; background: #f3f8ea; border-left: 6px solid #3f7d20; max-width: none; }
.sg-goal h3 { margin: 0 0 .2em; font-size: var(--step-0); }
.sg-count { margin: 0 0 .3em; }
.sg-acts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: var(--step--1); }
.sg-acts li { margin: 0; display: flex; gap: .35em; align-items: baseline; }
.sg-acts .icon { width: 1em; height: 1em; flex: none; position: relative; top: .12em; }
/* My wins panel */
.wn-head { margin: 0 0 .5em; }
.wn-list { list-style: none; margin: 0; padding: 0 0 0 6px; display: flex; flex-direction: column; gap: 0; border-left: 3px solid #e4dccd; }
.wn-list li { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: .5em; align-items: start; padding: .35em 0 .35em .6em; margin: 0; max-width: none; }
.wn-ico { width: 28px; height: 28px; margin-left: -22px; border-radius: 50%; display: grid; place-items: center; background: #fffdf7; border: 2px solid var(--wc, #2f7d4f); color: var(--wc, #2f7d4f); }
.wn-ico .icon { width: 15px; height: 15px; }
.wn-routine { --wc: #7c3aed; } .wn-habit { --wc: #ea580c; } .wn-task { --wc: #2f7d4f; } .wn-plan { --wc: #0e7490; } .wn-log { --wc: #b45309; }
.wn-text { display: flex; flex-direction: column; gap: 2px; }
.wn-goal { display: inline-flex; gap: .25em; align-items: center; font-size: var(--step--2); font-weight: 800; color: #47372a; }
.wn-goal .icon { width: 1em; height: 1em; }
.wn-date { font-size: var(--step--1); color: #5a4836; white-space: nowrap; }


/* People pictures */
.m-person-ico { background: var(--pc, #5b2486); overflow: hidden; position: relative; }
.m-person-ico .icon { width: 58%; height: 58%; }
.m-person-ico.has-photo img, .m-person-ico img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pp-face-row { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.pp-preview { width: 4.2em; height: 4.2em; font-size: 1.3em; }
.pp-upload { position: relative; cursor: pointer; }
.pp-upload:focus-within { outline: 3px solid var(--focus, #29298e); outline-offset: 2px; }
.pp-icons .m-chip-pick span { padding: .4em; }
/* Settings as the one place (draft 11, A4): an index under the title, two wide cards for the copied-in accessibility and controller controls */
.set-index { margin-top: var(--space-3); }
.set-index ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.set-index a { display: inline-flex; align-items: center; gap: .35em; padding: .3em .7em; border-radius: 999px; border: 2px solid rgba(35, 24, 15, .25); background: #fffdf7; color: #23180f; font-weight: 700; font-size: var(--step--1); text-decoration: none; }
.set-index a:hover, .set-index a:focus-visible { border-color: #23180f; background: #fff3c4; }
.m-card-grid .m-card-wide { grid-column: 1 / -1; }
.set-prefs { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.set-prefs .pref-group { display: flex; flex-direction: column; gap: var(--space-2); }
.set-prefs .pref-label { font-weight: 700; }
.set-prefs .seg { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.set-pad .pref-pad { display: flex; flex-direction: column; gap: var(--space-3); }
.set-pad .pref-pad .pref-label { display: none; }
.m-reset-stars { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 2px dashed rgba(90, 72, 54, .25); }
.m-reset-stars p { margin: 0 0 .4rem; }
/* ---------- Calendar: drag plans to another day or into a new order ---------- */
.m-drag-hint { display: flex; align-items: center; gap: .4em; margin: 0 0 .6rem; }
.m-drag-hint .icon { width: 1.1em; height: 1.1em; flex: none; }
.m-wk-day .m-ci-list { min-height: 2.6rem; align-content: start; border-radius: 10px; }
.m-ci-list:not(:empty) + .wk-empty { display: none; }
.m-ci-list:empty + .wk-empty { margin-top: -2.4rem; pointer-events: none; padding: .6rem .45em; }
.m-ci[data-sort-id], .m-mo-items li[data-sort-id] { cursor: grab; touch-action: pan-y; }
.m-ci[data-sort-id] .ci-title { cursor: pointer; }
.m-mo-items { min-height: 1.2rem; }
.is-drop-target { outline: 3px dashed #c9a24a; outline-offset: 2px; background: rgba(255, 243, 176, .45); }
.m-mo-items .m-sort-ph { height: 12px !important; width: auto !important; border-radius: 3px; }
.m-ci-list.is-sorting, .m-mo-items.is-sorting { cursor: grabbing; }

/* ---------- Draft 9 v35 → Draft 10: chosen options look chosen ----------
   The one "chosen" look (sign-yellow fill, ink text, ink check badge, pressed down) now lives in play.css
   ("Draft 10: one chosen look for every option"), which loads last and supersedes the per-family rules above.
   What stays here is only what that layer does not cover. */
.m-kind-pick span { transition: transform .15s ease, background-color .15s ease; }
.m-kind-pick input:focus-visible + span, .gg-pick input:focus-visible + span { outline: 3px solid #29298e; outline-offset: 3px; }
.btn:active:not(:disabled), .icon-btn:active:not(:disabled), .m-cat-chip:active, .m-gc-chip:active, .m-seg button:active { filter: brightness(.9) saturate(1.1); }

/* ---------- the getting-started guide ---------- */
.gd-guide { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 14px 18px; align-items: center; margin: 0 0 16px; padding: 16px 18px;
  border-radius: 18px; background: #fffdf7; color: #23180f; border: 3px solid #23180f; box-shadow: 0 5px 0 #23180f; }
.gd-guide::after { content: ""; position: absolute; top: -10px; left: 40px; width: 70px; height: 20px; background: rgba(255, 210, 92, .85); transform: rotate(-3deg); border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.gd-guide h2 { margin: 0 0 4px; font-size: var(--step-1); color: #23180f; }
.gd-guide p { margin: 0; color: #3a2c1f; }
.gg-badge { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: #ffd25c; color: #23180f; border: 3px solid #23180f; }
.gg-badge .icon { width: 32px; height: 32px; }
.gg-kicker { font-size: var(--step--1); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #6b4f2e !important; }
.gg-dots { display: flex; gap: 6px; list-style: none; margin: 10px 0 0; padding: 0; }
.gg-dots li { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #a3865c; background: #fffaf0; font-size: 12px; font-weight: 800; color: #47372a; }
.gg-dots li .icon { width: 14px; height: 14px; }
.gg-dots li.is-done { background: #3e690e; border-color: #3e690e; color: #fff; }
.gg-dots li.is-now { background: #23180f; border-color: #23180f; color: #ffd25c; transform: scale(1.12); }
.gg-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
@media (max-width: 720px) { .gd-guide { grid-template-columns: auto 1fr; } .gg-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; } .gg-badge { width: 48px; height: 48px; } }
.gg-icons, .gg-colors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; position: relative; }
.gg-pick { position: relative; }
.gg-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.gg-icons .gg-pick > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: #fffaf0; border: 2px solid #dcc8a6; color: #47372a; cursor: pointer; transition: transform .15s ease; }
.gg-icons .gg-pick > span::before { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; font-size: 12px; margin: 0; }
.gg-icons .gg-pick input:checked + span { background: #23180f; color: #ffd25c; border-color: #23180f; transform: scale(1.06); }
.gg-color > span { display: block; width: 40px; height: 40px; border-radius: 50%; background: var(--c); border: 2px solid rgba(0,0,0,.35); cursor: pointer; }
.gg-color input:checked + span { box-shadow: 0 0 0 3px #fffdf7, 0 0 0 6px #23180f; }
.gg-row { display: grid; grid-template-columns: 1fr 8.5rem; gap: 10px; align-items: end; }
.gg-budget { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 4px 14px; }
.gg-budget .field { margin: 0; }

/* ---------- snug card grids (lib/masonry.mjs): each card spans the tiny rows its height needs ---------- */

.m-card-grid.is-packed { grid-auto-rows: 4px; row-gap: 0; align-items: start; }
.m-card-grid.is-packed > * { margin-bottom: 0; }

/* Library pictures (lib/libart.mjs): a drawn scene across the top of each card, with the type chip on it */
.m-lib-item .li-top { position: relative; display: block; margin: calc(var(--space-4) * -1) calc(var(--space-4) * -1) 0; }
.li-art { display: block; height: 104px; border-radius: 10px 10px 0 0; background: radial-gradient(circle at 20% 15%, rgba(255,255,255,.7), transparent 55%), var(--c-tint-paper, #f5ead7); border-bottom: 2px solid rgba(35,24,15,.12); overflow: hidden; }
.li-art-svg { display: block; width: 100%; height: 100%; padding: 6px 0 0; transition: transform .25s cubic-bezier(.2,.9,.3,1.3); }
.m-lib-item:hover .li-art-svg, .m-lib-item:focus-within .li-art-svg { transform: scale(1.06) rotate(-1deg); }
.m-lib-item .li-type { position: absolute; right: 8px; top: 8px; background: #fffdf7; box-shadow: 0 1px 0 rgba(35,24,15,.25); }
@media (prefers-reduced-motion: reduce) { .m-lib-item:hover .li-art-svg, .m-lib-item:focus-within .li-art-svg { transform: none; } }
.m-tool-art { flex: none; display: block; width: 132px; height: 92px; border-radius: 14px; border: 2.5px solid #23180f; background: radial-gradient(circle at 20% 15%, rgba(255,255,255,.7), transparent 55%), var(--c-tint-paper, #f5ead7); box-shadow: 0 4px 0 rgba(35,24,15,.25); overflow: hidden; }
.m-tool-art svg { width: 100%; height: 100%; display: block; padding-top: 4px; }
@media (max-width: 520px) { .m-tool-art { width: 96px; height: 68px; } }

/* ---------- My timer, the tool page (draft 10, item 23): the biggest digits on the site ---------- */
.m-timer .tm-stage { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.tm-big { position: relative; width: min(100%, 420px); aspect-ratio: 1; }
.tm-big-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.tm-big-ring .tm-track { stroke: rgba(0,0,0,.14); stroke-width: 6; fill: none; }
.tm-big-ring .tm-prog { stroke: #e5484d; stroke-width: 6; fill: none; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .9s linear; filter: none; }
.tm-big-face { position: absolute; inset: 12%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: #121a2b; border: 3px solid #23180f; box-shadow: inset 0 4px 16px rgba(0,0,0,.6); text-align: center; padding: 8px; }
.tm-big-digits { font: 900 clamp(48px, 18vw, 96px)/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: #ffd34f; text-shadow: 0 0 12px rgba(255,211,79,.7); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.m-timer.is-running .tm-big-digits { color: #a8ff9e; text-shadow: 0 0 12px rgba(140,255,120,.65); }
.m-timer.is-done .tm-big-digits { color: #ff8e90; animation: tm-blink 1s steps(2, start) 6; }
.tm-big-label { margin: 0; font-weight: 800; font-size: var(--step-0); color: #9fe1ff; text-transform: uppercase; letter-spacing: .06em; }
.tm-big-words { margin: 0; font-size: var(--step--1, .9em); color: #cfd8e3; }
.tm-controls { justify-content: center; }
.tm-presets { margin-bottom: var(--space-3); }
.tm-custom { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-3); align-items: end; }
.tm-custom .tm-name { grid-column: 1 / -1; }
@media (min-width: 720px) { .tm-custom { grid-template-columns: 120px 120px 1fr auto; } .tm-custom .tm-name { grid-column: auto; } }
@media (prefers-reduced-motion: reduce) { .m-timer.is-done .tm-big-digits { animation: none; } .tm-big-ring .tm-prog { transition: none; } }
:root[data-motion="reduce"] .m-timer.is-done .tm-big-digits { animation: none; }
/* More timers and alarms (draft 11, C1): a card each, with its own little ring */
.tm-cards { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 10px; }
.tm-card { margin: 0; max-width: none; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: #fffdf7; color: #23180f; border: 2.5px solid #23180f; box-shadow: 0 4px 0 #23180f; }
.tm-card-face { position: relative; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: #121a2b; }
.tm-card-face svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tm-card-face .tm-track { stroke: rgba(255,255,255,.18); stroke-width: 5; fill: none; }
.tm-card-face .tm-prog { stroke: #ffd34f; stroke-width: 5; fill: none; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .9s linear; }
.tm-card.is-running .tm-prog { stroke: #8ef07f; }
.tm-card.is-alarm .tm-prog { stroke: #b892ff; }
.tm-card-ico { color: #ffd34f; display: grid; } .tm-card-ico .icon { width: 24px; height: 24px; }
.tm-card-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.tm-card-name { font-size: var(--step-0); overflow-wrap: anywhere; }
.tm-card-digits { font: 900 30px/1.1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: #23180f; }
.tm-card-words { color: #5a4836; }
.tm-card-btns { grid-column: 1 / -1; gap: 6px; }
.tm-card.is-ringing { background: #fff1c9; animation: tm-shake .5s ease-in-out 6; }
@keyframes tm-shake { 25% { transform: rotate(-1.2deg); } 75% { transform: rotate(1.2deg); } }
.tm-notify { margin: .4em 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5em; }
.tm-notify.is-on .icon { color: #0e7a5a; }
/* The card that names what rang: bottom of the screen, above everything else on the page */
.tm-ringing { position: fixed; z-index: 2147483000; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 32px), 460px); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.tm-ringing[popover] { inset: auto; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); margin: 0; border: 0; padding: 0; background: none; overflow: visible; color: inherit; }
.tm-ringcard { pointer-events: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 18px; background: #fffdf7; color: #23180f; border: 3px solid #23180f; box-shadow: 0 6px 0 #23180f, 0 14px 30px rgba(0,0,0,.3); animation: tm-rc-in .35s var(--toy-spring, ease) both; }
.tm-rc-bell { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #ffd34f; border: 2.5px solid #23180f; animation: tm-rc-ring 1s ease-in-out infinite; transform-origin: 50% 10%; }
.tm-rc-bell .icon { width: 26px; height: 26px; }
.tm-rc-text { flex: 1 1 160px; display: flex; flex-direction: column; font-size: var(--step-0); }
.tm-rc-text small { color: #5a4836; }
.tm-rc-btns { display: flex; gap: 8px; margin-left: auto; }
@keyframes tm-rc-in { from { transform: translateY(30px); opacity: 0; } }
@keyframes tm-rc-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-5deg); } }
.tm-more { display: block; font-size: 11px; font-weight: 800; color: #9fe1ff; letter-spacing: .02em; }
@media (prefers-reduced-motion: reduce) { .tm-card.is-ringing, .tm-ringcard, .tm-rc-bell { animation: none; } .tm-card-face .tm-prog { transition: none; } }
:root[data-motion="reduce"] :is(.tm-card.is-ringing, .tm-ringcard, .tm-rc-bell) { animation: none; }

/* ---------- Routine builder (draft 10, item 22): drawn pictures, photos, card colours, layouts, the step timer ---------- */
.rt-art.has-drawn { background: #fffdf7; border: 3px solid #23180f; }
.rt-art .st-art-svg { display: block; width: 100%; height: 100%; padding: 4%; }
.rt-art-sm .st-art-svg { padding: 2px; }
.rt-cover-ico.has-drawn, .rt-cover-ico.has-photo { overflow: hidden; }
.rt-cover-ico.has-drawn .st-art-svg { width: 84%; height: 84%; }
.rt-cover-ico.has-photo img { width: 100%; height: 100%; object-fit: cover; }
.rt-card-words { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; }
.rt-fmt-side { flex-direction: row; flex-wrap: wrap; align-items: center; text-align: left; justify-content: center; }
.rt-fmt-side .rt-card-no { flex-basis: 100%; }
.rt-fmt-side .rt-art-lg { width: min(100%, 260px); flex: none; }
.rt-fmt-side .rt-card-words { flex: 1 1 240px; align-items: flex-start; }
.rt-fmt-side .rt-text { max-width: none; }
.rt-fmt-side .st-timer { flex-basis: 100%; }
.rt-fmt-picture .rt-art-lg { width: min(100%, 520px); aspect-ratio: 4 / 3; }
.rt-fmt-picture h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
.rt-fmt-words h2 { font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.4rem); }
.rt-fmt-words .rt-text { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); max-width: 26ch; line-height: 1.4; }
.rt-picker { display: flex; flex-direction: column; gap: 10px; }
.rt-pick-tabs { flex-wrap: wrap; }
.rt-pick-pane { max-height: 300px; overflow: auto; padding: 4px; border: 2px dashed var(--line); border-radius: 12px; scrollbar-width: thin; }
.rt-pick-h { margin: 8px 0 6px; font-size: var(--step--1); color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.rt-art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.rt-art-pick { position: relative; cursor: pointer; }
.rt-art-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rt-art-pick > span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; border: 2px solid var(--line-strong); background: #fffdf7; color: #23180f; }
.rt-art-pick .st-art-svg { width: 100%; height: auto; }
.rt-art-pick small { font-size: 11px; font-weight: 700; text-align: center; line-height: 1.15; }
.rt-art-pick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.rt-photo-prevbox { display: grid; place-items: center; width: 112px; height: 84px; border-radius: 12px; background: var(--surface-2, #f3f0fa); border: 2px solid var(--line-strong); overflow: hidden; flex: none; }
.rt-photo-prevbox img { width: 100%; height: 100%; object-fit: cover; }
.rt-photo-empty .icon { width: 28px; height: 28px; color: var(--ink-3); }
.rt-sw-deck { position: relative; }
.rt-sw-deck::after { content: "deck"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 800 9px/1 system-ui, sans-serif; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); text-transform: uppercase; letter-spacing: .05em; }
.rt-fmt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rt-fmt-pick { position: relative; cursor: pointer; }
.rt-fmt-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rt-fmt-pick > span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: 12px; border: 2px solid var(--line-strong); background: #fffdf7; color: #23180f; text-align: center; }
.rt-fmt-pick strong { font-size: 13px; } .rt-fmt-pick small { font-size: 11px; color: #5a4532; line-height: 1.2; }
.rt-fmt-pick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.rt-fmt-demo { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; height: 48px; padding: 4px; border-radius: 8px; background: #e8dcc4; }
.rt-fmt-demo b { display: block; width: 28px; height: 20px; border-radius: 4px; background: #7b45c4; }
.rt-fmt-demo u { display: block; width: 40px; height: 8px; border-radius: 3px; background: #23180f; opacity: .7; text-decoration: none; }
.rt-fmt-demo.is-side { flex-direction: row; } .rt-fmt-demo.is-side b { width: 22px; height: 24px; } .rt-fmt-demo.is-side u { width: 24px; height: 14px; }
.rt-fmt-demo.is-picture b { width: 52px; height: 30px; } .rt-fmt-demo.is-picture u { width: 24px; height: 5px; }
.rt-fmt-demo.is-words b { display: none; } .rt-fmt-demo.is-words u { width: 48px; height: 14px; }
.rt-timer-fields { display: grid; grid-template-columns: repeat(2, minmax(100px, 160px)); gap: var(--space-3); }
.st-timer { gap: var(--space-3); }
.st-face { position: relative; width: 96px; height: 96px; flex: none; display: grid; place-items: center; }
.st-face svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-face .tm-track { fill: none; stroke: rgba(0,0,0,.14); stroke-width: 6; }
.st-face .tm-prog { fill: none; stroke: var(--c1, #e5484d); stroke-width: 6; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .9s linear; }
.st-digits { font: 900 22px/1 ui-monospace, Menlo, Consolas, monospace; color: #23180f; font-variant-numeric: tabular-nums; }
.st-timer.is-ringing .st-digits { color: #a3171b; animation: tm-blink 1s steps(2, start) 6; }
.st-btns { margin-top: 6px; }
.rt-next.is-nudged { animation: rt-nudge .6s ease-in-out 4; }
@keyframes rt-nudge { 50% { transform: translateY(-4px) scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .st-timer.is-ringing .st-digits, .rt-next.is-nudged { animation: none; } .st-face .tm-prog { transition: none; } }
:root[data-motion="reduce"] :is(.st-timer.is-ringing .st-digits, .rt-next.is-nudged) { animation: none; }
@media (max-width: 480px) { .st-timer { flex-direction: column; align-items: center; text-align: center; } .st-timer .rt-timer-text { align-items: center; } .st-btns { justify-content: center; } }

/* ---------- Build my schedule (draft 10, item 30): the board of blocks and the pile ---------- */
.m-sched .sc-bar { grid-template-columns: auto 1fr; }
.m-sched .sc-tools { grid-column: 1 / -1; }
.sc-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .85fr); gap: 16px; align-items: start; margin-top: 16px; }
.sc-board, .sc-pile { min-width: 0; }
.sc-pile { position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow: auto; }
.sc-day-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 16px; }
.sc-day-head .m-sub { margin: 0; }
.sc-day-head .small { margin: .2em 0 0; color: #47372a; }
.sc-start { display: inline-flex; align-items: center; gap: .5em; font-weight: 700; font-size: var(--step--1); }
.sc-start input { min-height: 40px; height: 40px; padding: 0 .5em; width: auto; }
.sc-empty { margin: .4em 0; padding: 1rem; border: 2px dashed #c9b791; border-radius: 14px; color: #47372a; text-align: center; font-weight: 700; }
/* the blocks */
.sc-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 64px; border-radius: 14px; }
.sc-list.is-day { padding: 4px; }
.sb { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ico time x" "ico title x" "ico place x" "ico meta x"; column-gap: 10px; row-gap: 1px; align-items: center; margin: 0; padding: 8px 10px 8px 14px; min-height: calc(56px + (var(--len, 30) - 15) * .5px); max-height: 180px; background: var(--bg, #fff1b8); color: #23180f; border: 2px solid #23180f; border-left: 10px solid var(--sp, #e3a900); border-radius: 12px; box-shadow: 0 2px 0 #23180f; touch-action: pan-y; }
.sb.is-compact { display: block; min-height: 0; padding: 5px 24px 6px 8px; border-left-width: 7px; box-shadow: 0 1px 0 #23180f; }
.sb.is-compact .sb-meta, .sb.is-compact .sb-ico { display: none; }
.sb.is-compact .sb-time, .sb.is-compact .sb-title, .sb.is-compact .sb-place { display: block; }
.sb.is-compact .sb-time { font-size: .7rem; }
.sb.is-compact .sb-place { font-size: .7rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sb.is-compact .sb-place .icon { display: none; }
.sb.is-compact .sb-x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; background: transparent; }
.sb.is-compact .sb-x .icon { width: 12px; height: 12px; }
.sc-grid.is-week { grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); }
.sc-grid.is-week .sc-pile-list { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.sb-ico { grid-area: ico; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 2px rgba(35,24,15,.18); }
.sb-ico .icon { width: 22px; height: 22px; }
.sb-time { grid-area: time; font-size: var(--step--2); font-weight: 800; letter-spacing: .02em; color: #47372a; display: inline-flex; align-items: center; gap: .3em; }
.sb-pin .icon { width: 12px; height: 12px; }
.sb-title { grid-area: title; justify-self: start; background: none; border: 0; padding: 0; margin: 0; font: inherit; font-weight: 800; font-size: var(--step-0); line-height: 1.2; color: inherit; text-align: left; cursor: grab; overflow-wrap: anywhere; }
.sb-title:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.sb.is-compact .sb-title { font-size: .82rem; line-height: 1.15; }
.sb-place { grid-area: place; font-size: var(--step--2); color: #47372a; display: inline-flex; align-items: center; gap: .25em; overflow-wrap: anywhere; }
.sb-place .icon { width: 13px; height: 13px; flex: none; }
.sb-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--step--2); color: #47372a; }
.sb-stars { color: #7a5200; letter-spacing: .05em; font-size: .9rem; }
.sb-offcal .icon { width: 14px; height: 14px; }
.sb-clash { color: #a3171b; font-weight: 800; display: inline-flex; align-items: center; gap: .25em; }
.sb-clash .icon { width: 14px; height: 14px; }
.sb.is-clash { border-color: #a3171b; }
.sb.is-off { background-image: repeating-linear-gradient(135deg, transparent 0 10px, rgba(35,24,15,.06) 10px 14px); }
.sb-x { grid-area: x; align-self: start; width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; background: rgba(255,255,255,.6); color: #47372a; display: grid; place-items: center; cursor: pointer; padding: 0; }
.sb-x .icon { width: 15px; height: 15px; } .sb-x:hover { border-color: #23180f; color: #23180f; background: #fffdf7; }
.sc-gap { list-style: none; margin: 0; display: flex; align-items: center; gap: 8px; color: #5a4836; font-size: var(--step--2); font-weight: 700; padding: 2px 12px; }
.sc-gap::before, .sc-gap::after { content: ""; flex: 1; border-top: 2px dashed #c9b791; }
.sc-gap span { display: inline-flex; align-items: center; gap: .3em; } .sc-gap .icon { width: 14px; height: 14px; }
.sc-list.is-sorting .sb-title { cursor: grabbing; }
.sc-day-foot { margin-top: 12px; }
.sc-also { margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(35,24,15,.05); }
.sc-also p { margin: 0 0 .2em; } .sc-also ul { margin: 0; padding-left: 1.1em; font-size: var(--step--1); } .sc-also.is-compact { margin: 6px 0 0; padding: 4px 8px; font-size: .74rem; color: #47372a; } .sc-also.is-compact .icon { width: 12px; height: 12px; }
/* the week: one strip of blocks per day, so every block stays readable and a drag between days is a drag up or down */
.sc-week { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.sc-wday { position: relative; margin: 0; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 6px 10px; align-items: start; padding: 6px 8px 6px 6px; background: #faf4e8; border-radius: 12px; min-width: 0; }
.sc-wday.is-today { box-shadow: inset 0 0 0 2px var(--m-accent, #2f6f7d); }
.sc-wday.is-target { background: #fff3b0; }
.sc-whead { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sc-whead h3 { margin: 0; }
.sc-whead h3 button { width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; background: none; border: 2px solid transparent; border-radius: 10px; padding: 4px 6px; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.sc-whead h3 button:hover { border-color: #a3865c; background: #fffdf7; }
.sc-whead h3 button[aria-pressed="true"] { border-color: #23180f; background: #fffdf7; box-shadow: inset 0 0 0 2px #23180f; }
.sc-whead h3 button[aria-pressed="true"]::after { content: "+"; margin-left: auto; width: 1.3em; height: 1.3em; display: grid; place-items: center; font-size: .85rem; font-weight: 900; line-height: 1; background: #23180f; color: #ffd25c; border-radius: 50%; }
.sc-wsum { margin: 0; padding-left: 6px; font-size: .72rem; font-weight: 700; color: #47372a; }
.sc-wopen { align-self: flex-start; margin-left: 6px; display: inline-flex; align-items: center; gap: .25em; font-size: .78rem; min-height: 24px; }
.sc-wopen .icon { width: 13px; height: 13px; }
.sc-wbody { min-width: 0; }
.sc-wday .sc-list { flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 6px; min-height: 52px; margin: 0; padding: 2px; }
.sb.is-compact { flex: 1 1 150px; max-width: 250px; }
.sc-wfree { margin: 0; padding: 4px 6px; color: #5a4836; font-weight: 700; font-size: var(--step--2); }
/* the pile */
.sc-pile .m-sub { margin-top: 0; }
.sc-pile-hint { margin: .3em 0 .6em; }
.sc-target { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 8px; }
.sc-target .small { margin-right: 4px; font-weight: 700; }
.sc-tbtn { min-width: 40px; min-height: 40px; padding: .2em .45em; border-radius: 10px; border: 2px solid #c9b791; background: #fffdf7; font: inherit; font-size: var(--step--2); font-weight: 700; color: #47372a; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; line-height: 1.05; }
.sc-tbtn b { font-size: var(--step-0); color: #23180f; }
.sc-tbtn[aria-pressed="true"] { border-color: #23180f; background: #fff3b0; box-shadow: inset 0 0 0 2px #23180f; }
.sc-cats { margin: 8px 0 10px; }
.sc-cats .m-cat-chip .icon { color: var(--sp, #47372a); }
.sc-pile-list { list-style: none; margin: 0; padding: 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; min-height: 60px; border-radius: 12px; }
.sp-group { grid-column: 1 / -1; margin: 6px 0 -2px; font-weight: 800; font-size: var(--step--1); color: #47372a; display: flex; align-items: center; gap: .4em; }
.sp-group:first-child { margin-top: 0; }
.sp-group .icon { width: 16px; height: 16px; }
.sp-item { position: relative; margin: 0; min-width: 0; }
.sp-block { width: 100%; height: 100%; min-height: 86px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 3px; padding: 8px 8px 8px 12px; background: var(--bg, #fff1b8); color: #23180f; border: 2px solid #23180f; border-left: 8px solid var(--sp, #e3a900); border-radius: 12px; box-shadow: 0 2px 0 #23180f; font: inherit; text-align: left; cursor: grab; touch-action: pan-y; }
.sp-block:hover { background: color-mix(in srgb, var(--bg, #fff1b8) 70%, #fffdf7); }
.sp-block .icon { width: 22px; height: 22px; color: var(--sp, #47372a); }
.sp-name { font-weight: 800; font-size: var(--step--1); line-height: 1.15; overflow-wrap: anywhere; }
.sp-place { font-size: .72rem; color: #47372a; line-height: 1.15; overflow-wrap: anywhere; }
.sp-len { margin-top: auto; font-size: .72rem; font-weight: 700; color: #5a4836; }
.sp-item.is-fav .sp-block { border-style: double; border-width: 4px; border-left-width: 8px; }
.sp-hide { position: absolute; top: -6px; right: -6px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #23180f; background: #fffdf7; color: #23180f; display: grid; place-items: center; cursor: pointer; padding: 0; z-index: 1; }
.sp-hide .icon { width: 14px; height: 14px; }
.sc-pile-foot { margin-top: 12px; }
.sc-pile-list.is-drop-target { outline-color: #a3171b; }
/* the block dialog */
.sc-lens { margin-bottom: 8px; }
.sc-lens .m-prompt[aria-pressed="true"] { background: #23180f; color: #ffd25c; border-style: solid; border-color: #23180f; }
.sc-len-row { margin-top: 4px; }
.sc-rate { border: 0; padding: 0; margin: 0 0 var(--space-3); min-width: 0; }
.sc-rate legend { font-weight: 800; margin-bottom: var(--space-2); }
.sc-stars { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.sc-stars label { position: relative; cursor: pointer; }
.sc-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sc-star > span:first-of-type { display: grid; place-items: center; width: 44px; height: 44px; font-size: 1.9rem; line-height: 1; color: #c9b791; border-radius: 10px; border: 2px solid transparent; }
.sc-stars input:focus-visible + span { outline: 3px solid #29298e; outline-offset: 1px; }
.sc-star input:checked + span { border-color: #23180f; background: #fffdf7; }
.sc-star:hover > span:first-of-type { background: #fff3b0; }
.sc-rate[data-score="1"] .sc-star:nth-child(-n+1) > span:first-of-type, .sc-rate[data-score="2"] .sc-star:nth-child(-n+2) > span:first-of-type, .sc-rate[data-score="3"] .sc-star:nth-child(-n+3) > span:first-of-type, .sc-rate[data-score="4"] .sc-star:nth-child(-n+4) > span:first-of-type, .sc-rate[data-score="5"] .sc-star:nth-child(-n+5) > span:first-of-type { color: #e3a900; text-shadow: 0 1px 0 #23180f; }
.sc-norate { margin-left: 8px; }
.sc-norate span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .8em; border: 2px dashed #c9b791; border-radius: 999px; font-weight: 700; font-size: var(--step--1); }
.sc-norate input:checked + span { border-style: solid; border-color: #23180f; background: #fff3b0; }
.sc-saved { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sc-saved li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 10px 12px; border: 2px solid #dcc8a6; border-radius: 12px; background: #fffdf7; }
.sc-saved-main { min-width: 0; flex: 1 1 220px; } .sc-saved-names { margin: .2em 0 0; color: #47372a; }
.sc-rlist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.sc-rstars { color: #7a5200; letter-spacing: .06em; }
.sc-places .m-card { padding: 1rem; }
.m-sched .m-back .link-btn { display: inline-flex; align-items: center; gap: .3em; }
@media (max-width: 900px) {
  .sc-grid, .sc-grid.is-week { grid-template-columns: minmax(0, 1fr); }
  .sc-grid.is-week .sc-pile-list { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .sc-pile { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 560px) {
  .sc-wday { grid-template-columns: minmax(0, 1fr); }
  .sc-whead { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .sc-whead h3 { flex: 1 1 auto; }
  .sb.is-compact { flex-basis: 130px; max-width: none; }
  .sb { grid-template-areas: "ico time x" "ico title x" "ico place x" "ico meta x"; max-height: none; }
  .sc-pile-list, .sc-grid.is-week .sc-pile-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .sp-block { padding: 6px 6px 6px 9px; min-height: 80px; border-left-width: 6px; }
  .sp-name { font-size: .78rem; }
  .sc-day-head { align-items: flex-start; }
  .m-sched .sc-bar { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .sb, .sp-block { transition: none; } }

/* A list item that works on a goal (draft 10) */
.li-goal { display: inline-flex; margin-left: 6px; }
.li-goal .gl-chip { font-size: .72rem; }
.li-goal-dot { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 4px; color: #2f6f9d; flex: none; }
.li-goal-dot .icon { width: 13px; height: 13px; }
.li-tool-goal[aria-pressed="true"] { color: #2f6f9d; }
.ck-tabs { display: grid; gap: 8px; }
.ck-pdfs { margin: 0; color: #47372a; }
/* My saved shelves (draft 11, G) */
.ly-saved { display: flex; flex-direction: column; gap: 4px; }
.ly-saved .m-add-opt { flex: 1; }
.ly-btns { gap: 6px; flex-wrap: wrap; }
.ly-btns input { flex: 1 1 10rem; min-height: 40px; }

/* ---------- The calendar as a readable plan for the day (draft 11, replacing the day map) ----------
 * Every plan shows all its words. The day view is a timeline: the time on the left, the plan as a card, free time
 * between plans, and on today a now line with a sun, plans already over softened, the current one and the next one lit.
 * Week columns use the whole width of the column for the words, with the time on a line above. */
.m-ci.is-compact { flex-direction: column; align-items: stretch; gap: 3px; padding: 6px 7px 7px; }
.m-ci.is-compact .ci-top { display: flex; align-items: center; gap: 6px; min-height: 24px; }
.m-ci.is-compact .ci-check { width: 1.1rem; height: 1.1rem; margin: 0; }
.m-ci.is-compact .ci-time { flex: 1; font-size: .78rem; white-space: nowrap; }
.m-ci.is-compact .ci-line { display: flex; gap: 5px; align-items: flex-start; }
.m-ci.is-compact .ci-line .ci-ico { margin-top: .2em; }
.m-ci.is-compact .ci-ico .icon { width: 1rem; height: 1rem; }
.m-ci.is-compact .ci-title { font-size: .92rem; line-height: 1.25; }
.m-ci.is-compact .ci-place, .m-ci.is-compact .ci-staff { font-size: .74rem; min-width: 0; }
.m-ci.is-compact .ci-place { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-ci.is-compact .ci-place .icon { vertical-align: -.12em; }
.m-wk-grid { gap: 6px; }
.m-wk-day { padding: 6px 5px 46px; }
.wk-next { margin: 0 2px; padding: .3em .5em; border-radius: 8px; background: #fff3b0; border: 2px solid #e3a900; font-size: .78rem; line-height: 1.25; display: flex; flex-wrap: wrap; gap: 0 .3em; align-items: baseline; }
.wk-next .icon { width: .9em; height: .9em; align-self: center; }
.wk-next span { font-weight: 800; color: #6b4a00; }
/* states shared by the week and the day */
.m-ci.is-past { opacity: .58; }
.m-ci.is-past .ci-title { font-weight: 600; }
.m-ci.is-now { box-shadow: 0 0 0 3px #ff9f1c, 0 2px 4px rgba(0, 0, 0, .12); background: #fff6dd; }
.m-ci.is-next { box-shadow: 0 0 0 3px #e3a900, 0 2px 4px rgba(0, 0, 0, .12); background: #fffbe8; }
.tl-tag { align-self: flex-start; display: inline-flex; align-items: center; padding: .05em .55em; border-radius: 999px; font-size: .74rem; font-weight: 900; letter-spacing: .02em; background: #e3a900; color: #23180f; }
.m-ci.is-now .tl-tag { background: #ff9f1c; }
/* the now line */
.tl-nowline { list-style: none; position: relative; margin: 2px 0; max-width: none; display: flex; align-items: center; gap: 8px; font-weight: 900; color: #7a3a00; font-size: var(--step--1); }
.tl-nowline [data-now-words] { padding: .05em .5em; border-radius: 999px; background: #fff3d6; }
.tl-nowline::after { content: ""; flex: 1; height: 0; border-top: 3px solid #ff9f1c; border-radius: 2px; }
.tl-sun { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: #ffd34f; border: 2px solid #23180f; color: #b35c00; box-shadow: 0 0 0 4px rgba(255, 211, 79, .4); }
.tl-sun .icon { width: 15px; height: 15px; }
.tl-nowline.is-short { font-size: .72rem; gap: 4px; }
.tl-nowline.is-short .tl-sun { width: 20px; height: 20px; } .tl-nowline.is-short .tl-sun .icon { width: 12px; height: 12px; }
/* the day timeline */
.tl-h { display: flex; align-items: center; gap: .35em; margin: .4em 0 0; font-size: var(--step-0); color: #47372a; }
.tl-list { list-style: none; padding: 0; gap: 8px; }
.tl-row { display: grid !important; grid-template-columns: 6.6rem minmax(0, 1fr); gap: 10px; align-items: stretch; padding: 0 !important; background: none !important; border-left: 0 !important; box-shadow: none !important; }
.tl-time { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-start; padding-top: .55em; text-align: right; line-height: 1.15; border-right: 4px solid var(--k); padding-right: 10px; }
.tl-time b { font-size: var(--step-0); font-weight: 900; color: #23180f; white-space: nowrap; }
.tl-time small { font-size: .78rem; color: #47372a; white-space: nowrap; }
.tl-card { display: flex; gap: 8px; align-items: flex-start; min-width: 0; padding: .6em .8em; background: #fffdf7; border-radius: 10px; border: 2px solid color-mix(in srgb, var(--k) 45%, #fffdf7); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.m-ci-list.is-loose .tl-row { grid-template-columns: minmax(0, 1fr); }
.tl-row.is-now .tl-card { background: #fff6dd; border-color: #ff9f1c; box-shadow: 0 0 0 3px #ff9f1c; }
.tl-row.is-next .tl-card { background: #fffbe8; border-color: #e3a900; box-shadow: 0 0 0 3px #e3a900; }
.tl-row.is-now, .tl-row.is-next { box-shadow: none !important; background: none !important; }
.tl-row.is-past .tl-time b { color: #5a4836; }
.tl-card .ci-title { font-size: var(--step-0); }
.ci-meta { display: flex; flex-wrap: wrap; gap: .2em .8em; align-items: center; }
.ci-meta:empty { display: none; }
.ci-any { font-size: .8rem; color: #47372a; font-weight: 700; }
.tl-gap { list-style: none; margin: 0; max-width: none; padding-left: calc(6.6rem + 10px); }
.tl-gap span { display: inline-flex; align-items: center; gap: .35em; font-size: .8rem; font-weight: 700; color: #4f6b3a; padding: .15em .7em; border-radius: 999px; border: 2px dashed #9fc28a; background: #f3faee; }
.tl-gap .icon { width: 1em; height: 1em; }
.tl-list .tl-nowline { padding-left: calc(6.6rem - 22px); }
.tl-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-summary p { margin: 0; flex: 1 1 16rem; display: flex; gap: .5em; align-items: center; padding: .6em .85em; border-radius: 12px; border: 2px solid #23180f; font-size: var(--step-0); line-height: 1.3; }
.tl-summary .icon { width: 1.3em; height: 1.3em; flex: none; }
.tl-sum-now { background: #ffe7b3; } .tl-sum-next { background: #fff6c8; }
.tl-in { display: inline-block; margin-left: .3em; padding: 0 .5em; border-radius: 999px; background: #23180f; color: #fff; font-size: .85em; font-weight: 800; }
@media (max-width: 560px) { .tl-row { grid-template-columns: 4.9rem minmax(0, 1fr); gap: 6px; } .tl-time { padding-right: 6px; } .tl-time b { font-size: .9rem; } .tl-gap { padding-left: calc(4.9rem + 6px); } .tl-list .tl-nowline { padding-left: calc(4.9rem - 22px); } }
/* My day on the shelf: now and next, readable from across the room */
.ob.ob-myday { align-items: stretch; justify-content: stretch; padding: 4px 4px 8px; }
.md-board { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 6px 9px; background: #fffdf7; color: #23180f; border: 3px solid #23180f; border-radius: 16px; box-shadow: 0 4px 0 #23180f; overflow: hidden; }
.md-anytime { flex: none; display: inline-flex; align-items: center; gap: .3em; padding: 2px 8px; border-radius: 999px; background: #f6efe1; font-size: 12.5px; color: #47372a; text-decoration: none; } .md-anytime .icon { width: 15px; height: 15px; } .md-anytime:hover { text-decoration: underline; }
.md-head { display: flex; align-items: center; gap: 6px; }
.md-date { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: .35em; font-family: var(--font-display); font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-date .icon { color: #e3a900; flex: none; }
.md-btn { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #23180f; background: #fffdf7; color: #23180f; cursor: pointer; text-decoration: none; }
.md-btn.is-add { background: #ffd34f; }
.md-btn .icon { width: 17px; height: 17px; }
.md-body { flex: 1; min-height: 0; display: flex; gap: 10px; }
.md-hero { flex: 1 1 55%; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 6px 10px; border-radius: 14px; border: 3px solid #23180f; border-left: 10px solid var(--k, #e3a900); background: #fff6c8; color: #23180f; font: inherit; text-align: left; cursor: pointer; }
.md-hero.is-now { background: #ffe7b3; }
.md-hero.is-free { background: #eef3fb; border-left-color: #8aa7c9; cursor: default; }
.md-label { display: inline-flex; align-items: center; gap: .3em; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: #6b4a00; }
.md-label .icon { width: 15px; height: 15px; }
.md-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; }
.md-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fffdf7; border: 2px solid #23180f; color: var(--k, #23180f); }
.md-ico .icon { width: 17px; height: 17px; }
.md-when { font-size: 14px; font-weight: 700; color: #47372a; }
.md-also { font-size: 13px; font-weight: 700; color: #6b4a00; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-when b { display: inline-block; padding: 0 .45em; border-radius: 999px; background: #23180f; color: #fff; }
.md-side { flex: 1 1 45%; min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.md-sub { margin: 0; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: #5a4836; }
.md-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.md-list li { margin: 0; max-width: none; }
.md-row { width: 100%; display: flex; gap: 6px; align-items: baseline; padding: 3px 6px; border: 0; border-left: 4px solid var(--k); border-radius: 6px; background: #f6efe1; color: #23180f; font: inherit; font-size: 14px; text-align: left; cursor: pointer; min-height: 28px; }
.md-row b { flex: none; font-size: 12.5px; }
.md-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-row:hover { background: #efe4d0; }
.md-more { font-size: 12px; font-weight: 800; color: #5a4836; padding-left: 6px; }
.ob-myday.is-big .md-body { flex-direction: column; }
.ob-myday.is-big .md-title { font-size: 26px; }
.w-grid[data-phone="1"] .md-head { padding-right: 34px; }
.w-grid[data-phone="1"] .md-date { font-size: 13px; }
@container (max-width: 360px) {
  .md-anytime { display: none; }
  .md-body { flex-direction: column; gap: 4px; }
  .md-hero { flex: none; }
  .md-title { font-size: 16px; } .md-ico { width: 24px; height: 24px; } .md-ico .icon { width: 14px; height: 14px; }
  .md-side .md-sub, .md-side .md-more, .md-side .md-list li + li { display: none; }
  .md-row::before { content: "Then:"; font-weight: 900; font-size: 12px; color: #6b4a00; }
}

/* ================= Draft 12: the calendar as a time grid (views/calgrid.mjs), the quick view, List, the small month ================= */
.m-cal-bar { grid-template-columns: auto minmax(0, 1fr) minmax(12rem, 16rem); }
.m-cal-bar .m-filter { grid-column: 1 / -1; }
.cal-modes button { padding: .3em .75em; }
.cal-find { position: relative; }
.cal-find .m-search-box input { width: 100%; min-height: 42px; }
.cal-found { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 6px; background: #fffdf7; border: 2px solid #23180f; border-radius: 12px; box-shadow: 0 10px 24px rgba(0, 0, 0, .2); max-height: 60vh; overflow: auto; }
.cal-found li { margin: 0; max-width: none; }
.cal-found button { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: .45em .6em; border: 0; border-left: 4px solid var(--k); border-radius: 6px; background: transparent; font: inherit; color: #23180f; cursor: pointer; }
.cal-found button:hover, .cal-found button:focus-visible { background: #f3ead9; }
.cal-found small { color: #47372a; font-weight: 700; }
.cal-none { padding: .5em .6em; color: #47372a; }
@media (max-width: 1000px) { .m-cal-bar { grid-template-columns: minmax(0, 1fr); } .m-cal-nav { justify-content: space-between; } }
.m-cal-main.has-side { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.m-cal-body { min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.m-cal-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 8px; }
.mm { padding: 10px; border-radius: 14px; background: #fffdf7; border: 2px solid #c9b28d; color: #23180f; }
.mm-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 4px; }
.mm-head b { font-size: var(--step-0); }
.mm-dow, .mm-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.mm-dow span { font-size: .72rem; font-weight: 800; color: #47372a; }
.mm-day { position: relative; aspect-ratio: 1; min-height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; font: inherit; font-size: .82rem; font-weight: 700; color: #23180f; cursor: pointer; padding: 0; }
.mm-day:hover { background: #f3ead9; }
.mm-day.is-out { color: #6b5d4f; }
.mm-day.is-in { background: #e3ecff; border-radius: 6px; }
.mm-day.is-today span { display: grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: #23180f; color: #fffdf7; }
.mm-day i { position: absolute; bottom: 2px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #2f6f9d; }
.mm-day:focus-visible { outline: 3px solid #29298e; outline-offset: 1px; }
.mm-hint { margin: 8px 0 0; display: flex; align-items: center; gap: .35em; font-size: .78rem; color: #47372a; }
.mm-hint .icon { width: 1em; height: 1em; }
.qv-link { display: inline; padding: 0; border: 0; background: none; font: inherit; font-weight: 800; color: #1d4ea8; text-decoration: underline; cursor: pointer; }
.qv-link:hover { color: #14306e; }
kbd { display: inline-block; min-width: 1.6em; padding: .05em .4em; border: 2px solid #23180f; border-bottom-width: 3px; border-radius: 6px; background: #fffdf7; color: #23180f; font: 800 .85em/1.3 var(--font-body); text-align: center; }
.cal-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 6px 14px; margin: 0 0 1em; }
.cal-keys div { display: flex; gap: .6em; align-items: center; }
.cal-keys dt, .cal-keys dd { margin: 0; }

/* the grid's sheet: now/next, the size and the whole-day switch, the hint */
.m-grid-sheet { display: flex; flex-direction: column; gap: 10px; padding-left: 10px; padding-right: 10px; }
.cg-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.cg-zoom button { min-height: 38px; padding: .2em .8em; }
.m-grid-sheet .m-drag-hint { margin: 0; }
/* the grid */
.cg { --hour: 64px; --gutter: 58px; --sb: 0px; position: relative; border: 2px solid #c9b28d; border-radius: 14px; background: #fffdf7; overflow: hidden; color: #23180f; }
.cg-head { display: grid; grid-template-columns: var(--gutter) repeat(var(--cols), minmax(0, 1fr)); padding-right: var(--sb); border-bottom: 2px solid #c9b28d; background: #faf4e8; }
.cg-corner { display: flex; align-items: flex-end; justify-content: center; padding: 4px 2px 8px; font-size: .62rem; font-weight: 800; color: #47372a; text-align: center; line-height: 1.1; text-transform: uppercase; letter-spacing: .04em; }
.cg-dhead { min-width: 0; padding: 4px 3px 6px; border-left: 1px solid #e4d4b8; display: flex; flex-direction: column; gap: 4px; }
.cg-dtop { display: flex; align-items: center; gap: 2px; }
.cg-dbtn { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: .2em .3em; border: 0; border-radius: 10px; background: transparent; font: inherit; color: #23180f; cursor: pointer; min-height: 40px; }
.cg-dbtn:hover { background: #efe4d0; }
.cg-dow { font-weight: 800; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: #47372a; }
.cg-dnum { font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); line-height: 1; }
.cg-dhead.is-today .cg-dnum { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .15em; border-radius: 999px; background: var(--m-accent, #2f6f7d); color: var(--m-on-accent, #fff); font-size: var(--step-1); }
.cg-dhead.is-today .cg-dow { color: #23180f; }
.cg-dmenu { flex: none; display: grid; place-items: center; width: 30px; min-width: 30px; height: 30px; min-height: 30px; padding: 0; border: 0 !important; border-radius: 50%; background: transparent !important; box-shadow: none !important; color: #47372a; }
.cg-dmenu:hover { background: #efe4d0 !important; color: #23180f; }
.cg-dmenu .icon { width: 18px; height: 18px; }
.cg-allday { list-style: none; margin: 0; padding: 2px; display: flex; flex-direction: column; gap: 3px; min-height: 26px; border-radius: 8px; }
.cg-allday.is-drop { outline: 3px dashed #2c56c9; background: #e8efff; }
.cg-chip { margin: 0; max-width: none; position: relative; }
.cg-chip-btn { width: 100%; display: flex; align-items: center; gap: .3em; padding: .2em .45em; min-height: 26px; border: 0; border-left: 4px solid var(--k); border-radius: 6px; background: color-mix(in srgb, var(--k) 14%, #fffdf7); font: inherit; font-size: .78rem; font-weight: 700; line-height: 1.2; color: #23180f; text-align: left; cursor: pointer; }
.cg-chip-btn span { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: break-word; hyphens: auto; }
.cg-chip-btn:hover span, .cg-chip-btn:focus-visible span { -webkit-line-clamp: unset; }
.cg-chip-btn .icon { width: 1em; height: 1em; flex: none; color: var(--k); }
.cg-chip.is-done .cg-chip-btn span { text-decoration: line-through; color: #5a4836; }
.cg-chip[data-move] { cursor: grab; touch-action: pan-y; }
.cg-allmore { border: 0; background: #efe4d0; border-radius: 999px; padding: .15em .6em; font: inherit; font-size: .74rem; font-weight: 800; color: #23180f; cursor: pointer; min-height: 26px; }
.cg-scroll { position: relative; max-height: min(66vh, calc(var(--grid-h) + 2px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.cg-scroll:focus-visible { outline: 3px solid #29298e; outline-offset: -3px; }
.cg-body { position: relative; display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); }
.cg-hours { list-style: none; margin: 0; padding: 0; position: relative; }
.cg-hours li { position: absolute; left: 0; right: 0; margin: 0; max-width: none; height: 0; }
.cg-hours li span { position: absolute; right: 6px; top: -.6em; font-size: .72rem; font-weight: 800; color: #47372a; white-space: nowrap; }
.cg-now-time { white-space: nowrap; right: 2px !important; left: auto !important; height: auto !important; transform: translateY(-50%); padding: 0 .35em; border-radius: 999px; background: #ff9f1c; color: #23180f; font-size: .7rem; font-weight: 900; z-index: 2; }
.cg-cols { position: relative; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  background-image: repeating-linear-gradient(to bottom, #e4d4b8 0 1px, transparent 1px calc(var(--hour) / 2), #f1e7d4 calc(var(--hour) / 2) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px) var(--hour)); }
.cg-col { position: relative; min-width: 0; border-left: 1px solid #e4d4b8; cursor: cell; }
.cg-col.is-today { background: color-mix(in srgb, var(--m-accent, #2f6f7d) 6%, transparent); }
.cg-col.is-drop { background: #e8efff; outline: none; }
.cg-night { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(60, 50, 120, .05) 0 6px, rgba(60, 50, 120, .09) 6px 12px); pointer-events: none; }
.cg-evs { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.cg-ev { position: absolute; margin: 0; max-width: none; min-width: 0; }
.cg-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: stretch; gap: 1px; padding: 3px 6px 3px 7px; text-align: left; border: 0; border-left: 5px solid var(--k); border-radius: 8px; background: color-mix(in srgb, var(--k) 15%, #fffdf7); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--k) 45%, #fffdf7), 0 2px 3px rgba(60, 40, 15, .14); font: inherit; color: #23180f; cursor: pointer; overflow: hidden; }
.cg-ev[data-move] .cg-card { cursor: grab; touch-action: pan-y; }
.cg-title { display: flex; gap: 4px; align-items: flex-start; font-weight: 800; font-size: .86rem; line-height: 1.22; min-width: 0; }
.cg-ico { display: inline-flex; color: var(--k); flex: none; margin-top: .1em; }
.cg-ico .icon { width: 1em; height: 1em; }
.cg-words { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.cg-time { font-size: .74rem; font-weight: 800; color: #47372a; display: inline-flex; align-items: center; gap: .3em; }
.cg-time .icon { width: .95em; height: .95em; }
.cg-more { display: none; flex-direction: column; gap: 1px; font-size: .74rem; color: #47372a; min-width: 0; }
.cg-meta { display: inline-flex; align-items: center; gap: .3em; min-width: 0; }
.cg-meta .icon { width: 1em; height: 1em; flex: none; }
.cg-more .gl-chip { align-self: flex-start; }
.sz-s .cg-card { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 6px; padding-top: 2px; }
.sz-s .cg-title { flex: 1 1 auto; } .sz-s .cg-words { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sz-m .cg-words { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sz-l .cg-more { display: flex; }
.cg-time .tl-tag { font-size: .66rem; padding: 0 .45em; margin-left: 2px; white-space: nowrap; }
.cg-time { flex-wrap: wrap; }
.cg-ev.is-done .cg-words { text-decoration: line-through; color: #5a4836; }
.cg-ev.is-done .cg-card { background: color-mix(in srgb, var(--k) 6%, #fffdf7); }
.cg-ev.is-past:not(:hover):not(:focus-within) .cg-card { opacity: .62; }
.cg-ev.is-now .cg-card { box-shadow: 0 0 0 3px #ff9f1c, 0 3px 6px rgba(0, 0, 0, .16); background: #fff6dd; }
.cg-ev.is-next .cg-card { box-shadow: 0 0 0 3px #e3a900, 0 3px 6px rgba(0, 0, 0, .16); background: #fffbe8; }
.cg-ev.is-team .cg-card { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--k) 14%, #fffdf7) 0 8px, color-mix(in srgb, var(--k) 22%, #fffdf7) 8px 16px); }
.cg-ev.is-cascade .cg-card { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--k) 55%, #fffdf7), -3px 2px 6px rgba(60, 40, 15, .22); }
.cg-bracket { position: absolute; left: 0; width: 4px; border-radius: 3px; background: repeating-linear-gradient(to bottom, #23180f 0 4px, transparent 4px 7px); pointer-events: none; z-index: 1; }
.cg-resize { position: absolute; z-index: 3; left: 18%; right: 18%; bottom: -3px; height: 10px; cursor: ns-resize; touch-action: none; }
.cg-resize::after { content: ""; position: absolute; left: 50%; top: 3px; width: 24px; height: 4px; margin-left: -12px; border-radius: 2px; background: rgba(35, 24, 15, .45); opacity: 0; transition: opacity .15s; }
.cg-ev:hover .cg-resize::after { opacity: 1; }
/* peek: hover, focus or the fairy lifts a card above the others, full width, with all its words */
.cg-ev:hover, .cg-ev:focus-within, .cg-ev.pad-target, .cg-ev:has(.pad-target) { z-index: 30 !important; }
.cg-ev:is(:hover, :focus-within, :has(.pad-target)) .cg-card { position: absolute; inset: 0 auto auto 0; min-width: max(100%, 13.5rem); height: auto; min-height: 100%; overflow: visible; box-shadow: 0 0 0 2px var(--k), 0 10px 24px rgba(40, 25, 10, .3); background: color-mix(in srgb, var(--k) 12%, #fffdf7); }
.peek-left .cg-ev:is(:hover, :focus-within, :has(.pad-target)) .cg-card { inset: 0 0 auto auto; }
.cg-ev:is(:hover, :focus-within, :has(.pad-target)) .cg-more { display: flex; }
.cg-ev:is(:hover, :focus-within, :has(.pad-target)) .cg-words { display: block; -webkit-line-clamp: unset; overflow: visible; }
.cg-card:focus-visible { outline: 3px solid #29298e; outline-offset: 2px; }
.cg-ev.is-moving { opacity: .35; }
.cg-ev.is-moving .cg-card { box-shadow: none; }
/* the place a drag would land */
.cg-preview { position: absolute; z-index: 40; left: 2px; right: 2px; display: flex; flex-direction: column; gap: 1px; padding: 3px 6px; border: 2.5px dashed #2c56c9; border-left: 6px solid var(--k, #2c56c9); border-radius: 8px; background: rgba(232, 239, 255, .92); color: #14306e; font-size: .78rem; line-height: 1.2; pointer-events: none; box-shadow: 0 6px 16px rgba(20, 48, 110, .2); }
.cg-preview b { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cg-preview span { font-weight: 900; }
.cg-new { position: absolute; z-index: 20; left: 3px; right: 3px; display: flex; align-items: flex-start; gap: .3em; padding: 4px 6px; border: 2.5px dashed #2c56c9; border-radius: 8px; background: #eef3ff; color: #14306e; font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; }
.cg-new .icon { width: 1em; height: 1em; margin-top: .15em; }
/* the now line */
.cg-now { position: absolute; z-index: 25; left: -4px; right: 0; height: 0; border-top: 3px solid #ff9f1c; pointer-events: none; }
.cg-sun { position: absolute; left: -10px; top: -12px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #ffd34f; border: 2px solid #23180f; color: #b35c00; box-shadow: 0 0 0 3px rgba(255, 211, 79, .45); }
.cg-sun .icon { width: 12px; height: 12px; }
@media (max-width: 640px) { .cg-dnum { font-size: var(--step-1); } .cg-title { font-size: .8rem; } .cg-card { padding: 2px 4px 2px 5px; border-left-width: 4px; } .cg-hours li span { font-size: .66rem; right: 3px; } .m-grid-sheet { padding-left: 6px; padding-right: 6px; } }
@media (prefers-reduced-motion: reduce) { .cg-resize::after { transition: none; } }
/* the quick view */
dialog.qv { margin: 0; padding: 0; border: 0; background: transparent; max-width: min(24rem, calc(100vw - 20px)); width: 24rem; overflow: visible; color: #23180f; }
dialog.qv:not(.is-placed):not(.is-sheet) { margin: auto; }
dialog.qv.is-placed { position: fixed; inset: auto; }
dialog.qv.is-sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: none; margin: 0; }
dialog.qv::backdrop { background: rgba(35, 24, 15, .18); }
.qv-in { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; border: 3px solid #23180f; border-top: 10px solid var(--k); border-radius: 16px; background: #fffdf7; box-shadow: 0 6px 0 #23180f, 0 18px 40px rgba(0, 0, 0, .25); max-height: min(80vh, 36rem); overflow: auto; }
dialog.qv.is-sheet .qv-in { border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .25); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.qv-head { display: flex; gap: 10px; align-items: flex-start; }
.qv-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: color-mix(in srgb, var(--k) 18%, #fffdf7); color: var(--k); }
.qv-ico .icon { width: 22px; height: 22px; }
.qv-ht { flex: 1; min-width: 0; }
.qv-kind { margin: 0; font-size: .78rem; font-weight: 800; color: #47372a; text-transform: uppercase; letter-spacing: .05em; }
.qv-head h2 { margin: 0; font-size: var(--step-1); line-height: 1.2; overflow-wrap: anywhere; }
.qv-when { margin: .15em 0 0; font-weight: 700; }
.qv-x { flex: none; }
.qv-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qv-facts li { margin: 0; max-width: none; display: flex; gap: .5em; align-items: flex-start; line-height: 1.35; }
.qv-facts li > .icon { width: 1.1em; height: 1.1em; flex: none; margin-top: .15em; color: #47372a; }
.qv-notes { white-space: pre-wrap; }
.qv-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.qv-btns .qv-del { margin-left: auto; }
/* the day menu */
.dm-list { display: grid; gap: 6px; }
.dm-btn { justify-content: flex-start; }
/* List */
.m-list-view { display: flex; flex-direction: column; gap: 14px; }
.lv-day { padding: 8px 10px 10px; border-radius: 12px; background: #faf4e8; display: flex; flex-direction: column; gap: 8px; }
.lv-day.is-today { box-shadow: inset 0 0 0 2px var(--m-accent, #2f6f7d); background: color-mix(in srgb, var(--m-accent, #2f6f7d) 7%, #fffdf7); }
.lv-day.is-drop { outline: 3px dashed #2c56c9; }
.lv-h { margin: 0; font-size: var(--step-0); }
.lv-hbtn { display: inline-flex; align-items: baseline; gap: .4em; flex-wrap: wrap; padding: .2em .4em; border: 0; border-radius: 8px; background: transparent; font: inherit; color: #23180f; cursor: pointer; min-height: 36px; }
.lv-hbtn:hover { background: #efe4d0; }
.lv-dow { font-weight: 900; } .lv-date { font-weight: 700; color: #47372a; }
.lv-free { margin: 0 .4em; }
.m-day-main { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.m-day-btns { margin: 0; }
.m-mo-items li[data-qv] { cursor: pointer; }
.m-mo-items li[data-qv]:hover { background: #f3ead9; }
@media (max-width: 640px) {
  .cal-modes button .icon { display: none; }
  .cal-modes button { padding: .3em .6em; }
  .m-cal-bar .m-filter-chip { font-size: .8rem; padding: .2em .55em; min-height: 36px; }
  .cg-now-time { font-size: .62rem; padding: 0 .2em; }
}

/* ================= Draft 12, batch 4: My style, reorganised (views/style.mjs, lib/musicui.mjs) ================= */
.m-world-stage .ws-h { margin: 0; color: #fff; font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); text-shadow: 0 2px 20px rgba(0,0,0,.5); display: flex; align-items: center; gap: .35em; }
.m-world-stage .ws-h .icon { width: .9em; height: .9em; }
.m-style #st-sec-world, .m-style #st-sec-music, .m-style #st-sec-shelf, .m-style #st-sec-look, .m-style #st-sec-card, .m-style #st-sec-earned { scroll-margin-top: 16px; }
/* Music */
.st-music { display: flex; flex-direction: column; gap: 12px; }
.mu-now { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "play what next" "play vol vol"; gap: 8px 14px; align-items: center; padding: 12px 14px; border-radius: 16px; background: #23180f; color: #fffdf7; }
.mu-big { grid-area: play; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; border: 3px solid #ffd34f; background: #ffd34f; color: #23180f; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.mu-big .icon { width: 30px; height: 30px; }
.mu-big:hover { background: #ffe27f; } .mu-big:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.mu-big:focus-visible { outline: 3px solid #8fc5ff; outline-offset: 3px; }
.mu-what { grid-area: what; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mu-what b { font-size: var(--step-1); line-height: 1.2; }
.mu-what small { color: #f3e6c8; }
.mu-now [data-mu-next] { grid-area: next; background: #fffdf7; color: #23180f; }
.mu-vol { grid-area: vol; display: flex; align-items: center; gap: 10px; }
.mu-vol label { display: inline-flex; align-items: center; gap: .35em; font-weight: 800; white-space: nowrap; }
.mu-vol label .icon { width: 1.1em; height: 1.1em; }
.mu-vol input { flex: 1; accent-color: #ffd34f; min-height: 32px; }
.mu-btns { margin: 0; }
.mu-auto { margin: 0; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; align-self: flex-start; }
.mu-songs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.mu-songs li { margin: 0; max-width: none; }
.mu-song { width: 100%; height: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ico txt" "ico state"; column-gap: .7em; align-items: center; padding: .65em .8em; border-radius: 14px; border: 2px solid #dcc8a6; background: #fffaf0; color: #23180f; font: inherit; text-align: left; cursor: pointer; transition: transform .12s; }
.mu-ico { grid-area: ico; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #f3e6c8; color: #5a4836; }
.mu-ico .icon { width: 24px; height: 24px; }
.mu-txt { grid-area: txt; display: flex; flex-direction: column; min-width: 0; }
.mu-txt small { color: #47372a; line-height: 1.3; }
.mu-state { grid-area: state; display: inline-flex; align-items: center; gap: .3em; margin-top: 4px; font-size: .8rem; font-weight: 800; color: #5a4836; }
.mu-state .icon { width: 1em; height: 1em; }
.mu-song:hover { transform: translateY(-2px); border-color: #a3865c; }
.mu-song:focus-visible { outline: 3px solid #29298e; outline-offset: 3px; }
.mu-song.is-playing { background: #23180f; color: #fffdf7; border-color: #23180f; }
.mu-song.is-playing .mu-txt small, .mu-song.is-playing .mu-state { color: #ffd25c; }
.mu-song.is-playing .mu-ico { background: #ffd34f; color: #23180f; }
@media (max-width: 560px) { .mu-now { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "play what" "next next" "vol vol"; } .mu-now [data-mu-next] { justify-self: start; } }
@media (prefers-reduced-motion: reduce) { .mu-song { transition: none; } .mu-song:hover { transform: none; } }
:root[data-motion="reduce"] .mu-song { transition: none; } :root[data-motion="reduce"] .mu-song:hover { transform: none; }
/* Clear my shelf, in My style */
.st-clear { align-items: center; margin-top: 12px; }
.st-clear .hint { flex: 1 1 18rem; margin: 0; }
/* Fine-tune the look: tabs */
.st-tune { display: flex; flex-direction: column; gap: 10px; }
.st-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 2px solid #e4d4b8; padding-bottom: 8px; }
.st-tabs [role="tab"] { display: inline-flex; align-items: center; gap: .35em; min-height: 42px; padding: .3em .85em; border: 2px solid #dcc8a6; border-radius: 999px; background: #fffaf0; color: #23180f; font: inherit; font-weight: 800; font-size: var(--step--1); cursor: pointer; }
.st-tabs [role="tab"] .icon { width: 1.1em; height: 1.1em; }
.st-tabs [role="tab"][aria-selected="true"] { background: #23180f; color: #fffdf7; border-color: #23180f; }
.st-tabs [role="tab"]:focus-visible { outline: 3px solid #29298e; outline-offset: 2px; }
.st-panel { padding: 4px 2px; }
.st-panel:focus-visible { outline: 3px solid #29298e; outline-offset: 4px; border-radius: 8px; }
/* Things I've earned: what's next */
.st-soon { margin-bottom: 12px; padding: 10px 12px; border-radius: 14px; background: #fffaf0; border: 2px dashed #c9a24a; }
.st-soon h3 { margin: 0 0 6px; display: flex; align-items: center; gap: .35em; font-size: var(--step-0); }
.st-soon ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-soon li { margin: 0; max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(6rem, 12rem) auto; gap: 4px 10px; align-items: center; }
.st-soon-name { font-weight: 800; }
.st-soon-bar { height: 12px; border-radius: 999px; background: #efe4d0; border: 1.5px solid #a3865c; overflow: hidden; }
.st-soon-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd34f, #ff9f1c); }
.st-soon small { font-weight: 800; color: #47372a; white-space: nowrap; }
.st-soon-all { display: flex; align-items: center; gap: .4em; font-weight: 800; }
@media (max-width: 560px) { .st-soon li { grid-template-columns: minmax(0, 1fr) auto; } .st-soon-bar { grid-column: 1 / -1; grid-row: 2; } }
/* the quick player (the header's Music button) */
dialog.qp { margin: 0; padding: 0; border: 0; background: transparent; width: 22rem; max-width: calc(100vw - 20px); overflow: visible; color: #23180f; }
dialog.qp:not(.is-placed):not(.is-sheet) { margin: auto; }
dialog.qp.is-placed { position: fixed; inset: auto; }
dialog.qp.is-sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: none; }
dialog.qp::backdrop { background: rgba(35, 24, 15, .15); }
.qp-in { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; border: 3px solid #23180f; border-radius: 16px; background: #fffdf7; box-shadow: 0 6px 0 #23180f, 0 18px 40px rgba(0, 0, 0, .25); }
dialog.qp.is-sheet .qp-in { border-radius: 18px 18px 0 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.qp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qp-head h2 { margin: 0; display: flex; align-items: center; gap: .35em; font-size: var(--step-1); }
.qp-now { margin: 0; display: flex; align-items: center; gap: .45em; line-height: 1.35; }
.qp-now .icon { width: 1.4em; height: 1.4em; flex: none; }
.qp-ctl { display: flex; flex-wrap: wrap; gap: 6px; }
.qp-vol { margin: 0; }
.qp-vol input { width: 100%; }
.qp-more { margin: 0; }
.qp-more a { display: inline-flex; align-items: center; gap: .35em; font-weight: 800; }
