/* Dore studio app. Builds on site.css tokens (v2: hairlines, one clear yes, who's-on-it chips, Dore's state rings). */
.studio-body { background: var(--paper); min-height: 100vh; }
.app-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 62px; padding: 0 20px; background: var(--yellow); border-bottom: 1px solid var(--ink); }
.app-top .brand { font-size: 22px; }
.app-top .brand-mark .brand-avatar { width: 34px; height: 34px; }
.app-top .brand-mark .brand-word { height: 23px; width: auto; }
.app-title { font-weight: 700; display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.app-title b { font-family: var(--display); font-weight: 800; font-stretch: 110%; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-title span { font-size: 13px; color: var(--ink-2); font-family: var(--mono); }
.app-top .lang { margin-left: auto; }

.app { display: grid; grid-template-columns: 220px minmax(0, 1fr) 360px; min-height: calc(100vh - 62px); }
.app.no-nav { grid-template-columns: minmax(0, 1fr); }
.app.no-chat { grid-template-columns: 220px minmax(0, 1fr); }
.app.no-nav.no-chat { grid-template-columns: minmax(0, 1fr); }
.app-nav { border-right: 1px solid var(--ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; background: var(--white); position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; }
.app-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 650; }
.app-nav a:hover { background: rgba(21, 19, 15, 0.05); }
.app-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.app-nav .count { margin-left: auto; font-size: 12px; font-weight: 800; background: var(--brick); color: var(--white); border-radius: 999px; padding: 1px 7px; }
.app-nav .nav-foot { margin-top: auto; padding: 12px; font-size: 13px; color: var(--ink-3); }
/* The sample studio's call to action sits in the narrow nav: let it wrap, keep the pill and the button's own hover. */
.app-nav .nav-foot .btn { width: 100%; padding: 9px 14px; border-radius: var(--r-pill); white-space: normal; text-align: center; line-height: 1.3; }
.app-nav .nav-foot .btn-ink:hover { background: var(--wing-deep); }
.app-main { padding: 34px 40px 80px; min-width: 0; }
.app-main:focus { outline: none; }
.app-chat { border-left: 1px solid var(--ink); background: var(--white); display: flex; flex-direction: column; height: calc(100vh - 62px); position: sticky; top: 62px; }
.loading { padding: 80px 0; text-align: center; font-weight: 650; color: var(--ink-2); }
.noscript { padding: 20px; }

.view-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.view-head h1 { font-family: var(--display); font-weight: 800; font-stretch: 110%; font-size: clamp(30px, 3.6vw, 46px); line-height: 1; letter-spacing: -0.03em; margin: 0; }
html[data-lang="zh"] .view-head h1 { font-stretch: 100%; letter-spacing: 0; }
.view-head p { margin: 8px 0 0; color: var(--ink-2); max-width: 60ch; }
.card { background: var(--white); border: 1px solid var(--ink); border-radius: var(--r-panel); padding: 22px; }
.card + .card { margin-top: 18px; }
.card.decide + .card, .card + .card.decide { margin-top: 18px; }
.card h2 { font-family: var(--display); font-weight: 800; font-stretch: 108%; font-size: 20px; letter-spacing: -0.01em; margin: 0 0 12px; }
html[data-lang="zh"] .card h2 { font-stretch: 100%; }
.card.soft { border: 1px solid var(--hair); }
.card.note { background: var(--yellow-soft); }
.card.warn { background: var(--brick-soft); border-color: var(--brick); }
/* Today: decisions first, then what is moving */
.card.decide { border: 1.5px solid var(--ink); display: grid; gap: 12px; justify-items: start; }
.card.decide h3 { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; }
.card.decide .small { margin: 0; }
.decide-bubble { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 12px 14px; background: var(--lilac); border-radius: 4px 16px 16px 16px; }
.decide-bubble p { margin: 3px 0 0; }
.moving { list-style: none; margin: 0; padding: 0; }
.moving li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.moving li:last-child { border-bottom: 1px solid var(--line); }
.moving-what { flex: 1; min-width: 0; display: grid; gap: 2px; }
.moving-what small { font-size: 13px; color: var(--ink-2); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: 13px; }

/* progress */
.progress { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin: 14px 0 6px; }
.progress i { height: 10px; border-radius: 4px; border: 1px solid var(--ink); background: var(--white); }
.progress i.done { background: var(--leaf); border-color: var(--leaf); }
.progress i.you { background: var(--brick); border-color: var(--brick); }
.progress i.team { background: repeating-linear-gradient(45deg, var(--ink) 0 3px, var(--white) 3px 6px); }
.progress i.doing { background: var(--wing); border-color: var(--wing); }

/* steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.stepcard { background: var(--white); border: 1px solid var(--hair); border-radius: 18px; padding: 16px 18px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.stepcard.current { border: 1.5px solid var(--ink); }
.stepcard.compact { grid-template-columns: 40px minmax(0, 1fr); border: 0; padding: 0; background: transparent; }
.stepcard.compact .actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
.stepcard .n { font-family: var(--display); font-weight: 900; font-stretch: 60%; font-size: 38px; line-height: 0.85; }
.stepcard h3 { font-size: 19px; }
.stepcard p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.stepcard .who { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.stepcard .actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.stepnote { margin-top: 8px; font-size: 14px; color: var(--ink-2); font-style: italic; }
.draft { margin-top: 14px; padding: 16px 18px; border-radius: 14px; background: var(--paper); border: 1px dashed var(--line-strong); }
.draft h4 { margin: 14px 0 6px; font-size: 16px; }
.draft h4:first-child { margin-top: 0; }
.draft p { margin: 0 0 8px; }
.draft ul, .draft ol { margin: 0 0 8px; padding-left: 20px; }
.draft li { margin: 2px 0; }
.draft-meta { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
textarea, .input, select { width: 100%; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--white); padding: 10px 12px; font-size: 16px; }
textarea { min-height: 86px; resize: vertical; }
label.field { display: grid; gap: 6px; font-weight: 650; font-size: 14px; }
label.field small { font-weight: 500; color: var(--ink-3); }
.fields { display: grid; gap: 14px; }
.fields.two { grid-template-columns: 1fr 1fr; }

/* chat */
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--ink); }
.chat-head .ava { width: 40px; height: 40px; }
.chat-head .ava img { width: 30px; height: 30px; }
.chat-head b { display: block; font-family: var(--display); font-stretch: 108%; font-weight: 800; }
.chat-head span { font-size: 13px; color: var(--ink-3); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); margin-bottom: 3px; }
.msg.dore { background: var(--lilac); align-self: flex-start; border-top-left-radius: 4px; }
.msg.team { background: var(--ink); color: var(--paper); align-self: flex-start; border-top-left-radius: 4px; }
.msg.team small { color: rgba(255, 252, 243, 0.7); }
.msg.creator { background: var(--yellow-soft); align-self: flex-end; border-top-right-radius: 4px; }
.chat-form { border-top: 1px solid var(--ink); padding: 12px; display: grid; gap: 8px; }
.chat-form textarea { min-height: 64px; }
.chat-hint { font-size: 12px; color: var(--ink-3); }
.typing { align-self: flex-start; font-size: 13px; color: var(--ink-3); }

