/* The plan pages (views/plan.js, plan-builder.js, plan-common.js): 구독 관리, and the page where a plan is put together, in the manner of Apple's page to buy a Mac:
   the large card on the left stays, the choices on the right are the only thing that scrolls, and the large title and price give way to a bar at the top. */

/* ---- 구독 관리 ---- */
.pm { max-width: 720px; }
.pm-title, .pb-title { margin: 0 0 22px; font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.pm-title b, .pb-title b, .pb-step-title b, .pm-sub b { color: var(--text); font-weight: 700; }
.pm-title span, .pb-title span, .pb-step-title span, .pm-sub span { color: var(--muted); font-weight: 700; }
.pm-title:focus, .pb-title:focus { outline: none; }
.pm-sub { margin: 0 0 16px; font-size: 22px; letter-spacing: -0.02em; line-height: 1.25; }
.pm-card { margin-bottom: 28px; }
.pm-text { margin: 0 0 18px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.pm-actions { margin-top: 18px; }
.pm-go, .pb-buy { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; border-radius: 12px; font-size: 17px; text-decoration: none; }
.pm-order { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; padding: 18px 22px; border: var(--sticker-w) solid var(--pal-amber-fill); border-radius: 18px; background: var(--warn-soft); }
.pm-order p { margin: 4px 0 0; font-size: 14px; }
.pm-order .pm-fine { color: var(--muted); font-size: 13px; }

/* ---- the card that says what a plan is (also the end of the choosing) ---- */
.ps-card { padding: 26px 26px 22px; border-radius: 22px; background: var(--surface-2); color: var(--text); }
.ps-name { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.ps-line { margin: 0; color: var(--muted); font-size: 14px; }
.ps-sep { height: 1px; margin: 18px 0; border: 0; background: var(--separator); }
.ps-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ps-spec { display: grid; gap: 4px; }
.ps-spec strong { font-size: 15px; font-weight: 700; }
.ps-spec span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.ps-ico { width: 26px; height: 26px; margin-bottom: 4px; color: var(--muted); }
.ps-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.ps-list dt { font-weight: 700; }
.ps-list dd { margin: 0; color: var(--muted); }
.ps-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.ps-price { display: grid; gap: 4px; margin: 22px 0 6px; }
.ps-price-label { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }
.ps-price strong { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ps-price strong small { color: var(--muted); font-size: 18px; font-weight: 600; letter-spacing: 0; }
.ps-price span { color: var(--muted); font-size: 14px; }

/* ---- the page to put a plan together ---- */
.pb-head { padding: 4px 0 14px; }
.pb-title { margin-bottom: 8px; }
.pb-price { margin: 0; color: var(--muted); font-size: 20px; font-weight: 600; }
.pb-price-num { color: var(--text); font-variant-numeric: tabular-nums; }
.pb-price small { font-size: 14px; font-weight: 500; }

/* The bar at the top (read off a recording of Apple's page, frame by frame): when the large title has scrolled away, the small name and the price slide down into the bar from
   above its top edge, which cuts them off while they are on the way (0.2s, slowing at the end); when the title is back they slide up out of it the same way (0.17s, speeding
   up). The title itself does not move: it only scrolls. The bar is a thin line under them. */
.pb-bar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; height: 52px; margin: -32px -40px 0; padding: 0 40px; overflow: hidden;
  border-bottom: 1px solid transparent; background: transparent; pointer-events: none;
  transition: background-color 0.18s linear 0.04s, border-color 0.18s linear 0.04s, -webkit-backdrop-filter 0.18s linear 0.04s, backdrop-filter 0.18s linear 0.04s;
}
.pb-bar.on { border-bottom-color: var(--separator); background: var(--card-glass); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); transition-delay: 0s; }
.pb-bar-name, .pb-bar-price { transform: translateY(-46px); transition: transform 0.17s cubic-bezier(0.55, 0, 1, 0.45); }
.pb-bar.on .pb-bar-name, .pb-bar.on .pb-bar-price { transform: none; transition: transform 0.2s cubic-bezier(0.1, 0.7, 0.3, 1); }
.pb-bar.on .pb-bar-price { transition-delay: 0.02s; }
.pb-bar-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.pb-bar-price { color: var(--muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.pb-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 25%, 380px); gap: 40px; align-items: start; }

/* The stage stays where it is while the choices scroll. */
.pb-stage {
  position: sticky; top: 76px; height: calc(100vh - 176px); height: calc(100dvh - 176px); min-height: 440px; overflow: hidden;
  border: 0; border-radius: var(--radius-lg); background: var(--surface-2);
}
.pb-gallery { position: relative; display: flex; flex-direction: column; height: 100%; padding: 26px 28px 22px; }
.pb-cap { z-index: 2; max-width: 420px; margin: 0 0 12px; color: var(--muted); font-size: 14px; font-weight: 500; line-height: 1.5; }
.pb-cap b { color: var(--text); }
.pb-slides { position: relative; flex: 1; min-height: 0; }
.pb-slide { container-type: size; position: absolute; inset: 0; display: grid; place-items: center; margin: 0; opacity: 0; transition: opacity 0.4s ease; pointer-events: none; }
.pb-slide.on { opacity: 1; pointer-events: auto; }
.pb-lap { container-type: inline-size; display: flex; flex-direction: column; align-items: center; width: min(80cqw, 1200px, calc((100cqh - 38px) * 1.5397 + 24px)); }
.pb-lap-lid { width: 100%; padding: 1.15cqw; border-radius: 2cqw 2cqw 0.5cqw 0.5cqw; background: #0b0b0d; box-shadow: 0 0 0 1.5px #3a3a3e inset; }
.pb-lap-lid { position: relative; }
.pb-lap-base { position: relative; width: 108%; height: 14px; border-radius: 0 0 18px 18px; background: linear-gradient(#e6e7ea, #c3c5ca); }
.pb-lap-base::before { content: ""; position: absolute; top: 0; left: 50%; width: 16%; height: 6px; border-radius: 0 0 8px 8px; background: #b2b4ba; transform: translateX(-50%); }
.pb-screen { position: relative; container-type: inline-size; aspect-ratio: 3024 / 1964; overflow: hidden; border-radius: 0.85cqw; background: radial-gradient(120% 90% at 18% 12%, #6f8cff 0%, transparent 55%), radial-gradient(100% 80% at 88% 20%, #b66dff 0%, transparent 58%), radial-gradient(120% 90% at 60% 105%, #ff8fb8 0%, transparent 60%), linear-gradient(160deg, #3d4fd6, #7a4fd0); }
/* the bar at the top: clear (the desktop shows through it), with a soft shadow */
.pb-screen::after { content: ""; position: absolute; z-index: 3; top: 0; left: 50%; width: 11.5%; height: 3.4%; min-height: 14px; border-radius: 0 0 1cqw 1cqw; background: #0b0b0d; transform: translateX(-50%); } /* the notch is as high as the bar */
.pb-menubar { position: absolute; z-index: 2; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; height: 3.4%; min-height: 14px; padding: 0 1.5cqw; color: #fff; font-size: 1.2cqw; line-height: 1; white-space: nowrap; }
.pb-mb-left, .pb-mb-right { display: flex; align-items: center; gap: 1.55cqw; }
.pb-mb-right { gap: 1.15cqw; }
.pb-mb-app { font-weight: 700; }
.pb-mb-logo { width: 1.05cqw; height: 1.05cqw; margin-right: 0.35cqw; border-radius: 50%; background: #fff; }
.pb-ic { flex: none; width: 1.5cqw; height: 1.5cqw; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pb-menubar .pb-ic { width: 1.35cqw; height: 1.35cqw; }
.pb-win { position: absolute; z-index: 1; left: 2.65%; right: 2.65%; top: 5.2%; bottom: 2.2%; display: flex; flex-direction: column; overflow: hidden; border-radius: 1.1cqw; background: #f4f4f6; box-shadow: 0 2.4cqw 7cqw -0.5cqw rgba(0, 0, 0, 0.55), 0 0.4cqw 1.4cqw rgba(0, 0, 0, 0.25), 0 0 0 0.08cqw rgba(0, 0, 0, 0.35); }
.pb-win-bar { position: relative; flex: none; display: flex; align-items: center; justify-content: space-between; height: 6.2%; padding: 0 1.3cqw; background: #ececef; color: #4a4a50; box-shadow: 0 0.08cqw 0 rgba(0, 0, 0, 0.14); }
.pb-tb-left, .pb-tb-right { display: flex; align-items: center; gap: 0.9cqw; }
.pb-tb-right { gap: 1.7cqw; padding-right: 0.4cqw; }
.pb-dots3 { display: flex; gap: 0.8cqw; margin-right: 0.6cqw; }
.pb-dots3 i { display: block; width: 1.05cqw; height: 1.05cqw; border-radius: 50%; }
.pb-d-r { background: #ff5f57; }
.pb-d-y { background: #febc2e; }
.pb-d-g { background: #28c840; }
.pb-tb-pill { display: flex; align-items: center; justify-content: center; gap: 0.5cqw; height: 2.7cqw; padding: 0 0.8cqw; border-radius: 1.2cqw; background: rgba(0, 0, 0, 0.06); }
.pb-tb-pair { padding: 0 0.5cqw; }
.pb-tb-pill .pb-ic { width: 1.5cqw; height: 1.5cqw; }
.pb-addr { position: absolute; left: 50%; top: 50%; display: flex; align-items: center; justify-content: center; width: 38%; height: 56%; border-radius: 1.3cqw; background: rgba(0, 0, 0, 0.06); color: #2c2c30; font-size: 1.2cqw; font-weight: 600; transform: translate(-50%, -50%); }
.pb-addr .pb-addr-ic { position: absolute; right: 0.9cqw; width: 1.2cqw; height: 1.2cqw; }
.pb-win-body { position: relative; flex: 1; min-height: 0; background: #fff; }
.pb-shot { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.pb-shot-dark { display: none; }
:root[data-theme="dark"] .pb-win { background: #1f1f22; }
:root[data-theme="dark"] .pb-win-bar { background: #2c2c2f; color: #d6d6db; box-shadow: 0 0.08cqw 0 rgba(0, 0, 0, 0.5); }
:root[data-theme="dark"] .pb-tb-pill { background: rgba(255, 255, 255, 0.1); }
:root[data-theme="dark"] .pb-addr { background: rgba(255, 255, 255, 0.1); color: #f1f1f4; }
:root[data-theme="dark"] .pb-win-body { background: #1c1c1e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pb-win { background: #1f1f22; }
  :root:not([data-theme="light"]) .pb-win-bar { background: #2c2c2f; color: #d6d6db; box-shadow: 0 0.08cqw 0 rgba(0, 0, 0, 0.5); }
  :root:not([data-theme="light"]) .pb-tb-pill { background: rgba(255, 255, 255, 0.1); }
  :root:not([data-theme="light"]) .pb-addr { background: rgba(255, 255, 255, 0.1); color: #f1f1f4; }
  :root:not([data-theme="light"]) .pb-win-body { background: #1c1c1e; }
}
:root[data-theme="dark"] .pb-shot-light { display: none; }
:root[data-theme="dark"] .pb-shot-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pb-shot-light { display: none; }
  :root:not([data-theme="light"]) .pb-shot-dark { display: block; }
}

/* The drawings of the stage (views/plan-stage.js): one for each step of the choosing, changing with the choice. */
.pb-stagebox { height: 100%; }
.pb-gallery[hidden], .pv[hidden] { display: none; }
.pv { display: flex; flex-direction: column; height: 100%; padding: 26px 28px 22px; }
.pv-art { display: grid; flex: 1; min-height: 0; place-items: center; }
.pb-stagebox { transition: opacity 0.22s ease; }
.pb-stagebox.is-out { opacity: 0; }
.pv-svg { width: min(100%, 620px); max-height: 100%; }
.pv-body { fill: var(--surface); stroke: var(--separator); stroke-width: 2; }
.pv-accent { fill: var(--accent); }
.pv-dim { fill: var(--fill-strong); }
.pv-faint { opacity: 0.5; }
.pv-link { fill: none; stroke: var(--faint); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 12; }
.pv-tick { fill: none; stroke: var(--surface); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.pv-arc { fill: none; stroke-width: 26; stroke-linecap: round; }
.pv-arc-dim { stroke: var(--fill-strong); }
.pv-arc-on { stroke: var(--accent); }
.pv-big { fill: var(--text); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.pv-huge { fill: var(--text); font-size: 64px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pv-c1 { fill: light-dark(#ff9500, #ff9f0a); }
.pv-c2 { fill: light-dark(#34c759, #30d158); }
.pv-c3 { fill: light-dark(#af52de, #bf5af2); }
.pv-c4 { fill: light-dark(#aeaeb2, #636366); }
.pv-card { fill: var(--surface); }
.pv-hair { fill: none; stroke: var(--separator); stroke-width: 1; }
.pv-dash { fill: none; stroke: light-dark(#ff3b30, #ff453a); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 0.5 1.5; }
.pv-alert { fill: light-dark(#ff9500, #ff9f0a); }
.pv-alert-mark { fill: #fff; font-size: 15px; font-weight: 800; }
.pv-lead { fill: var(--text); font-size: 16px; font-weight: 600; }
.pv-segtxt { fill: #fff; font-size: 17px; font-weight: 600; }
.pv-dashtxt { fill: light-dark(#ff3b30, #ff453a); font-size: 19px; font-weight: 600; }
.pv-dashtxt-sm { font-size: 14px; font-weight: 500; }
.pv-title { fill: var(--text); font-size: 40px; font-weight: 700; letter-spacing: -0.03em; }
.pv-warn { fill: light-dark(#ff3b30, #ff453a); font-size: 16px; font-weight: 600; }
.pv-row { fill: var(--text); font-size: 18px; font-weight: 600; }
.pv-small { fill: var(--muted); font-size: 13px; font-weight: 400; }
.pv-state { fill: var(--muted); font-size: 14px; font-weight: 500; }
.pv-state-on { fill: light-dark(#248a3d, #30d158); }
.pv-note { fill: var(--text); font-size: 15px; font-weight: 400; }
.pv-live { fill: light-dark(#248a3d, #30d158); font-size: 16px; font-weight: 600; }
.pv-tiny { fill: var(--faint); font-size: 14px; font-weight: 600; }
.pv-sub { fill: var(--muted); font-size: 17px; font-weight: 400; }
@media (prefers-reduced-motion: reduce) { .pb-stagebox { transition: none; } }

/* The control under the pictures: an arrow to the left, the dots in a pill, an arrow to the right. */
.pb-control { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.pb-arrow { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--fill-strong); color: var(--text); cursor: pointer; }
.pb-arrow:hover { background: var(--separator); }
.pb-arrow .icon { width: 18px; height: 18px; stroke-width: 2.4; }
.pb-arrow:focus-visible, .pb-dot:focus-visible, .pb-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pb-dots { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px; border-radius: 999px; background: var(--fill-strong); }
.pb-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--faint); opacity: 0.55; cursor: pointer; transition: opacity 0.2s ease, transform 0.2s ease; }
.pb-dot.on { background: var(--text); opacity: 1; transform: scale(1.1); }

/* The choices. */
.pb-options { padding-bottom: 80px; }
.pb-step { display: flex; flex-direction: column; justify-content: center; min-height: calc(100vh - 176px); min-height: calc(100dvh - 176px); margin: 0; } /* a step of its own: the stage changes while it is in the middle */
.pb-step-title { margin: 0 0 14px; font-size: 19px; letter-spacing: -0.015em; line-height: 1.3; }
.pb-group { display: grid; gap: 10px; }
.pb-opt { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; width: 100%; padding: 16px 18px; border: 1.5px solid var(--separator); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.pb-opt:hover:not(:disabled):not(.is-fixed) { border-color: var(--faint); }
.pb-opt.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pb-opt.is-off { opacity: 0.55; cursor: not-allowed; }
.pb-opt.is-fixed { cursor: default; }
.pb-opt-main { display: grid; gap: 4px; }
.pb-opt-main strong { font-size: 16px; font-weight: 700; }
.pb-opt-desc { color: var(--muted); font-size: 13px; line-height: 1.45; }
.pb-opt-right { flex: none; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.pb-opt-soon { position: absolute; top: 14px; right: 16px; padding: 2px 10px; border-radius: 999px; background: var(--fill-strong); color: var(--muted); font-size: 12px; font-weight: 600; }

.pb-summary { margin-top: 12px; }
.pb-sum-title { margin-bottom: 16px; }
.pb-buy { margin-top: 18px; }
.pb-fine { margin: 12px 2px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* The sign-in button of the sidebar a visitor has: black in the light mode, white in the dark. */
.public-login { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; border-radius: 999px; background: #000; color: #fff; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.public-login .icon { width: 15px; height: 15px; }
:root[data-theme="dark"] .public-login { background: #fff; color: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .public-login { background: #fff; color: #000; } }

@media (max-width: 1100px) { .pb-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; } }
@media (max-width: 900px) {
  .pm-title, .pb-title { font-size: 30px; }
  .pb-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .pb-stage { position: relative; top: 0; height: 420px; min-height: 0; }
  .pb-bar { top: 56px; margin: -24px -16px 0; padding: 0 16px; }
  .pb-options { padding-bottom: 40px; }
  .pb-step { display: block; min-height: 0; margin: 0 0 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .pb-bar, .pb-bar-name, .pb-bar-price, .pb-slide { transition: none; }
}

/* The room that is left in the storage of the panel (plan-builder.js), live. */
.pb-live { margin: 0 0 4px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.pb-live::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: light-dark(#34c759, #30d158); vertical-align: 1px; }

/* Sizes that the chip has no room for but another chip has (plan-builder.js sizeOptions). */
.pb-more { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--separator); }
.pb-more-title { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.pb-more-text { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.pb-opt-other { margin-bottom: 10px; }
.pb-opt-other .pb-opt-right { max-width: 52%; color: var(--text); font-size: 13px; text-align: right; line-height: 1.35; }

/* The motherboard of the last screen (views/plan-stage.js boardPicture): line art in the blue of the page. */
.pv-board { width: min(100%, 600px); }
.pv-ln { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pv-tint { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.pv-faintline { stroke-opacity: 0.38; }
.pv-lbl { fill: var(--accent); font-size: 13px; font-weight: 500; text-anchor: middle; }
.pv-lbl-strong { font-size: 15px; font-weight: 700; }
.pv-lbl-small { font-size: 10px; font-weight: 600; opacity: 0.8; }

/* The line at the foot of the sidebar of the public pages: what signing in or up means, with the terms and the policy (app.js buildPublicShell). */
.side-legal { margin: 10px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.side-legal a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.side-legal a:hover { color: var(--text); }
