/* KaiSync Perfume Lab
 * 所有 class 皆以 .pl- 為前綴，嵌入其他網站（例如 Zensical）時不易與既有樣式衝突。
 */

:root {
  --pl-bg: #f8f4ee;
  --pl-surface: #fffdf9;
  --pl-surface-2: #f3ece2;
  --pl-ink: #2a2421;
  --pl-ink-2: #5d534d;
  --pl-muted: #8b7f77;
  --pl-line: #e6dccf;
  --pl-accent: #7a4e5c;       /* plum */
  --pl-accent-ink: #fff;
  --pl-accent-soft: #f1e4e7;
  --pl-gold: #b08d57;
  --pl-top: #d9a93f;          /* citrus gold */
  --pl-top-soft: #fbf1d9;
  --pl-middle: #c07a8a;       /* rose */
  --pl-middle-soft: #f8e7ea;
  --pl-base: #8a6446;         /* wood */
  --pl-base-soft: #f1e6dc;
  --pl-warn: #a86a12;
  --pl-warn-soft: #fdf3e0;
  --pl-danger: #b0413e;
  --pl-danger-soft: #fbe9e7;
  --pl-ok: #4f7a5a;
  --pl-ok-soft: #e8f1ea;
  --pl-radius: 18px;
  --pl-radius-sm: 10px;
  --pl-shadow: 0 1px 2px rgba(60, 40, 30, .04), 0 8px 24px rgba(60, 40, 30, .06);
  --pl-serif: 'Cormorant Garamond', 'Noto Serif TC', Georgia, serif;
  --pl-sans: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--pl-bg);
  color: var(--pl-ink);
  font-family: var(--pl-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.pl-app { min-height: 100vh; }
.pl-app button, .pl-app input, .pl-app select { font: inherit; color: inherit; }
.pl-app a { color: var(--pl-accent); }

.pl-visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.pl-muted { color: var(--pl-muted); }
.pl-small { font-size: 12.5px; }
.pl-warn-text { color: var(--pl-warn); margin: 4px 0 0; }
.pl-fineprint { font-size: 12px; color: var(--pl-muted); margin: 12px 0 0; }
[hidden] { display: none !important; }

/* ---------- Hero ---------- */
.pl-hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(192, 122, 138, .18), transparent 60%),
    radial-gradient(900px 380px at 0% 0%, rgba(217, 169, 63, .14), transparent 60%),
    linear-gradient(180deg, #fbf7f1, var(--pl-bg));
  border-bottom: 1px solid var(--pl-line);
}
.pl-hero__inner {
  max-width: 1120px; margin: 0 auto; padding: 56px 20px 28px; position: relative;
}
.pl-eyebrow {
  margin: 0; font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--pl-gold); font-weight: 500;
}
.pl-brand-link { color: inherit !important; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s; }
.pl-brand-link:hover { border-bottom-color: currentColor; }

.pl-title {
  margin: 4px 0 6px; font-family: var(--pl-serif); font-weight: 500; font-size: clamp(42px, 7vw, 68px); line-height: 1.02; letter-spacing: .01em;
}
.pl-subtitle { margin: 0; font-family: var(--pl-serif); font-style: italic; font-size: 22px; color: var(--pl-ink-2); }
.pl-subtitle-zh { margin: 8px 0 0; color: var(--pl-muted); }
.pl-hero__reset { position: absolute; top: 20px; right: 20px; }

.pl-steps {
  max-width: 1120px; margin: 0 auto; padding: 0 20px 16px;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
}
.pl-steps::-webkit-scrollbar { display: none; }
.pl-steps a {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--pl-line); background: var(--pl-surface);
  text-decoration: none; color: var(--pl-ink-2); font-size: 13px; white-space: nowrap;
}
.pl-steps a:hover { border-color: var(--pl-accent); color: var(--pl-accent); }
.pl-steps a span { font-family: var(--pl-serif); color: var(--pl-gold); font-weight: 600; }

