@font-face {
  font-family: "BKA Sans";
  src: local("Noto Sans CJK SC"), local("Source Han Sans SC"), local("PingFang SC");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #1d1b26;
  --ink-soft: #45424f;
  --muted: #777481;
  --paper: #f6f6fa;
  --surface: #ffffff;
  --soft: #efeff7;
  --line: #dcdae8;
  --line-strong: #c8c4d8;
  --indigo: #3529aa;
  --indigo-dark: #251b7e;
  --indigo-soft: #eeecff;
  --green: #1daf3f;
  --red: #a43a33;
  --radius: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); scroll-behavior: smooth; }
body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "BKA Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.58;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
::selection { color: #fff; background: var(--indigo); }
* { scrollbar-color: rgba(53, 41, 170, .32) transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(53, 41, 170, .28); }

button, input, textarea { font: inherit; }
button { color: inherit; }
button, label[for] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(53, 41, 170, .22);
  outline-offset: 2px;
}
svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-bar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 64px;
  border-bottom: 1px solid rgba(53, 41, 170, .09);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(16px);
}
.app-bar-inner { width: min(760px, 100%); height: 100%; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; }
.brand-identity { min-height: 48px; padding: 0; display: inline-flex; align-items: center; gap: 9px; }
.brand-logo { display: block; width: 30px; height: 38px; object-fit: cover; object-position: center; }
.brand-title { color: var(--indigo-dark); font-size: 15px; font-weight: 760; letter-spacing: .01em; }
.icon-action { width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 12px; background: transparent; display: grid; place-items: center; color: var(--ink-soft); cursor: pointer; transition: border-color .18s, background .18s, color .18s; }
.icon-action:hover { border-color: var(--line); color: var(--indigo); background: var(--indigo-soft); }

main { width: min(720px, 100%); margin: 0 auto; padding: clamp(48px, 9vh, 84px) 22px max(96px, calc(64px + env(safe-area-inset-bottom))); }
.assistant-line { display: block; }
.assistant-line h1 { margin: 0 0 11px; color: var(--ink-soft); font-size: 16px; font-weight: 620; line-height: 1.5; letter-spacing: 0; white-space: nowrap; }
.assistant-line p { margin: 0; }

