/* ==========================================================================
   Smartisan OS UI — CSS tokens + components (complete kit)
   Source: Figma Community "Smartisan OS UI Kit (Unofficial)" by Paix Chan (CC BY 4.0)
           https://www.figma.com/community/file/1419385240874679870
           — based on Smartisan OS 8 on Smartisan R2; cross-checked on a real R2.
   Every value below was read from the Figma nodes; the comment after a rule
   names the Figma component it reproduces. See references/inventory.md.

   Usage:  <link rel="stylesheet" href="smartisan.css">, put class="s-page" on
           <body>, inline icons-sprite.svg, then use the .s-* classes.
   State:  every pressable component styles :active AND .is-pressed, so you can
           render a static "pressed" sample. Disabled = :disabled or
           [aria-disabled="true"]. Selected = :checked / aria-selected /
           aria-pressed / aria-current as noted per component.
   ========================================================================== */

:root {
  /* ---------- Figma variables: Grey/* ---------- */
  --s-white: #ffffff;      /* Grey/white */
  --s-grey-100: #fafafa;   /* Grey/100  = Background/Container/Miscellaneous */
  --s-grey-200: #f2f2f2;   /* Grey/200  = Divider */
  --s-grey-300: #eeeeee;   /* Grey/300  = Border/Button */
  --s-grey-400: #e2e2e2;   /* Grey/400  = Border/List */
  --s-grey-500: #bababa;   /* Grey/500  = Disabled */
  --s-grey-600: #9d9d9d;   /* Grey/600  = Subtitle/Other */
  --s-grey-700: #7f7f7f;   /* Grey/700  = Subtitle/List */
  --s-grey-800: #636363;   /* Grey/800  = Title/Other */
  --s-grey-900: #333333;   /* Grey/900  = Title/List */

  /* ---------- Figma variables: Blue/* ---------- */
  --s-blue-100: #e7edfd;   /* Blue/100 — icon button bg */
  --s-blue-300: #5985eb;   /* Blue/300 — pressed list row */
  --s-blue-400: #5079d9;   /* Blue/400 — text button */
  --s-blue-500: #3f68e2;   /* Blue/500 — primary border */
  --s-blue-600: #2f54d7;   /* Blue/600 — primary pressed border */

  /* ---------- Figma variables: semantic ---------- */
  --s-title-list: var(--s-grey-900);
  --s-subtitle-list: var(--s-grey-700);
  --s-title-other: var(--s-grey-800);
  --s-subtitle-other: var(--s-grey-600);
  --s-disabled: var(--s-grey-500);
  --s-divider-color: var(--s-grey-200);
  --s-border-list: var(--s-grey-400);
  --s-border-button: var(--s-grey-300);
  --s-container-misc: var(--s-grey-100);
  --s-btn-primary-pressed: #4772e6;  /* Background/Button/Primary/Pressed */
  --s-dialog-action-text: #5e80d0;   /* Dialog/Action */
  --s-dialog-action: #f7f7f7;        /* Miscellaneous/Backgound-DialogAction/Enabled */
  --s-dialog-action-pressed: #dfdfdf;/* Miscellaneous/Backgound-DialogAction/Pressed */
  --s-red-stroke: #da463e;           /* Red/Button-Stroke-Enabled */
  --s-board: #f5f5f5;                /* ComponentBoard/SectionFill (= page bg) */
  --s-board-stroke: #9a9a9a;         /* ComponentBoard/ComponentSetStroke */

  /* ---------- Figma paint styles (gradients, top → bottom) ---------- */
  --s-grad-primary: linear-gradient(180deg, #5b87eb, #5883eb);         /* Background/Button/Primary/Enabled */
  --s-grad-primary-sm-disabled: linear-gradient(180deg, #628cec, #517ce8);
  --s-grad-white: linear-gradient(180deg, #ffffff, #fcfcfc);           /* Background/Button/White/Enabled */
  --s-grad-white-pressed: linear-gradient(180deg, #ebebeb, #f2f2f2);   /* Background/Button/White/Pressed */
  --s-grad-red: linear-gradient(180deg, #e5645a, #e55f55);             /* Background/Button/Red/Enabled */
  --s-grad-icon: linear-gradient(180deg, #8c8c8c, #989898);            /* Fill/Icon/Enabled */
  --s-grad-icon-disabled: linear-gradient(180deg, #c6c6c6, #c8c8c8);   /* Fill/Icon/Disabled */
  --s-grad-appbar-red: linear-gradient(180deg, #cd3f3a, #c83530);
  --s-grad-segment: linear-gradient(180deg, #4878f0, #6997f4);
  --s-grad-sheet-header: linear-gradient(180deg, #ffffff, #fafafa);
  --s-grad-toast: linear-gradient(180deg, #fcf6e6, #fcf3dc);
  --s-grad-slider-fill: linear-gradient(0deg, #7ca3fb, #668ff7);
  --s-grad-switch-dot: linear-gradient(180deg, #9cbcff, #7da7ff);
  --s-grad-radio-on: linear-gradient(180deg, #95afe5, #6889da);
  --s-grad-radio-off: linear-gradient(180deg, #fbfbfb, #f1f1f1);
  --s-grad-picker-body: linear-gradient(180deg, #ededed 0%, #f1f1f1 14%, #ededed 100%);
  --s-grad-picker-well: linear-gradient(180deg, #fefefe 40.5%, #e2e2e3 100%);
  --s-grad-picker-band: linear-gradient(180deg, #ffffff 0%, #f5f5f5 53.5%, #f8f8f8 100%);
  --s-grad-kit-header: linear-gradient(90deg, #222325 0%, #3b3c3f 49%, #222325 100%);

  /* ---------- Other surfaces / text ---------- */
  --s-page: var(--s-board);
  --s-sheet-body: #efefef;
  --s-overlay: rgba(0, 0, 0, 0.6);
  --s-appbar-border: #d8d8d8;
  --s-appbar-red-border: #b7241f;
  --s-dialog-header-border: #ededed;
  --s-dialog-action-border: #e8e8e8;
  --s-dialog-action-border-pressed: #d5d5d5;
  --s-text-body: #656565;      /* dialog paragraph, sheet/picker title */
  --s-text-desc: #797979;      /* list footer description */
  --s-text-simple-dialog: #898989;
  --s-text-tile3: #787878;
  --s-placeholder: #d9d9d9;
  --s-icon: #929292;           /* solid stand-in for --s-grad-icon */
  --s-icon-disabled: #c7c7c7;  /* solid stand-in for --s-grad-icon-disabled */
  --s-icon-chevron: #b2b2b2;
  --s-icon-more: #bababa;
  --s-icon-blue: #5c89f2;
  --s-icon-check-blue: #6190ff;
  --s-icon-add: #c9cbcf;

  /* ---------- Radii ---------- */
  --s-r-segment: 3px;
  --s-r-sm: 4px;        /* button/radius/small */
  --s-r-md: 6px;
  --s-r-sheet-btn: 8px;
  --s-r-lg: 10px;       /* button-radius */
  --s-r-dialog: 12px;
  --s-r-sheet: 20px;
  --s-r-kit: 40px;      /* kit documentation boards */
  --s-r-pill: 100px;

  /* ---------- Hairlines ---------- */
  --s-hair-xs: 0.4px;
  --s-hair-sm: 0.5px;
  --s-hair: 0.8px;

  /* ---------- Shadows ---------- */
  --s-shadow-btn: 0 4px 2px rgba(0, 0, 0, 0.10);            /* drop-shadow on elevated button */
  --s-shadow-card: 0 10px 16px rgba(0, 0, 0, 0.04);         /* list card */
  --s-shadow-card-sm: 0 2px 6px rgba(0, 0, 0, 0.06);        /* slide bar card */
  --s-shadow-dialog-actions: 0 4px 2.1px rgba(0, 0, 0, 0.07);
  --s-shadow-bar: 0 4px 4px rgba(0, 0, 0, 0.08);            /* search bar */
  --s-shadow-knob: 0 5px 16.6px rgba(0, 0, 0, 0.21);        /* 80px rounded button */
  --s-shadow-knob-sm: 0 4px 4px rgba(0, 0, 0, 0.12);        /* 28px rounded button */
  --s-shadow-thumb: 0 4px 4px rgba(0, 0, 0, 0.08);          /* switch thumb */
  --s-shadow-slider-thumb: 0 4px 8px rgba(0, 0, 0, 0.16);
  --s-shadow-radio-dot: 0 2px 4px rgba(0, 0, 0, 0.06);
  --s-inset-track: inset 0 4px 4px rgba(0, 0, 0, 0.06);
  --s-inset-switch: inset 0 4px 12px rgba(0, 0, 0, 0.10);
  --s-inset-well: inset 0 4px 12px rgba(0, 0, 0, 0.18);
  --s-inset-field: inset 0 4px 4px rgba(0, 0, 0, 0.04);     /* Shadow/textfield-inner */
  --s-inset-tab: inset 0 4px 10px rgba(0, 0, 0, 0.06);
  --s-inset-swipe: inset 0 0 4px rgba(0, 0, 0, 0.16);
  --s-inset-radio: inset 0 0 2px rgba(0, 0, 0, 0.08);

  /* ---------- Type ---------- */
  /* Real device (Smartisan OS 8.5.3 on R2): Latin = Smartisan Compact, CJK = Noto Sans CJK SC.
     The Figma kit substitutes Inter. Smartisan Compact is proprietary — only used if installed. */
  --s-font: "Smartisan Compact", "Inter", -apple-system, BlinkMacSystemFont, "Noto Sans CJK SC",
            "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
            "Helvetica Neue", Arial, sans-serif;

  /* ---------- Measured on a real Smartisan R2 (not in the Figma kit) ---------- */
  --s-page-real: #f0f0f0;                 /* real Settings page base */
  --s-page-texture: repeating-linear-gradient(90deg, #f0f0f0 0 3.6px, #eeeeee 3.6px 7.2px); /* vertical pinstripes */
  --s-appbar-shadow: linear-gradient(180deg, rgba(0, 0, 0, 0.047), rgba(0, 0, 0, 0.004) 70%, rgba(0, 0, 0, 0)); /* title_bar_shadow: 14dp, alpha 12→1 */
  --s-icon-list-light: #cdcdcf;           /* leading icons in real Settings rows */

  /* ---------- Layout ---------- */
  --s-screen: 432px;      /* R2: 1080px / density 400 (2.5x) = 432dp */

  /* ---------- Smartisan OS framework (smartisanos resource table, OS 8) ----------
     See references/motion.md. Text colours are black with alpha; on white they equal the
     kit greys (.8 = #333, .6 = #666, .5 = #7f7f7f, .384 = #9d9d9d), and they stay right on
     tinted or striped backgrounds, so prefer them over the solid greys there. */
  --s-text-primary: rgba(0, 0, 0, 0.8);      /* primary_text_color #cc000000 */
  --s-text-title: rgba(0, 0, 0, 0.6);        /* title_or_btn_text_color #99000000 */
  --s-text-summary: rgba(0, 0, 0, 0.5);      /* setting_item_summary_text_color #80000000 */
  --s-text-secondary: rgba(0, 0, 0, 0.384);  /* secondary_text_color #62000000 */
  --s-text-hint: rgba(0, 0, 0, 0.3);         /* input hint / section title #4c000000 */
  --s-text-disabled: rgba(0, 0, 0, 0.15);    /* disabled_text_color #26000000 */
  --s-list-divider: rgba(0, 0, 0, 0.08);     /* list_divider_color #14000000 */
  --s-link: #5079d9;                          /* blue_highlight_link_text_color */
  --s-warning: #d44d44;                       /* red_warning_failed_text_color */
  --s-success: #79ad31;                       /* succeed_text_color */
  --s-green: #97cc4e;                         /* green_btn_color (round add button) */
  --s-list-pressed: #5e88eb;                  /* list_item_pressed / blue_highlight_list_item_color */
  --s-list-selected: #e5eeff;                 /* multi-select row tint (Music 8.1 rewrite) */
  --s-section-bg: #f5f5f5;                    /* list_section_title_background */

  /* Spacing: the framework is a 6dp grid (small 6 / medium 12 / semi-large 18 / large 24 /
     section bar 30 / avatar 36 / title bar 48 / list row 60); 8, 10, 16, 26 are the "alt" steps. */
  --s-space-1: 6px;  --s-space-2: 12px; --s-space-3: 18px; --s-space-4: 24px;
  --s-space-5: 30px; --s-space-6: 36px; --s-space-8: 48px; --s-space-10: 60px;

  /* Type scale in sp: 20 / 17 / 16 / 15 / 13.5 / 12 / 10 / 8. The R2 ships with font scale 0.91,
     which is why the kit's px sizes are ~0.91x of these (20→18 dialog title, 17→16 bar title). */
  --s-font-scale: 0.91;

  /* Motion. Pressed states are instant; everything else uses these curves. */
  --s-ease-smooth: cubic-bezier(0.37, 0, 0.63, 1);   /* (1 - cos πt) / 2 — tabs, edit mode, push */
  --s-ease-decel: cubic-bezier(0.5, 1, 0.89, 1);     /* 1 - (1 - t)^2 — back, sheets, dialogs */
  --s-ease-decel-cubic: cubic-bezier(0.33, 1, 0.68, 1); /* 1 - (1 - t)^3 — full-screen page up/down */
  --s-ease-accel: cubic-bezier(0.11, 0, 0.5, 0);     /* t^2 — things leaving */
  --s-ease-spring: cubic-bezier(0.34, 1.7, 0.6, 1);  /* overshoot ≈ spring(damping .55, stiffness 800) */
  --s-dur-press: 64ms;     /* minimum time a quick tap stays visibly pressed */
  --s-dur-fast: 150ms;     /* title cross-fade halves, popup menu */
  --s-dur-swipe: 200ms;    /* swipe row settle, quick bar, wheel snap */
  --s-dur-base: 300ms;     /* page push, sheet in, full-screen page */
}

/* ======================= Base ======================= */
.s-root, .s-page {
  font-family: var(--s-font); color: var(--s-grey-900);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
.s-page { background: var(--s-page); min-height: 100%; }
/* Real-device look: pinstriped background as on Smartisan OS Settings (optional) */
.s-page--textured { background: var(--s-page-texture); }
.s-root [hidden], .s-page [hidden] { display: none !important; }
.s-root *, .s-page *, .s-root *::before, .s-page *::before, .s-root *::after, .s-page *::after { box-sizing: border-box; }

.s-icon { width: 24px; height: 24px; flex: none; color: var(--s-icon); display: inline-block; vertical-align: middle; }
.s-icon--16 { width: 16px; height: 16px; }
.s-icon--18 { width: 18px; height: 18px; }
.s-icon--20 { width: 20px; height: 20px; }
.s-icon--22 { width: 22px; height: 22px; }
.s-icon--28 { width: 28px; height: 28px; }

/* Divider (173:1303) · Vertical Divider (197:1228) · Divider-Short (208:1274) */
.s-divider { display: block; height: var(--s-hair); background: var(--s-divider-color); border: 0; margin: 0; }
.s-divider--v { width: 1px; height: 54px; }
.s-divider--short { width: var(--s-hair); height: 12px; background: var(--s-grey-300); }

/* ======================= App Bar (40:887) ======================= */
.s-appbar {
  position: relative; display: flex; align-items: center; gap: 4px;
  height: 48px; padding: 8px 14px; background: var(--s-white); border-bottom: 1px solid var(--s-appbar-border);
}
.s-appbar__title {
  position: absolute; left: 50%; top: calc(50% - 0.5px); transform: translate(-50%, -50%);
  font-size: 16px; font-weight: 700; color: var(--s-title-other); white-space: nowrap; pointer-events: none;
}
.s-appbar__spacer { flex: 1; }
.s-appbar__actions { display: flex; align-items: center; gap: 18px; }
/* zero specificity on purpose: any class you put on an app-bar button overrides this reset */
:where(.s-appbar > button, .s-appbar__actions > button):where(:not(.s-btn, .s-btn-icon)) {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--s-icon);
  transition: transform 220ms var(--s-ease-spring);   /* R2: peak ≈1.39 at ~120ms, settles at 1.33 by ~220ms */
}
/* Bar icons (TitleBar setBarIconScaleTouchListener): the glyph darkens and pops to 1.33x on a spring
   while held, then springs back. No background highlight. */
:where(.s-appbar > button, .s-appbar__actions > button):where(:not(.s-btn, .s-btn-icon)):where(:active, .is-pressed) { transform: scale(1.33); color: #5f5f5f; }
:where(.s-appbar > button, .s-appbar__actions > button):where(:not(.s-btn, .s-btn-icon)):where(:active, .is-pressed) .s-icon { color: #5f5f5f; }
/* Text actions in the bar: prefer .s-btn.s-btn--sm (primary, e.g. 完成) or .s-btn.s-btn--outline (secondary),
   both are 30px and sit in the 48px bar like the kit. Plain text fallback (not in the kit, derived): */
.s-appbar__text { font-family: var(--s-font); font-size: 16px; font-weight: 500; color: var(--s-title-other); }
.s-appbar__text:active { opacity: .6; }
.s-appbar--red { background: var(--s-grad-appbar-red); border-bottom-color: var(--s-appbar-red-border); }
/* Real device: no hairline, a 14dp soft fade onto the page instead (title_bar_shadow_height = 14dp) */
.s-appbar--shadow { z-index: 2; border-bottom-color: transparent; }
.s-appbar--shadow::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; background: var(--s-appbar-shadow); pointer-events: none; }
/* Real-device Settings style: lighter leading icons in list rows (optional) */
.s-list--light-icons .s-list-item > .s-icon:first-child { color: var(--s-icon-list-light); }
.s-appbar--red .s-appbar__title, .s-appbar--red > button, .s-appbar--red .s-appbar__actions > button, .s-appbar--red .s-icon { color: var(--s-white); }
.s-appbar--red > button:active .s-icon, .s-appbar--red > button.is-pressed .s-icon,
.s-appbar--red .s-appbar__actions > button:active .s-icon, .s-appbar--red .s-appbar__actions > button.is-pressed .s-icon { color: rgba(255, 255, 255, 0.7); }

/* ======================= Buttons ======================= */
/* Elevated Button (18:7) — large 408×60 */
.s-btn {
  appearance: none; cursor: pointer; font-family: var(--s-font);
  display: inline-flex; align-items: center; justify-content: center;
  height: 60px; padding: 0 22px; min-width: 120px;
  font-size: 16px; font-weight: 700; line-height: 1; color: var(--s-white);
  background: var(--s-grad-primary); border: var(--s-hair) solid var(--s-blue-500); border-radius: var(--s-r-lg);
  filter: drop-shadow(var(--s-shadow-btn));
}
.s-btn--block { display: flex; width: 100%; }
.s-btn:active, .s-btn.is-pressed { background: var(--s-btn-primary-pressed); border-color: var(--s-blue-600); }
.s-btn:disabled, .s-btn[aria-disabled="true"] { opacity: 0.3; cursor: default; background: var(--s-grad-primary); border-color: var(--s-blue-500); }

/* Small Elevated Button (147:413) — 30px */
.s-btn--sm { height: 30px; min-width: 0; padding: 8px 12px; font-size: 14px; border-width: var(--s-hair-xs); border-radius: var(--s-r-sm); filter: none; }
.s-btn--sm:disabled, .s-btn--sm[aria-disabled="true"] { background: var(--s-grad-primary-sm-disabled); border-color: #2c50cf; }

/* BottomSheet Button (27:138) — white 392×48 */
.s-btn--sheet { height: 48px; color: var(--s-title-other); background: var(--s-white); border: var(--s-hair) solid var(--s-border-button); border-radius: var(--s-r-sheet-btn); filter: none; }
.s-btn--sheet:active, .s-btn--sheet.is-pressed { background: #f8f8f8; border-color: var(--s-border-button); }

/* Outlined Button (26:13) — 94×30 */
.s-btn--outline { height: 30px; min-width: 0; padding: 8px 28px; font-size: 14px; color: #606060; background: transparent; border: var(--s-hair-sm) solid #d3d3d3; border-radius: var(--s-r-sm); filter: none; }
.s-btn--outline:active, .s-btn--outline.is-pressed { background: var(--s-grey-200); border-color: #d3d3d3; }

/* Text Button (147:270) — 12px Blue/400 */
.s-btn--text { height: auto; min-width: 0; padding: 0; font-size: 12px; font-weight: 400; color: var(--s-blue-400); background: none; border: 0; filter: none; }
.s-btn--text:active, .s-btn--text.is-pressed { background: none; opacity: 0.6; }

/* Icon Button (40:1028) — 38×30 */
.s-btn-icon {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 6px 10px; border: 0; border-radius: var(--s-r-md); background: var(--s-blue-100); color: var(--s-icon-blue);
}
.s-btn-icon .s-icon { width: 18px; height: 18px; color: inherit; }
.s-btn-icon:active, .s-btn-icon.is-pressed { filter: brightness(0.95); }

/* Rounded Button (20:5) — knob in a recess; large 80, small 28 */
.s-round-btn {
  appearance: none; cursor: pointer; position: relative; border: 0; padding: 0; flex: none;
  width: 80px; height: 80px; border-radius: 50%; background: #ededed;
  display: inline-flex; align-items: center; justify-content: center; color: var(--s-icon);
}
.s-round-btn::before {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  background: var(--s-grad-white); border: var(--s-hair-xs) solid var(--s-grey-300); box-shadow: var(--s-shadow-knob);
}
.s-round-btn > * { position: relative; }
/* si-play path bbox is 16.5×19.5 in a 24 viewBox, already shifted +3.25 right (optical centring).
   28px → triangle 19.25×22.75, bbox +3.8px right, centroid ≈ circle centre — exactly as Figma 19:30. */
.s-round-btn .s-icon { width: 28px; height: 28px; }
.s-round-btn:active::before, .s-round-btn.is-pressed::before { background: var(--s-grad-white-pressed); }
.s-round-btn--sm { width: 28px; height: 28px; background: #f5f5f5; }
.s-round-btn--sm::before { inset: 2.33px; box-shadow: var(--s-shadow-knob-sm); }
.s-round-btn--sm .s-icon { width: 10px; height: 10px; } /* triangle 6.9×8.1, +1.35px — Figma 24:58 */

/* Segmented Button (26:83 bar, 208:1263 item) — 60px; selected = blue 30px block.
   NB: in Figma the item variants are mislabeled (the blue block is "Selected=False"). */
.s-segmented { display: flex; align-items: center; height: 60px; background: var(--s-white); }
.s-segmented > button {
  all: unset; cursor: pointer; box-sizing: border-box; width: 100px; height: 100%; flex: none;
  display: flex; align-items: center; justify-content: center; position: relative;
  font-family: var(--s-font); font-size: 14px; font-weight: 700; color: var(--s-title-other);
}
.s-segmented--fill > button { flex: 1; width: auto; }
.s-segmented > button + button::before {
  content: ""; position: absolute; left: 0; top: 50%; height: 12px; width: var(--s-hair);
  transform: translateY(-50%); background: var(--s-grey-300);
}
.s-segmented > button > span { display: inline-flex; align-items: center; height: 30px; padding: 6px 12px; border-radius: var(--s-r-segment); border: var(--s-hair) solid transparent; }
.s-segmented > button[aria-pressed="true"] > span { color: var(--s-white); background: var(--s-grad-segment); border-color: #3d6fee; }

/* Tabs (179:3017) / Tab (203:1864) — 28.8px compact segmented control */
.s-tabs { display: inline-flex; height: 28.8px; overflow: hidden; border: var(--s-hair-xs) solid var(--s-grey-400); border-radius: var(--s-r-md); }
.s-tabs > button {
  all: unset; cursor: pointer; box-sizing: border-box; width: 60px; height: 100%; text-align: center; line-height: 28px;
  font-family: var(--s-font); font-size: 12px; font-weight: 700; color: var(--s-title-other);
  background: var(--s-white); border-right: var(--s-hair-sm) solid var(--s-grey-200);
}
.s-tabs > button:last-child { border-right: 0; }
.s-tabs > button[aria-selected="true"] { color: var(--s-white); background: #b2b2b2; box-shadow: var(--s-inset-tab), inset 0 0 0 var(--s-hair-xs) #a7a7a7; border-right-color: transparent; }

/* ======================= Chip (253:2478) ======================= */
/* colours: default(White) | --yellow | --blue | --red | --grey ; layout: default(None) | --all | --leading | --trailing */
.s-chip {
  appearance: none; cursor: pointer; font-family: var(--s-font);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 30px; min-height: 30px; min-width: 60px; padding: 6px 16px; overflow: hidden; border-radius: var(--s-r-pill);
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
  color: #646464; background: var(--s-grey-100); border: var(--s-hair-xs) solid #cecece;
}
.s-chip .s-icon { width: 20px; height: 20px; color: currentColor; }
.s-chip--all { padding: 6px 0 6px 4px; }
.s-chip--leading { padding: 6px 16px 6px 4px; }
.s-chip--trailing { padding: 6px 0 6px 16px; }
.s-chip:active, .s-chip.is-pressed { background: linear-gradient(180deg, #e9e9e9, #ececec); border-color: #bfbfbf; }
.s-chip--yellow { color: #cd9143; background: #fff5d9; border-color: #ccb08c; }
.s-chip--yellow:active, .s-chip--yellow.is-pressed { background: linear-gradient(180deg, #f2e9d1, #f2e8c9); border-color: #c5aa87; }
.s-chip--blue { color: #6393ff; background: var(--s-white); border-color: #93b2f7; }
.s-chip--blue:active, .s-chip--blue.is-pressed { background: linear-gradient(180deg, #e6efff, #e1ecff); border-color: #93b2f7; }
.s-chip--red { color: #cc3e39; background: #ffe7e5; border-color: #eb7f77; }
.s-chip--red:active, .s-chip--red.is-pressed { background: linear-gradient(180deg, #f2dcda, #f2d8d6); border-color: #f0948d; }
.s-chip--grey { color: #646464; background: #f0f0f0; border-color: #dadada; }
.s-chip--grey:active, .s-chip--grey.is-pressed { background: linear-gradient(180deg, #e9e9e9, #ececec); border-color: #bfbfbf; }

/* ======================= List (248:872) ======================= */
.s-list-group { display: flex; flex-direction: column; gap: 4px; }
.s-list-group__body { display: flex; flex-direction: column; gap: 6px; }
.s-list-group__header { padding: 0 16px; font-size: 14px; font-weight: 600; color: var(--s-subtitle-list); }
.s-list-group__desc { text-align: center; font-size: 14px; line-height: 1; color: var(--s-text-desc); }
.s-list {
  margin: 0; padding: 0; list-style: none; overflow: hidden; background: var(--s-white);
  border: var(--s-hair) solid var(--s-border-list); border-radius: var(--s-r-lg); box-shadow: var(--s-shadow-card);
}
.s-list--flush { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }

/* List Tile (253:1305) — 60px; Enabled / Pressed / Disabled */
.s-list-item {
  all: unset; box-sizing: border-box; width: 100%; position: relative;
  display: flex; align-items: center; gap: 18px; min-height: 60px; padding: 0 12px 0 18px;
  font-family: var(--s-font); background: var(--s-white); color: var(--s-title-list);
}
.s-list > .s-list-item:not(:last-child), .s-list-item--divider { box-shadow: inset 0 calc(-1 * var(--s-hair)) 0 var(--s-divider-color); }
.s-list-item > .s-icon:first-child { width: 20px; height: 20px; }
.s-list-item__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.s-list-item__title { font-size: 16px; color: var(--s-title-list); }
.s-list-item__subtitle { font-size: 12px; color: var(--s-subtitle-list); }
/* List Item Detail (253:1360) */
.s-list-item__detail { display: flex; align-items: center; font-size: 16px; color: var(--s-subtitle-list); white-space: nowrap; }
.s-list-item__detail .s-icon { color: var(--s-icon-chevron); }
a.s-list-item, button.s-list-item, .s-list-item[data-pressable] { cursor: pointer; }
/* Without smartisan.js rows use :active. With it (html.s-js) the script owns the state like Android's
   ListView: pressed after a 100ms tap timeout, at least 64ms for a quick tap, cancelled when the finger
   starts a scroll — so flinging a list never flashes rows blue. */
:root:not(.s-js) :is(a.s-list-item, button.s-list-item, .s-list-item[data-pressable]):active, .s-list-item.is-pressed {
  background: var(--s-blue-300); box-shadow: inset 0 0 0 var(--s-hair-xs) var(--s-blue-500);
}
:root:not(.s-js) :is(a.s-list-item, button.s-list-item, .s-list-item[data-pressable]):active *, .s-list-item.is-pressed * { color: var(--s-white) !important; }
/* Multi-select (edit mode): checked rows get a light blue tint, text keeps its colour */
.s-list-item[aria-selected="true"], .s-list-item.is-selected { background: var(--s-list-selected); }
.s-list-item[aria-disabled="true"] { pointer-events: none; }
.s-list-item[aria-disabled="true"], .s-list-item[aria-disabled="true"] * { color: var(--s-disabled) !important; }
.s-list-item[aria-disabled="true"] .s-icon { color: var(--s-icon-disabled) !important; }

/* A control that should take the remaining width of a row (e.g. a volume slider):
   <div class="s-list-item"><div class="s-list-item__text">…音量…</div><div class="s-list-item__control s-slider-row">…</div></div> */
.s-list-item__control { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; }
.s-list-item__text:has(~ .s-list-item__control) { flex: none; }
.s-list-item__control.s-slider-row > .s-icon { color: #808080; }

/* List Tile 2 (253:2000) — title 18 + right-aligned 14px detail */
.s-list-item--simple { gap: 18.4px; padding: 0 11.2px 0 18.4px; }
.s-list-item--simple .s-list-item__title { font-size: 18px; color: #333; white-space: nowrap; }
.s-list-item--simple .s-list-item__detail { flex: 1; justify-content: flex-end; font-size: 14px; color: var(--s-subtitle-other); }

/* List Tile 3 (211:1303) — transparent, grey text, 0.5px #ddd rule */
.s-list-item--plain { background: transparent; padding: 0 18px; flex-direction: column; align-items: stretch; gap: 0; }
.s-list-item--plain .s-list-item__text { height: 60px; justify-content: center; color: var(--s-text-tile3); }
.s-list-item--plain .s-list-item__title { font-size: 14px; color: var(--s-text-tile3); }
.s-list-item--plain .s-list-item__subtitle { font-size: 12px; color: var(--s-text-tile3); }
.s-list-item--plain::after { content: ""; display: block; height: 0.5px; background: #ddd; }

/* Slidable List Tile (211:1357). Smartisan swipes RIGHT: the row slides right and uncovers the tray on
   the left (Music, Clock, Notes all do this). Static markup = the open state, as in the kit.
   Add data-s-swipe and load smartisan.js for the gesture (see references/motion.md). */
.s-swipe { display: flex; overflow: hidden; width: 100%; }
.s-swipe__actions {
  flex: none; display: flex; align-items: center; gap: 20px; padding: 16px;
  background: rgba(255, 255, 255, 0.01); border: var(--s-hair-sm) solid #c7c7c7; box-shadow: var(--s-inset-swipe);
}
.s-swipe__actions > button { all: unset; cursor: pointer; display: inline-flex; color: var(--s-icon); }
.s-swipe > .s-list-item { flex: none; width: 100%; border: 1px solid var(--s-grey-400); gap: 18.4px; padding: 0 11.2px 0 18.4px; }
.s-swipe[data-s-swipe] { position: relative; touch-action: pan-y; background: var(--s-page-texture); }
.s-swipe[data-s-swipe] > .s-swipe__actions { position: absolute; left: 0; top: 0; bottom: 0; border: 0; padding: 0 16px; }
.s-swipe[data-s-swipe] > .s-list-item {
  border: 0; transform: translateX(var(--x, 0px)); transition: transform 200ms var(--s-ease-smooth);
  box-shadow: inset 0 calc(-1 * var(--s-hair)) 0 var(--s-divider-color), -2px 0 4px rgba(0, 0, 0, 0.06);
}
.s-swipe[data-s-swipe].is-dragging > .s-list-item { transition: none; }
.s-list > .s-swipe[data-s-swipe]:last-child > .s-list-item { box-shadow: -2px 0 4px rgba(0, 0, 0, 0.06); }   /* no rule under the last row */
.s-swipe.is-removing { overflow: hidden; transition: height 200ms var(--s-ease-decel), opacity 200ms; height: 0 !important; opacity: 0; }

/* ======================= Switch (42:1333) — <input type=checkbox> ======================= */
.s-switch {
  appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; flex: none;
  position: relative; width: 52px; height: 24px; border-radius: var(--s-r-pill);
  background: var(--s-white); border: var(--s-hair-xs) solid var(--s-grey-400); box-shadow: var(--s-inset-switch);
}
.s-switch::after { /* indicator dot: grey right when off, blue left when on */
  content: ""; position: absolute; top: 50%; left: 34.5px; width: 9.6px; height: 9.6px; margin-top: -4.8px;
  border-radius: 50%; background: #f4f4f4; border: var(--s-hair-xs) solid #e8e8e8;
}
.s-switch:checked::after { left: 7.9px; background: var(--s-grad-switch-dot); border-color: #769dfe; }
.s-switch::before { /* thumb: left when off, right when on */
  content: ""; position: absolute; top: -0.4px; left: -0.4px; width: 24px; height: 24px; border-radius: 50%; z-index: 1;
  background: var(--s-grad-white); border: var(--s-hair-xs) solid var(--s-grey-400); box-shadow: var(--s-shadow-thumb);
  left: calc(-0.4px + var(--pos, 0) * (100% - 23.2px));
  transition: left calc(70ms * var(--travel, 1)) linear;   /* SwitchEx, linear; R2 recording: full travel in ~4 frames */
}
.s-switch:checked { --pos: 1; }
.s-switch.is-dragging::before { transition: none; }   /* smartisan.js sets --pos while the thumb is dragged */
.s-switch:active::before, .s-switch.is-dragging::before { box-shadow: var(--s-shadow-thumb), 0 0 0 0.4px #d0d0d0; background: var(--s-grad-white-pressed); }
.s-switch:disabled { opacity: 0.75; cursor: default; }   /* SwitchEx disabled alpha 191/255 */

/* ======================= Radio (171:398) — <input type=radio> ======================= */
.s-radio {
  appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; flex: none; position: relative;
  width: 22px; height: 22px; border-radius: 50%; background: #ececec; box-shadow: var(--s-inset-radio);
}
.s-radio::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  background: var(--s-grad-radio-off); border: var(--s-hair-xs) solid #ececec; box-shadow: var(--s-shadow-radio-dot);
}
.s-radio:checked::after { background: var(--s-grad-radio-on); border-color: #5671c9; }
/* Radio List Item (171:369) — 48px + 0.8px divider */
.s-radio-item { display: flex; align-items: center; height: 48px; padding: 0 16px; font-size: 14px; color: var(--s-title-list); background: var(--s-white); cursor: pointer; }
.s-radio-item > span { flex: 1; }
.s-radio-item + .s-radio-item { box-shadow: inset 0 var(--s-hair) 0 var(--s-divider-color); }
.s-radio-item:last-child { box-shadow: inset 0 calc(-1 * var(--s-hair)) 0 var(--s-divider-color); }
.s-radio-item + .s-radio-item:last-child { box-shadow: inset 0 var(--s-hair) 0 var(--s-divider-color), inset 0 calc(-1 * var(--s-hair)) 0 var(--s-divider-color); }

/* ======================= Dialog (248:871) ======================= */
.s-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--s-overlay); }
.s-overlay--inline { position: relative; inset: auto; z-index: auto; }
.s-overlay--in-frame { position: absolute; }   /* inside a position:relative phone frame instead of the viewport */
.s-overlay[hidden] { display: none; }   /* .s-overlay sets display:flex, which would beat the UA [hidden] rule */
/* Dialog (R2 recordings, 60fps): the scrim darkens to 60% over ~200ms while the card pops in fast —
   scale ≈0.88 → 1 with a fade in ~120ms, decelerating. Closing: the card fades in ~100ms, the scrim
   clears over ~200ms. smartisan.js adds .is-closing before setting [hidden]. */
.s-overlay:not([hidden]) { animation: s-fade-in 200ms var(--s-ease-decel); }
.s-overlay:not([hidden]) > .s-dialog { animation: s-dialog-in 120ms var(--s-ease-decel); }
.s-overlay.is-closing { animation: s-scrim-out 200ms var(--s-ease-decel) forwards; }
.s-overlay.is-closing > .s-dialog { animation: s-fade-out 100ms var(--s-ease-accel) forwards; }
/* Bottom menu (MenuDialog / bottom sheet): slides up 300ms decelerate, leaves 250ms accelerate */
.s-overlay--sheet { align-items: flex-end; padding: 0; }
.s-overlay--sheet:not([hidden]) > .s-sheet { animation: s-sheet-in 300ms var(--s-ease-decel); }
.s-overlay--sheet.is-closing { animation-duration: 250ms; }
.s-overlay--sheet.is-closing > .s-sheet { animation: s-sheet-out 250ms var(--s-ease-accel) forwards; }
@keyframes s-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes s-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes s-dialog-in { from { opacity: 0; transform: scale(0.88); } to { opacity: 1; transform: none; } }
@keyframes s-scrim-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes s-dialog-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.9); } }
@keyframes s-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes s-sheet-out { from { transform: none; } to { transform: translateY(100%); } }
.s-dialog { width: 368px; max-width: 100%; display: flex; flex-direction: column; font-family: var(--s-font); }
.s-dialog.is-pressed { opacity: 0.9; }
.s-dialog.is-pressed .s-dialog__body { color: var(--s-title-other); }
/* Dialog Header (171:272) */
.s-dialog__header {
  height: 48px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--s-container-misc); border-bottom: 1px solid var(--s-dialog-header-border);
  border-radius: var(--s-r-dialog) var(--s-r-dialog) 0 0; font-size: 18px; font-weight: 700; color: var(--s-title-other);
}
.s-dialog__body { padding: 20px; background: var(--s-white); font-size: 16px; line-height: 24px; color: var(--s-text-body); }
.s-dialog__body:first-child { border-radius: var(--s-r-dialog) var(--s-r-dialog) 0 0; }
.s-dialog__body--flush { padding: 0; }
.s-dialog__body--field { padding: 24px 18px; }   /* TextField Dialog (195:1211) */
/* Dialog Action Group (253:1210): 1, 2 or 3 actions; primary is rightmost */
.s-dialog__actions { display: flex; overflow: hidden; border-radius: 0 0 var(--s-r-dialog) var(--s-r-dialog); filter: drop-shadow(var(--s-shadow-dialog-actions)); }
/* Dialog Action Button (253:1049) */
.s-dialog__actions > button {
  all: unset; cursor: pointer; box-sizing: border-box; flex: 1; height: 54px; text-align: center; line-height: 53px;
  font-family: var(--s-font); font-size: 14px; font-weight: 700; color: var(--s-title-other);
  background: var(--s-dialog-action); border-top: var(--s-hair) solid var(--s-dialog-action-border);
}
.s-dialog__actions > button + button { box-shadow: inset 1px 0 0 var(--s-divider-color); }
.s-dialog__actions > button[data-primary] { color: var(--s-dialog-action-text); }
.s-dialog__actions > button:active, .s-dialog__actions > button.is-pressed { background: var(--s-dialog-action-pressed); }
.s-dialog__actions > button[data-primary]:active, .s-dialog__actions > button[data-primary].is-pressed { border-top-color: var(--s-dialog-action-border-pressed); }
/* Simple Dialog (40:1064) — no header/actions, dismiss by tapping scrim */
.s-dialog--simple { width: 376px; padding: 40px 28px; background: var(--s-white); border-radius: var(--s-r-dialog); font-size: 12px; line-height: 28px; color: var(--s-text-simple-dialog); }

/* Text Field — Size=Narrow (172:455, "Be used in dialog") */
.s-textfield {
  width: 100%; height: 34px; padding: 0 12px; font-family: var(--s-font); font-size: 14px; color: var(--s-title-list);
  background: var(--s-white); border: var(--s-hair) solid var(--s-border-list); border-radius: var(--s-r-md);
  box-shadow: var(--s-inset-field); outline: none;
}
.s-textfield::placeholder { color: var(--s-placeholder); }
.s-textfield:focus { border-color: #93b2f7; }

/* ======================= Bottom Sheet (253:838) ======================= */
.s-sheet { width: 100%; display: flex; flex-direction: column; overflow: hidden; font-family: var(--s-font); }
/* Bottom Sheet Header (204:1173): leading ×, centered title, trailing ✓ (each optional) */
.s-sheet__header {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 0;
  height: 48px; padding: 14px 13px; background: var(--s-grad-sheet-header);
  border-bottom: 1px solid var(--s-border-list); border-radius: var(--s-r-sheet) var(--s-r-sheet) 0 0;
}
.s-sheet__header > .s-sheet__spacer { flex: 1; }
.s-sheet__title {
  position: absolute; left: calc(50% + 0.5px); top: 50%; transform: translate(-50%, -50%);
  font-size: 14px; font-weight: 700; color: var(--s-text-body); white-space: nowrap;
}
.s-sheet__header button { all: unset; cursor: pointer; display: inline-flex; color: var(--s-icon); }
.s-sheet__body { display: flex; flex-direction: column; align-items: stretch; gap: 20px; padding: 22px 20px 40px; background: var(--s-sheet-body); }

/* ======================= Date / Time Picker (147:276, 147:390) ======================= */
.s-picker { display: flex; flex-direction: column; height: 274px; overflow: hidden; font-family: var(--s-font); }
.s-picker__body { flex: 1; display: flex; padding: 0 12px 18px; background: var(--s-grad-picker-body); }
.s-picker__well {
  flex: 1; position: relative; display: flex; overflow: hidden;
  border: 1px solid #c6c6c8; border-radius: var(--s-r-md); background: var(--s-grad-picker-well);
}
.s-picker__well::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: var(--s-inset-well); }
.s-picker__band { position: absolute; left: -1px; right: -1px; top: 81px; height: 44px; background: var(--s-grad-picker-band); border: 1px solid #d9d9d9; }
.s-picker__col {
  flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 14px 0; font-size: 16px; text-align: center; color: #b3b3b5; border-right: 1px solid rgba(206, 206, 206, 0.4);
}
.s-picker__col:last-child { border-right: 0; }
.s-picker__col > * { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.s-picker__col > [aria-selected="true"] { flex: none; height: 38px; color: #55585c; }

/* ======================= Popup Menu (249:1126) ======================= */
.s-menu { width: 220px; overflow: hidden; background: var(--s-white); border: var(--s-hair-xs) solid var(--s-border-list); border-radius: var(--s-r-md); }
/* Popup Menu Item (175:1583) — 42px + 1px divider */
.s-menu > button {
  all: unset; cursor: pointer; box-sizing: border-box; width: 100%; height: 43px; padding: 0 18px;
  display: flex; align-items: center; gap: 8px; font-family: var(--s-font); font-size: 16px; color: var(--s-title-other);
  background: var(--s-white); box-shadow: inset 0 -1px 0 var(--s-divider-color);
}
.s-menu > button:active, .s-menu > button.is-pressed { background: var(--s-grey-200); }

/* ======================= Search (249:1242) ======================= */
/* Search Bar (68:142) */
.s-search { display: flex; align-items: center; gap: 16px; height: 48px; padding: 0 16px; background: var(--s-white); filter: drop-shadow(var(--s-shadow-bar)); }
.s-search > button { all: unset; cursor: pointer; display: inline-flex; color: var(--s-icon); }
/* Search Field (68:140) — standalone stroke #e9e9e9, inside bar #e2e2e2 */
.s-search-field {
  flex: 1; display: flex; align-items: center; gap: 10px; height: 30px; padding: 8px; overflow: hidden;
  background: #f5f5f5; border: var(--s-hair-sm) solid #e9e9e9; border-radius: var(--s-r-pill);
}
.s-search .s-search-field { border-color: var(--s-border-list); }
.s-search-field input { all: unset; flex: 1; min-width: 0; font-family: var(--s-font); font-size: 14px; color: var(--s-title-list); }
.s-search-field input::placeholder { color: var(--s-subtitle-other); }
.s-search-field > button { all: unset; cursor: pointer; display: inline-flex; }
/* Search Result Item (70:1103) / Search Result List (181:530) */
.s-result { display: flex; height: 60px; background: var(--s-white); box-shadow: inset 0 -1px 0 var(--s-divider-color); }
.s-result__leading { width: 60px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--s-container-misc); border-right: var(--s-hair-sm) solid var(--s-border-list); }
.s-result__text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 12px 18px 10px; letter-spacing: 0.5px; line-height: 24px; }
.s-result__title { font-size: 14px; color: var(--s-title-list); }
.s-result__subtitle { font-size: 12px; color: var(--s-subtitle-other); }
.s-search-with-result { position: relative; display: flex; flex-direction: column; }
.s-search-with-result > .s-search { position: relative; z-index: 1; }

/* ======================= Slide Bar (253:165) — <input type=range>; set --p 0–100 ======================= */
.s-slider-row { display: flex; align-items: center; gap: 22px; }
.s-slider-row > .s-icon, .s-slider-row > button { color: #808080; }
.s-slider-card { display: flex; align-items: center; gap: 22px; height: 60px; padding: 0 18px; background: var(--s-white); border: var(--s-hair) solid var(--s-border-list); border-radius: var(--s-r-lg); box-shadow: var(--s-shadow-card-sm); }
.s-slider-card > .s-icon { color: #808080; }
.s-slider { --p: 50; appearance: none; -webkit-appearance: none; flex: 1; min-width: 0; height: 20px; margin: 0; background: transparent; cursor: pointer; }
.s-slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: var(--s-r-pill); box-shadow: var(--s-inset-track);
  background: var(--s-grad-slider-fill) 0 0 / calc(var(--p) * 1%) 100% no-repeat, #efefef;
}
.s-slider::-moz-range-track { height: 4px; border-radius: var(--s-r-pill); background: #efefef; box-shadow: var(--s-inset-track); }
.s-slider::-moz-range-progress { height: 4px; border-radius: var(--s-r-pill); background: var(--s-grad-slider-fill); }
.s-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--s-white); border: var(--s-hair-xs) solid #f1f1f1; box-shadow: var(--s-shadow-slider-thumb); }
.s-slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--s-white); border: 0.4px solid #f1f1f1; box-shadow: var(--s-shadow-slider-thumb); }

/* ======================= Toast (40:1076) ======================= */
/* Toast host: fixed, centred above the bottom navigation. Toggle with [hidden] or use Smartisan.toast() from smartisan.js */
.s-toast-host { position: fixed; left: 0; right: 0; bottom: 78px; z-index: 110; display: flex; justify-content: center; pointer-events: none; }
.s-toast-host--in-frame { position: absolute; }   /* inside a position:relative phone frame instead of the viewport */
.s-toast-host[hidden] { display: none; }
.s-toast-host:not([hidden]) .s-toast { animation: s-fade-in .2s ease; }
.s-toast { display: inline-flex; align-items: center; justify-content: center; padding: 12px 16px; font-family: var(--s-font); font-size: 14px; font-weight: 700; color: #ad8a67; background: var(--s-grad-toast); border: var(--s-hair-xs) solid #d2b89c; border-radius: var(--s-r-md); white-space: nowrap; }

/* ======================= Bottom Navigation Bar (203:2020 / 72:178) ======================= */
.s-bottom-nav { display: flex; align-items: center; justify-content: center; gap: 48px; height: 54px; overflow: hidden; background: var(--s-white); }
.s-bottom-nav > button, .s-bottom-nav > a {
  all: unset; cursor: pointer; box-sizing: border-box; width: 38px; height: 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  font-family: var(--s-font); font-size: 8px; color: var(--s-subtitle-other); white-space: nowrap;
}
.s-bottom-nav .s-icon { width: 22px; height: 22px; color: var(--s-icon-disabled); }
.s-bottom-nav [aria-current="page"] { color: var(--s-title-other); }
.s-bottom-nav [aria-current="page"] .s-icon { width: 28px; height: 28px; color: var(--s-title-other); }

/* ======================= Kit documentation chrome (Header 248:874, Label 261:442) ======================= */
/* Optional: for design-system / showcase pages in the kit's own style */
.s-kit-canvas { background: #dddddd; padding: 40px; font-family: var(--s-font); }
.s-kit-board { background: var(--s-board); border-radius: var(--s-r-kit); overflow: hidden; }
.s-kit-board--white { background: var(--s-white); }
.s-kit-header { position: relative; height: 220px; background: var(--s-grad-kit-header); }
.s-kit-header__logo { position: absolute; left: 36px; top: 36px; width: 30px; height: 30px; }
.s-kit-header__title { position: absolute; left: 36px; top: 110px; margin: 0; font-size: 48px; font-weight: 700; line-height: 1; color: rgba(255, 255, 255, 0.9); }
.s-kit-body { padding: 56px 40px 64px; }
.s-kit-set { border: 1px dashed var(--s-board-stroke); border-radius: 5px; padding: 20px; }
.s-kit-label { display: inline-flex; align-items: center; padding: 4px 8px; font-size: 16px; color: var(--s-grey-900); background: var(--s-grey-400); border: 1px solid var(--s-grey-500); border-radius: 8px; }
.s-kit-cover { position: relative; background: var(--s-grad-kit-header); color: #fff; }
.s-kit-cover__caption { font-size: 20px; font-weight: 500; color: #b8b8b8; }

/* ==========================================================================
   Smartisan OS framework layer — components and behaviour that the Figma kit does not
   draw but every system app uses. Values come from the smartisanos framework resources
   and from the community 1:1 rewrites of Music / Weather / Clock (references/motion.md).
   ========================================================================== */

/* Danger button (long_btn_red / MenuDialog red button). Works on .s-btn (60) and .s-btn--sheet (48). */
.s-btn--danger { color: var(--s-white); background: linear-gradient(180deg, #e66359, #e55f55); border: var(--s-hair) solid #d2463c; filter: none; }
.s-btn--danger:active, .s-btn--danger.is-pressed { background: #df4f46; border-color: #c43c33; }

/* Section title bar (list_section_title): 30dp grey strip above a flush list */
.s-section-title {
  display: flex; align-items: center; height: 30px; padding: 0 var(--s-space-2);
  background: var(--s-section-bg); font-size: 12px; color: var(--s-grey-600);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

/* Empty state (blank view): big pale glyph, bold grey title, lighter hint; centred, 60dp side margins */
.s-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 60px; text-align: center; }
.s-empty__icon { width: 120px; height: 120px; color: #d6d6d6; }
.s-empty__icon.s-icon { width: 96px; height: 96px; margin: 12px; }
.s-empty__title { margin-top: var(--s-space-3); font-size: 16px; font-weight: 700; color: var(--s-grey-500); }
.s-empty__desc { margin-top: 5px; font-size: 12px; color: #c8c8c8; }
.s-empty > .s-btn, .s-empty > .s-round-btn { margin-top: var(--s-space-4); }

/* Check circle (check_box_mini): multi-select in edit mode. Off = thin grey ring, on = blue disc + white ✓ */
.s-check {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; cursor: pointer; position: relative;
  width: 22px; height: 22px; border-radius: 50%; background: var(--s-white);
  border: 1.2px solid #c9c9c9; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.04);
}
.s-check:checked {
  border-color: #4f7ff0; background: linear-gradient(180deg, #6b97ff, #5a87f5);
  box-shadow: 0 1px 1.5px rgba(40, 80, 200, 0.25);
}
.s-check:checked::after {
  content: ""; position: absolute; left: 6.6px; top: 3.4px; width: 5.4px; height: 10px;
  border: solid var(--s-white); border-width: 0 2px 2px 0; transform: rotate(42deg);
}
.s-check--red:checked { border-color: #d24a40; background: linear-gradient(180deg, #ec6a60, #e5584e); box-shadow: 0 1px 1.5px rgba(200, 60, 50, 0.25); }
.s-check:disabled { opacity: 0.4; cursor: default; }

/* Round add / remove buttons (add_round_s_btn / remove_round_btn): edit lists, e.g. world clock */
.s-round-add, .s-round-remove {
  appearance: none; cursor: pointer; flex: none; position: relative; width: 22px; height: 22px; padding: 0;
  border-radius: 50%; border: var(--s-hair) solid; box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.15);
}
.s-round-add { background: linear-gradient(180deg, #a5d65c, #8fc445); border-color: #7fb236; }
.s-round-remove { background: linear-gradient(180deg, #ec6a60, #e3564c); border-color: #cf453b; }
.s-round-add::before, .s-round-add::after, .s-round-remove::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 2.4px; margin: -1.2px 0 0 -5.5px;
  border-radius: 1px; background: var(--s-white);
}
.s-round-add::after { transform: rotate(90deg); }
.s-round-add:active, .s-round-add.is-pressed { background: #84b93b; }
.s-round-remove:active, .s-round-remove.is-pressed { background: #d84c42; }

/* Quick bar (QuickBar / letters bar): A–Z# strip on the right edge of a long list. The strip is bare
   until touched; while the finger is on it a pale backing + shadow appear and the touched letter
   is shown in a bubble. smartisan.js fires "s-letter" ({detail: "K"}) on the .s-quickbar. */
.s-quickbar {
  position: absolute; right: 0; top: 0; bottom: 0; z-index: 3; width: 34px; padding: 6px 0;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer;
}
.s-quickbar > span { flex: 1; display: flex; align-items: center; font-size: 10px; font-weight: 700; color: #9a9a9a; line-height: 1; }
.s-quickbar.is-active { background: linear-gradient(90deg, rgba(245, 245, 245, 0.92), #f5f5f5); box-shadow: -3px 0 8px rgba(0, 0, 0, 0.08); }
.s-quickbar > span.is-current { color: var(--s-icon-blue); }
.s-quickbar__bubble {
  position: absolute; right: 48px; width: 60px; height: 60px; margin-top: -30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
  font-size: 28px; font-weight: 700; color: var(--s-white); background: rgba(0, 0, 0, 0.55);
}

/* Page stack: horizontal push / pop. Put pages in .s-stack; smartisan.js animates them.
   Push: new page slides in from the right over 300ms (smooth), the old page drifts left by a third;
   the new page arrives blank (page colour + soft left-edge shadow) and its content fades in over the
   last 40%. Pop mirrors it with a decelerating curve. */
.s-stack { position: relative; overflow: hidden; }
.s-stack > .s-stack__page { position: absolute; inset: 0; overflow: auto; background: var(--s-page); -webkit-overflow-scrolling: touch; }
.s-stack > .s-stack__page[hidden] { display: none; }
.s-stack__page.is-entering { animation: s-push-in 300ms var(--s-ease-smooth) both; box-shadow: -6px 0 12px rgba(0, 0, 0, 0.08); z-index: 2; }
.s-stack__page.is-entering > * { animation: s-content-late 300ms linear both; }
.s-stack__page.is-leaving { animation: s-push-out 300ms var(--s-ease-smooth) both; z-index: 1; }
.s-stack__page.is-popping { animation: s-pop-out 270ms var(--s-ease-decel) both; box-shadow: -6px 0 12px rgba(0, 0, 0, 0.08); z-index: 2; }
.s-stack__page.is-returning { animation: s-pop-in 270ms var(--s-ease-decel) both; z-index: 1; }
.s-stack__page.is-returning > * { animation: s-content-late 270ms linear both; }
@keyframes s-push-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes s-push-out { from { transform: none; opacity: 1; } to { transform: translateX(-33%); opacity: 0.4; } }
@keyframes s-pop-out { from { transform: none; } to { transform: translateX(100%); } }
@keyframes s-pop-in { from { transform: translateX(-33%); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes s-content-late { 0%, 60% { opacity: 0; } 100% { opacity: 1; } }

/* Fixed title bar over a stack (Notes / Music List2Detail): the bar stays put; the old title and
   icons fade out 0–150ms, the new ones fade in 150–300ms; the back arrow waits 100ms, then fades in
   over 150ms while sliding in from the right over 200ms. smartisan.js toggles these classes. */
.s-appbar .is-fading-out { animation: s-fade-out 150ms var(--s-ease-smooth) both; }
.s-appbar .is-fading-in { animation: s-fade-in 150ms var(--s-ease-smooth) 150ms both; }
.s-appbar .is-back-in { animation: s-back-in 200ms var(--s-ease-smooth) 100ms both; }
.s-appbar .is-back-out { animation: s-back-out 300ms var(--s-ease-decel) both; }
@keyframes s-back-in { from { opacity: 0; transform: translateX(48px); } 75% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes s-back-out { from { opacity: 1; transform: none; } 50% { opacity: 0; } to { opacity: 0; transform: translateX(48px); } }

/* Full-screen page (settings, editors, search, "new …"): rises from the bottom over 300ms
   (decelerate cubic) while the page underneath stays still; leaves downward to 109% in 300ms. */
.s-modal-page { position: fixed; inset: 0; z-index: 90; overflow: auto; background: var(--s-page); }
.s-modal-page--in-frame { position: absolute; }
.s-modal-page[hidden] { display: none; }
.s-modal-page:not([hidden]) { animation: s-page-up 300ms var(--s-ease-decel-cubic) both; }
.s-modal-page.is-closing { animation: s-page-down 300ms var(--s-ease-decel-cubic) both; }
@keyframes s-page-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes s-page-down { from { transform: none; } to { transform: translateY(109%); } }

/* Elastic scroll container: rubber-band past either end, no glow, no stretch (smartisan.js) */
.s-elastic { overflow: auto; overscroll-behavior: contain; }
.s-elastic > .s-elastic__content { transform: translateY(var(--o, 0px)); }
.s-elastic.is-returning > .s-elastic__content { transition: transform 250ms cubic-bezier(0.2, 0.9, 0.3, 1); }

/* Wheel picker driven by smartisan.js: .s-picker__col[data-s-wheel] — 5 visible rows; the row in the
   band grows 16 → 18px and greys #b3b3b5 → #55585c as it nears the centre; edges fade over 1/6. */
.s-picker__col[data-s-wheel] {
  display: block; gap: 0; padding: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 16.7%, #000 83.3%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 16.7%, #000 83.3%, transparent);
}
.s-picker__col[data-s-wheel] > * { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: center; height: var(--row, 40px); will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .s-overlay, .s-overlay > *, .s-stack__page, .s-stack__page > *, .s-modal-page, .s-appbar * { animation-duration: 1ms !important; animation-delay: 0ms !important; }
}

/* ==========================================================================
   Part choreography (Clock 7.1.1 tab switch, R2 recording). When pages share a main visual
   (a dial, a gauge, a card), that visual stays put and only its parts move:
     out  ≈300ms, accelerating — parts keep going the way they were going (hands spin on) and fade;
     in   staggered, each part on its own clock — hands chase in from behind (0.7 / 0.9 / 1.0s),
          ears slide back from a diagonal offset (700ms), buttons pop with a little overshoot.
   Markup: .s-swap holds the persistent anchor plus .s-swap__panel layers; give moving parts
   data-s-part and set --from-* / --to-* / --d / --delay on them. smartisan.js runs it.
   ========================================================================== */
.s-swap { position: relative; }
.s-swap__panel[hidden] { display: none; }
.s-swap__panel.is-leaving [data-s-part], .s-swap__panel.is-leaving > :not([data-s-part]) {
  animation: s-part-out var(--d-out, 300ms) var(--s-ease-accel) both;
}
.s-swap__panel.is-entering [data-s-part] {
  animation: s-part-in var(--d, 700ms) var(--ease, var(--s-ease-decel)) var(--delay, 0ms) both;
}
.s-swap__panel.is-entering > :not([data-s-part]) { animation: s-fade-in 300ms var(--s-ease-decel) 150ms both; }
[data-s-part="pop"] { --ease: var(--s-ease-spring); --from-s: 0.6; }
@keyframes s-part-in {
  from { opacity: 0; translate: var(--from-x, 0) var(--from-y, 0); rotate: var(--from-r, 0deg); scale: var(--from-s, 1); }
}
@keyframes s-part-out {
  to { opacity: 0; translate: var(--to-x, 0) var(--to-y, 0); rotate: var(--to-r, 0deg); scale: var(--to-s, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .s-swap__panel [data-s-part], .s-swap__panel > * { animation-duration: 1ms !important; animation-delay: 0ms !important; }
}
