/* Ippo design system, part 1: tokens and the app shell.
   Loaded on every page. Holds the color, type and spacing tokens plus the parts
   of the UI that every page shares: top bar, bottom nav, bottom sheet, toast and
   the icon base. Components for page content live in ippo.css. Both load on
   every page (notes/DESIGN_SYSTEM.md).

   Rules: no !important, and no raw hex values outside the token blocks. */

/* ───────────────────────── Font: DM Sans (self-hosted) ─────────────────────────
   static/fonts, SIL Open Font License 1.1 (static/fonts/OFL.txt). The same faces,
   subsets and unicode ranges Google Fonts served before (DM Sans v17: a variable
   file per subset, declared once per weight so weights match exactly). */
/* latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-sans-italic-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-sans-italic-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-sans-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/dm-sans-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/dm-sans-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/dm-sans-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/dm-sans-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ───────────────────────── Tokens · A (Warm, light) ───────────────────────── */
:root {
  color-scheme: light;
  --bg: #F7F2EA;
  --surface: #FFFDFA;
  --surface-2: #F2EBE1;
  --line: #E8DED2;
  --line-strong: #B9A794;
  --ink: #26190F;
  --ink-2: #66533F;
  --ink-3: #7D6957;
  --accent: #EE6A1B;
  --accent-ink: #B04208;
  --primary: #C64A0B;
  --on-primary: #FFFFFF;
  --on-accent: #FFFFFF;
  --accent-soft: #FDE8D6;
  --accent-soft-ink: #933705;
  --success: #1C7548;
  --success-soft: #DFF2E6;
  --warn: #8A5300;
  --warn-soft: #FCEFD0;
  --danger: #B42318;
  --on-danger: #FFFFFF;
  --danger-soft: #FCE4E0;
  --steps: #0A6B82;
  --steps-soft: #DCEFF4;
  --rest: #6049A6;
  --rest-soft: #ECE7F8;
  --freeze: #2459AA;
  --freeze-soft: #E1EBFA;
  --focus: #2459AA;

  /* Group member colors (DESIGN_SYSTEM.md, "Member colors") */
  --member-1: #C4520E;
  --member-2: #0E7F6F;
  --member-3: #6B4BC8;
  --member-4: #2463C4;
  --member-5: #BE3680;
  --member-6: #C2382A;
  --member-7: #3D8526;
  --member-8: #9A6700;
  --member-9: #0B7DA3;
  --member-10: #8B3A88;
  --member-11: #8A5A2E;
  --member-12: #6A7614;
  --member-others: #7D6957;
  /* Cast avatar circles (static/img/cast/av-*.svg are transparent heads) */
  --cast-ippo: #FFE2CC; --cast-cat: #E9E3FA; --cast-fox: #D9F0E1; --cast-elephant: #FCEDC4;
  --cast-dog: #DCE7FB; --cast-rabbit: #FBDDE5; --cast-bear: #E3EDD2; --cast-penguin: #D3EEEC;

  /* Derived */
  --btn2-bg: var(--accent-soft);
  --btn2-ink: var(--accent-soft-ink);
  --btn2-line: transparent;
  --field-bg: #FFFFFF;
  --field-line: #DCCFC0;
  --card-line: rgba(80, 45, 15, 0.07);
  --nav-bg: rgba(255, 253, 250, 0.94);
  --hero-bg: linear-gradient(160deg, #FFF8EF 0%, #FFE7D1 100%);
  --hero-line: rgba(238, 106, 27, 0.18);
  --hero-note: rgba(255, 255, 255, 0.7);
  --seg-on: var(--surface);
  --knob: #FFFFFF;
  --knob-on: #FFFFFF;
  --toast-bg: #2A1D13;
  --toast-ink: #FFF6EE;
  --toast-act: #FFAE75;
  --toast-ok: #6EDC9E;
  --toast-err: #FF9C8F;
  --scrim: rgba(38, 22, 8, 0.45);
  --m-gold: linear-gradient(150deg, #FFD36B 0%, #F0A21C 55%, #C97A06 100%);
  --m-orange: linear-gradient(150deg, #FFB070 0%, #F2701F 55%, #C4480A 100%);
  --m-silver: linear-gradient(150deg, #E3E8EE 0%, #A9B3BF 55%, #7D8896 100%);
  --m-ink: #FFFFFF;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --sh-1: 0 1px 2px rgba(70, 40, 10, 0.05), 0 3px 10px rgba(70, 40, 10, 0.06);
  --sh-2: 0 6px 20px rgba(70, 40, 10, 0.11);
  --sh-3: 0 16px 44px rgba(45, 22, 5, 0.24);
  --sh-seg: 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.05);
  --sh-knob: 0 1px 3px rgba(0, 0, 0, 0.25);

  /* Type and spacing */
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-display: 2.75rem;
  --fs-title: 1.75rem;
  --fs-h: 1.25rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-cap: 0.75rem;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  /* Safe areas: the Capacitor shell sets --safe-area-inset-*; browsers use env(). */
  --sat: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --sar: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  --sab: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --sal: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
  --topbar-h: 56px;
  --bnav-h: 64px;
}

/* ───────────────────────── Tokens · C (Night, dark) ─────────────────────────
   Follows the phone (prefers-color-scheme) unless html[data-theme] overrides it.
   The two blocks below must stay identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14100D;
    --surface: #1F1915;
    --surface-2: #2B231D;
    --line: #392E26;
    --line-strong: #7A6A5C;
    --ink: #F6EEE6;
    --ink-2: #C5B5A5;
    --ink-3: #A39181;
    --accent: #FF8A3D;
    --accent-ink: #FFA466;
    --primary: #FF8A3D;
    --on-primary: #1F0E02;
    --on-accent: #1F0E02;
    --accent-soft: #3D2616;
    --accent-soft-ink: #FFB687;
    --success: #62D394;
    --success-soft: #163222;
    --warn: #F4BD55;
    --warn-soft: #352A10;
    --danger: #FF8B7B;
    --on-danger: #2A0B06;
    --danger-soft: #3F1D18;
    --steps: #5BCBE6;
    --steps-soft: #12313B;
    --rest: #BDAEF7;
    --rest-soft: #2C2644;
    --freeze: #8DBBFF;
    --freeze-soft: #192B4B;
    --focus: #8DBBFF;

    --member-1: #F59048;
    --member-2: #2EC4AE;
    --member-3: #A68BFF;
    --member-4: #6AA8FF;
    --member-5: #F27BB8;
    --member-6: #FF7F6B;
    --member-7: #7FCB5C;
    --member-8: #EBC04A;
    --member-9: #5CCDEB;
    --member-10: #D883D2;
    --member-11: #D3A272;
    --member-12: #BCC95A;
    --member-others: #A39181;
    --cast-ippo: #4A2A16; --cast-cat: #322B4D; --cast-fox: #193A28; --cast-elephant: #3E3414;
    --cast-dog: #1D2E4D; --cast-rabbit: #4A2230; --cast-bear: #2C3A1C; --cast-penguin: #133A3A;

    --btn2-bg: var(--surface-2);
    --btn2-ink: var(--ink);
    --field-bg: #17120F;
    --field-line: #4A3D33;
    --card-line: #2E251F;
    --nav-bg: rgba(26, 21, 17, 0.96);
    --hero-bg: radial-gradient(120% 90% at 85% 0%, rgba(255, 138, 61, 0.22) 0%, rgba(255, 138, 61, 0) 60%), #1F1915;
    --hero-line: #3A2D23;
    --hero-note: rgba(255, 255, 255, 0.06);
    --seg-on: #3A2F27;
    --knob: #F6EEE6;
    --knob-on: #1F0E02;
    --toast-bg: #F6EEE6;
    --toast-ink: #1A120C;
    --toast-act: #A93E05;
    --toast-ok: #17703F;
    --toast-err: #B42318;
    --scrim: rgba(0, 0, 0, 0.6);

    --r-lg: 20px;
    --sh-1: none;
    --sh-2: 0 6px 20px rgba(0, 0, 0, 0.4);
    --sh-3: 0 18px 50px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14100D;
  --surface: #1F1915;
  --surface-2: #2B231D;
  --line: #392E26;
  --line-strong: #7A6A5C;
  --ink: #F6EEE6;
  --ink-2: #C5B5A5;
  --ink-3: #A39181;
  --accent: #FF8A3D;
  --accent-ink: #FFA466;
  --primary: #FF8A3D;
  --on-primary: #1F0E02;
  --on-accent: #1F0E02;
  --accent-soft: #3D2616;
  --accent-soft-ink: #FFB687;
  --success: #62D394;
  --success-soft: #163222;
  --warn: #F4BD55;
  --warn-soft: #352A10;
  --danger: #FF8B7B;
  --on-danger: #2A0B06;
  --danger-soft: #3F1D18;
  --steps: #5BCBE6;
  --steps-soft: #12313B;
  --rest: #BDAEF7;
  --rest-soft: #2C2644;
  --freeze: #8DBBFF;
  --freeze-soft: #192B4B;
  --focus: #8DBBFF;

  --member-1: #F59048;
  --member-2: #2EC4AE;
  --member-3: #A68BFF;
  --member-4: #6AA8FF;
  --member-5: #F27BB8;
  --member-6: #FF7F6B;
  --member-7: #7FCB5C;
  --member-8: #EBC04A;
  --member-9: #5CCDEB;
  --member-10: #D883D2;
  --member-11: #D3A272;
  --member-12: #BCC95A;
  --member-others: #A39181;
  --cast-ippo: #4A2A16; --cast-cat: #322B4D; --cast-fox: #193A28; --cast-elephant: #3E3414;
  --cast-dog: #1D2E4D; --cast-rabbit: #4A2230; --cast-bear: #2C3A1C; --cast-penguin: #133A3A;

  --btn2-bg: var(--surface-2);
  --btn2-ink: var(--ink);
  --field-bg: #17120F;
  --field-line: #4A3D33;
  --card-line: #2E251F;
  --nav-bg: rgba(26, 21, 17, 0.96);
  --hero-bg: radial-gradient(120% 90% at 85% 0%, rgba(255, 138, 61, 0.22) 0%, rgba(255, 138, 61, 0) 60%), #1F1915;
  --hero-line: #3A2D23;
  --hero-note: rgba(255, 255, 255, 0.06);
  --seg-on: #3A2F27;
  --knob: #F6EEE6;
  --knob-on: #1F0E02;
  --toast-bg: #F6EEE6;
  --toast-ink: #1A120C;
  --toast-act: #A93E05;
  --toast-ok: #17703F;
  --toast-err: #B42318;
  --scrim: rgba(0, 0, 0, 0.6);

  --r-lg: 20px;
  --sh-1: none;
  --sh-2: 0 6px 20px rgba(0, 0, 0, 0.4);
  --sh-3: 0 18px 50px rgba(0, 0, 0, 0.6);
}

/* ───────────────────────── Icons ───────────────────────── */
.ip-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
symbol .fill { fill: currentColor; stroke: none; }

/* Cast avatars: each animal sits on its own circle color (light and dark tokens above).
   Keyed on the file name, so every <img> of an avatar gets it without extra markup. */
:root img[src*="/img/cast/av-ippo."] { background-color: var(--cast-ippo); }
:root img[src*="/img/cast/av-cat."] { background-color: var(--cast-cat); }
:root img[src*="/img/cast/av-fox."] { background-color: var(--cast-fox); }
:root img[src*="/img/cast/av-elephant."] { background-color: var(--cast-elephant); }
:root img[src*="/img/cast/av-dog."] { background-color: var(--cast-dog); }
:root img[src*="/img/cast/av-rabbit."] { background-color: var(--cast-rabbit); }
:root img[src*="/img/cast/av-bear."] { background-color: var(--cast-bear); }
:root img[src*="/img/cast/av-penguin."] { background-color: var(--cast-penguin); }

html.ip-locked,
html.ip-locked body { overflow: hidden; }

.topbar :focus-visible,
.bnav :focus-visible,
.sheet :focus-visible,
.toast :focus-visible,
.skip-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link {
  position: fixed; z-index: 10002; left: var(--s3); top: calc(var(--sat) + var(--s2));
  padding: var(--s2) var(--s4); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); box-shadow: var(--sh-2);
  font: 700 var(--fs-small) / 1.4 var(--font); text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ───────────────────────── Top bar ───────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  padding-top: var(--sat);
  background: var(--nav-bg); color: var(--ink);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  font-family: var(--font);
}
.topbar-in {
  max-width: 1080px; margin: 0 auto; min-height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--s2);
  padding: 0 max(var(--s2), var(--sar)) 0 max(var(--s4), var(--sal));
}
.wordmark {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1;
  color: var(--accent-ink); text-decoration: none;
}
.wordmark .ic { color: var(--accent); }
.topnav { display: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s1); }
.topbar-btn {
  position: relative; width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center;
  margin: 0; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.topbar-btn:hover { background: var(--surface-2); }
.topbar-badge {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: var(--on-danger);
  font-size: var(--fs-cap); font-weight: 800; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.topbar-login {
  position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s4);
  border-radius: var(--r-md); background: var(--primary); color: var(--on-primary);
  font-size: 0.9375rem; font-weight: 700; text-decoration: none;
}
.topbar-login::after { content: ""; position: absolute; inset: -2px 0; }

@media (min-width: 901px) {
  .topnav { display: flex; align-items: center; gap: var(--s1); margin-left: var(--s4); }
  .topnav-item {
    display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 14px;
    border-radius: 999px; color: var(--ink-2); font-size: 0.9375rem; font-weight: 650; text-decoration: none;
  }
  .topnav-item:hover { background: var(--surface-2); color: var(--ink); }
  .topnav-item.is-active { background: var(--accent-soft); color: var(--accent-soft-ink); }
}

/* Notification bell + panel (markup in base.html, behaviour in ceremonies.js) */
.notif-bell-wrap { position: relative; }
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 400;
  display: flex; flex-direction: column; overflow: hidden;
  width: min(360px, calc(100vw - 24px)); max-height: min(460px, calc(100vh - 140px));
  background: var(--surface); color: var(--ink); font-family: var(--font); text-align: left;
  border: 1px solid var(--card-line); border-radius: var(--r-lg); box-shadow: var(--sh-3);
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: var(--s2) var(--s2) var(--s2) var(--s4); border-bottom: 1px solid var(--line); font-size: 1rem;
}
.notif-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--s1); color: var(--ink-2); font-size: var(--fs-small); }
.notif-list > p { margin: 0; padding: var(--s3); }
.notif-item { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2); border-radius: var(--r-md); color: var(--ink); }
.notif-item + .notif-item { margin-top: var(--s1); }
.notif-item.unread { background: var(--accent-soft); }
.notif-main {
  display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 44px; padding: var(--s1);
  border: 0; border-radius: var(--r-sm); background: transparent; color: inherit; font: inherit; text-align: left;
}
button.notif-main { cursor: pointer; }
button.notif-main:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.notif-item-title { color: var(--ink); font-size: 0.9375rem; font-weight: 750; line-height: 1.35; }
.notif-item-msg { color: var(--ink-2); font-size: var(--fs-small); line-height: 1.4; overflow-wrap: anywhere; }
.notif-item-actions { display: flex; justify-content: flex-end; gap: var(--s2); }

