/* ==========================================================================
   Clay (Toy Box): the values of the app shell.

   The shell sheets (core/css/sidebar_toybox.css, mobile_shell.css, notifications/css/notifications.css) are
   structure only. They read the --tb-* names below; this file is what Clay answers with: violet, lavender
   neutrals, soft lift, 12-28px radii, 150-180ms. The --tb- prefix is a historical hook name for "the shell's
   tokens", not a dependency on Toy Box: every design defines the ones it reads in its own files.

   Loaded by core/designs/clay/_head.html, so it also rides along on the pages a design renders through its
   declared Toy Box adapter (a world's or Minimal's page outside its own shell). `:where(html:not([data-ui-theme]))`
   adds no specificity and leaves out any page that wears a world's or Minimal's own shell, which brings its own values.

   Clay's admin variant (data-shell="admin") is what a school teacher in Clay sees: pine, line icons, an edge bar.
   Clay owns this copy; it is not linked to Calm's (core/calm/shell.css), and editing either cannot change the other.
   ========================================================================== */

/* --- Sidebar, its tooltip, the account menu and the install guide -------- */
:where(html:not([data-ui-theme])) .sidebar,
:where(html:not([data-ui-theme])) #global-sidebar-tooltip,
:where(html:not([data-ui-theme])) .tb-acct-menu,
:where(html:not([data-ui-theme])) .tb-install-guide{
  --tb-violet:      oklch(58% 0.19 300);
  --tb-violet-deep: oklch(46% 0.17 300);
  --tb-rose:        oklch(70% 0.16 10);
  --tb-card:        oklch(99.5% 0.002 300);   /* raised panel face */
  --tb-ink:         oklch(23% 0.03 300);      /* primary text */
  --tb-soft:        oklch(45% 0.025 300);     /* muted text / rest icons */
  --tb-hover:       oklch(93% 0.03 300);      /* subtle hover wash */
  --tb-border:      oklch(88% 0.03 300);
  --tb-r-md: 18px; --tb-r-sm: 12px;
  --tb-lift: 0 2px 4px rgb(40 20 80 / .06), 0 12px 28px -8px rgb(40 20 80 / .16),
             0 32px 64px -24px rgb(40 20 80 / .22);
  --tb-ring-strong: 0 0 0 3px oklch(58% 0.19 300 / .30);
  --tb-dur: .15s;
  --tb-on: #fff;                              /* ink on a solid accent fill */
  --tb-scrim: rgb(20 10 40 / .45);            /* the install guide's backdrop */
  --tb-exit-wash: oklch(70% 0.16 10 / .14);   /* the sign-out row, hovered */
  --tb-exit-ink: oklch(48% 0.17 10);
  --tb-exit-ink-hi: oklch(55% 0.18 10);
}
:where(html:not([data-ui-theme])) .sidebar{
  --tb-notif-face:   oklch(97.5% 0.018 10);
  --tb-notif-hover:  oklch(95% 0.03 10);
  --tb-notif-border: oklch(90% 0.05 10);
}

/* --- Phone shell: top bar, dock, More sheet ------------------------------ */
:where(html:not([data-ui-theme])) .tb-mshell{
  --tb-violet:      oklch(58% 0.19 300);
  --tb-violet-deep: oklch(46% 0.17 300);
  --tb-violet-wash: oklch(58% 0.19 300 / .14);
  --tb-rose:        oklch(70% 0.16 10);
  --tb-card:        oklch(99.5% 0.002 300);
  --tb-glass:       oklch(99.5% 0.002 300 / .86);
  --tb-ink:         oklch(23% 0.03 300);
  --tb-soft:        oklch(45% 0.025 300);
  --tb-hover:       oklch(93% 0.03 300);
  --tb-border:      oklch(88% 0.03 300);
  --tb-r-lg: 28px; --tb-r-md: 18px; --tb-r-sm: 12px;
  --tb-lift: 0 2px 4px rgb(40 20 80 / .06), 0 12px 28px -8px rgb(40 20 80 / .16),
             0 32px 64px -24px rgb(40 20 80 / .22);
  --tb-ring: 0 0 0 3px oklch(58% 0.19 300 / .35);
  --tb-dur: .18s;
  --tb-on: #fff;
  --tb-scrim: rgb(20 10 40 / .42);            /* behind the More sheet */
  --tb-exit-ink: oklch(52% 0.18 10);
}