.topic-composer { position: relative; }
.topic-input-wrap { min-height: 72px; padding: 7px 8px 7px 20px; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); display: grid; grid-template-columns: minmax(0, 1fr) 38px 48px; align-items: center; gap: 3px; box-shadow: 0 18px 50px rgba(37, 27, 126, .09); transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.topic-input-wrap:not(:has(.composer-clear:not([hidden]))) { grid-template-columns: minmax(0, 1fr) 48px; }
.topic-input-wrap:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(53, 41, 170, .1), 0 22px 56px rgba(37, 27, 126, .13); transform: translateY(-1px); }
.topic-input-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 17px; caret-color: var(--indigo); }
.topic-input-wrap input::placeholder, textarea::placeholder { color: #85818d; opacity: 1; }
.topic-input-wrap button { padding: 0; border: 0; display: grid; place-items: center; cursor: pointer; }
.composer-clear { width: 36px; height: 36px; border-radius: 50%; color: var(--muted); background: transparent; }
.composer-clear:hover { color: var(--indigo); background: var(--indigo-soft); }
.composer-send { width: 44px; height: 44px; border-radius: 14px; color: #fff; background: var(--indigo); box-shadow: 0 8px 18px rgba(53, 41, 170, .22); transition: transform .18s var(--ease), background .18s, box-shadow .18s; }
.composer-send:hover { background: var(--indigo-dark); transform: translateY(-1px); box-shadow: 0 11px 22px rgba(37, 27, 126, .28); }
.composer-send svg { font-size: 20px; }

.topic-results { position: absolute; z-index: 20; top: 78px; left: 0; right: 0; max-height: 330px; overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 22px 54px rgba(29, 27, 38, .15); }
.topic-result { width: 100%; min-height: 58px; padding: 11px 16px; border: 0; border-bottom: 1px solid var(--soft); background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left; cursor: pointer; }
.topic-result:last-child { border-bottom: 0; }
.topic-result:hover, .topic-result:focus-visible { background: var(--indigo-soft); }
.topic-result strong { display: block; color: var(--ink); }
.topic-result small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.topic-result > span:last-child { color: var(--indigo-dark); font-size: 12px; white-space: nowrap; }

.quick-topics, .thought-prompts, .style-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.quick-topics { padding: 12px 1px 4px; }
.thought-prompts { padding: 10px 1px 3px; }
.style-row { padding: 0 1px 3px; margin-bottom: 12px; }
.quick-topics::-webkit-scrollbar, .thought-prompts::-webkit-scrollbar, .style-row::-webkit-scrollbar { display: none; }
.quick-topics button, .thought-prompts button, .style-chip { min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .65); color: var(--muted); font-size: 13px; white-space: nowrap; cursor: pointer; transition: border-color .18s, color .18s, background .18s, transform .18s var(--ease); }
.quick-topics button:hover, .thought-prompts button:hover { border-color: #b7b0e6; color: var(--indigo-dark); background: var(--indigo-soft); transform: translateY(-1px); }
.quick-topics button:last-child { color: var(--indigo-dark); border-color: #c9c3ee; }

.follow-up { margin-top: 54px; padding-top: 38px; border-top: 1px solid var(--line); animation: rise .42s var(--ease) both; }
.follow-up > .assistant-line > p, .thought-line p { color: var(--ink-soft); font-size: 16px; font-weight: 620; line-height: 1.5; letter-spacing: 0; }
.photo-input { margin: 14px 0 38px; }
.photo-button { width: 100%; min-height: 56px; padding: 12px 15px; border: 1px dashed #a9a3c8; border-radius: var(--radius); background: rgba(255, 255, 255, .64); display: flex; align-items: center; gap: 10px; color: var(--indigo-dark); font-weight: 650; cursor: pointer; transition: border-color .18s, background .18s; }
.photo-button:hover { border-color: var(--indigo); background: var(--indigo-soft); }
.photo-button svg { font-size: 21px; }
.photo-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-preview { position: relative; width: min(280px, 78vw); margin-top: 13px; }
.photo-preview img { display: block; width: 100%; max-height: 280px; border-radius: var(--radius); object-fit: cover; }
.photo-preview button { position: absolute; right: 9px; bottom: 9px; padding: 7px 11px; border: 0; border-radius: 999px; color: #fff; background: rgba(29, 27, 38, .86); font-size: 12px; cursor: pointer; }
.thought-line { margin-top: 2px; }
.thought-line p span { color: var(--indigo-dark); }
.thought-line small { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }

textarea { width: 100%; resize: none; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink); background: var(--surface); padding: 15px 16px; line-height: 1.72; caret-color: var(--indigo); transition: border-color .18s, box-shadow .18s; }
#ownerInput { min-height: 142px; margin-top: 15px; }
textarea:focus { border-color: var(--indigo); outline: 0; box-shadow: 0 0 0 3px rgba(53, 41, 170, .09); }
.input-meta { margin: 9px 1px 28px; display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.input-meta span:first-child { max-width: 38ch; }

.primary-action { width: 100%; min-height: 58px; padding: 14px 17px; border: 0; border-radius: var(--radius); color: #fff; background: var(--indigo); display: flex; align-items: center; justify-content: space-between; gap: 14px; font-weight: 760; cursor: pointer; box-shadow: 0 14px 30px rgba(53, 41, 170, .2); transition: transform .2s var(--ease), background .2s, box-shadow .2s; }
.primary-action:hover { background: var(--indigo-dark); transform: translateY(-1px); box-shadow: 0 18px 36px rgba(37, 27, 126, .26); }
.primary-action:disabled { color: #e7e6eb; background: #777481; cursor: wait; transform: none; box-shadow: none; }
.primary-action svg { font-size: 21px; }
.form-error { margin: 10px 0 0; color: var(--red); font-size: 13px; font-weight: 650; }

.result { margin-top: 64px; padding-top: 38px; border-top: 1px solid var(--line); animation: reveal .5s var(--ease) both; }
.style-chip.is-active { border-color: var(--indigo); color: #fff; background: var(--indigo); }
.draft-text { min-height: 290px; padding: 18px; border-color: var(--line); font-size: 16px; line-height: 1.86; box-shadow: 0 14px 38px rgba(29, 27, 38, .06); }
.image-pair { margin: 30px 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.image-slot { min-width: 0; }
.image-frame { aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--radius); background: var(--surface); display: grid; place-items: center; box-shadow: 0 10px 28px rgba(29, 27, 38, .06); }
.image-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.empty-frame { border: 1px dashed #b5b1c6; color: var(--muted); background: rgba(255, 255, 255, .45); align-content: center; gap: 7px; font-size: 12px; box-shadow: none; }
.empty-frame svg { font-size: 23px; }
.image-loading { color: var(--muted); font-size: 12px; }
.image-slot-label { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.image-slot-label > span { color: var(--muted); }
.image-slot-label button { padding: 5px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--indigo-dark); cursor: pointer; }
.asset-empty { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
#confirmDraftButton { margin-top: 26px; }

.publish-stage { animation: reveal .42s var(--ease) both; }
.back-button { margin: -18px 0 32px; padding: 8px 0; border: 0; background: transparent; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); cursor: pointer; }
.back-button:hover { color: var(--indigo-dark); }
.back-button svg { transform: rotate(90deg); }
.publish-stage > h2 { margin: 0 0 24px; font-size: 30px; line-height: 1.2; letter-spacing: -.03em; }
.moments-preview { padding: 18px; border: 1px solid rgba(220, 218, 232, .76); border-radius: 20px; background: var(--surface); display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; box-shadow: 0 18px 48px rgba(29, 27, 38, .07); }
.shop-avatar { width: 44px; height: 44px; border-radius: 10px; color: #fff; background: var(--indigo-dark); display: grid; place-items: center; font-size: 17px; font-weight: 760; }
.moment-body > strong { display: block; margin: -2px 0 8px; color: #4f6285; font-size: 15px; }
.moment-body textarea { min-height: 230px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 16px; line-height: 1.74; }
.moment-body textarea:focus { box-shadow: none; }
.moment-body > img { display: block; width: min(100%, 430px); margin-top: 13px; background: var(--soft); object-fit: cover; }
.moment-meta { width: min(100%, 430px); margin-top: 9px; display: flex; align-items: center; justify-content: space-between; color: #8b8d87; font-size: 12px; }
.moment-meta span:last-child { padding: 1px 7px 4px; border-radius: 4px; color: #4f6285; background: #eef0f3; letter-spacing: 1px; }
.publish-hint { margin: 22px 2px; display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 13px; }
.publish-hint svg { flex: 0 0 auto; margin-top: 2px; color: var(--indigo-dark); }

dialog { color: var(--ink); }
.pilot-dialog, .handoff-dialog { width: min(480px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 20px; background: var(--surface); box-shadow: 0 28px 76px rgba(29, 27, 38, .3); }
.pilot-dialog::backdrop, .handoff-dialog::backdrop { background: rgba(25, 23, 34, .62); backdrop-filter: blur(3px); }
.pilot-dialog form { position: relative; padding: 30px; }
.pilot-dialog h2, .handoff-dialog h2 { margin: 0; font-size: 27px; letter-spacing: -.025em; }
.pilot-dialog p, .handoff-dialog p { margin: 8px 0 22px; color: var(--muted); }
.pilot-dialog label { display: block; margin: 0 0 16px; font-weight: 700; }
.pilot-dialog input { width: 100%; height: 50px; margin-top: 6px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.dialog-close { position: absolute; z-index: 2; top: 14px; right: 14px; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 12px; background: transparent; display: grid; place-items: center; cursor: pointer; }
.dialog-close:hover { background: var(--soft); }
.handoff-dialog { position: relative; padding: 32px; text-align: center; }
.handoff-check { width: 50px; height: 50px; margin: 0 auto 15px; border-radius: 50%; color: #fff; background: var(--green); display: grid; place-items: center; font-size: 24px; }
.handoff-dialog img { display: block; width: min(100%, 340px); max-height: 48vh; margin: 18px auto; object-fit: contain; background: var(--soft); }
.secondary-action { min-height: 46px; padding: 10px 15px; border: 1px solid var(--ink); border-radius: 12px; background: transparent; font-weight: 710; cursor: pointer; }
.secondary-action:hover { color: #fff; background: var(--ink); }
.text-action { display: block; margin: 12px auto 0; padding: 5px 0; border: 0; border-bottom: 1px solid currentColor; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
.text-action:hover { color: var(--indigo-dark); }

.history-drawer { position: fixed; z-index: 60; top: 0; right: 0; width: min(420px, 92vw); height: 100dvh; padding: 26px; background: var(--surface); box-shadow: -18px 0 48px rgba(29, 27, 38, .18); overflow-y: auto; visibility: hidden; transform: translateX(104%); transition: transform .34s var(--ease), visibility 0s linear .34s; }
.history-drawer.is-open { visibility: visible; transform: none; transition-delay: 0s; }
.history-head { display: flex; align-items: center; justify-content: space-between; }
.history-head h2 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.history-head button { width: 42px; height: 42px; border: 0; border-radius: 12px; background: transparent; display: grid; place-items: center; cursor: pointer; }
.history-head button:hover { background: var(--soft); }
.history-list { margin-top: 24px; display: grid; gap: 18px; }
.history-item { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.history-item-head { display: flex; justify-content: space-between; gap: 14px; }
.history-item-head span { color: var(--muted); font-size: 11px; }
.history-item p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 4; -webkit-box-orient: vertical; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.history-empty { padding: 30px 0; color: var(--muted); text-align: center; }
.drawer-scrim { position: fixed; z-index: 50; inset: 0; background: rgba(25, 23, 34, .48); }

.toast { position: fixed; z-index: 90; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); max-width: calc(100% - 36px); padding: 11px 16px; border-radius: 999px; color: #fff; background: var(--ink); text-align: center; box-shadow: 0 12px 30px rgba(29, 27, 38, .22); opacity: 0; transform: translate(-50%, 14px); pointer-events: none; transition: opacity .2s, transform .28s var(--ease); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.login-page { min-height: 100dvh; display: flex; flex-direction: column; }
.login-masthead { width: min(560px, 100%); min-height: 68px; margin: 0 auto; padding: 14px 22px; display: flex; align-items: center; gap: 9px; }
.login-main { width: min(560px, 100%); flex: 1; margin: 0 auto; padding: clamp(54px, 11vh, 112px) 22px max(48px, env(safe-area-inset-bottom)); display: block; }
.login-content { max-width: 480px; }
.login-content h1 { max-width: 15ch; margin: 0; color: var(--ink); font-size: clamp(30px, 7vw, 46px); font-weight: 790; line-height: 1.16; letter-spacing: -.035em; text-wrap: balance; }
.login-content > p { max-width: 35ch; margin: 18px 0 34px; color: var(--ink-soft); line-height: 1.75; }
.login-form > label { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 14px; font-weight: 720; }
.login-input-wrap { min-height: 58px; padding: 4px 6px 4px 15px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; transition: border-color .18s, box-shadow .18s; }
.login-input-wrap:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(53, 41, 170, .1); }
.login-input-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 17px; caret-color: var(--indigo); }
.login-input-wrap input[aria-invalid="true"] { color: var(--red); }
.login-input-wrap button { min-width: 52px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 12px; color: var(--indigo-dark); background: var(--indigo-soft); font-size: 13px; font-weight: 710; cursor: pointer; }
.login-error { margin: 9px 1px 0; color: var(--red); font-size: 13px; font-weight: 650; }
.login-submit { margin-top: 22px; }
.login-help { margin: 18px 1px 0 !important; color: var(--muted) !important; font-size: 13px; }

.admin-page { min-height: 100dvh; background: #f4f3f8; }
.admin-masthead { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid rgba(53, 41, 170, .1); background: rgba(255, 255, 255, .96); backdrop-filter: blur(16px); }
.admin-masthead-inner { width: min(1180px, 100%); min-height: 66px; margin: 0 auto; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; }
.admin-logout, .admin-refresh { min-height: 42px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-soft); font-size: 13px; font-weight: 700; cursor: pointer; }
.admin-logout:hover, .admin-refresh:hover { border-color: #b9b3dc; color: var(--indigo-dark); background: var(--indigo-soft); }
.admin-shell { width: min(1180px, 100%); margin: 0 auto; padding: 54px 26px 90px; }
.admin-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.admin-intro h1 { margin: 0; font-size: clamp(34px, 5vw, 54px); line-height: 1.05; letter-spacing: -.04em; }
.admin-intro p { max-width: 48ch; margin: 15px 0 0; color: var(--ink-soft); }
.admin-summary { margin: 34px 0; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-summary > div { min-height: 80px; padding: 2px 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.admin-summary > div:first-child { padding-left: 0; }
.admin-summary > div:last-child { border-right: 0; }
.admin-summary strong { font-size: 31px; line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.admin-summary span { margin-top: 10px; color: var(--muted); font-size: 12px; }
.admin-controls { display: grid; grid-template-columns: minmax(260px, 1fr) 220px; gap: 14px; }
.admin-controls label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.admin-controls input, .admin-controls select { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.admin-controls input:focus, .admin-controls select:focus { border-color: var(--indigo); outline: 3px solid rgba(53, 41, 170, .1); }
.admin-runs { margin-top: 48px; }
.admin-section-head { margin-bottom: 14px; display: flex; align-items: baseline; justify-content: space-between; }
.admin-section-head h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.admin-section-head span { color: var(--muted); font-size: 12px; }
.run-list { border-top: 1px solid var(--line-strong); }
.run-item { border-bottom: 1px solid var(--line); background: transparent; }
.run-item summary { min-height: 78px; padding: 16px 2px; display: grid; grid-template-columns: minmax(220px, 1.3fr) minmax(190px, .8fr) 120px; align-items: center; gap: 18px; list-style: none; cursor: pointer; }
.run-item summary::-webkit-details-marker { display: none; }
.run-item summary:hover .run-primary strong { color: var(--indigo-dark); }
.run-primary { min-width: 0; display: grid; grid-template-columns: minmax(120px, .8fr) minmax(120px, 1fr); gap: 16px; }
.run-primary strong, .run-primary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-primary > span { color: var(--ink-soft); }
.run-status { width: fit-content; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 710; }
.run-status.is-ai { color: var(--indigo-dark); background: var(--indigo-soft); }
.run-status.is-fallback { color: #71502b; background: #f4ead9; }
.run-time { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.run-detail { padding: 2px 0 28px; animation: reveal .28s var(--ease) both; }
.run-facts { margin: 0 0 18px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.run-facts div { padding: 0 14px; border-right: 1px solid var(--line); }
.run-facts div:first-child { padding-left: 0; }
.run-facts div:last-child { border-right: 0; }
.run-facts dt { color: var(--muted); font-size: 11px; }
.run-facts dd { margin: 4px 0 0; color: var(--ink); font-size: 13px; font-weight: 700; word-break: break-word; }
.run-block { padding: 18px 20px; border-radius: 14px; background: var(--surface); }
.run-block + .run-block { margin-top: 12px; }
.run-block h3 { margin: 0 0 9px; font-size: 14px; }
.run-block p { margin: 4px 0; color: var(--ink-soft); font-size: 13px; line-height: 1.72; white-space: pre-wrap; }
.run-copy-grid { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.run-copy-grid .run-block + .run-block { margin-top: 0; }
.admin-empty { padding: 70px 0; display: grid; gap: 7px; color: var(--muted); text-align: center; }
.admin-empty strong { color: var(--ink-soft); font-size: 17px; }
.admin-tabs { margin: 34px 0 38px; border-bottom: 1px solid var(--line-strong); display: flex; gap: 28px; }
.admin-tabs button { position: relative; min-height: 48px; padding: 0 1px 13px; border: 0; background: transparent; color: var(--muted); font-size: 15px; font-weight: 720; cursor: pointer; }
.admin-tabs button::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--indigo); transform: scaleX(0); transition: transform .18s var(--ease); }
.admin-tabs button:hover, .admin-tabs button.is-active { color: var(--ink); }
.admin-tabs button.is-active::after { transform: scaleX(1); }
.admin-panel[hidden], .guidance-review[hidden], .review-warning[hidden] { display: none; }
.guidance-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(440px, 1.1fr); gap: 24px; align-items: start; }
.guidance-composer, .guidance-review { padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 18px 44px rgba(29, 27, 38, .055); }
.admin-section-head > div { min-width: 0; }
.admin-section-head p { max-width: 62ch; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.62; }
.guidance-field { display: grid; gap: 7px; margin-top: 18px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.guidance-field > input, .guidance-field > textarea { width: 100%; min-height: 48px; padding: 12px 13px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); background: #fff; font-size: 16px; line-height: 1.58; resize: vertical; }
.guidance-field > textarea { min-height: 120px; }
.guidance-field > input:focus, .guidance-field > textarea:focus { border-color: var(--indigo); outline: 3px solid rgba(53, 41, 170, .09); box-shadow: none; }
.guidance-field small { color: var(--muted); font-size: 11px; font-weight: 500; }
.guidance-image-field { margin-top: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #faf9fc; }
.guidance-image-copy { display: grid; gap: 5px; }
.guidance-image-copy strong { color: var(--ink-soft); font-size: 13px; }
.guidance-image-copy strong span { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 600; }
.guidance-image-copy small { color: var(--muted); font-size: 11px; line-height: 1.55; }
.guidance-image-empty { min-height: 46px; margin-top: 13px; display: flex; align-items: center; gap: 11px; }
.guidance-image-empty button, .guidance-image-actions button { min-height: 38px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 720; cursor: pointer; }
.guidance-image-empty span { color: var(--muted); font-size: 11px; }
.guidance-image-preview { min-width: 0; margin-top: 13px; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 13px; }
.guidance-image-preview[hidden] { display: none; }
.guidance-image-preview img { width: 92px; height: 72px; border: 1px solid var(--line); border-radius: 9px; background: #fff; object-fit: contain; }
.guidance-image-preview > div { min-width: 0; display: grid; gap: 4px; }
.guidance-image-preview strong { overflow: hidden; color: var(--ink-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.guidance-image-preview span { color: var(--muted); font-size: 11px; }
.guidance-image-actions { margin-top: 5px; display: flex; gap: 7px; }
.guidance-image-actions button { min-height: 34px; padding: 5px 9px; }
.guidance-image-actions button:last-child { color: var(--red); }
.guidance-actions { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.voice-action, .guidance-primary, .guidance-item-actions button { min-height: 44px; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink-soft); background: #fff; font-size: 13px; font-weight: 720; cursor: pointer; }
.voice-action { display: inline-flex; align-items: center; gap: 8px; }
.voice-dot { width: 9px; height: 9px; border: 2px solid var(--indigo); border-radius: 50%; }
.voice-action.is-listening { color: #8c2f2f; border-color: #d79d9d; background: #fff5f5; }
.voice-action.is-listening .voice-dot { border-color: #b54242; background: #b54242; animation: voicePulse 1.2s ease-out infinite; }
.voice-action:disabled, .guidance-primary:disabled, .guidance-item-actions button:disabled { opacity: .55; cursor: wait; }
.guidance-primary, .guidance-item-actions .is-primary { color: #fff; border-color: var(--indigo); background: var(--indigo); }
.guidance-primary:hover, .guidance-item-actions .is-primary:hover { border-color: var(--indigo-dark); background: var(--indigo-dark); }
.guidance-message { min-height: 20px; margin: 10px 0 0; color: var(--red); font-size: 12px; }
.review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.review-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.review-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.review-warning { margin-top: 18px; padding: 14px 16px; border: 1px solid #ead8b8; border-radius: 12px; color: #684d2d; background: #fffaf0; font-size: 12px; line-height: 1.65; }
.review-warning strong { display: block; margin-bottom: 5px; }
.review-warning ul { margin: 0; padding-left: 18px; }
.guidance-status { width: fit-content; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.guidance-status.is-active { color: #24653c; background: #e2f2e7; }
.guidance-status.is-pending { color: #74552d; background: #f5ead7; }
.guidance-status.is-disabled { color: var(--muted); background: #eceaf1; }
.guidance-library { margin-top: 48px; }
.guidance-list { border-top: 1px solid var(--line-strong); }
.guidance-item { min-width: 0; padding: 21px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; }
.guidance-item-main { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 12px; align-items: center; }
.guidance-item-main h3 { min-width: 0; margin: 0; overflow: hidden; color: var(--ink); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.guidance-item-main p { grid-column: 1 / -1; max-width: 76ch; margin: 1px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.62; }
.guidance-item-main small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.guidance-item-image { width: 42px; height: 34px; margin-right: 4px; border: 1px solid var(--line); border-radius: 7px; background: #fff; object-fit: contain; vertical-align: middle; }
.guidance-item-actions { display: flex; gap: 8px; }
.guidance-item-actions button { min-height: 38px; padding: 7px 11px; }
@keyframes voicePulse { 0% { box-shadow: 0 0 0 0 rgba(181, 66, 66, .35); } 80%, 100% { box-shadow: 0 0 0 8px rgba(181, 66, 66, 0); } }

@keyframes rise { from { opacity: .01; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes reveal { from { opacity: .01; transform: translateY(16px); clip-path: inset(0 0 10% 0); } to { opacity: 1; transform: none; clip-path: inset(0); } }

@media (max-width: 520px) {
  .app-bar-inner { padding-right: max(14px, env(safe-area-inset-right)); padding-left: max(17px, env(safe-area-inset-left)); }
  main { padding: 50px 18px max(80px, calc(56px + env(safe-area-inset-bottom))); }
  .assistant-line h1, .follow-up > .assistant-line > p, .thought-line p { font-size: 15px; }
  .assistant-line h1 { margin-bottom: 10px; }
  .topic-input-wrap { min-height: 68px; padding-left: 16px; grid-template-columns: minmax(0, 1fr) 36px 46px; border-radius: 18px; }
  .topic-input-wrap:not(:has(.composer-clear:not([hidden]))) { grid-template-columns: minmax(0, 1fr) 46px; }
  .topic-input-wrap input { font-size: 16px; }
  .composer-send { width: 42px; height: 42px; border-radius: 13px; }
  .follow-up { margin-top: 48px; padding-top: 34px; }
  .image-pair { gap: 10px; }
  .image-slot-label { font-size: 12px; }
  .moments-preview { padding: 15px; grid-template-columns: 42px minmax(0, 1fr); gap: 11px; }
  .shop-avatar { width: 42px; height: 42px; }
  .handoff-dialog { padding: 29px 20px 23px; }
  .login-masthead { min-height: 62px; padding-right: max(18px, env(safe-area-inset-right)); padding-left: max(18px, env(safe-area-inset-left)); }
  .login-main { padding: clamp(46px, 10vh, 80px) 20px max(40px, env(safe-area-inset-bottom)); }
  .login-content h1 { font-size: clamp(30px, 9vw, 38px); }
  .login-content > p { margin-top: 16px; margin-bottom: 30px; }
  .admin-masthead-inner { min-height: 62px; padding: 0 18px; }
  .admin-shell { padding: 38px 18px 70px; }
  .admin-intro { align-items: flex-start; }
  .admin-intro h1 { font-size: 36px; }
  .admin-intro p { font-size: 14px; }
  .admin-refresh { flex: 0 0 auto; padding: 7px 10px; }
  .admin-summary { grid-template-columns: 1fr 1fr; }
  .admin-summary > div { min-height: 70px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
  .admin-summary > div:nth-child(2) { border-right: 0; }
  .admin-summary > div:nth-child(3), .admin-summary > div:nth-child(4) { border-bottom: 0; }
  .admin-summary > div:nth-child(3) { padding-left: 0; }
  .admin-summary strong { font-size: 27px; }
  .admin-controls { grid-template-columns: 1fr; }
  .admin-tabs { margin-top: 28px; }
  .guidance-layout { grid-template-columns: 1fr; }
  .guidance-composer, .guidance-review { padding: 21px 18px; }
  .review-grid { grid-template-columns: 1fr; gap: 0; }
  .guidance-actions { align-items: stretch; flex-direction: column; }
  .guidance-actions > button { width: 100%; justify-content: center; }
  .guidance-item { grid-template-columns: 1fr; gap: 14px; }
  .guidance-item-actions { justify-content: flex-end; }
  .run-item summary { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .run-primary { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .run-time { text-align: right; }
  .run-facts { grid-template-columns: 1fr 1fr; }
  .run-facts div { padding: 9px 12px; border-bottom: 1px solid var(--line); }
  .run-facts div:nth-child(2n) { border-right: 0; }
  .run-facts div:nth-last-child(-n+2) { border-bottom: 0; }
  .run-copy-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .brand-title { font-size: 14px; }
  .quick-topics { gap: 6px; }
  .image-pair { grid-template-columns: 1fr; }
  .image-frame { aspect-ratio: 16 / 10; }
}

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