/* ---------- Layout ---------- */
.pl-main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 40px; display: grid; gap: 22px; }

.pl-section {
  background: var(--pl-surface); border: 1px solid var(--pl-line); border-radius: var(--pl-radius);
  padding: 26px 26px 28px; box-shadow: var(--pl-shadow); scroll-margin-top: 16px;
}
.pl-section__head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.pl-section__head h2 { margin: 0; font-family: var(--pl-serif), var(--pl-sans); font-weight: 600; font-size: 26px; line-height: 1.2; }
.pl-section__head h2 small { font-family: var(--pl-serif); font-style: italic; font-weight: 500; font-size: 17px; color: var(--pl-muted); margin-left: 6px; }
.pl-hint { margin: 4px 0 0; color: var(--pl-ink-2); font-size: 14px; }
.pl-step-no {
  flex: none; font-family: var(--pl-serif); font-size: 30px; line-height: 1; color: var(--pl-gold);
  border-right: 1px solid var(--pl-line); padding-right: 14px; min-width: 52px;
}

.pl-status {
  padding: 12px 16px; border-radius: var(--pl-radius-sm); background: var(--pl-surface-2); color: var(--pl-ink-2);
}
.pl-status--warn { background: var(--pl-warn-soft); color: var(--pl-warn); }
.pl-status--error { background: var(--pl-danger-soft); color: var(--pl-danger); }

