:root {
  --font-sans: "Geist", "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --font-mono: "Geist Mono", "SFMono-Regular", Consolas, monospace;
  --canvas: #f6f7f4;
  --surface: #ffffff;
  --surface-muted: #f0f3ef;
  --ink: #202421;
  --muted: #68716b;
  --subtle: #929a94;
  --line: #e1e5e0;
  --line-strong: #cbd2cc;
  --accent: #16885f;
  --accent-hover: #116f4d;
  --accent-soft: #e8f4ef;
  --danger: #b4493f;
  --content-max: 1440px;
  --create-max: 1180px;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(32, 36, 33, .04), 0 10px 30px rgba(32, 36, 33, .035);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

[hidden] { display: none !important; }

.auth-gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(22,136,95,.11), transparent 34%),
    var(--canvas);
}
.auth-card {
  width: min(100%, 440px);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(32,36,33,.10);
  text-align: center;
}
.auth-brand-mark { width: 52px; height: 52px; color: var(--accent); }
.auth-card .eyebrow { margin: 22px 0 7px; }
.auth-card h1 { margin: 0; font-size: 27px; letter-spacing: -.025em; }
.auth-card > p:not(.eyebrow, .auth-error) { margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.google-signin { min-height: 44px; display: grid; place-items: center; margin-top: 28px; }
.auth-error { min-height: 20px; margin: 14px 0 0; color: var(--danger); font-size: 13px; line-height: 1.5; }
.auth-user { max-width: 180px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.auth-logout { min-height: 40px; padding-inline: 8px; color: var(--muted); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 1.6; }
button, .nav-link, input, select { min-height: 44px; font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.is-hidden { display: none !important; }

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 24px 16px; border-right: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(18px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px 22px; }
.brand-mark { width: 38px; height: 38px; color: var(--accent); }
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup strong { color: var(--ink); font-size: 16px; letter-spacing: -.01em; }
.brand-lockup small { margin-top: 1px; color: var(--subtle); font: 600 10px/1.3 var(--font-mono); letter-spacing: .1em; }
.nav-stack { display: grid; gap: 6px; margin-top: 22px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 6px; color: var(--muted); font-weight: 600; transition: color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease); }
.nav-link:hover { background: var(--surface-muted); color: var(--ink); transform: translateX(2px); }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-icon { display: grid; place-items: center; }

.main-content { min-width: 0; min-height: 100dvh; overflow-x: hidden; }
.topbar { position: sticky; top: 0; z-index: 9; min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 4vw, 64px); border-bottom: 1px solid rgba(225,229,224,.9); background: rgba(246,247,244,.86); backdrop-filter: blur(16px); }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--surface-muted); color: var(--ink); }
.mobile-create { display: none; align-items: center; padding: 0 14px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 650; }

.dashboard-page, .links-page, .detail-page, .page-heading, .creation-form {
  width: min(var(--content-max), calc(100% - clamp(48px, 8vw, 128px)));
  margin-inline: auto;
}
.page-title-row, .detail-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 44px 0 28px; text-align: left; }
.page-title-row h1, .detail-heading h1, .page-heading h1 { margin: 0; font-size: clamp(30px, 3vw, 40px); line-height: 1.16; letter-spacing: -.025em; }
.page-title-row p:not(.eyebrow), .detail-heading p, .page-heading p:not(.eyebrow) { max-width: 65ch; margin: 8px 0 0; color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: var(--accent); font: 700 12px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.page-tools, .detail-heading > div:last-child { display: flex; align-items: center; gap: 10px; flex: none; }

.stitch-button, .primary-button, .secondary-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font-weight: 650; transition: transform .16s var(--ease), background .16s var(--ease), border-color .16s var(--ease); }
.stitch-button:hover, .secondary-button:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.stitch-button--primary, .primary-button { border-color: var(--accent); background: var(--accent); color: #fff; }
.stitch-button--primary:hover, .primary-button:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.stitch-button:active, .primary-button:active, .secondary-button:active { transform: translateY(1px); }
.search-input, .filters select, .date-field, input[type="text"], .tip-row input, .trend-panel select, .qr-row input { min-height: 46px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); outline: none; }
.search-input { width: min(280px, 32vw); }
input:focus, select:focus, button:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(22,136,95,.16); outline: none; }