/* onboarding */
.onboard { max-width: 760px; margin: 0 auto; }
.onboard-head { display: flex; align-items: center; gap: 16px; }
.onboard-head img { width: 88px; height: auto; transform: rotate(-6deg); }
.onboard-head h1 { font-size: clamp(30px, 4vw, 46px); }
.onboard-log { display: flex; flex-direction: column; gap: 12px; margin: 26px 0; }
.onboard .msg { font-size: 17px; max-width: 80%; }
.ask { background: var(--white); border: 1px solid var(--ink); border-radius: 18px; padding: 18px; display: grid; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { border: 1.5px solid var(--ink); background: var(--white); border-radius: 999px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.pick[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.summary dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; }
.summary dt { font-weight: 700; }
.summary dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.keycard { background: var(--yellow-soft); border: 1.5px solid var(--ink); border-radius: 18px; padding: 18px; display: grid; gap: 10px; }
.keycard .mono { word-break: break-all; background: var(--white); border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 10px; }
.keycard h2 { font-size: 30px; margin: 0; }
.keycard p { margin: 0; }
.keycard + .grid2, .card.note + .grid2 { margin-top: 18px; }

/* sandbox store */
.storefront { --s-bg: #FFFCF3; --s-ink: #15130F; --s-accent: #6A3FA0; --s-button: #F3D23F; border: 1px solid var(--ink); border-radius: var(--r-panel); overflow: hidden; background: var(--s-bg); color: var(--s-ink); }
.sf-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700; }
.sf-bar .chip { margin-left: auto; }
.sf-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1.5px solid rgba(0, 0, 0, 0.12); }
.sf-name { font-family: var(--display); font-weight: 900; font-stretch: 140%; font-size: 24px; }
.sf-hero { padding: 34px 22px; background: var(--s-accent); color: #FFFCF3; }
.sf-hero strong { display: block; font-family: var(--display); font-weight: 860; font-stretch: 120%; font-size: 30px; line-height: 1.05; }
.sf-hero p { margin: 8px 0 0; opacity: 0.9; }
.sf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; padding: 22px; }
.sf-item { display: grid; gap: 8px; align-content: start; }
.sf-img { aspect-ratio: 1; border-radius: 14px; background: #FFFFFF; border: 1.5px solid rgba(0, 0, 0, 0.12); overflow: hidden; display: grid; place-items: center; }
.sf-img img { width: 100%; height: 100%; object-fit: cover; }
.sf-img svg { width: 76%; }
.sf-item b { font-size: 15px; }
.sf-item .price { font-weight: 700; }
.sf-item p { margin: 0; font-size: 13px; opacity: 0.75; }
.sf-buy { background: var(--s-button); color: var(--s-ink); border: 1.5px solid var(--s-ink); border-radius: 999px; padding: 8px 12px; font-weight: 800; cursor: pointer; }
.sf-empty { padding: 40px 22px; text-align: center; }
.sf-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 2px dashed rgba(0, 0, 0, 0.25); font-size: 13px; font-weight: 650; }
.order-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.order-steps li { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.order-steps li::before { content: '✓'; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 12px; }

/* dashboard */
.kgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kbox { background: var(--white); border: 1px solid var(--hair); border-radius: 16px; padding: 16px; }
.kbox span { font-size: 13px; color: var(--ink-3); font-weight: 650; }
.kbox b { display: block; font-family: var(--display); font-weight: 800; font-size: 28px; margin-top: 6px; letter-spacing: -0.03em; }
.kbox small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.kbox.empty b { color: var(--ink-3); }
.kgrid.mini { grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.sf-grid.mini { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 0 12px; }
.sf-grid.mini .sf-item b { font-size: 13px; }
.connect-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.connect-cta p { margin: 0; max-width: 56ch; }
.section-label { font-weight: 800; margin: 28px 0 10px; font-size: 15px; }
.bars svg { width: 100%; height: 160px; }

/* files & connections */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list li b { display: block; }
.list li span { font-size: 14px; color: var(--ink-3); }
.status { font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 7px; white-space: nowrap; }
.s-done, .s-connected { background: var(--leaf-soft); color: var(--leaf-ink); }
.s-needs_you, .s-pending { background: var(--brick-soft); color: var(--brick-ink); }
.s-with_team, .s-team { background: var(--ink); color: var(--paper); }
.s-in_progress { background: var(--lilac); color: var(--wing-deep); }
.s-not_started, .s-not_connected, .s-on_hold { background: transparent; color: var(--ink-3); border: 1px solid var(--line-strong); }

/* team (ops) */
.ops { border: 2px dashed var(--wing); border-radius: var(--r-panel); padding: 18px; margin-top: 22px; background: var(--lilac); }
.ops h2 { margin-top: 0; }
.ops form { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1.5px solid rgba(79, 44, 125, 0.25); }

/* plan & credits */
.credit-chip { margin-left: auto; border: 1.5px solid var(--ink); background: var(--white); border-radius: 999px; padding: 5px 12px; font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap; }
.credit-chip:hover { background: var(--ink); color: var(--paper); }
.credit-chip.low { background: var(--brick-soft); border-color: var(--brick); color: var(--brick-ink); }
.credit-chip:not([hidden]) + .lang { margin-left: 0; }
.credit-big { display: flex; align-items: baseline; gap: 8px; }
.credit-big b { font-family: var(--display); font-weight: 800; font-size: 52px; line-height: 1; letter-spacing: -0.04em; }
.credit-big span { font-weight: 700; color: var(--ink-2); }
.credits-card { background: var(--lilac); border-color: var(--ink); margin-bottom: 18px; }
.credits-card p { margin: 6px 0 10px; }
.credits-panel { display: grid; gap: 16px; }
.credits-panel .stepnote { margin: 0; }
.kgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan-card { position: relative; background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-panel); padding: 22px 20px 20px; display: grid; gap: 12px; align-content: start; }
.plan-card.popular { border: 2px solid var(--ink); }
.plan-card.current { background: var(--yellow-soft); }
.plan-card h3 { font-family: var(--display); font-weight: 860; font-stretch: 115%; font-size: 22px; margin: 0; }
html[data-lang="zh"] .plan-card h3 { font-stretch: 100%; }
.plan-tag { position: absolute; top: -13px; left: 18px; background: var(--wing); color: var(--white); border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 800; }
.plan-price { display: flex; align-items: baseline; gap: 4px; }
.plan-price b { font-family: var(--display); font-weight: 900; font-size: 40px; line-height: 1; }
.plan-price span { color: var(--ink-3); font-weight: 650; }
.plan-card ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--ink-2); font-size: 15px; }
.plan-card .btn { justify-self: start; }
.invite { margin-top: 22px; }
.invite-code { font-family: var(--display); font-weight: 900; font-stretch: 140%; font-size: 40px; letter-spacing: 0.08em; margin: 4px 0 12px; }
.pay { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 18px; }
.pay p { margin: 0; }
.stepcard .actions .cost { font-size: 12px; color: var(--ink-3); text-align: center; }
.trial-note { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--lilac); color: var(--wing-deep); font-weight: 700; }
.invite-input { font-family: var(--mono); font-size: 20px; letter-spacing: 0.12em; text-transform: uppercase; }