/* --- Notification chrome: bell badge, panel, toasts, push prompt --------- */
:where(html:not([data-ui-theme])) .notif-ui,
:where(html:not([data-ui-theme])) .flash-toasts,
:where(html:not([data-ui-theme])) .notif-badge{
  --tb-violet:      oklch(58% 0.19 300);
  --tb-violet-deep: oklch(46% 0.17 300);
  --tb-rose:        oklch(64% 0.2 10);
  --tb-tang:        oklch(72% 0.17 55);
  --tb-card:        oklch(99.5% 0.002 300);
  --tb-ink:         oklch(23% 0.03 300);
  --tb-soft:        oklch(45% 0.025 300);
  --tb-hover:       oklch(95% 0.02 300);
  --tb-unread:      oklch(97% 0.025 300);
  --tb-fill-soft:   oklch(93% 0.035 300);
  --tb-border:      oklch(90% 0.025 300);
  --tb-r-md: 18px; --tb-r-sm: 12px;
  --tb-lift: 0 2px 4px rgb(40 20 80 / .06), 0 12px 28px -8px rgb(40 20 80 / .16),
             0 32px 64px -24px rgb(40 20 80 / .22);
  --tb-ring: 0 0 0 3px oklch(58% 0.19 300 / .30);
  --tb-dur: .15s;
  --tb-on: #fff;
  --tb-art-border: oklch(84% 0.08 300);       /* the milestone toast's edge */
  --tb-switch-knob: #fff;
  /* White on the bright rose is about 3.5:1; a deeper rose keeps 11px white digits above 4.5:1. */
  --tb-badge-bg: oklch(52% .2 12);
}

/* ==========================================================================
   Clay's admin variant: School teachers in Clay (and an admin) wear the calm pine shell.
   Switched on by `data-shell="admin"` on the <aside>, the account menu, the phone shell and <body>
   (sidebar_nav.admin_calm_shell). Same markup and behaviour; pine accent, cool neutrals, line icons (outlined,
   filled when current) and a tint with an edge bar on the current row instead of a solid violet fill.
   ========================================================================== */
:where(html:not([data-ui-theme])) .sidebar.tb-side[data-shell="admin"]{
  --tb-violet: #2b6a55;
  --tb-violet-deep: #225846;
  --tb-card: #f6f8f5;
  --tb-ink: #1f2b25;
  --tb-soft: #55645c;
  --tb-hover: #e6eee9;
  --tb-border: #dde3de;
  --tb-active-bg: #d9e9e0;
  --tb-active-ink: #1b4d3d;
  --tb-on: #fbfdfc;
  --tb-r-md: 10px;
  --tb-ring-strong: 0 0 0 3px rgb(43 106 85 / .32);
  --tb-notif-face: #fbfdfc;
  --tb-notif-hover: #e6eee9;
  --tb-notif-border: #dde3de;
  --tb-lift: 0 1px 2px rgb(16 40 30 / .05), 0 10px 26px -18px rgb(16 40 30 / .22);
}
:where(html:not([data-ui-theme])) .sidebar.tb-side[data-shell="admin"] .sidebar-icon{ font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; color: var(--tb-soft); }
:where(html:not([data-ui-theme])) .sidebar.tb-side[data-shell="admin"] .tb-side__item{ font-weight: 560; }
:where(html:not([data-ui-theme])) .sidebar.tb-side[data-shell="admin"] .tb-side__item:hover .sidebar-icon{ color: var(--tb-ink); }
:where(html:not([data-ui-theme])) .sidebar.tb-side[data-shell="admin"] .tb-side__item[aria-current]{
  background: var(--tb-active-bg);
  color: var(--tb-active-ink);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--tb-violet);
}
:where(html:not([data-ui-theme])) [dir="rtl"] .sidebar.tb-side[data-shell="admin"] .tb-side__item[aria-current]{ box-shadow: inset -3px 0 0 var(--tb-violet); }
:where(html:not([data-ui-theme])) .sidebar.tb-side[data-shell="admin"] .tb-side__item[aria-current]:hover{ background: var(--tb-active-bg); }
:where(html:not([data-ui-theme])) .sidebar.tb-side[data-shell="admin"] .tb-side__item[aria-current] .sidebar-icon{
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; color: var(--tb-violet);
}
:where(html:not([data-ui-theme])) .sidebar.tb-side[data-shell="admin"] .tb-side__item:focus-visible{ box-shadow: var(--tb-ring-strong); }
:where(html:not([data-ui-theme])) .sidebar.tb-side[data-shell="admin"] .tb-side__item[aria-current]:focus-visible{ box-shadow: inset 3px 0 0 var(--tb-violet), var(--tb-ring-strong); }
:where(html:not([data-ui-theme])) .sidebar.tb-side[data-shell="admin"] .tb-side__badge{ background: var(--tb-violet); color: var(--tb-on); }   /* pine, not rose: 6.4:1 */
:where(html:not([data-ui-theme])) .sidebar.tb-side[data-shell="admin"] .tb-side__item[aria-current] .tb-side__badge{ background: var(--tb-violet); color: var(--tb-on); }
:where(html:not([data-ui-theme])) .sidebar.tb-side[data-shell="admin"] .tb-side__avatar{ background: var(--tb-violet); color: var(--tb-card); }