.dashboard-metrics { display: grid; grid-template-columns: 1.45fr repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); box-shadow: var(--shadow); }
.dashboard-metric { position: relative; min-height: 148px; padding: 24px; background: var(--surface); animation: rise-in .45s var(--ease) both; }
.dashboard-metric:nth-child(2) { animation-delay: .04s; }.dashboard-metric:nth-child(3) { animation-delay: .08s; }.dashboard-metric:nth-child(4) { animation-delay: .12s; }
.dashboard-metric > span { display: block; color: var(--muted); font-size: 14px; }
.dashboard-metric strong { display: inline-block; margin-top: 18px; font: 600 clamp(32px, 3vw, 46px)/1 var(--font-mono); letter-spacing: -.04em; }
.dashboard-metric mark { margin-left: 9px; padding: 3px 7px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font: 600 12px/1 var(--font-mono); }
.dashboard-metric i { position: absolute; top: 22px; right: 22px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-style: normal; }

.stitch-panel, .creation-form { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.process-panel { margin-top: 24px; padding: 28px; }
.process-panel > h2, .panel-title h2, .basic-info h2 { margin: 0; font-size: 20px; letter-spacing: -.015em; }
.process-track { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 14px; margin-top: 24px; }
.process-track > div { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; }
.process-track b { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.process-track em { height: 1px; background: var(--line); }
.ready-state { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; margin-top: 28px; padding: 24px; border-top: 1px solid var(--line); }
.ready-state > b { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.ready-state h3, .ready-state p { margin: 0; }.ready-state h3 { font-size: 19px; }.ready-state p { grid-column: 2; color: var(--muted); font-size: 14px; }
.ready-state .stitch-button { grid-column: 3; grid-row: 1 / span 2; }

.filters { display: grid; grid-template-columns: minmax(240px, 1fr) repeat(3, auto); gap: 10px; padding: 14px; }
.filters .search-input { width: 100%; }
.links-table { margin-top: 18px; overflow-x: auto; overflow-y: hidden; }
.links-table table { width: 100%; border-collapse: collapse; }
.links-table th, .links-table td { padding: 17px 16px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.links-table th { background: var(--surface-muted); color: var(--muted); font-size: 13px; font-weight: 650; }
.links-table td { font-size: 14px; }.links-table tbody tr { transition: background .16s var(--ease); }.links-table tbody tr:hover { background: #fafbf9; }
.links-table footer { padding: 14px 16px; color: var(--muted); font-size: 13px; }
.short-link, .rate, .detail-stats b { color: var(--accent); font-family: var(--font-mono); }
.status-chip { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 650; vertical-align: middle; }
.status-chip--paused { background: var(--surface-muted); color: var(--muted); }
.link-code { color: var(--muted); font-family: var(--font-mono); font-size: 12px !important; }.links-table td strong, .links-table td small { display: block; }.links-table td small { max-width: 300px; overflow: hidden; margin-top: 4px; color: var(--muted); text-overflow: ellipsis; }
.link-actions { min-width: 350px; display: flex; align-items: center; gap: 2px; }.row-action { min-height: 44px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; color: var(--accent); font-weight: 650; white-space: nowrap; }.row-action:hover { background: var(--accent-soft); }.row-action:active { transform: translateY(1px); }.row-action--danger { color: var(--danger); }
.link-list-state { padding: 50px 20px; color: var(--muted); text-align: center; }.link-list-state[hidden] { display: none; }

.management-dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 70px rgba(28, 40, 34, .18); }.management-dialog::backdrop { background: rgba(24, 31, 27, .35); backdrop-filter: blur(3px); }.management-dialog form { padding: 24px; }.management-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }.management-dialog h2 { margin: 4px 0 0; font-size: 24px; }.dialog-close { width: 44px; min-height: 44px; border: 0; border-radius: 7px; background: var(--surface-muted); color: var(--muted); font-size: 22px; }.dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.dialog-grid label { color: var(--muted); font-size: 13px; font-weight: 650; }.dialog-grid input, .dialog-grid select { width: 100%; min-height: 46px; margin-top: 7px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); }.dialog-span { grid-column: 1 / -1; }.management-dialog footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }.dialog-error { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }.danger-button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--danger); color: #fff; font-weight: 700; }.management-dialog--danger { width: min(480px, calc(100% - 32px)); }.management-dialog--danger form > p { color: var(--muted); line-height: 1.7; }
.muted-row { color: var(--subtle); }