/* five phases */
.phase-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; position: relative; }
.phase-track li { display: grid; gap: 8px; align-content: start; }
.phase-track .ph-dot { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--white); display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.phase-track li.done .ph-dot { background: var(--leaf); border-color: var(--leaf); color: var(--white); }
.phase-track li.active .ph-dot { background: var(--yellow); }
.phase-track b { display: block; font-size: 15px; }
.phase-track small { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.phase-track em { display: inline-block; margin-top: 4px; font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--brick-ink); background: var(--brick-soft); border-radius: 6px; padding: 2px 6px; }

/* sample product photos */
.sf-img { position: relative; }
.sample-tag { position: absolute; left: 8px; bottom: 8px; background: rgba(21, 19, 15, 0.72); color: #FFFCF3; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }

/* mobile */
.app-tabs { display: none; }
@media (max-width: 1180px) {
  .app { grid-template-columns: 200px minmax(0, 1fr); }
  .app-chat { display: none; }
  .app.chat-open .app-chat { display: flex; position: fixed; inset: 62px 0 0 auto; width: min(420px, 100%); z-index: 30; box-shadow: -12px 0 0 rgba(21, 19, 15, 0.08); }
  .chat-toggle { display: inline-flex; }
}
@media (min-width: 1181px) { .chat-toggle { display: none; } }
@media (max-width: 860px) {
  .app, .app.no-chat { grid-template-columns: minmax(0, 1fr); }
  .app-nav { display: none; }
  .app-main { padding: 22px 16px 110px; }
  .app-top { padding: 0 14px; gap: 10px; }
  .app-title span { display: none; }
  .app-top .brand-word { display: none; }
  .app-top [data-mode-badge] { display: none !important; }
  .app-title b { max-width: 34vw; }
  .grid2, .fields.two, .kgrid { grid-template-columns: 1fr; }
  .kgrid, .kgrid.three { grid-template-columns: 1fr 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .phase-track { grid-template-columns: 1fr; gap: 12px; }
  .phase-track li { grid-template-columns: 34px minmax(0, 1fr); align-items: start; }
  .credit-chip { padding: 4px 10px; font-size: 12px; }
  .invite-code { font-size: 32px; }
  .stepcard { grid-template-columns: 36px minmax(0, 1fr); }
  .stepcard .actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .summary dl { grid-template-columns: 1fr; }
  .app-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--white); border-top: 1px solid var(--ink); }
  .app-tabs a, .app-tabs button { flex: 1; display: grid; place-items: center; padding: 10px 4px 12px; font-size: 12px; font-weight: 800; text-decoration: none; border: 0; background: transparent; cursor: pointer; }
  .app-tabs [aria-current="page"] { background: var(--ink); color: var(--paper); }
  .app.chat-open .app-chat { inset: 62px 0 60px 0; width: 100%; }
}