/* Ceremony sheet (ceremonies.js) and page intro sheet (page_intros.js): sheet bodies used on every page */
.cer { display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; }
.cer-ic { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; margin-top: var(--s1); }
.cer-art { position: relative; display: block; width: 140px; margin-top: calc(-1 * var(--s2)); }
.cer-art img { display: block; width: 140px; height: auto; aspect-ratio: 140 / 150; }
.cer-art .cer-badge { position: absolute; right: -6px; bottom: 10px; width: 44px; height: 44px; margin: 0; box-shadow: 0 0 0 3px var(--surface); }
.cer-gold { background: var(--m-gold); color: var(--m-ink); }
.cer-accent { background: var(--accent-soft); color: var(--accent-soft-ink); }
.cer-calm { background: var(--freeze-soft); color: var(--freeze); }
.cer-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); }
.cer-tag {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); font-size: var(--fs-small); font-weight: 700;
}
.cer-tag-mvp { background: var(--accent-soft); color: var(--accent-soft-ink); }
.intro { display: flex; flex-direction: column; gap: var(--s2); color: var(--ink-2); }
.intro p, .intro ul { margin: 0; }
.intro ul { padding-left: 1.25em; }
.intro-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-soft-ink); margin-bottom: var(--s1); }

/* ───────────────────────── Bottom nav (phones) ───────────────────────── */
.bnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px max(6px, var(--sar)) max(6px, var(--sab)) max(6px, var(--sal));
  background: var(--nav-bg); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  font-family: var(--font);
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; padding-top: 2px;
  color: var(--ink-2); text-decoration: none; font-size: var(--fs-cap); font-weight: 600; line-height: 1.33;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.bnav-ic { position: relative; width: 60px; height: 32px; border-radius: 999px; display: grid; place-items: center; transition: background-color 0.15s ease; }