.detail-heading h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); gap: 20px; padding-bottom: 48px; }
.basic-info, .trend-panel, .qr-config, .events-panel { padding: 22px; }
.basic-info dl { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }.basic-info dt { margin-top: 14px; color: var(--muted); font-size: 12px; }.basic-info dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.boxed-link { display: block; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-muted); }
.detail-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }.detail-stats span { color: var(--muted); font-size: 12px; }.detail-stats b { display: block; margin-top: 5px; color: var(--ink); font-size: 24px; }
.detail-main { display: grid; gap: 20px; }.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }.text-action, .text-button { border: 0; background: transparent; color: var(--accent); font-weight: 650; }
.fake-chart { position: relative; height: 250px; margin-top: 18px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 100% 25%, 14.285% 100%; }.fake-chart > span { display: none; }.fake-chart svg { width: 100%; height: 100%; }.fake-chart path { fill: none; stroke: var(--accent); stroke-width: 3; vector-effect: non-scaling-stroke; }.fake-chart .chart-area { fill: rgba(22,136,95,.09); stroke: none; }
.qr-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }.fake-qr-img { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-muted); color: var(--accent); }.qr-row small { display: block; color: var(--muted); }.qr-row label { color: var(--muted); font-size: 13px; }.qr-row input { width: 58px; min-height: 38px; text-align: center; }
.event-head { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; color: var(--muted); font-size: 12px; }

.analytics-page { padding-bottom: 52px; }
#analyticsRange { min-height: 46px; padding: 0 34px 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); }
.analytics-state { padding: 64px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); text-align: center; }
.analytics-content { display: grid; gap: 20px; }.analytics-content[hidden] { display: none; }
.analytics-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); box-shadow: var(--shadow); }
.analytics-funnel-step { min-height: 144px; display: grid; grid-template-columns: auto 1fr; align-content: space-between; gap: 14px; padding: 22px; background: var(--surface); }
.analytics-funnel-step > span { color: var(--subtle); font: 700 11px/1.4 var(--font-mono); letter-spacing: .08em; }
.analytics-funnel-step small, .analytics-funnel-step strong { display: block; }.analytics-funnel-step small { color: var(--muted); font-size: 13px; }.analytics-funnel-step strong { margin-top: 9px; font: 600 32px/1 var(--font-mono); letter-spacing: -.04em; }
.analytics-funnel-step mark { grid-column: 2; justify-self: start; padding: 4px 7px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font: 650 11px/1 var(--font-mono); }
.analytics-trend-panel, .analytics-table-panel, .analytics-events-panel { padding: 22px; }.panel-title p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.analytics-trend { height: 260px; display: grid; grid-template-columns: repeat(auto-fit, minmax(34px, 1fr)); align-items: end; gap: 10px; padding: 30px 4px 0; border-bottom: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 25%; }
.analytics-trend-column { height: 100%; display: grid; grid-template-rows: 24px minmax(0, 1fr) 28px; align-items: end; justify-items: center; gap: 5px; }.analytics-trend-column strong { color: var(--muted); font: 600 11px/1 var(--font-mono); }.analytics-trend-column i { width: min(34px, 74%); min-height: 3px; border-radius: 4px 4px 0 0; background: var(--accent); transition: height .24s var(--ease); }.analytics-trend-column span { color: var(--subtle); font: 500 10px/1 var(--font-mono); }
.analytics-lower-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr); gap: 20px; align-items: start; }
.analytics-table-wrap { overflow-x: auto; }.analytics-table-wrap table { width: 100%; border-collapse: collapse; }.analytics-table-wrap th, .analytics-table-wrap td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: right; font-size: 13px; white-space: nowrap; }.analytics-table-wrap th:first-child, .analytics-table-wrap td:first-child { text-align: left; }.analytics-table-wrap th { color: var(--muted); font-weight: 650; }
.analytics-event-list { max-height: 330px; overflow: auto; }.analytics-event-row { padding: 14px 2px; border-bottom: 1px solid var(--line); }.analytics-event-row strong, .analytics-event-row span { display: block; }.analytics-event-row strong { font-size: 13px; }.analytics-event-row span { margin-top: 3px; color: var(--muted); font-size: 11px; }

