/* Midnyte — Living pearl design system.
   One set of semantic tokens, redefined for night; every component below reads
   only tokens. Light: warm ivory reading surfaces in a frosted pearl frame.
   Night: slate and indigo, same materials and layout, never black. */

:root {
  color-scheme: light;
  --pl-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --pl-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --pl-surround: #e3e2e7;
  --pl-surround-glow: #f9f9fa;
  --pl-surround-deep: #cbd0e1;
  --pl-frame: linear-gradient(130deg, #ffffffa1, #f6f6ff28 70%, #ffffffa8);
  --pl-frame-line: #ffffffcf;
  --pl-canvas: #f3efe7;
  --pl-canvas-grad: radial-gradient(ellipse at 20% 0, #fffdf8 0, transparent 46%), linear-gradient(135deg, #f6f3ed, #eeebe4);
  --pl-raised: linear-gradient(150deg, #fffdf8, #eee9e1);
  --pl-raised-flat: #fbf8f2;
  --pl-raised-line: #ffffffde;
  --pl-sheet: linear-gradient(145deg, #fffdf8, #f4eee7);
  --pl-soft: linear-gradient(135deg, #eee8f3, #f3ece5);
  --pl-soft-line: #ffffff88;
  --pl-hover: #ffffff99;

  --pl-ink: #141417;
  --pl-ink-2: #37333b;
  --pl-muted: #645f68;
  --pl-faint: #7d7680;
  --pl-line: #dfdbd4;
  --pl-line-soft: #e8e2da;

  --pl-accent: #6f6497;
  --pl-accent-ink: #4d4169;
  --pl-accent-wash: #e9e3f3;
  --pl-blue: #b7d8f8;
  --pl-lilac: #c7b7f5;
  --pl-blush: #f2d8e3;

  --pl-good: #3d6c52;   --pl-good-wash: #e5f0e7;
  --pl-warn: #85602a;   --pl-warn-wash: #f5ecdc;
  --pl-bad: #9a3f42;    --pl-bad-wash: #f7e3e2;
  --pl-info: #50608f;   --pl-info-wash: #e5e9f5;

  --pl-primary: linear-gradient(#252526, #09090a);
  --pl-primary-hover: linear-gradient(#3a373d, #19171c);
  --pl-primary-ink: #ffffff;
  --pl-primary-line: #19191b;

  --pl-field: #fffcf8;
  --pl-field-line: #d6ced4;
  --pl-field-shadow: inset 0 2px 4px #665c6a08;

  --pl-shadow-card: inset 0 2px 2px #fff, 0 16px 26px #78694917;
  --pl-shadow-raised: inset 0 2px 2px #fff, 0 14px 19px #78644420;
  --pl-shadow-btn: inset 0 1px 2px #fff, 0 8px 13px #67574419;
  --pl-shadow-pop: inset 0 2px 2px #fff, -18px 22px 42px #6450682e;
  --pl-focus: #7c6bb0;

  --pl-r-xl: 34px; --pl-r-lg: 28px; --pl-r-md: 22px; --pl-r-sm: 14px; --pl-r-xs: 10px;

  /* Charts: categorical slots in fixed order, one sequential violet ramp. */
  --s1: #6b5ca5; --s2: #c0704d; --s3: #3f8a73; --s4: #a9812a;
  --s5: #b4638b; --s6: #4a7cb4; --s7: #7c6b58; --s8: #a84b4b;
  --q1: #cfc6ea; --q2: #b0a3dc; --q3: #9282c9; --q4: #7563b3; --q5: #5f4e9c; --q6: #473a7c;
  --grid: #e6e0d8; --axis: #cfc7bd;

  --pl-moon: linear-gradient(135deg, #242945, #8c83c8);
  --pl-moon-filter: drop-shadow(0 1px 1px #fff9) drop-shadow(-1px -1px 1px #3e345133);
  --pl-body-filter: none;
}

:root[data-theme="night"] {
  color-scheme: dark;
  --pl-surround: #353a4f;
  --pl-surround-glow: #616c8766;
  --pl-surround-deep: #6b658233;
  --pl-frame: linear-gradient(130deg, #b5c1df45, #8994b520 70%, #aab9d744);
  --pl-frame-line: #a7b1d044;
  --pl-canvas: #3a4257;
  --pl-canvas-grad: radial-gradient(ellipse at 20% 0, #5b65803d, transparent 50%), linear-gradient(135deg, #3e465c, #343c50);
  --pl-raised: linear-gradient(145deg, #596278, #454d64);
  --pl-raised-flat: #4d566d;
  --pl-raised-line: #8995b04d;
  --pl-sheet: linear-gradient(145deg, #4b556d, #3c455b);
  --pl-soft: linear-gradient(135deg, #5a5f79, #4c5670);
  --pl-soft-line: #acb1cc44;
  --pl-hover: #67718a40;

  --pl-ink: #f3f0f8;
  --pl-ink-2: #e7e4f0;
  --pl-muted: #dcdeec;
  --pl-faint: #c3c6d8;
  --pl-line: #67718a88;
  --pl-line-soft: #67718a55;

  --pl-accent: #c9bdf0;
  --pl-accent-ink: #f0e8ff;
  --pl-accent-wash: #5e5a7e;
  --pl-blue: #779bc3;
  --pl-lilac: #8c86ab;
  --pl-blush: #ab8fa8;

  --pl-good: #b9e3c8;   --pl-good-wash: #4c6a60;
  --pl-warn: #efd3a6;   --pl-warn-wash: #6e6352;
  --pl-bad: #f6b9b6;    --pl-bad-wash: #6f5059;
  --pl-info: #cdd8f6;   --pl-info-wash: #505d7d;

  --pl-primary: linear-gradient(#fffaf3, #e4e0ed);
  --pl-primary-hover: linear-gradient(#fffdf8, #fffaf3);
  --pl-primary-ink: #2f3046;
  --pl-primary-line: #fbf8ff9e;

  --pl-field: #39435a;
  --pl-field-line: #7a85a38a;
  --pl-field-shadow: inset 0 2px 4px #27354c33;

  --pl-shadow-card: inset 0 1px 2px #d5dff033, 0 13px 20px #21293b3d;
  --pl-shadow-raised: inset 0 1px 2px #d5dff033, 0 13px 20px #21293b3d;
  --pl-shadow-btn: inset 0 1px 2px #d5dff02f, 0 8px 15px #2027383d;
  --pl-shadow-pop: inset 0 1px 2px #e7eafa33, -18px 22px 42px #20263866;
  --pl-focus: #dbcaef;

  --s1: #c8b2e8; --s2: #eaa482; --s3: #8fd1b8; --s4: #e6c779;
  --s5: #e7a3c4; --s6: #9cc3ee; --s7: #cbbba6; --s8: #f0a0a0;
  --q1: #4c4670; --q2: #62598f; --q3: #7a70ad; --q4: #948ac6; --q5: #afa6dc; --q6: #cbc4ee;
  --grid: #5d677f; --axis: #7a849c;

  --pl-moon: linear-gradient(135deg, #fff9e9, #e4d6fc);
  --pl-moon-filter: drop-shadow(0 0 2px #faf3ddcc) drop-shadow(0 0 7px #e1cfff7a);
  --pl-body-filter: brightness(.94) saturate(.86);
}

/* ------------------------------------------------------------ base */

* { box-sizing: border-box; }
html { background: var(--pl-surround); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding: 22px; min-height: 100vh;
  font-family: var(--pl-font); font-size: 15px; line-height: 1.55; color: var(--pl-ink);
  background: radial-gradient(ellipse at 20% 8%, var(--pl-surround-glow) 0, transparent 48%), radial-gradient(ellipse at 85% 95%, var(--pl-surround-deep) 0, transparent 50%), var(--pl-surround);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s, color .4s;
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(30px, 3.2vw, 40px); line-height: 1.08; letter-spacing: -1.6px; font-weight: 650; color: var(--pl-ink); }
h2 { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.25; letter-spacing: -.6px; font-weight: 620; color: var(--pl-ink); }
h3 { font-size: 16.5px; line-height: 1.3; letter-spacing: -.3px; font-weight: 620; color: var(--pl-ink); }
a { color: var(--pl-accent-ink); text-underline-offset: 3px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--pl-focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.pl-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.pl-skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--pl-raised-flat); color: var(--pl-ink); padding: 10px 16px; border-radius: 22px; box-shadow: var(--pl-shadow-btn); }
.pl-skip:focus { top: 12px; }
.pl-i { width: 17px; height: 17px; flex: none; vertical-align: middle; }
.num, .pl-num { font-variant-numeric: tabular-nums; }

/* Advanced view is a display preference: professional controls appear, what
   Midnyte may do does not change (the server enforces that separately). */
[data-role="admin"] .client-only { display: none; }
.pl-adv { display: none !important; }
:root[data-view="advanced"] .pl-adv { display: revert !important; }
:root[data-view="advanced"] .pl-simple-only { display: none !important; }
:root[data-view="advanced"] a.pl-tab.pl-adv, a.pl-tab.pl-adv[aria-current="page"] { display: inline-flex !important; }

/* ------------------------------------------------------------ frame + shell */

.pl-frame {
  max-width: 1400px; margin: 0 auto; padding: 13px;
  border: 1px solid var(--pl-frame-line); border-radius: 46px;
  background: var(--pl-frame);
  box-shadow: inset 0 2px 2px #ffffffb3, 0 26px 48px #43425727, 0 3px 7px #fff6;
}
:root[data-theme="night"] .pl-frame { box-shadow: inset 0 1px 2px #e3eaff44, 0 26px 48px #22283a40, 0 3px 7px #b8c6e115; }
.pl-app {
  position: relative; min-height: calc(100vh - 72px);
  background: var(--pl-canvas-grad); background-color: var(--pl-canvas);
  border: 1px solid #ffffffba; border-radius: var(--pl-r-xl);
  box-shadow: inset 0 1px 3px #fff, 0 12px 28px #70665810;
  isolation: isolate;
}
:root[data-theme="night"] .pl-app { border-color: #b9c3df55; box-shadow: inset 0 1px 3px #c4cce033, 0 12px 28px #1e253224; }

.pl-top { display: grid; grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr); align-items: center; gap: 18px; padding: 24px 36px 16px; }
.pl-brand { font-size: 31px; font-weight: 760; letter-spacing: -1.9px; line-height: 1; color: var(--pl-ink); text-decoration: none; justify-self: start; }
.pl-brand span { color: var(--pl-ink); }
.pl-nav { display: flex; gap: 4px; justify-content: center; }
.pl-nav-item {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 10px 16px; border-radius: 28px;
  font-size: 13.5px; font-weight: 500; color: var(--pl-ink-2); text-decoration: none; white-space: nowrap;
  transition: background .18s, box-shadow .18s;
}
.pl-nav-item .pl-i { display: none; }
.pl-nav-item:hover { background: var(--pl-hover); }
.pl-nav-item[aria-current="page"] { background: var(--pl-raised); box-shadow: inset 0 1px 1px #fff, 0 9px 15px #74664e1e; color: var(--pl-ink); font-weight: 640; }
:root[data-theme="night"] .pl-nav-item[aria-current="page"] { box-shadow: var(--pl-shadow-raised); }
.pl-count { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; background: #d9869f; color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
:root[data-theme="night"] .pl-count { background: #e7a3c4; color: #3a2833; }
.pl-top-end { display: flex; justify-content: flex-end; align-items: center; gap: 10px; min-width: 0; }
.pl-demo-badge { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pl-warn); background: var(--pl-warn-wash); border-radius: 20px; padding: 5px 10px; }
.pl-business { position: relative; min-width: 0; }
.pl-business-btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 280px;
  min-height: 44px; padding: 10px 16px; border-radius: 28px; border: 1px solid var(--pl-raised-line);
  background: var(--pl-raised); box-shadow: 0 8px 14px #75674915; color: var(--pl-ink);
  font: inherit; font-size: 13px; font-weight: 620; cursor: pointer;
}
.pl-business-btn:disabled { cursor: default; opacity: 1; }
.pl-business-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-business-btn .pl-caret { width: 15px; height: 15px; color: var(--pl-muted); }
.pl-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(340px, 86vw);
  padding: 8px; border-radius: var(--pl-r-md); border: 1px solid var(--pl-raised-line);
  background: var(--pl-sheet); box-shadow: var(--pl-shadow-pop);
}
.pl-menu a, .pl-menu button {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px;
  border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--pl-ink); text-decoration: none; text-align: left; cursor: pointer;
}
.pl-menu a:hover, .pl-menu button:hover, .pl-menu [aria-current="true"] { background: var(--pl-hover); }
.pl-menu small { display: block; color: var(--pl-muted); font-size: 12px; }
.pl-menu hr { border: 0; border-top: 1px solid var(--pl-line); margin: 6px 4px; }
.pl-menu .pl-check-mark { margin-left: auto; color: var(--pl-accent); }

.pl-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin: 0 36px; padding: 8px 0 2px; min-height: 50px; border-top: 1px solid var(--pl-line);
}
.pl-bar-label { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--pl-muted); font-weight: 600; }
.pl-tabs { display: flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
.pl-tab {
  display: inline-flex; align-items: center; min-height: 36px; padding: 7px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 520; color: var(--pl-ink-2); text-decoration: none; white-space: nowrap;
}
.pl-tab:hover { background: var(--pl-hover); }
.pl-tab[aria-current="page"] { background: var(--pl-accent-wash); color: var(--pl-accent-ink); font-weight: 640; }
.pl-tab.pl-adv::after { content: "Pro"; margin-left: 7px; font-size: 9.5px; letter-spacing: .06em; font-weight: 700; color: var(--pl-accent); text-transform: uppercase; }
.pl-bar-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pl-theme {
  display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 3px 8px 3px 11px;
  border: 1px solid #fff9; border-radius: 22px; background: #fff7; color: var(--pl-muted); font-size: 12px;
}
:root[data-theme="night"] .pl-theme { background: #7786a326; border-color: #8b99b244; }
.pl-theme .pl-i { width: 15px; height: 15px; }
.pl-theme select { font: inherit; border: 0; background: transparent; color: var(--pl-ink-2); padding: 4px 2px; min-height: 28px; cursor: pointer; }
.pl-theme select option { color: #141417; background: #fff; }
.pl-view-toggle {
  display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 0 4px; border: 0; background: none;
  font: inherit; font-size: 12.5px; color: var(--pl-muted); cursor: pointer; white-space: nowrap;
}
.pl-switch { width: 34px; height: 21px; border-radius: 22px; background: #e1ddd8; padding: 3px; box-shadow: inset 0 2px 4px #68606318; display: block; flex: none; }
.pl-switch::after { content: ""; display: block; width: 15px; height: 15px; background: #fff; border-radius: 50%; box-shadow: 0 2px 5px #594b472a; transition: transform .18s; }
[aria-pressed="true"] > .pl-switch, input:checked + .pl-switch { background: var(--pl-accent); }
[aria-pressed="true"] > .pl-switch::after, input:checked + .pl-switch::after { transform: translateX(13px); }
:root[data-theme="night"] .pl-switch { background: #78819c77; }
:root[data-theme="night"] [aria-pressed="true"] > .pl-switch { background: #9c8fb9; }
.pl-iconbtn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%;
  border: 1px solid var(--pl-raised-line); background: var(--pl-raised); box-shadow: 0 5px 9px #67574917;
  color: var(--pl-ink-2); cursor: pointer; text-decoration: none;
}
.pl-iconbtn:hover, .pl-iconbtn.is-on { color: var(--pl-ink); background: var(--pl-raised-flat); }
.pl-iconbtn.is-on { box-shadow: inset 0 0 0 2px var(--pl-accent-wash), 0 5px 9px #67574917; }

.pl-main { padding: 22px 36px 44px; min-width: 0; outline: none; }
.pl-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin: 8px 0 26px; }
.pl-page-head h1 { margin-top: 8px; }
.pl-page-head p { margin-top: 10px; max-width: 640px; color: var(--pl-muted); font-size: 15px; }
.pl-page-head .pl-actions { margin-bottom: 4px; }

/* ------------------------------------------------------------ text helpers */

.pl-eyebrow { display: inline-block; font-size: 11px; letter-spacing: 1.7px; font-weight: 650; text-transform: uppercase; color: var(--pl-muted); }
.pl-lede { font-size: 16px; line-height: 1.65; color: var(--pl-muted); max-width: 520px; }
.pl-muted { color: var(--pl-muted); }
.pl-note { font-size: 13px; color: var(--pl-muted); line-height: 1.6; }
.pl-error { color: var(--pl-bad); background: var(--pl-bad-wash); border-radius: var(--pl-r-sm); padding: 10px 14px; font-size: 13.5px; margin: 0 0 14px; }
.pl-kicker { font-size: 12.5px; color: var(--pl-muted); }

/* ------------------------------------------------------------ buttons */

.pl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  padding: 10px 18px; border-radius: 28px; border: 1px solid var(--pl-raised-line);
  background: var(--pl-raised); box-shadow: var(--pl-shadow-btn);
  font: inherit; font-size: 13.5px; font-weight: 560; color: var(--pl-ink); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.pl-btn:hover { transform: translateY(-1px); background: var(--pl-raised-flat); }
.pl-btn:active { transform: none; }
.pl-btn.pl-primary { color: var(--pl-primary-ink); background: var(--pl-primary); border-color: var(--pl-primary-line); box-shadow: inset 0 1px 1px #ffffff36, 0 10px 17px #51463b29; }
.pl-btn.pl-primary:hover { background: var(--pl-primary-hover); }
.pl-btn.pl-danger { color: var(--pl-bad); }
.pl-btn.pl-small { min-height: 34px; padding: 6px 13px; font-size: 12.5px; }
/* Buttons never let their label spill out: in a tight row they shrink and wrap the label instead. */
.pl-btn { max-width: 100%; min-width: 0; white-space: normal; text-align: center; line-height: 1.25; overflow-wrap: break-word; }
.pl-btn > span, .pl-btn > b { min-width: 0; }
.pl-btn > .pl-i, .pl-btn > svg { flex: none; }
button, select { max-width: 100%; }
.pl-btn.pl-block { width: 100%; }
.pl-btn:disabled, .pl-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.pl-btn[aria-busy="true"] { cursor: progress; }
.pl-btn .pl-i { width: 16px; height: 16px; }
.pl-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 0; min-height: 32px; font: inherit; font-size: 13px; color: var(--pl-accent-ink); cursor: pointer; text-decoration: underline; text-decoration-color: #b9afc5; text-underline-offset: 3px; }
.pl-link:hover { text-decoration-color: currentColor; }
.pl-text-action { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 10px 4px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 520; color: var(--pl-ink); cursor: pointer; text-decoration: none; }
.pl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ------------------------------------------------------------ surfaces */

.pl-card { border: 1px solid var(--pl-raised-line); border-radius: var(--pl-r-md); background: var(--pl-sheet); box-shadow: var(--pl-shadow-card); padding: 22px; min-width: 0; }
.pl-card + .pl-card { margin-top: 18px; }
/* Cards side by side in a grid or flex row get their spacing from the gap, never a stacked margin. */
.pl-grid > .pl-card, .pl-actions > .pl-card, [class*="-grid"] > .pl-card { margin-top: 0; }
.pl-card > h2 + p, .pl-card > h3 + p { margin-top: 6px; color: var(--pl-muted); font-size: 14px; }
.pl-soft { border-radius: 21px; padding: 20px 22px; background: var(--pl-soft); border: 1px solid var(--pl-soft-line); box-shadow: inset 0 1px 2px #fff8; }
.pl-section { margin-top: 34px; }
.pl-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pl-section-head p { color: var(--pl-muted); font-size: 13.5px; }
.pl-grid { display: grid; gap: 18px; }
.pl-grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }
.pl-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }

.pl-list { border: 1px solid var(--pl-raised-line); border-radius: var(--pl-r-md); background: var(--pl-sheet); box-shadow: var(--pl-shadow-card); overflow: hidden; }
.pl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--pl-line-soft); color: inherit; text-decoration: none; }
.pl-row:last-child { border-bottom: 0; }
a.pl-row:hover { background: var(--pl-hover); }
.pl-row h3 { font-size: 15px; }
.pl-row small, .pl-row .pl-sub { display: block; color: var(--pl-muted); font-size: 13px; margin-top: 3px; }
.pl-row-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #f1eaff, #d8d0eb); color: #6b5a86; border: 1px solid #fff9; box-shadow: inset 0 2px 1px #fffb; }
:root[data-theme="night"] .pl-row-icon { color: #e6dcf6; background: linear-gradient(135deg, #827997, #686380); border-color: #b6aed166; box-shadow: inset 0 1px 2px #eae3ff33; }
.pl-row-main { display: flex; gap: 14px; align-items: center; min-width: 0; }
.pl-row-value { text-align: right; font-variant-numeric: tabular-nums; font-size: 14.5px; font-weight: 560; }
.pl-row-value small { font-weight: 400; }

/* Status: always a word, never colour alone. */
.pl-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--pl-accent-wash); color: var(--pl-accent-ink); }
.pl-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .75; }
.pl-status.is-good { background: var(--pl-good-wash); color: var(--pl-good); }
.pl-status.is-warn { background: var(--pl-warn-wash); color: var(--pl-warn); }
.pl-status.is-bad { background: var(--pl-bad-wash); color: var(--pl-bad); }
.pl-status.is-info { background: var(--pl-info-wash); color: var(--pl-info); }
.pl-status.is-muted { background: transparent; color: var(--pl-muted); box-shadow: inset 0 0 0 1px var(--pl-line); }
.pl-tag { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; color: var(--pl-ink-2); background: var(--pl-hover); box-shadow: inset 0 0 0 1px var(--pl-line-soft); }

.pl-detail-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); border-top: 1px solid var(--pl-line); margin: 16px 0 20px; }
.pl-detail-list > dt, .pl-detail-list > dd, .pl-detail-list > div { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--pl-line); font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.pl-detail-list > dt { color: var(--pl-muted); padding-right: 12px; }
.pl-detail-list > dd { text-align: right; font-weight: 560; font-variant-numeric: tabular-nums; }
.pl-detail-list .pl-change { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.pl-detail-list .pl-change s { color: var(--pl-muted); font-weight: 400; }

.pl-checklist { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 9px; font-size: 14px; }
.pl-checklist li { display: flex; gap: 10px; align-items: flex-start; }
.pl-checklist li::before { content: "✓"; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--pl-good-wash); color: var(--pl-good); }
.pl-checklist li.is-no::before { content: "!"; background: var(--pl-warn-wash); color: var(--pl-warn); font-weight: 700; }

/* ------------------------------------------------------------ fields */

.pl-form { display: grid; gap: 16px; }
.pl-field { display: grid; gap: 7px; font-size: 13.5px; font-weight: 560; color: var(--pl-ink); min-width: 0; }
.pl-field input, .pl-field select, .pl-field textarea {
  width: 100%; min-height: 44px; padding: 11px 14px; border-radius: 13px;
  border: 1px solid var(--pl-field-line); background: var(--pl-field); box-shadow: var(--pl-field-shadow);
  font: inherit; font-size: 15px; font-weight: 400; color: var(--pl-ink);
}
.pl-field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.pl-field input::placeholder, .pl-field textarea::placeholder { color: var(--pl-faint); }
.pl-field small { font-weight: 400; font-size: 12.5px; color: var(--pl-muted); }
.pl-field .pl-field-error { color: var(--pl-bad); font-weight: 500; font-size: 12.5px; }
.pl-field [aria-invalid="true"] { border-color: var(--pl-bad); box-shadow: 0 0 0 3px var(--pl-bad-wash); }
.pl-fields-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.pl-choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--pl-field-line); background: var(--pl-field); cursor: pointer; font-size: 14px; }
.pl-choice input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--pl-accent); flex: none; }
.pl-choice b { display: block; font-weight: 620; }
.pl-choice small { display: block; color: var(--pl-muted); font-size: 13px; margin-top: 2px; font-weight: 400; }
.pl-choice:has(input:checked) { border-color: var(--pl-accent); box-shadow: 0 0 0 3px var(--pl-accent-wash); }
.pl-choice:has(input:disabled) { opacity: .6; cursor: not-allowed; }
fieldset.pl-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 9px; }
fieldset.pl-fieldset legend { font-size: 14px; font-weight: 620; margin-bottom: 8px; padding: 0; }
.pl-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; font-size: 14px; }
.pl-toggle-row small { display: block; font-weight: 400; color: var(--pl-muted); font-size: 12.5px; margin-top: 2px; }
.pl-toggle-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--pl-accent); flex: none; }

/* ------------------------------------------------------------ drawer, toast */

.pl-scrim { position: fixed; inset: 0; z-index: 70; background: #2a24321f; backdrop-filter: blur(2px); }
:root[data-theme="night"] .pl-scrim { background: #12162366; }
.pl-drawer {
  position: fixed; z-index: 80; top: 16px; right: 16px; bottom: 16px; width: min(500px, calc(100vw - 32px));
  display: flex; flex-direction: column; border-radius: 30px; border: 1px solid var(--pl-raised-line);
  background: var(--pl-sheet); background-color: var(--pl-canvas); box-shadow: var(--pl-shadow-pop); color: var(--pl-ink);
  animation: pl-drawer-in .22s cubic-bezier(.2, .7, .3, 1);
}
.pl-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 26px 28px 14px; }
.pl-drawer-head h2 { font-size: 25px; margin-top: 5px; }
.pl-drawer-body { overflow-y: auto; padding: 4px 28px 28px; flex: 1; overscroll-behavior: contain; }
.pl-drawer-body > p { color: var(--pl-muted); font-size: 14.5px; line-height: 1.7; margin-bottom: 14px; }
.pl-drawer-foot { position: sticky; bottom: -28px; margin: 18px -28px -28px; padding: 16px 28px 22px; background: linear-gradient(transparent, var(--pl-canvas) 30%); display: flex; gap: 10px; flex-wrap: wrap; }
@keyframes pl-drawer-in { from { transform: translateX(24px); opacity: 0; } }
.pl-toast {
  position: fixed; z-index: 90; left: 50%; bottom: 26px; transform: translateX(-50%); max-width: calc(100vw - 32px); width: max-content;
  display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-radius: 22px;
  background: #f7fcf4; color: #2f5238; border: 1px solid #fff; box-shadow: 0 9px 25px #53594324; font-size: 14px;
}
.pl-toast.is-bad { background: #fff4f2; color: #7e3033; }
:root[data-theme="night"] .pl-toast { background: #4b655d; color: #eff8f0; border-color: #b2cbb566; }
:root[data-theme="night"] .pl-toast.is-bad { background: #6f5059; color: #fff0ee; }

/* ------------------------------------------------------------ empty, skeleton */

.pl-empty { text-align: center; padding: 30px 22px 34px; border-radius: var(--pl-r-md); border: 1px solid var(--pl-raised-line); background: var(--pl-sheet); box-shadow: var(--pl-shadow-card); }
.pl-empty .pl-mascot { width: 104px; margin: 0 auto 12px; }
.pl-empty h3 { font-size: 18px; }
.pl-empty p { color: var(--pl-muted); font-size: 14px; margin: 8px auto 18px; max-width: 440px; }
.pl-empty .pl-actions { justify-content: center; }
.pl-inline-empty { color: var(--pl-muted); font-size: 14px; padding: 6px 0; }
.pl-skeleton { display: grid; gap: 16px; padding: 10px 0; }
.pl-skeleton i { display: block; height: 22px; border-radius: 12px; background: linear-gradient(90deg, var(--pl-line-soft), var(--pl-hover), var(--pl-line-soft)); background-size: 200% 100%; animation: pl-shimmer 1.4s linear infinite; }
.pl-skeleton i:nth-child(1) { width: 40%; height: 46px; }
.pl-skeleton i:nth-child(2) { width: 65%; }
.pl-skeleton i:nth-child(3) { width: 100%; height: 150px; border-radius: 24px; }
@keyframes pl-shimmer { to { background-position: -200% 0; } }
.pl-inline-status { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--pl-muted); }
.pl-dots { display: inline-flex; gap: 3px; }
.pl-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: mn-thought 1.3s ease-in-out infinite; }
.pl-dots i:nth-child(2) { animation-delay: .17s; } .pl-dots i:nth-child(3) { animation-delay: .34s; }

/* ------------------------------------------------------------ metric tiles */

.pl-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pl-metric { display: flex; align-items: center; gap: 11px; padding: 15px 13px; min-width: 0; border: 1px solid var(--pl-raised-line); border-radius: var(--pl-r-md); background: var(--pl-raised); box-shadow: var(--pl-shadow-raised); }
.pl-metric > div { min-width: 0; }
.pl-metric-label { display: block; font-size: 12.5px; color: var(--pl-muted); }
.pl-metric strong { display: block; font-size: 23px; letter-spacing: -.9px; font-weight: 680; line-height: 1.35; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-metric strong.is-unknown { font-size: 15px; letter-spacing: -.2px; font-weight: 600; color: var(--pl-muted); line-height: 1.6; white-space: normal; }
.pl-metric small { display: block; font-size: 12px; line-height: 1.4; color: var(--pl-muted); }
.pl-metric small.is-up { color: var(--pl-good); }
.pl-metric small.is-down { color: var(--pl-bad); }
.pl-metric-icon { flex: none; display: grid; place-items: center; width: 36px; height: 44px; border-radius: 14px; box-shadow: inset 0 1px 2px #fff9; color: #5e527c; }
.pl-metric-icon .pl-i { width: 20px; height: 20px; }
.pl-lilac { background: linear-gradient(140deg, #f3eeff, #d8d1f5); }
.pl-blue { background: linear-gradient(140deg, #e4f7ff, #b1d4f5); color: #5462b4; }
.pl-rose { background: linear-gradient(140deg, #fff0f1, #f3d8e4); color: #b0617f; }
:root[data-theme="night"] .pl-metric-icon { box-shadow: inset 0 1px 2px #e2dcff2b; }
:root[data-theme="night"] .pl-lilac { background: linear-gradient(140deg, #8c86ab, #6c688d); color: #f0e6ff; }
:root[data-theme="night"] .pl-blue { background: linear-gradient(140deg, #779bc3, #536f95); color: #e6f0ff; }
:root[data-theme="night"] .pl-rose { background: linear-gradient(140deg, #ab8fa8, #85667f); color: #fae5f3; }

/* ------------------------------------------------------------ the character */

/* One body texture with native eye and moon layers, all inside one transform
   wrapper so the face never slides off the body. Geometry is measured on the
   full 1312×1199 canvas (see public/img/midnyte/ASSET_GUIDE.md). */
.pl-mascot { display: inline-block; position: relative; width: 160px; aspect-ratio: 1312 / 1199; flex: none; vertical-align: middle; line-height: 0; isolation: isolate; }
.pl-mascot-float { position: absolute; inset: 0; display: block; transform-origin: 54% 80%; animation: mn-breathe 6s ease-in-out infinite; }
.pl-mascot picture { display: block; width: 100%; height: 100%; }
.pl-mascot img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; filter: var(--pl-body-filter); }
.pl-eye { position: absolute; width: 6.7%; height: 14%; transform: rotate(-7deg); transition: translate .3s, rotate .3s; z-index: 2; }
.pl-eye-l { left: 43.35%; top: 46.5%; }
.pl-eye-r { left: 63.82%; top: 42.5%; }
.pl-eye-open { position: absolute; inset: 0; border-radius: 48% / 28%; background: radial-gradient(ellipse at 73% 89%, #9f89d9 0, transparent 24%), radial-gradient(ellipse at 18% 30%, #445c9a 0, transparent 23%), linear-gradient(135deg, #2b315e, #171e39 49%, #3d3864); box-shadow: inset 1px 1px 2px #111d47, 0 1px 2px #fff, 0 0 0 1px #5c546126; transform-origin: center; transition: transform .16s ease, opacity .14s ease; }
.pl-eye-open::after { content: ""; position: absolute; left: 58%; top: 5%; width: 25%; height: 17%; background: #fff9ff; border-radius: 60%; transform: rotate(-28deg); box-shadow: 0 0 3px #eee4ff; }
.pl-eye-closed { position: absolute; left: 0; right: 0; top: 35%; height: 29%; border-bottom: 4px solid #2b3157; border-radius: 0 0 50% 50%; opacity: 0; transition: opacity .15s; }
.pl-moon { position: absolute; left: 50.35%; top: 33.05%; width: 7.45%; aspect-ratio: 1; filter: var(--pl-moon-filter); transition: filter .5s; z-index: 2; }
.pl-moon > span { position: absolute; inset: 0; border-radius: 50%; background: var(--pl-moon); -webkit-mask: radial-gradient(circle at 71% 30%, transparent 0 45%, #000 47%); mask: radial-gradient(circle at 71% 30%, transparent 0 45%, #000 47%); }
.pl-zzz { position: absolute; left: 70%; top: 10%; width: 23%; height: 30%; opacity: 0; transition: opacity .25s; color: #66587d; line-height: 1; z-index: 3; }
:root[data-theme="night"] .pl-zzz { color: #e2d8f3; }
.pl-zzz b { position: absolute; font-size: clamp(12px, 1.7vw, 21px); font-weight: 550; opacity: 0; animation: mn-zzz 3.6s ease-out infinite paused; }
.pl-zzz b:nth-child(1) { left: 0; bottom: 0; }
.pl-zzz b:nth-child(2) { left: 22%; bottom: 21%; animation-delay: 1.2s; }
.pl-zzz b:nth-child(3) { left: 48%; bottom: 46%; animation-delay: 2.4s; }
.pl-thought { position: absolute; left: 57%; top: 17%; display: flex; gap: 4px; opacity: 0; transition: opacity .2s; z-index: 3; }
.pl-thought i { width: 5px; height: 5px; border-radius: 50%; background: #857a9d; animation: mn-thought 1.4s ease-in-out infinite paused; }
:root[data-theme="night"] .pl-thought i { background: #e0d5f0; }
.pl-thought i:nth-child(2) { animation-delay: .18s; } .pl-thought i:nth-child(3) { animation-delay: .36s; }
.pl-mascot.is-small .pl-zzz, .pl-mascot.is-small .pl-thought { display: none; }
.pl-mascot.is-small .pl-eye-closed { border-bottom-width: 1.5px; }

:root[data-blink="true"] .pl-eye-open { transform: scaleY(.09); }
:root[data-expression="sleeping"] .pl-mascot-float { animation: mn-sleep 5s ease-in-out infinite; }
:root[data-expression="sleeping"] .pl-eye-open { transform: scaleY(.05); opacity: 0; }
:root[data-expression="sleeping"] .pl-eye-closed { opacity: 1; }
:root[data-expression="sleeping"] .pl-zzz { opacity: 1; }
:root[data-expression="sleeping"] .pl-zzz b { animation-play-state: running; }
:root[data-expression="waking"] .pl-mascot-float { animation: mn-wake .9s cubic-bezier(.2, .7, .3, 1) both; }
:root[data-expression="waking"] .pl-eye-open { transform: scale(1.08, 1.05); }
:root[data-expression="listening"] .pl-mascot-float { animation: mn-listen 5s ease-in-out infinite; }
:root[data-expression="listening"] .pl-eye-open { transform: scale(1.03, 1.07); }
:root[data-expression="thinking"] .pl-mascot-float { animation: mn-think 4s ease-in-out infinite; }
:root[data-expression="thinking"] .pl-eye { translate: -1px -3px; }
:root[data-expression="thinking"] .pl-eye-r .pl-eye-open { transform: scaleY(.79); }
:root[data-expression="thinking"] .pl-thought { opacity: 1; }
:root[data-expression="thinking"] .pl-thought i { animation-play-state: running; }
:root[data-expression="happy"] .pl-mascot-float { animation: mn-happy 1.1s ease-in-out both; }
:root[data-expression="happy"] .pl-eye-open { opacity: 0; }
:root[data-expression="happy"] .pl-eye-closed { opacity: 1; border-bottom: 0; border-top: 5px solid #2b3157; border-radius: 50% 50% 0 0; top: 31%; height: 35%; }
:root[data-expression="happy"] .pl-mascot.is-small .pl-eye-closed { border-top-width: 2px; }
:root[data-expression="curious"] .pl-mascot-float { animation: mn-curious 4s ease-in-out infinite; }
:root[data-expression="curious"] .pl-eye-l .pl-eye-open { transform: scaleY(.72); }
:root[data-expression="curious"] .pl-eye-r .pl-eye-open { transform: scaleY(1.07); }
:root[data-expression="concerned"] .pl-mascot-float { animation: none; transform: rotate(-2deg) translateY(2px); }
:root[data-expression="concerned"] .pl-eye-l { rotate: 10deg; translate: 0 1px; }
:root[data-expression="concerned"] .pl-eye-r { rotate: -9deg; translate: 0 1px; }
:root[data-expression="concerned"] .pl-eye-open { transform: scaleY(.76); }
:root[data-expression="paused"] .pl-mascot-float { animation: none; transform: translateY(3px); }
:root[data-expression="paused"] .pl-eye-open { transform: scaleY(.62); }

@keyframes mn-breathe { 0%, 100% { transform: translateY(0) rotate(0); } 45% { transform: translateY(-3px) rotate(-.7deg); } 70% { transform: translateY(-1px) rotate(.3deg); } }
@keyframes mn-sleep { 0%, 100% { transform: translateY(3px) rotate(-4deg) scaleY(.99); } 50% { transform: translateY(1px) rotate(-4.6deg) scaleY(1.01); } }
@keyframes mn-wake { 0% { transform: translateY(4px) rotate(-4deg) scaleY(.98); } 48% { transform: translateY(-7px) rotate(1deg) scaleY(1.015); } 100% { transform: translateY(0) rotate(0); } }
@keyframes mn-listen { 0%, 100% { transform: translateY(-2px) rotate(1.7deg); } 50% { transform: translateY(-4px) rotate(2.3deg); } }
@keyframes mn-think { 0%, 100% { transform: translateY(-2px) rotate(-2deg); } 50% { transform: translateY(-4px) rotate(.8deg); } }
@keyframes mn-happy { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-8px) rotate(-2deg); } 65% { transform: translateY(1px) rotate(1deg); } }
@keyframes mn-curious { 0%, 100% { transform: rotate(3deg) translateY(-2px); } 50% { transform: rotate(4deg) translateY(-3px); } }
@keyframes mn-zzz { 0% { opacity: 0; transform: translate(0, 5px); } 25%, 65% { opacity: .75; } 100% { opacity: 0; transform: translate(7px, -13px); } }
@keyframes mn-thought { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: .85; transform: translateY(-3px); } }

.pl-mascot-btn { position: relative; display: block; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; line-height: 0; border-radius: 35%; filter: drop-shadow(5px 17px 7px #5b455518); }
.pl-mascot-btn > .pl-mascot { width: 100%; }
.pl-mascot-btn:focus-visible { outline: 2px solid var(--pl-focus); outline-offset: 4px; }

/* Motion off: the in-app switch or the device setting (which wins). Static
   expressions stay readable. Hidden tabs pause everything. */
:root[data-motion="off"] .pl-mascot *, :root[data-motion="off"] .pl-mascot *::before, :root[data-motion="off"] .pl-mascot *::after { animation: none !important; transition: none !important; }
:root[data-motion="off"][data-expression="sleeping"] .pl-zzz b { opacity: .65; }
:root[data-motion="off"] .pl-dots i, :root[data-motion="off"] .pl-skeleton i { animation: none !important; }
:root[data-visibility="hidden"] * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  :root[data-expression="sleeping"] .pl-zzz b { opacity: .65; }
}

/* ------------------------------------------------------------ home */

.pl-home-top { display: grid; grid-template-columns: 1.18fr .92fr; gap: 18px; align-items: center; margin-bottom: 30px; }
.pl-home-intro { position: relative; z-index: 2; min-width: 0; padding-top: 8px; }
.pl-home-title { font-size: clamp(40px, 4.6vw, 62px); line-height: 1.02; letter-spacing: -2.8px; font-weight: 680; margin: 12px 0 14px; overflow-wrap: anywhere; }
.pl-home-title.is-long { font-size: clamp(36px, 3.9vw, 50px); letter-spacing: -2px; }
.pl-home-summary { color: var(--pl-muted); font-size: 16px; line-height: 1.65; max-width: 500px; }
.pl-home-actions { margin: 22px 0 30px; gap: 18px; }
.pl-period { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--pl-muted); margin-bottom: 10px; flex-wrap: wrap; }
.pl-period span { font-size: 12px; }
.pl-stage { position: relative; height: 360px; min-width: 0; isolation: isolate; margin: 0 -3px 34px; }
.pl-glass-ribbon {
  position: absolute; inset: 0 0 15px 21px; z-index: -2; transform: rotate(5deg);
  border-radius: 42% 27% 18% 38% / 29% 18% 34% 20%;
  background: radial-gradient(ellipse at 20% 75%, #f2d8ef 0, transparent 52%), linear-gradient(133deg, #d9cefc 7%, #b7d8f8 44%, #cceff8 62%, #ada9f0 86%, #d1b2ea);
  border: 1px solid #fff9; box-shadow: inset 2px 3px 4px #fff8, inset -2px -3px 4px #96a2d24d, 0 24px 25px #59588220;
}
.pl-glass-ribbon::after { content: ""; position: absolute; inset: 12px 13px; border-radius: inherit; border-top: 1px solid #ffffffbd; border-right: 1px solid #fff8; }
.pl-pearl-platform {
  position: absolute; bottom: 22px; left: 4%; width: 91%; height: 94px; z-index: -1; transform: rotate(6deg);
  border-radius: 50% 43% 27% 36% / 41% 44% 35% 38%;
  background: linear-gradient(155deg, #fffefb 3%, #f4ecec 39%, #e1dcea 75%, #f8e6ed); border: 1px solid #fff8;
  box-shadow: inset 0 8px 2px #ffffffa1, inset 0 -12px 17px #c9bdd62e, 0 24px 24px #7762543b;
}
:root[data-theme="night"] .pl-glass-ribbon { background: radial-gradient(ellipse at 20% 75%, #aa8bb54a, transparent 52%), linear-gradient(133deg, #8482b8 7%, #7b96b5 44%, #91b1ca 62%, #777da9 86%, #9a86af); border-color: #dce8ff55; box-shadow: inset 2px 3px 4px #dae9ff44, inset -2px -3px 4px #41567666, 0 24px 25px #22273f42; }
:root[data-theme="night"] .pl-glass-ribbon::after { border-color: #dce8ff55; }
:root[data-theme="night"] .pl-pearl-platform { background: linear-gradient(155deg, #a3a8bd, #80899f 39%, #717991 75%, #9990a7); border-color: #e0dbef55; box-shadow: inset 0 8px 2px #e8e6fa33, inset 0 -12px 17px #4149622e, 0 24px 24px #20283b66; }
.pl-stage .pl-mascot-btn { position: absolute; left: 6%; top: 18px; width: 80%; max-width: 350px; }
.pl-float-status {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 8px; max-width: 82%;
  padding: 12px 17px; min-height: 42px; border-radius: 28px; font-size: 12.5px; font-weight: 560; line-height: 1.3; text-decoration: none;
  color: var(--pl-ink-2); background: var(--pl-raised); border: 1px solid var(--pl-raised-line); box-shadow: inset 0 2px 2px #fff, 0 12px 18px #725c6520;
}
:root[data-theme="night"] .pl-float-status { box-shadow: var(--pl-shadow-raised); }
.pl-float-a { right: -3px; top: 12px; }
.pl-float-b { right: 6px; bottom: 3px; }
.pl-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #78bba8; box-shadow: inset 0 1px 2px #fff8; }
.pl-dot.is-warn { background: #d2a45a; } .pl-dot.is-bad { background: #d07378; } .pl-dot.is-pink { background: #df8fae; } .pl-dot.is-muted { background: #a9a2ad; } .pl-dot.is-info { background: #8ea2d8; }
.pl-caption { position: absolute; top: calc(100% + 10px); left: 0; right: 0; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--pl-muted); }
.pl-caption .pl-link { font-size: 13px; }

.pl-decisions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.pl-decision { position: relative; overflow: hidden; isolation: isolate; display: flex; gap: 16px; align-items: flex-start; min-height: 168px; padding: 22px; border: 1px solid #fffdfce8; border-radius: var(--pl-r-lg); background: var(--pl-raised); box-shadow: inset 0 2px 2px #fff, 0 22px 24px #79684c29; }
:root[data-theme="night"] .pl-decision { border-color: var(--pl-raised-line); box-shadow: var(--pl-shadow-raised); }
.pl-decision-copy { position: relative; z-index: 2; min-width: 0; flex: 1; }
.pl-decision-copy h3 { font-size: 19px; line-height: 1.2; letter-spacing: -.6px; }
.pl-decision-copy p { font-size: 14px; line-height: 1.55; color: var(--pl-muted); margin: 8px 0 16px; }
.pl-decision-kind { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 650; color: var(--pl-muted); display: block; margin-bottom: 6px; }
.pl-decision-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #fff6; box-shadow: inset 0 2px 2px #fff5; background: linear-gradient(140deg, #ffecef, #f2d8e3); color: #b9708f; }
.pl-decision-icon.is-lilac { background: linear-gradient(140deg, #f3eeff, #d8d1f5); color: #6b5a86; }
.pl-decision-icon.is-blue { background: linear-gradient(140deg, #e4f7ff, #b1d4f5); color: #5462b4; }
.pl-decision-icon.is-warn { background: linear-gradient(140deg, #fff5e6, #f1dfbf); color: #8a6327; }
:root[data-theme="night"] .pl-decision-icon { background: linear-gradient(140deg, #a388a2, #7c6b8b); color: #f0d1e7; border-color: #d0bfd555; }
:root[data-theme="night"] .pl-decision-icon.is-lilac { background: linear-gradient(140deg, #8c86ab, #6c688d); color: #f0e6ff; }
:root[data-theme="night"] .pl-decision-icon.is-blue { background: linear-gradient(140deg, #779bc3, #536f95); color: #e6f0ff; }
:root[data-theme="night"] .pl-decision-icon.is-warn { background: linear-gradient(140deg, #a58e6c, #7e6a4f); color: #fff0d6; }
.pl-decision.is-curve { background: radial-gradient(ellipse at 100% 100%, #c7b7f5 0, transparent 68%), linear-gradient(140deg, #fffcf7, #f1ede7); }
.pl-decision.is-curve::after { content: ""; position: absolute; right: -105px; bottom: -75px; width: 230px; height: 360px; transform: rotate(34deg); border-radius: 50%; background: linear-gradient(90deg, #d8cff859, #abc8fae8 53%, #87cef9c7); border-left: 2px solid #ffffffba; box-shadow: -13px 1px 20px #b9a4ea30; z-index: 0; }
:root[data-theme="night"] .pl-decision.is-curve { background: radial-gradient(ellipse at 100% 100%, #837eaa66, transparent 68%), linear-gradient(140deg, #596278, #434e65); }
:root[data-theme="night"] .pl-decision.is-curve::after { background: linear-gradient(90deg, #b7aed840, #718eafa6 53%, #81b2ccb0); border-left-color: #ccd8ea7a; }
.pl-decision.is-curve .pl-decision-copy { max-width: 72%; }
.pl-art { flex: none; align-self: stretch; width: 134px; min-height: 134px; border-radius: 18px; position: relative; overflow: hidden; padding: 13px; display: flex; flex-direction: column; justify-content: space-between; color: #40355b; background: radial-gradient(ellipse at 85% 10%, #f3ebff 0, transparent 43%), linear-gradient(140deg, #99b6f3, #d8bdef 58%, #b1b9ee); box-shadow: inset 0 1px 2px #fffa, 0 8px 12px #67578815; }
.pl-art::after { content: ""; position: absolute; width: 170px; height: 125px; border-radius: 80% 25% 0 0; right: -75px; bottom: -36px; transform: rotate(-30deg); background: linear-gradient(120deg, #d5f0ffa9, #adb8eeb9); border-top: 2px solid #f6ebffd9; }
.pl-art small { font-size: 9.5px; letter-spacing: 1.3px; text-transform: uppercase; position: relative; z-index: 1; }
.pl-art strong { position: relative; z-index: 1; font-size: 17px; line-height: 1.05; letter-spacing: -.5px; font-weight: 680; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.pl-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.pl-decision-done { justify-content: center; align-items: center; background: var(--pl-raised); }
.pl-check-circle { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(#eff8ed, #d9e7d7); color: #537563; box-shadow: inset 0 2px 2px #fff9; }
:root[data-theme="night"] .pl-check-circle { background: linear-gradient(#6c8e81, #507568); color: #eff9ef; }
.pl-more-decisions { margin-top: 14px; }

.pl-ask { display: flex; align-items: center; gap: 10px; padding: 8px 9px 8px 14px; border-radius: 34px; background: var(--pl-raised); border: 1px solid var(--pl-raised-line); box-shadow: inset 0 2px 1px #fff, 0 12px 22px #75665518; }
:root[data-theme="night"] .pl-ask { box-shadow: var(--pl-shadow-raised); }
.pl-ask .pl-mascot { width: 44px; }
.pl-ask button { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 46px; padding: 0 0 0 4px; border: 0; background: none; font: inherit; font-size: 15px; color: var(--pl-muted); cursor: text; text-align: left; }
.pl-ask-send { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--pl-primary); color: var(--pl-primary-ink); box-shadow: inset 0 1px 2px #fff5, 0 4px 8px #271b231e; }
.pl-assistant { max-width: 780px; margin: 34px auto 0; }
.pl-budget-line { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; font-size: 13px; color: var(--pl-muted); text-align: center; }

.pl-banner { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 20px; margin-bottom: 18px; background: var(--pl-warn-wash); color: var(--pl-ink); border: 1px solid #fff8; }
.pl-banner.is-bad { background: var(--pl-bad-wash); }
.pl-banner.is-info { background: var(--pl-info-wash); }
.pl-banner p { font-size: 14px; color: var(--pl-ink-2); margin-top: 2px; }
.pl-banner .pl-actions { margin-top: 10px; }

.pl-steps { list-style: none; margin: 0; padding: 4px 22px; }
.pl-step { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--pl-line-soft); }
.pl-step:last-child { border-bottom: 0; }
.pl-step-n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 14px; background: var(--pl-hover); box-shadow: inset 0 0 0 1px var(--pl-line); color: var(--pl-ink-2); }
.pl-step.is-done .pl-step-n { background: var(--pl-good-wash); color: var(--pl-good); box-shadow: none; }
.pl-step.is-next .pl-step-n { background: var(--pl-primary); color: var(--pl-primary-ink); box-shadow: none; }
.pl-step strong { display: block; font-size: 15px; }
.pl-step small { display: block; color: var(--pl-muted); font-size: 13px; margin-top: 3px; }
.pl-progress { height: 5px; border-radius: 6px; background: var(--pl-line-soft); overflow: hidden; }
.pl-progress > span { display: block; height: 100%; background: var(--pl-accent); border-radius: 6px; }

/* ------------------------------------------------------------ chat */

.pl-chat-presence { display: flex; align-items: center; gap: 12px; margin: -6px 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--pl-line); }
.pl-chat-presence .pl-mascot { width: 60px; }
.pl-chat-presence strong { display: block; font-size: 15px; }
.pl-chat-presence small { font-size: 13px; color: var(--pl-muted); }
.pl-chat-log { display: grid; gap: 12px; margin-bottom: 16px; }
.pl-bubble { padding: 13px 15px; border-radius: 4px 19px 19px 19px; background: #eae4f1; border: 1px solid #fff9; font-size: 14.5px; line-height: 1.65; color: var(--pl-ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.pl-bubble.is-user { border-radius: 19px 4px 19px 19px; background: #ede7df; margin-left: 36px; }
.pl-bubble.is-failed { background: var(--pl-bad-wash); color: var(--pl-ink); }
.pl-bubble.is-pending { display: flex; align-items: center; gap: 10px; color: var(--pl-muted); }
:root[data-theme="night"] .pl-bubble { background: #5e5f7e; color: #f0eafa; border-color: #b0a6cc44; }
:root[data-theme="night"] .pl-bubble.is-user { background: #515e75; }
:root[data-theme="night"] .pl-bubble.is-failed { background: var(--pl-bad-wash); }
.pl-context-chip { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; margin-bottom: 12px; border-radius: 18px; background: var(--pl-accent-wash); color: var(--pl-accent-ink); font-size: 13px; }
.pl-context-chip span { flex: 1; }
.pl-context-chip .pl-iconbtn { width: 30px; height: 30px; }
.pl-saved-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--pl-muted); padding: 2px 4px; }
.pl-saved-note span { flex: 1; min-width: 160px; }
.pl-saved-note.is-bad { color: var(--pl-bad); }
.pl-brief { position: relative; margin: -6px 0 28px; }
.pl-brief ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.pl-brief li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--pl-ink-2); }
.pl-brief li .pl-i { margin-top: 3px; color: var(--pl-accent); }
.pl-brief li.is-problem .pl-i { color: var(--pl-warn); }
.pl-brief li a { color: inherit; }
.pl-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pl-quick button { font: inherit; font-size: 13px; min-height: 36px; padding: 6px 13px; border-radius: 18px; border: 1px solid var(--pl-field-line); background: var(--pl-field); color: var(--pl-ink-2); cursor: pointer; }
.pl-quick button:disabled { opacity: .5; cursor: wait; }

.pl-expressions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.pl-expressions button { display: flex; flex-direction: column; align-items: center; gap: 7px; min-height: 70px; padding: 11px 6px; border-radius: 17px; border: 1px solid var(--pl-field-line); background: var(--pl-field); font: inherit; font-size: 12.5px; color: var(--pl-muted); cursor: pointer; }
.pl-expressions button[aria-pressed="true"] { background: var(--pl-accent-wash); border-color: var(--pl-accent); color: var(--pl-accent-ink); }
.pl-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 22px; background: var(--pl-hover); box-shadow: inset 0 0 0 1px var(--pl-line-soft); flex-wrap: wrap; }
.pl-seg button, .pl-seg a { min-height: 34px; padding: 6px 14px; border: 0; border-radius: 18px; background: none; font: inherit; font-size: 13px; color: var(--pl-ink-2); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.pl-seg [aria-pressed="true"], .pl-seg [aria-current="page"] { background: var(--pl-raised); box-shadow: var(--pl-shadow-btn); color: var(--pl-ink); font-weight: 620; }
.pl-personality-stage { display: grid; place-items: center; min-height: 190px; margin: -8px 0 6px; background: radial-gradient(ellipse at 50% 65%, #dfdcf066, transparent 65%); }
:root[data-theme="night"] .pl-personality-stage { background: radial-gradient(ellipse at 50% 65%, #aaa3d044, transparent 65%); }
.pl-personality-stage .pl-mascot-btn { width: 215px; max-width: 100%; }

/* ------------------------------------------------------------ login */

.pl-login-page .pl-frame { max-width: 1060px; margin-top: 5vh; }
.pl-login { display: grid; grid-template-columns: 1fr 1fr; align-items: center; min-height: min(680px, calc(100vh - 120px)); padding: 30px; gap: 20px; }
.pl-login-art { position: relative; height: 380px; }
.pl-login-art .pl-mascot { position: absolute; left: 10%; top: 20px; width: 78%; max-width: 330px; filter: drop-shadow(5px 17px 7px #5b455518); }
.pl-login-card { padding: 10px 26px; max-width: 420px; }
.pl-login-card .pl-brand { display: inline-block; margin-bottom: 28px; }
.pl-login-card h1 { font-size: clamp(36px, 4vw, 50px); letter-spacing: -2px; margin: 10px 0 12px; }
.pl-login-card .pl-form { margin-top: 26px; }
.pl-login-tools { margin-top: 22px; }

/* ------------------------------------------------------------ responsive */

@media (min-width: 1300px) { .pl-stage { height: 380px; } }
@media (max-width: 1180px) {
  .pl-top { grid-template-columns: auto 1fr auto; padding: 22px 26px 14px; gap: 12px; }
  .pl-bar { margin: 0 26px; }
  .pl-main { padding: 18px 26px 40px; }
  .pl-nav-item { padding: 10px 12px; font-size: 13px; }
  .pl-home-top { grid-template-columns: 1.15fr .85fr; gap: 6px; }
  .pl-stage { height: 330px; }
  .pl-stage .pl-mascot-btn { width: 92%; left: 0; top: 36px; }
  .pl-metric { padding: 13px 11px; gap: 8px; }
  .pl-metric-icon { width: 30px; height: 40px; border-radius: 12px; }
  .pl-metric strong { font-size: 20px; }
}
@media (max-width: 900px) {
  body { padding: 12px; }
  .pl-frame { padding: 8px; border-radius: 34px; }
  .pl-app { border-radius: 27px; }
  .pl-top { grid-template-columns: 1fr auto; }
  .pl-nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
  .pl-home-top { grid-template-columns: 1fr; }
  .pl-stage { width: min(440px, 100%); justify-self: center; height: 320px; margin-top: 8px; }
  .pl-decisions { grid-template-columns: 1fr; }
  .pl-login { grid-template-columns: 1fr; }
  .pl-login-art { height: 240px; max-width: 360px; width: 100%; justify-self: center; }
  .pl-login-art .pl-mascot { width: 62%; left: 18%; top: 4px; }
}
@media (max-width: 620px) {
  body { padding: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .pl-frame { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .pl-app { border-radius: 0; border: 0; min-height: 100vh; box-shadow: none; }
  .pl-top { padding: 16px 16px 10px; }
  .pl-brand { font-size: 27px; }
  /* Five destinations stay one thumb away. */
  .pl-nav { position: fixed; z-index: 50; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 6px; border-radius: 26px; background: var(--pl-sheet); background-color: var(--pl-canvas); border: 1px solid var(--pl-raised-line); box-shadow: 0 -4px 24px #45365524, var(--pl-shadow-card); }
  .pl-nav-item { flex-direction: column; gap: 3px; min-height: 52px; padding: 7px 2px; font-size: 11px; border-radius: 20px; justify-content: center; }
  .pl-nav-item .pl-i { display: block; width: 20px; height: 20px; }
  .pl-nav-item .pl-count { position: absolute; top: 3px; right: calc(50% - 22px); min-width: 17px; height: 17px; font-size: 10px; }
  .pl-business-btn { max-width: 190px; min-height: 40px; padding: 8px 12px; font-size: 12.5px; }
  .pl-business-btn > .pl-i:first-child { display: none; }
  .pl-bar { margin: 0 16px; gap: 8px; }
  .pl-tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
  .pl-tabs::-webkit-scrollbar { display: none; }
  .pl-bar-tools { width: 100%; justify-content: flex-end; }
  .pl-bar-tools .pl-theme { margin-right: auto; }
  .pl-view-toggle { font-size: 12px; }
  .pl-main { padding: 16px 16px 32px; }
  .pl-page-head { margin-bottom: 20px; }
  h1 { font-size: 32px; letter-spacing: -1.2px; }
  .pl-home-title { font-size: 44px; letter-spacing: -2.1px; }
  .pl-home-actions { margin: 18px 0 22px; gap: 10px; }
  .pl-metrics { gap: 8px; }
  .pl-metric { display: block; padding: 12px 10px; border-radius: 18px; }
  .pl-metric-icon { display: none; }
  .pl-metric strong { font-size: 20px; }
  .pl-stage { height: 270px; margin-bottom: 44px; }
  .pl-stage .pl-mascot-btn { width: 72%; left: 8%; top: 8px; }
  .pl-float-status { font-size: 11.5px; padding: 10px 13px; }
  .pl-decision { flex-direction: column; min-height: 0; padding: 18px; border-radius: 23px; }
  .pl-decision.is-curve .pl-decision-copy { max-width: 100%; }
  .pl-decision .pl-art { width: 100%; min-height: 120px; }
  .pl-row { padding: 16px; }
  .pl-steps { padding: 4px 16px; }
  .pl-step { grid-template-columns: 32px minmax(0, 1fr); }
  .pl-step > :last-child:not(div) { grid-column: 2; justify-self: start; }
  body { background: var(--pl-canvas); }
  .pl-drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92vh; border-radius: 26px 26px 0 0; animation-name: pl-sheet-in; }
  .pl-drawer-head { padding: 22px 20px 10px; }
  .pl-drawer-body { padding: 4px 20px calc(24px + env(safe-area-inset-bottom)); }
  .pl-drawer-foot { margin: 18px -20px -24px; padding: 14px 20px 20px; }
  .pl-expressions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pl-detail-list { grid-template-columns: 1fr; }
  .pl-detail-list > dd { text-align: left; padding-top: 0; }
  .pl-detail-list > dt { border-bottom: 0; padding-bottom: 2px; }
  .pl-toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .pl-login-page .pl-frame { margin-top: 0; }
  .pl-login { padding: 18px; }
}
@keyframes pl-sheet-in { from { transform: translateY(30px); opacity: 0; } }
@media (max-width: 375px) {
  .pl-home-title { font-size: 39px; }
  .pl-nav-item { font-size: 10.5px; }
  .pl-metric strong { font-size: 18px; }
}
@media (pointer: coarse) {
  .pl-btn, .pl-tab, .pl-link, .pl-quick button { min-height: 44px; }
  .pl-iconbtn { width: 44px; height: 44px; }
}

.pl-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