.bnav-item.is-active { color: var(--ink); font-weight: 750; }
.bnav-item.is-active .bnav-ic { background: var(--accent-soft); color: var(--accent-soft-ink); }
.bnav-item.is-active .ic { stroke-width: 2.3; }
@media (min-width: 901px) {
  .bnav { display: none; }
}

/* ───────────────────────── Bottom sheet (ippoSheet / ippoConfirm) ───────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 6000;
  background: var(--scrim); opacity: 0; transition: opacity 0.2s ease;
}
.scrim.is-open { opacity: 1; }
.sheet {
  position: fixed; z-index: 6001; left: 50%; bottom: 0;
  width: min(100%, 520px); max-height: calc(100% - var(--sat) - var(--s5)); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 10px;
  padding: 6px max(var(--s4), var(--sar)) calc(var(--s4) + var(--sab)) max(var(--s4), var(--sal));
  background: var(--surface); color: var(--ink);
  border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--sh-3);
  font-family: var(--font); font-size: var(--fs-body); line-height: 1.5; text-align: left;
  transform: translate(-50%, 100%); transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet:focus { outline: none; }
.grab { flex: none; width: 40px; height: 5px; border-radius: 999px; background: var(--line-strong); margin: 4px auto 6px; opacity: 0.7; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 44px; }
.sheet-title { margin: 0; font-size: var(--fs-h); line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.sheet-body { margin: 0; color: var(--ink-2); }
.sheet-actions { display: grid; gap: var(--s2); margin-top: 6px; }
.sheet-actions > .btn { width: 100%; }
.sheet-x {
  width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; margin: 0 -8px 0 0; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.sheet-x:hover { background: var(--surface-2); color: var(--ink); }

/* ───────────────────────── Toast (ippoToast) ───────────────────────── */
.toast {
  position: fixed; z-index: 10001; left: 50%;
  bottom: calc(var(--bnav-h) + var(--sab) + var(--s3));
  width: min(calc(100% - 32px), 420px); min-height: 52px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px 10px 16px; border-radius: var(--r-md);
  background: var(--toast-bg); color: var(--toast-ink); box-shadow: var(--sh-3);
  font-family: var(--font); font-size: 0.9375rem; font-weight: 500; line-height: 1.4;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.toast.is-open { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast-msg { flex: 1; min-width: 0; padding: 4px 0; }
.toast > .ic { color: var(--toast-ok); }
.toast-error > .ic { color: var(--toast-err); }
.toast-act {
  flex: none; min-height: 44px; margin: 0; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--toast-act); font: inherit; font-weight: 750; cursor: pointer;
}
@media (min-width: 901px) {
  .toast { bottom: calc(var(--s5) + var(--sab)); }
}

@media (prefers-reduced-motion: reduce) {
  .scrim, .sheet, .toast, .bnav-ic { transition: none; }
}