.page-heading { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 44px 0 24px; text-align: left; }.anchor-target { position: absolute; width: 0; height: 0; }.heading-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }.heading-status span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: breathe 2.4s var(--ease) infinite; }
.creation-form { overflow: hidden; margin-bottom: 24px; }
.form-section { padding: 30px clamp(22px, 4vw, 48px); border-bottom: 1px solid var(--line); }.form-section--last { border-bottom: 0; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 22px; }.section-heading > div { display: flex; align-items: center; gap: 10px; }.section-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 12px/1 var(--font-mono); }.section-heading h2 { margin: 0; font-size: 20px; }.section-heading p { max-width: 42ch; margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.promo-type-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }.type-card { display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); text-align: left; }.type-card:hover { border-color: var(--accent); }.type-card.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650; }.type-symbol { min-width: 25px; height: 25px; display: grid; place-items: center; border-radius: 5px; background: var(--surface-muted); color: var(--muted); font-size: 11px; font-weight: 700; }.type-card.is-selected .type-symbol { background: var(--accent); color: #fff; }
.field-block label, .field-label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 650; }.required, .field-error { color: var(--danger); }.hint { width: 22px; min-height: 22px; margin-left: 4px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; color: var(--muted); font-size: 11px; }.field-block input[type="text"] { width: 100%; }.field-error { display: none; margin: 7px 0 0; font-size: 12px; }.field-error.is-visible { display: block; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.profile-panel { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 26px; padding: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }.avatar-field { display: flex; flex-direction: column; align-items: flex-start; }.avatar-uploader { display: grid; justify-items: center; gap: 7px; margin-top: 10px; padding: 0; border: 0; background: transparent; color: var(--accent); }.avatar-preview { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--accent); color: #fff; font-size: 22px; }.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }.avatar-field small { color: var(--muted); font-size: 12px; }
.qr-upload-slot { width: 100%; }
.qr-dropzone { width: 100%; min-height: 128px; display: grid; place-items: center; align-content: center; gap: 5px; border: 1px dashed var(--line-strong); border-radius: 7px; background: #fafbf9; color: var(--ink); }.qr-dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }.upload-icon { color: var(--accent); }.qr-dropzone small { color: var(--muted); }
.qr-selected-state { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: 120px; padding: 16px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent-soft); }
.qr-selected-state[hidden] { display: none; }
.qr-selected-state img { width: 88px; height: 88px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.qr-selected-copy span, .qr-selected-copy strong, .qr-selected-copy small { display: block; }.qr-selected-copy span { color: var(--accent); font-size: 12px; font-weight: 700; }.qr-selected-copy strong { overflow: hidden; margin-top: 5px; text-overflow: ellipsis; white-space: nowrap; }.qr-selected-copy small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.qr-selected-actions { display: flex; align-items: center; gap: 8px; }.qr-selected-actions button { min-height: 44px; }.text-action--danger { color: var(--danger); }
.tip-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; }.tip-preview { color: var(--muted); font-size: 13px; }.tip-preview strong { color: var(--ink); }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px clamp(22px,4vw,48px); background: var(--surface-muted); }.form-footer strong, .form-footer span { display: block; }.form-footer span { color: var(--muted); font-size: 13px; }.footer-actions { display: flex; gap: 10px; }