/* The account menu is teleported to <body>, outside the <aside>, so it carries its own data-shell="admin". */
:where(html:not([data-ui-theme])) .tb-acct-menu[data-shell="admin"]{
  --tb-violet: #2b6a55;
  --tb-violet-deep: #225846;
  --tb-card: #f6f8f5;
  --tb-ink: #1f2b25;
  --tb-soft: #55645c;
  --tb-hover: #e6eee9;
  --tb-border: #dde3de;
  --tb-r-md: 10px;
  --tb-lift: 0 1px 2px rgb(16 40 30 / .06), 0 14px 32px -14px rgb(16 40 30 / .32);
}

/* Phone: the same pine values, line icons (filled when current), a pine active pill, a solid pine avatar, a neutral backdrop. */
:where(html:not([data-ui-theme])) .tb-mshell[data-shell="admin"]{
  --tb-violet:      #2b6a55;
  --tb-violet-deep: #225846;
  --tb-violet-wash: #d9e9e0;
  --tb-rose:        #2b6a55;
  --tb-card:        #f6f8f5;
  --tb-glass:       rgb(246 249 247 / .9);
  --tb-ink:         #1f2b25;
  --tb-soft:        #55645c;
  --tb-hover:       #e6eee9;
  --tb-border:      #dde3de;
  --tb-r-md: 12px;
  --tb-lift: 0 1px 2px rgb(16 40 30 / .06), 0 14px 32px -14px rgb(16 40 30 / .3);
  --tb-ring: 0 0 0 3px rgb(43 106 85 / .32);
  --tb-scrim: rgb(12 22 18 / .45);
  --tb-exit-ink: oklch(52% 0.16 25);
}
:where(html:not([data-ui-theme])) .tb-mshell[data-shell="admin"] .material-symbols-outlined{ font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
:where(html:not([data-ui-theme])) .tb-mshell[data-shell="admin"] .tb-dock__item[aria-current="page"] .material-symbols-outlined,
:where(html:not([data-ui-theme])) .tb-mshell[data-shell="admin"] .tb-dock__item.is-open .material-symbols-outlined{
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
:where(html:not([data-ui-theme])) .tb-mshell[data-shell="admin"] .tb-dock__item[aria-current="page"],
:where(html:not([data-ui-theme])) .tb-mshell[data-shell="admin"] .tb-dock__item.is-open{ color: var(--tb-violet-deep); }
:where(html:not([data-ui-theme])) .tb-mshell[data-shell="admin"] .tb-mtop__logo{ background: var(--tb-hover); }
:where(html:not([data-ui-theme])) .tb-mshell[data-shell="admin"] .tb-mtop__avatar:not(:has(img)),
:where(html:not([data-ui-theme])) .tb-mshell[data-shell="admin"] .tb-more__tile[aria-current="page"]{ box-shadow: inset 0 0 0 2px var(--tb-violet); }

/* Notifications: the "Get notified" prompt, the unread badge, the bell panel and the toasts take the pine tokens. */
:where(html:not([data-ui-theme])) body[data-shell="admin"] :is(.notif-ui, .flash-toasts, .notif-badge){
  --tb-violet: #2b6a55; --tb-violet-deep: #225846; --tb-rose: #a8321f; --tb-tang: #d9921c;
  --tb-card: #fafbf9; --tb-ink: #1f2b25; --tb-soft: #55645c; --tb-hover: #e6eee9; --tb-unread: #ecf2ee;
  --tb-fill-soft: #e3eee8; --tb-border: #dde3de; --tb-r-md: 14px; --tb-r-sm: 10px;
  --tb-lift: 0 1px 2px rgb(16 40 30 / .06), 0 14px 32px -14px rgb(16 40 30 / .3);
  --tb-ring: 0 0 0 3px rgb(43 106 85 / .32);
  --tb-badge-bg: #2b6a55;
}
/* White on pine is 6.4:1 (the rose was 2.9:1). */
:where(html:not([data-ui-theme])) body[data-shell="admin"] .notif-badge{ color: #fbfdfc }
:where(html:not([data-ui-theme])) body[data-shell="admin"] .notif-push-btn{ color: #fbfdfc; border-radius: 10px }

/* Studio status (core/css/nav_live.css reads these). Clay: a chunky 12px mark with a soft cut-out ring; the row takes a soft violet wash and the pencil sways. */
:where(html:not([data-ui-theme])) {
  --nav-live-busy:  oklch(58% 0.19 300);
  --nav-live-wait:  oklch(66% 0.15 75);
  --nav-live-ready: oklch(56% 0.14 150);
  --nav-live-error: oklch(55% 0.2 20);
  --nav-live-tint: 14%; --nav-live-icon-dur: 2.2s; --nav-live-icon-ease: ease-in-out; --nav-live-icon-tilt: -7deg;
}
:where(html:not([data-ui-theme])) .nav-live {
  --nav-live-size: 12px; --nav-live-ring: 2px; --nav-live-spin-dur: 1.8s;
  --nav-live-cut:   var(--tb-card);
}
