/* Prina Cloud dashboard — layout and component classes on top of tokens.css.
   Visual language follows the vendor console (design "Prina License Console v2"). */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-family: var(--font-sans); font-size: 15px; letter-spacing: -0.005em; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font-family: var(--font-sans); font-size: 14px; color: var(--text); }
input::placeholder { color: var(--text-3); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--border); }
.topbar-in { max-width: 1040px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 14px; }
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.wordmark:hover { text-decoration: none; }
.wordmark svg { width: 28px; height: 28px; display: block; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.nav a { height: 32px; padding: 0 11px; display: inline-flex; align-items: center; border-radius: var(--r-sm); color: var(--text-2); font-size: 13.5px; }
.nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--surface-3); color: var(--text); font-weight: 500; }
.spacer { flex: 1; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 2px; }
.seg button { height: 26px; padding: 0 12px; border: none; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; cursor: pointer; background: transparent; color: var(--text-3); transition: all 0.13s ease; }
.seg button.on { background: var(--accent); color: var(--accent-on); }

/* ── Page frame ──────────────────────────────────────────── */
.page { max-width: 1040px; margin: 0 auto; padding: 32px 24px 80px; display: flex; flex-direction: column; gap: 24px; animation: fadeIn 0.18s ease both; }
.page-narrow { max-width: 560px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; }
.page-head .sub { margin-top: 4px; font-size: 13.5px; color: var(--text-2); }
.page-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
h2.sec { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { flex: 1; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card-danger { border-color: var(--danger-border); }
.card-danger .card-head { border-bottom-color: var(--danger-border); color: var(--danger); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { margin: 0; color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); word-break: break-all; }
.danger-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.danger-row:last-child { border-bottom: none; padding-bottom: 0; }
.danger-row:first-child { padding-top: 0; }
.danger-row .txt { flex: 1; }
.danger-row .txt b { display: block; font-weight: 500; font-size: 14px; }
.danger-row .txt span { font-size: 12.5px; color: var(--text-2); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { height: 36px; padding: 0 15px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; transition: all 0.13s ease; text-decoration: none; }
.btn:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-on); }
.btn-danger { color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger-solid:hover { opacity: 0.9; color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14.5px; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.busy { opacity: 0.5; cursor: default; pointer-events: none; }
.icon-btn { width: 28px; height: 28px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text-3); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* ── Forms ───────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.input, .select { height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); outline: none; width: 100%; }
.input:focus, .select:focus { border-color: var(--border-strong); }
.input.bad { border-color: var(--danger); }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.addon { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.addon .input { border: none; border-radius: 0; flex: 1; min-width: 0; }
.addon .suffix { padding: 0 12px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); background: var(--surface-2); height: 38px; display: flex; align-items: center; border-left: 1px solid var(--border); white-space: nowrap; }
.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.hint.bad { color: var(--danger); }
.hint.ok { color: var(--published); }
.err { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid var(--danger-border); border-radius: var(--r-sm); background: var(--danger-bg); color: var(--danger); font-size: 13px; line-height: 1.5; }
.err svg { flex: none; margin-top: 2px; }
.code-boxes { display: flex; gap: 8px; }
.code-boxes input { width: 48px; height: 56px; text-align: center; font-family: var(--font-mono); font-size: 22px; font-weight: 500; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); outline: none; }
.code-boxes input:focus { border-color: var(--text); }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { min-width: 120px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 3px; transition: all 0.13s ease; }
.pill:hover { border-color: var(--border-strong); }
.pill.on { border-color: var(--text); box-shadow: 0 0 0 1px var(--text) inset; }
.pill b { font-size: 14px; font-weight: 500; }
.pill span { font-size: 12px; color: var(--text-3); }
.pill[disabled] { opacity: 0.55; cursor: default; }

/* ── Chips / dots / bars ─────────────────────────────────── */
.chip { height: var(--chip-sm-h); padding: 0 var(--chip-sm-px); border-radius: var(--r-pill); font-size: var(--chip-sm-fs); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; white-space: nowrap; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: currentColor; }
.chip-green { background: var(--published-bg); color: var(--published); border-color: var(--published-border); }
.chip-blue { background: var(--approved-bg); color: var(--approved); border-color: var(--approved-border); }
.chip-amber { background: var(--review-bg); color: var(--review); border-color: var(--review-border); }
.chip-grey { background: var(--draft-bg); color: var(--draft); border-color: var(--draft-border); }
.chip-red { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.chip-outline { background: transparent; color: var(--text-2); border-color: var(--border); font-family: var(--font-mono); }
.chip .dot.live { animation: pulseDot 1.8s ease-in-out infinite; }
.bar { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width 0.4s ease; }
.bar.live i { background: linear-gradient(90deg, var(--approved) 0%, var(--approved-border) 50%, var(--approved) 100%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.bar.warn i { background: var(--review); }
.bar-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); }

/* ── Banners / empty / toast / modal ─────────────────────── */
.banner { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--review-border); border-radius: var(--r); background: var(--review-bg); color: var(--review); font-size: 13.5px; }
.banner.red { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger); }
.banner svg { flex: none; }
.empty { padding: 64px 24px 68px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.empty .ico { width: 44px; height: 44px; border-radius: var(--r-sm); border: 1px dashed var(--border-strong); display: grid; place-items: center; color: var(--text-3); }
.empty h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.empty p { margin: 6px 0 0; font-size: 13.5px; color: var(--text-2); max-width: 380px; line-height: 1.6; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 9px 14px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-on); font-size: 13px; box-shadow: var(--shadow); animation: popIn 0.18s ease both; z-index: 60; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 24px; animation: fadeIn 0.15s ease both; z-index: 50; }
.modal { width: 460px; max-width: 100%; max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 26px; display: flex; flex-direction: column; gap: 16px; animation: popIn 0.2s ease both; }
.modal h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.025em; }
.modal p { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.loading { padding: 80px 24px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ── Landing ─────────────────────────────────────────────── */
.hero { padding: 56px 0 24px; display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.hero h1 { margin: 0; font-size: 40px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; text-wrap: balance; }
.hero p { margin: 0; font-size: 17px; color: var(--text-2); line-height: 1.6; text-wrap: pretty; }
.hero-actions { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.plan-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.plan-card .name { font-size: 15px; font-weight: 600; }
.plan-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.plan-card li::before { content: "·"; margin-right: 8px; color: var(--text-3); }
.oss { font-size: 13.5px; color: var(--text-3); }

/* ── Projects ────────────────────────────────────────────── */
.proj-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.proj-top { display: flex; align-items: flex-start; gap: 12px; }
.proj-top .name { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.proj-top .name a { color: var(--text); }
.proj-top .host { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); word-break: break-all; }
.proj-foot { display: flex; align-items: center; gap: 8px; }
.url-row { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13px; color: var(--text-2); }
.events { display: flex; flex-direction: column; }
.event { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.event:last-child { border-bottom: none; }
.event .when { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.steps { display: flex; flex-direction: column; gap: 8px; }