/* ---------- Buttons ---------- */
.pl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; padding: 10px 20px; border: 1px solid var(--pl-line); background: var(--pl-surface);
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .05s; font-weight: 500;
}
.pl-btn:hover:not(:disabled) { border-color: var(--pl-accent); color: var(--pl-accent); }
.pl-btn:active:not(:disabled) { transform: translateY(1px); }
.pl-btn:disabled { opacity: .45; cursor: not-allowed; }
.pl-btn--primary { background: var(--pl-accent); color: var(--pl-accent-ink); border-color: var(--pl-accent); }
.pl-btn--primary:hover:not(:disabled) { background: #683f4c; color: #fff; }
.pl-btn--ghost { background: transparent; }
.pl-btn--small { padding: 5px 12px; font-size: 13px; }
.pl-btn--done { background: var(--pl-accent-soft); border-color: transparent; color: var(--pl-accent); }
.pl-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.pl-app :focus-visible { outline: 2px solid var(--pl-accent); outline-offset: 2px; }

/* ---------- Search / autocomplete ---------- */
.pl-search { position: relative; }
.pl-search__icon {
  position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%);
  fill: none; stroke: var(--pl-muted); stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
.pl-search input {
  width: 100%; padding: 15px 18px 15px 48px; font-size: 16px; border-radius: 999px;
  border: 1px solid var(--pl-line); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.pl-search input:focus { border-color: var(--pl-accent); box-shadow: 0 0 0 4px var(--pl-accent-soft); }

.pl-ac {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  list-style: none; margin: 0; padding: 6px; max-height: 420px; overflow-y: auto;
  background: #fff; border: 1px solid var(--pl-line); border-radius: 16px; box-shadow: 0 16px 40px rgba(60, 40, 30, .14);
}
.ac-option { padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.ac-option.is-active { background: var(--pl-accent-soft); }
.ac-option.is-disabled { opacity: .5; cursor: default; }
.ac-empty { padding: 14px; color: var(--pl-muted); }
.ac-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 3px; }

.pl-oilname { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 0; min-width: 0; }
.pl-oilname__zh { font-weight: 700; }
.pl-oilname__en { color: var(--pl-ink-2); }
.pl-oilname__bot { font-style: italic; color: var(--pl-muted); font-size: 13px; }

.pl-note-badge {
  display: inline-block; font-size: 11.5px; padding: 1px 9px; border-radius: 999px; white-space: nowrap; font-weight: 500;
}
.pl-note-badge--top { background: var(--pl-top-soft); color: #8a6512; }
.pl-note-badge--middle { background: var(--pl-middle-soft); color: #93505f; }
.pl-note-badge--base { background: var(--pl-base-soft); color: #6c4b32; }

.pl-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pl-tag { font-size: 11.5px; padding: 0 8px; border-radius: 999px; background: var(--pl-surface-2); color: var(--pl-ink-2); }

/* ---------- 五行 ---------- */
.pl-elements { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
.pl-elements__label { font-size: 11.5px; color: var(--pl-muted); margin-right: 2px; }
.pl-elements__note { flex-basis: 100%; margin: 2px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--pl-ink-2); }
.pl-element {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  font-family: var(--pl-serif), 'Noto Serif TC', serif; font-size: 13px; font-weight: 600; color: #fff; cursor: help;
}
.pl-element.is-secondary { width: 20px; height: 20px; font-size: 12px; opacity: .75; }
.pl-element--木 { background: #5f8a5b; }
.pl-element--火 { background: #c0564b; }
.pl-element--土 { background: #b48a3c; }
.pl-element--金 { background: #8f98a3; }
.pl-element--水 { background: #3f5f7f; }
.ac-meta .pl-element { width: 18px; height: 18px; font-size: 11px; margin-left: 2px; }

/* ---------- Filters ---------- */
.pl-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 20px; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-chip {
  border: 1px solid var(--pl-line); background: transparent; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px;
}
.pl-chip span { color: var(--pl-muted); font-size: 11px; margin-left: 2px; }
.pl-chip.is-on { background: var(--pl-ink); color: #fff; border-color: var(--pl-ink); }
.pl-chip.is-on span { color: rgba(255, 255, 255, .7); }
.pl-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; color: var(--pl-ink-2); }
.pl-toggle input, .pl-own input { accent-color: var(--pl-accent); }

/* ---------- Note board ---------- */
.pl-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pl-board__col { border-radius: 16px; padding: 14px; min-height: 140px; }
.pl-board__col--top { background: var(--pl-top-soft); }
.pl-board__col--middle { background: var(--pl-middle-soft); }
.pl-board__col--base { background: var(--pl-base-soft); }
.pl-board__col h3 { margin: 0 0 10px; font-size: 16px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pl-board__col h3 small { font-family: var(--pl-serif); letter-spacing: .12em; color: var(--pl-ink-2); font-weight: 600; }
.pl-board__col h3 em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--pl-ink-2); font-weight: 500; }
.pl-board__empty { color: var(--pl-muted); font-size: 13px; margin: 8px 0; }

.pl-oilcard {
  background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; border-left: 3px solid var(--pl-line);
}
.pl-oilcard[data-note="top"] { border-left-color: var(--pl-top); }
.pl-oilcard[data-note="middle"] { border-left-color: var(--pl-middle); }
.pl-oilcard[data-note="base"] { border-left-color: var(--pl-base); }
.pl-oilcard__top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pl-x {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--pl-surface-2);
  cursor: pointer; line-height: 1; font-size: 16px; color: var(--pl-ink-2);
}
.pl-x:hover { background: var(--pl-danger-soft); color: var(--pl-danger); }
.pl-oilcard__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 8px; }
.pl-mini { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--pl-ink-2); }
.pl-mini input, .pl-mini select {
  border: 1px solid var(--pl-line); border-radius: 8px; padding: 2px 6px; background: #fff; font-size: 13px;
}
.pl-mini input { width: 56px; }
.pl-own { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--pl-ink-2); cursor: pointer; margin-top: 6px; }

/* ---------- Pick mode ---------- */
.pl-mode {
  display: inline-flex; padding: 4px; gap: 4px; margin-bottom: 16px;
  background: var(--pl-surface-2); border-radius: 999px; max-width: 100%;
}
.pl-mode__btn {
  border: none; background: transparent; border-radius: 999px; padding: 8px 18px; cursor: pointer;
  font-weight: 500; color: var(--pl-ink-2); white-space: nowrap;
}
.pl-mode__btn span { font-family: var(--pl-serif); font-style: italic; font-weight: 500; color: var(--pl-muted); margin-left: 4px; }
.pl-mode__btn.is-on { background: #fff; color: var(--pl-ink); box-shadow: 0 1px 4px rgba(60, 40, 30, .12); }

/* ---------- Note picker (browse by note) ---------- */
.pl-picker { margin-bottom: 8px; }
.pl-notetabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pl-notetab {
  border: 1px solid var(--pl-line); background: #fff; border-radius: 14px; padding: 10px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; transition: background .15s, border-color .15s;
}
.pl-notetab b { font-size: 17px; }
.pl-notetab span { font-family: var(--pl-serif); font-style: italic; font-size: 13px; color: var(--pl-muted); }
.pl-notetab small { font-size: 12px; color: var(--pl-ink-2); margin-top: 2px; }
.pl-notetab--top.is-on { background: var(--pl-top-soft); border-color: var(--pl-top); box-shadow: inset 0 0 0 1px var(--pl-top); }
.pl-notetab--middle.is-on { background: var(--pl-middle-soft); border-color: var(--pl-middle); box-shadow: inset 0 0 0 1px var(--pl-middle); }
.pl-notetab--base.is-on { background: var(--pl-base-soft); border-color: var(--pl-base); box-shadow: inset 0 0 0 1px var(--pl-base); }
.pl-notetabs__hint { margin: 12px 2px; font-size: 13.5px; color: var(--pl-ink-2); }
.pl-picker__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px;
  max-height: 620px; overflow-y: auto; padding: 2px 4px 2px 2px;
}
.pl-pcard {
  border: 1px solid var(--pl-line); border-radius: 14px; padding: 12px 14px; background: #fff;
  display: flex; flex-direction: column; border-left: 3px solid var(--pl-line);
}
.pl-pcard--top { border-left-color: var(--pl-top); }
.pl-pcard--middle { border-left-color: var(--pl-middle); }
.pl-pcard--base { border-left-color: var(--pl-base); }
.pl-pcard.is-added { background: #fffafb; border-color: var(--pl-accent); border-left-width: 3px; }
.pl-pcard__head .pl-oilname__zh { font-size: 16px; }
.pl-pcard__desc { margin: 6px 0 0; font-size: 13px; color: var(--pl-ink-2); line-height: 1.5; }
.pl-pcard__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; flex-wrap: wrap; }
.pl-pcard__foot .pl-own { margin: 0 0 0 auto; }

.pl-subhead { margin: 22px 0 10px; font-size: 16px; padding-top: 16px; border-top: 1px solid var(--pl-line); }
.pl-subhead small { font-family: var(--pl-serif); font-style: italic; font-weight: 500; color: var(--pl-muted); margin-left: 4px; }

/* ---------- Segments ---------- */
.pl-segment { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.pl-segment--small { grid-template-columns: repeat(6, minmax(56px, 1fr)); max-width: 500px; }
.pl-seg {
  border: 1px solid var(--pl-line); background: #fff; border-radius: 14px; padding: 10px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0; transition: border-color .15s, background .15s;
}
.pl-seg b { font-weight: 600; font-size: 15px; }
.pl-seg span { font-size: 12px; color: var(--pl-muted); font-family: var(--pl-serif); font-style: italic; }
.pl-seg small { font-size: 11.5px; color: var(--pl-ink-2); margin-top: 2px; }
.pl-seg:hover:not(:disabled) { border-color: var(--pl-accent); }
.pl-seg.is-on { border-color: var(--pl-accent); background: var(--pl-accent-soft); box-shadow: inset 0 0 0 1px var(--pl-accent); }
.pl-seg:disabled { cursor: not-allowed; opacity: .5; }

.pl-inline-field { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pl-label { font-size: 13px; color: var(--pl-ink-2); font-weight: 500; }

/* ---------- 分配方式 ---------- */
.pl-segment--method { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; flex: 1 1 320px; }
.pl-segment--method .pl-seg { align-items: flex-start; text-align: left; padding: 10px 14px; }
.pl-segment--method .pl-seg small { color: var(--pl-muted); }
#bf-mode-note { margin: 0 0 4px; }

/* ---------- Ratio ---------- */
.pl-ratio { margin-top: 18px; display: grid; gap: 10px; max-width: 640px; }
.pl-ratio__row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 14px; }
.pl-ratio__row label { font-weight: 500; font-size: 14px; }
.pl-ratio__row input[type="range"] { width: 100%; }
.pl-ratio__row[data-note="top"] input[type="range"] { accent-color: var(--pl-top); }
.pl-ratio__row[data-note="middle"] input[type="range"] { accent-color: var(--pl-middle); }
.pl-ratio__row[data-note="base"] input[type="range"] { accent-color: var(--pl-base); }
.pl-num { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.pl-num input {
  width: 64px; padding: 6px 8px; border: 1px solid var(--pl-line); border-radius: 10px; text-align: right; background: #fff;
}
.pl-num--wide { margin-top: 8px; }
.pl-num--wide input { width: 80px; }
.pl-ratio__bar { display: flex; height: 26px; border-radius: 999px; overflow: hidden; background: var(--pl-surface-2); margin-top: 6px; }
.pl-ratio__seg { display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; white-space: nowrap; overflow: hidden; transition: flex-grow .2s; }
.pl-ratio__seg--top { background: var(--pl-top); }
.pl-ratio__seg--middle { background: var(--pl-middle); }
.pl-ratio__seg--base { background: var(--pl-base); }
.pl-ratio__sum { margin: 0; font-size: 13.5px; color: var(--pl-ok); }
.pl-ratio__sum.is-error { color: var(--pl-danger); font-weight: 500; }

/* ---------- Formula ---------- */
.pl-formula { border: 1px solid var(--pl-line); border-radius: 16px; overflow: hidden; }
.pl-formula__head {
  display: flex; justify-content: space-between; align-items: baseline; padding: 14px 18px;
  background: var(--pl-ink); color: #fff;
}
.pl-formula__head strong { font-family: var(--pl-serif); font-size: 24px; font-weight: 500; }
.pl-fgroup { padding: 12px 18px 6px; border-top: 1px solid var(--pl-line); }
.pl-fgroup h3 { margin: 0 0 6px; font-size: 15px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.pl-fgroup h3 small { font-family: var(--pl-serif); letter-spacing: .12em; font-weight: 600; }
.pl-fgroup--top h3 { color: #8a6512; }
.pl-fgroup--middle h3 { color: #93505f; }
.pl-fgroup--base h3 { color: #6c4b32; }
.pl-frow {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px dashed var(--pl-line);
}
.pl-frow:last-child { border-bottom: none; }
.pl-frow__name { display: flex; flex-direction: column; min-width: 0; }
.pl-frow--empty { padding: 4px 0 10px; margin: 0; }
.pl-modified {
  align-self: flex-start; font-size: 11px; padding: 0 8px; border-radius: 999px; margin-top: 2px;
  background: var(--pl-accent); color: #fff; letter-spacing: .04em;
}
.pl-frow.is-modified output { color: var(--pl-accent); }
.pl-stepper { display: inline-flex; align-items: center; border: 1px solid var(--pl-line); border-radius: 999px; background: #fff; }
.pl-stepper button {
  width: 36px; height: 36px; border: none; background: transparent; cursor: pointer; font-size: 18px; border-radius: 50%; color: var(--pl-ink-2);
}
.pl-stepper button:hover:not(:disabled) { background: var(--pl-surface-2); }
.pl-stepper button:disabled { opacity: .3; cursor: not-allowed; }
.pl-stepper output { min-width: 30px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 16px; }
.pl-formula__total {
  display: flex; align-items: baseline; gap: 10px; justify-content: flex-end; padding: 14px 18px;
  border-top: 2px solid var(--pl-ink); background: var(--pl-surface-2);
}
.pl-formula__total strong { font-family: var(--pl-serif); font-size: 26px; font-weight: 600; }
.pl-link { font-size: 12.5px; white-space: nowrap; }
.pl-oos { font-size: 12px; color: var(--pl-muted); background: var(--pl-surface-2); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }

/* ---------- 計算說明 ---------- */
.pl-explain { margin-top: 14px; border: 1px solid var(--pl-line); border-radius: 14px; background: var(--pl-bg); }
.pl-explain > summary { cursor: pointer; padding: 12px 16px; font-weight: 500; color: var(--pl-accent); }
.pl-explain__body { padding: 0 18px 16px; font-size: 13.5px; color: var(--pl-ink-2); }
.pl-explain__body h4 { margin: 14px 0 6px; font-size: 14px; color: var(--pl-ink); }
.pl-explain__body ul { margin: 0; padding-left: 18px; }
.pl-explain__body li { margin: 3px 0; }
.pl-explain__body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--pl-surface-2); padding: 1px 6px; border-radius: 6px; }
.pl-explain__body .pl-calc { font-variant-numeric: tabular-nums; }

/* ---------- Alerts ---------- */
.pl-alert { margin: 14px 0 0; padding: 12px 16px 12px 36px; border-radius: 12px; font-size: 13.5px; }
.pl-alert li { margin: 2px 0; }
.pl-alert--warn { background: var(--pl-warn-soft); color: #6f4709; }
.pl-alert--error { background: var(--pl-danger-soft); color: var(--pl-danger); padding-left: 16px; }
.pl-alert--info { background: var(--pl-accent-soft); color: var(--pl-accent); padding-left: 16px; }
.pl-empty {
  padding: 22px; text-align: center; color: var(--pl-muted); border: 1px dashed var(--pl-line); border-radius: 14px; background: var(--pl-bg);
}

/* ---------- Tables ---------- */
.pl-table-wrap { overflow-x: auto; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pl-table th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--pl-muted); padding: 8px 10px; border-bottom: 1px solid var(--pl-line); white-space: nowrap; }
.pl-table td { padding: 10px; border-bottom: 1px solid var(--pl-line); vertical-align: middle; }
.pl-table tfoot td { font-weight: 600; border-bottom: none; background: var(--pl-surface-2); }
.pl-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-table .is-danger { color: var(--pl-danger); font-weight: 700; }

.pl-locked__stamp { margin: 0 0 10px; color: var(--pl-accent); font-weight: 500; }

/* ---------- Final ---------- */
.pl-final-controls { display: grid; gap: 22px; }
.pl-final-controls.is-disabled { opacity: .55; }
.pl-field { display: grid; gap: 8px; }
.pl-conc { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.pl-conc__opt {
  border: 1px solid var(--pl-line); background: #fff; border-radius: 14px; padding: 12px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column;
}
.pl-conc__opt span { font-family: var(--pl-serif); font-style: italic; color: var(--pl-muted); }
.pl-conc__opt small { color: var(--pl-ink-2); }
.pl-conc__opt.is-on { border-color: var(--pl-accent); background: var(--pl-accent-soft); box-shadow: inset 0 0 0 1px var(--pl-accent); }
.pl-conc__opt:disabled { cursor: not-allowed; }

/* ---------- Safety ---------- */
.pl-safety-summary { margin: 0 0 14px; padding: 14px 16px 14px 34px; background: var(--pl-surface-2); border-radius: 12px; }
.pl-safety-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.pl-scard { border: 1px solid var(--pl-line); border-radius: 14px; padding: 12px 14px; background: #fff; border-top: 3px solid var(--pl-line); }
.pl-scard ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--pl-ink-2); }
.pl-scard li { margin: 3px 0; }
.pl-scard--ok { border-top-color: var(--pl-ok); }
.pl-scard--warn { border-top-color: var(--pl-warn); }
.pl-scard--danger { border-top-color: var(--pl-danger); background: #fffafa; }
.pl-scard--unknown { border-top-color: var(--pl-muted); }
.is-warn { color: var(--pl-warn); }
.is-danger { color: var(--pl-danger); font-weight: 500; }
.is-muted { color: var(--pl-muted); }

/* ---------- Recipe ---------- */
.pl-recipe__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.pl-recipe__stats div { background: var(--pl-surface-2); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; }
.pl-recipe__stats span { font-size: 12.5px; color: var(--pl-ink-2); }
.pl-recipe__stats strong { font-family: var(--pl-serif); font-size: 32px; font-weight: 600; line-height: 1.1; margin-top: 4px; }
.pl-recipe__stats small { font-size: 16px; }

/* ---------- Shop ---------- */
.pl-shop { display: grid; gap: 8px; }
.pl-shoprow {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; align-items: center;
  padding: 10px 14px; border: 1px solid var(--pl-line); border-radius: 12px; background: #fff;
}
.pl-shoprow .pl-own { margin: 0; }
.pl-shoprow.is-owned { background: var(--pl-ok-soft); border-color: transparent; }

/* ---------- Footer / toast ---------- */
.pl-footer { max-width: 1120px; margin: 0 auto; padding: 8px 20px 48px; color: var(--pl-ink-2); font-size: 13px; }
.pl-footer h3 { font-family: var(--pl-serif); font-size: 20px; margin: 0 0 6px; color: var(--pl-ink); }
.pl-footer ul { padding-left: 18px; margin: 0 0 12px; }

.pl-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
  background: var(--pl-ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .pl-board { grid-template-columns: 1fr; }
  .pl-board__col { min-height: 0; }
  .pl-recipe__stats { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .pl-hero__inner { padding: 64px 16px 20px; }
  .pl-hero__reset { top: 14px; right: 16px; padding: 6px 14px; font-size: 13px; }
  .pl-steps { padding: 0 16px 14px; }
  .pl-main { padding: 16px 12px 32px; gap: 14px; }
  .pl-section { padding: 18px 16px 20px; border-radius: 16px; }
  .pl-section__head { gap: 12px; }
  .pl-section__head h2 { font-size: 22px; }
  .pl-section__head h2 small { display: block; margin: 0; font-size: 15px; }
  .pl-step-no { font-size: 24px; min-width: 40px; padding-right: 10px; }
  .pl-ratio__row { grid-template-columns: 80px 1fr auto; gap: 10px; }
  .pl-segment--small { max-width: none; }
  .pl-frow { grid-template-columns: 1fr auto; }
  .pl-frow__shop { grid-column: 1; grid-row: 2; }
  .pl-frow .pl-stepper { grid-row: 1 / span 2; grid-column: 2; }
  .pl-formula__head, .pl-fgroup, .pl-formula__total { padding-left: 14px; padding-right: 14px; }
  .pl-shoprow { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .pl-table { font-size: 13px; }
  .pl-table td, .pl-table th { padding: 8px 6px; }
  .pl-actions { justify-content: stretch; }
  .pl-actions .pl-btn { flex: 1 1 auto; }
  .pl-picker__grid { grid-template-columns: 1fr; max-height: 520px; }
  .pl-mode { display: flex; }
  .pl-mode__btn { flex: 1; padding: 8px 10px; }
  .pl-mode__btn span { display: none; }
  .pl-footer { padding: 4px 16px 40px; }
}