/* Create page: a compact form canvas paired with persistent outcome preview. */
#create-page, .creation-workspace {
  width: min(var(--create-max), calc(100% - clamp(40px, 5vw, 72px)));
}
.creation-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  align-items: start;
  gap: 20px;
  margin: 0 auto 24px;
}
.creation-workspace .creation-form { width: 100%; margin: 0; box-shadow: 0 1px 2px rgba(32,36,33,.025); }
.creation-form .form-section { padding: 24px clamp(22px, 3vw, 32px); scroll-margin-top: 84px; }
.creation-form .section-heading {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  margin-bottom: 20px;
}
.creation-form .section-heading > div { display: block; }
.creation-form .section-heading h2 { font-size: 18px; line-height: 1.35; }
.creation-form .section-heading p { max-width: 55ch; margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
.creation-form .promo-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.creation-form .type-card { min-height: 48px; padding-inline: 10px; font-size: 14px; }
.creation-form .type-symbol { min-width: 24px; height: 24px; }
.creation-form .field-block input[type="text"] { min-height: 48px; }
.share-config { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.share-config__heading h3, .share-config__heading p { margin: 0; }.share-config__heading h3 { font-size: 15px; }.share-config__heading p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.share-config__grid { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 20px; margin-top: 16px; }
.share-image-field { display: flex; flex-direction: column; align-items: center; text-align: center; }
.share-image-field .field-label { align-self: stretch; text-align: left; }
.share-image-uploader { width: 96px; min-height: 96px; display: grid; place-items: center; align-content: center; gap: 5px; padding: 8px; border: 1px dashed var(--line-strong); border-radius: 7px; background: #fafbf9; color: var(--accent); }
.share-image-uploader:hover { border-color: var(--accent); background: var(--accent-soft); }
.share-image-uploader > span { width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: 5px; background: var(--accent-soft); }
.share-image-uploader img { width: 100%; height: 100%; object-fit: cover; }
.share-image-uploader strong { color: var(--ink); font-size: 11px; }.share-image-field small { margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.share-fields { display: grid; gap: 12px; align-content: start; }
.creation-form .profile-panel { grid-template-columns: 112px minmax(0, 1fr); gap: 20px; padding: 18px 0 0; border-bottom: 0; background: transparent; }
.creation-form .avatar-field { align-items: center; text-align: center; }
.creation-form .avatar-preview { width: 64px; height: 64px; }
.creation-form .form-columns { grid-template-columns: 1fr; gap: 14px; }
.creation-form .qr-dropzone { min-height: 104px; }
.creation-form .tip-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.creation-form .tip-preview { padding-left: 2px; }
.creation-form .form-footer { padding: 18px clamp(22px, 3vw, 32px); background: #fafbf9; }
.creation-form .form-footer > div:first-child { max-width: 29ch; }
.creation-form .primary-button { min-width: 178px; }

.creation-aside { position: sticky; top: 88px; display: grid; gap: 14px; }
.preview-panel, .form-progress { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(32,36,33,.025); }
.preview-panel { padding: 18px; }
.preview-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.preview-panel h2, .preview-panel p { margin: 0; }.preview-panel h2 { font-size: 17px; letter-spacing: -.015em; }
.preview-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.preview-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: breathe 2.4s var(--ease) infinite; }
.preview-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-top: 14px; padding: 3px; border-radius: 7px; background: var(--surface-muted); }
.preview-tabs button { min-height: 38px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 650; }
.preview-tabs button.is-active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(32,36,33,.08); }
.share-preview { margin-top: 12px; }
.share-preview > p { margin: 8px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.share-card { display: grid; grid-template-columns: minmax(0, 1fr) 72px; gap: 12px; align-items: center; min-height: 112px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 6px 18px rgba(32,36,33,.06); }
.share-card__copy { min-width: 0; }.share-card__copy strong { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 13px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }.share-card__copy p { display: -webkit-box; overflow: hidden; margin: 4px 0; color: var(--muted); font-size: 10px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }.share-card__copy small { color: var(--subtle); font: 500 9px/1.3 var(--font-mono); }
.share-card__image { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.share-card__image img { width: 100%; height: 100%; object-fit: cover; }
.live-phone { display: grid; justify-items: center; margin-top: 12px; padding: 15px 14px 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--canvas); text-align: center; }
.live-phone__type { justify-self: start; padding: 3px 7px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; }
.live-phone__avatar { width: 44px; height: 44px; display: grid; place-items: center; margin-top: 10px; overflow: hidden; border-radius: 50%; background: var(--accent); color: #fff; font-size: 16px; }
.live-phone__avatar img { width: 100%; height: 100%; object-fit: cover; }
.live-phone strong { margin-top: 6px; font-size: 14px; }.live-phone p { min-height: 30px; margin: 2px 0 7px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.live-phone > img { width: min(132px, 72%); aspect-ratio: 1; object-fit: contain; border: 5px solid #fff; border-radius: 7px; }
.live-phone small { margin-top: 8px; color: var(--muted); font-size: 10px; }
.form-progress { padding: 12px; }
.form-progress > p { display: flex; justify-content: space-between; margin: 0 4px 8px; color: var(--muted); font-size: 11px; }.form-progress > p strong { color: var(--ink); }
.form-progress ol { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin: 0; padding: 0; list-style: none; }
.form-progress a { min-height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border-radius: 5px; color: var(--muted); font-size: 9px; line-height: 1.2; text-align: center; transition: background .16s var(--ease), color .16s var(--ease); }
.form-progress a:hover { background: var(--accent-soft); color: var(--accent); }.form-progress a span { width: auto; font: 650 10px/1 var(--font-mono); }
.toast { position: fixed; z-index: 40; left: 50%; top: 20px; max-width: min(90vw, 460px); padding: 11px 15px; border-radius: 6px; background: var(--ink); color: #fff; opacity: 0; transform: translate(-50%,-10px); pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }.toast.is-visible { opacity: 1; transform: translate(-50%,0); }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(32,36,33,.38); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }.modal-backdrop.is-open { opacity: 1; pointer-events: auto; }.demo-modal { position: relative; width: min(520px,100%); max-height: 90dvh; overflow: auto; padding: 28px; border-radius: 10px; background: var(--surface); }.modal-close { position: absolute; top: 14px; right: 14px; width: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 24px; }.demo-copy { color: var(--muted); }.phone-frame { display: grid; justify-items: center; gap: 9px; margin-top: 20px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--canvas); }.demo-avatar { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; }.demo-qr-image { width: 180px; height: 180px; object-fit: contain; border-radius: 8px; }.phone-frame button { border: 0; border-radius: 6px; background: var(--accent); color: #fff; padding: 0 18px; }

@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes breathe { 50% { opacity: .42; transform: scale(.86); } }

@media (max-width: 1280px) {
  .links-table th, .links-table td { padding: 14px 10px; }
  .links-table th:nth-child(1) { width: 100px; }
  .links-table th:nth-child(2) { width: 230px; }
  .links-table th:nth-child(3) { width: 90px; }
  .links-table th:nth-child(4) { width: 85px; }
  .links-table th:nth-child(5) { width: 150px; }
  .link-actions { min-width: 240px; flex-wrap: wrap; align-content: center; }
  .row-action { min-height: 36px; padding: 0 5px; font-size: 13px; }
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 84px minmax(0,1fr); }
  .sidebar { padding-inline: 12px; }.brand-lockup { justify-content: center; padding-inline: 0; }.brand-lockup > span { display: none; }.nav-link { justify-content: center; padding: 0; font-size: 0; }.nav-link .icon { width: 22px; height: 22px; }
  .dashboard-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }.dashboard-metric:first-child { grid-column: 1 / -1; }
  .filters { grid-template-columns: 1fr 1fr; }.detail-grid { grid-template-columns: 1fr; }.basic-info { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }.basic-info h2 { grid-column: 1 / -1; }
  .promo-type-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 980px) {
  .creation-workspace { grid-template-columns: 1fr; }
  .creation-aside { position: static; grid-template-columns: 292px minmax(0, 1fr); }
  .form-progress { align-self: start; }
  .analytics-funnel { grid-template-columns: 1fr 1fr; }
  .analytics-lower-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: 72px; }
  .sidebar { position: sticky; z-index: 12; width: 100%; height: 64px; display: block; padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--line); }.brand-lockup { justify-content: flex-start; padding: 0; }.brand-lockup > span { display: block; }.brand-mark { width: 34px; height: 34px; }
  .nav-stack { position: fixed; z-index: 14; left: 12px; right: 12px; bottom: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.94); box-shadow: 0 10px 30px rgba(32,36,33,.15); backdrop-filter: blur(16px); }.nav-link { min-height: 50px; justify-content: center; gap: 7px; padding: 0 10px; font-size: 13px; }
  .topbar { min-height: 58px; padding: 0 16px; }.breadcrumb strong, .breadcrumb > span { display: none; }.topbar-actions .icon-button:first-of-type { display: none; }.mobile-create { display: inline-flex; }
  .dashboard-page, .links-page, .detail-page, .page-heading, .creation-form { width: calc(100% - 32px); }
  .page-title-row, .detail-heading, .page-heading { align-items: flex-start; flex-direction: column; gap: 18px; padding: 28px 0 20px; text-align: left; }.page-title-row h1, .detail-heading h1, .page-heading h1 { font-size: clamp(28px,9vw,34px); }.page-tools, .detail-heading > div:last-child { width: 100%; }.page-tools .search-input { display: none; }.page-tools .stitch-button, .detail-heading .stitch-button { flex: 1; }
  .dashboard-metrics { grid-template-columns: 1fr; }.dashboard-metric:first-child { grid-column: auto; }.dashboard-metric { min-height: 122px; }.dashboard-metric strong { font-size: 36px; }
  .analytics-funnel { grid-template-columns: 1fr; }
  .analytics-trend { gap: 4px; }
  .analytics-trend-column i { width: 70%; }
  .process-panel { padding: 22px; }.process-track { grid-template-columns: 1fr; gap: 10px; }.process-track em { display: none; }.ready-state { grid-template-columns: auto 1fr; padding-inline: 0; }.ready-state p { grid-column: 1 / -1; }.ready-state .stitch-button { grid-column: 1 / -1; grid-row: auto; width: 100%; }
  .filters { grid-template-columns: 1fr; }.filters .search-input { width: 100%; }.links-table { overflow: visible; border: 0; background: transparent; box-shadow: none; }.links-table table, .links-table tbody, .links-table tr, .links-table td { display: block; }.links-table thead { display: none; }.links-table tr { margin-bottom: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }.links-table td { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border: 0; white-space: normal; }.links-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }.links-table footer { padding-inline: 0; }
  .basic-info { display: block; }.detail-grid { padding-bottom: 28px; }.fake-chart { height: 190px; }.qr-row { grid-template-columns: 44px 1fr; }.qr-row label { grid-column: 2; }.event-head { grid-template-columns: 1fr 1fr; }
  .section-heading { display: block; }.section-heading p { margin: 8px 0 0 38px; }.promo-type-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.form-columns, .profile-panel { grid-template-columns: 1fr; }.profile-panel { padding-inline: 0; }.tip-row { grid-template-columns: 1fr; }.form-footer { align-items: stretch; flex-direction: column; }.footer-actions { display: grid; }
  #create-page, .creation-workspace { width: calc(100% - 32px); }
  .creation-workspace { grid-template-columns: 1fr; }
  .creation-aside { position: static; display: grid; grid-template-columns: 1fr; }
  .creation-form .form-section { padding: 22px 18px; }
  .creation-form .section-heading { grid-template-columns: 28px minmax(0, 1fr); }
  .creation-form .section-heading p { margin: 4px 0 0; }
.creation-form .promo-type-grid { grid-template-columns: 1fr; }
  .creation-form .profile-panel { grid-template-columns: 1fr; }
  .share-config__grid { grid-template-columns: 1fr; }
  .share-image-field { align-items: flex-start; text-align: left; }
  .creation-form .profile-panel { gap: 14px; }
  .creation-form .form-footer { padding: 18px; }
  .creation-form .primary-button { width: 100%; }
  .qr-selected-state { grid-template-columns: 72px minmax(0, 1fr); }
  .qr-selected-state img { width: 72px; height: 72px; }
  .qr-selected-actions { grid-column: 1 / -1; }
  .qr-selected-actions .secondary-button { flex: 1; }
  .dialog-grid { grid-template-columns: 1fr; }
  .dialog-span { grid-column: auto; }
  .management-dialog form { padding: 18px; }
  .link-actions { min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
  .preview-panel { padding: 16px; }
  .live-phone { max-width: 280px; margin-inline: auto; }
}

.creation-result { margin: 0 32px 32px; padding: 20px; border: 1px solid #b9dfcf; border-radius: 12px; background: #f2faf6; }
.creation-result > div:first-child { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.creation-result > div:first-child span { color: #16865f; font-size: 13px; font-weight: 700; }
.creation-result label { display: block; margin-bottom: 8px; color: #69736e; font-size: 13px; }
.creation-result > div:last-child { display: flex; gap: 10px; }
.creation-result input { min-width: 0; flex: 1; height: 42px; padding: 0 12px; border: 1px solid #cdd8d2; border-radius: 8px; background: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
