/* ==========================================================================
   Leaf API demo kit: shared styles
   ========================================================================== */

:root {
  --bg: #faf8f6;
  --fg: #1a4d2e;
  --fg-soft: rgba(26, 77, 46, 0.72);
  --fg-mute: rgba(26, 77, 46, 0.5);
  --card: #ffffff;
  --primary: #2d7a4f;
  --primary-hover: #256842;
  --primary-fg: #ffffff;
  --secondary: #f0ebe3;
  --muted: #e8ddf5;
  --border: #e0d5ca;
  --input: #ffffff;
  --danger: #c41e3a;
  --dark: #0f2818;
  --dark-2: #1a3a2a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(26, 77, 46, 0.06), 0 1px 3px rgba(26, 77, 46, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 40, 24, 0.12);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--fg);
  background: linear-gradient(180deg, var(--secondary) 0%, var(--bg) 280px);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--primary); }

/* ---------- Shell ---------- */
.leaf-shell { max-width: 1240px; margin: 0 auto; padding: 16px; }
.leaf-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 14px; flex-wrap: wrap; }
.leaf-brand { display: flex; align-items: center; gap: 10px; }
.leaf-logo {
  width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: var(--primary-fg);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
}
.leaf-brand-title { font-weight: 700; font-size: 16px; }
.leaf-brand-sub { font-size: 12px; color: var(--fg-mute); display: flex; align-items: center; gap: 6px; }
.leaf-status { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--card);
  border-radius: 999px; padding: 5px 10px; color: var(--fg-soft);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.status-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }

.leaf-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.leaf-app {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px; min-height: 520px; min-width: 0;
}
.leaf-stage { min-width: 0; }
/* The demo's own layouts respond to the space the demo really has (page, tablet or phone), not the window. */
.leaf-screen { container: site / inline-size; }
@media (max-width: 960px) { .leaf-layout { grid-template-columns: minmax(0, 1fr); } }
@container site (max-width: 960px) { .leaf-app { padding: 16px; } }

.leaf-boot { min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--fg-mute); font-size: 14px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--secondary); border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- API call log ---------- */
.leaf-log {
  background: var(--dark); color: #f0ebe3; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  height: 640px; position: sticky; top: 16px;
}
@media (max-width: 960px) { .leaf-log { position: static; height: 360px; } }
.log-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); font-size: 14px; font-weight: 600; }
.log-head .count { color: rgba(255, 255, 255, 0.5); font-weight: 500; font-size: 12px; }
.log-head .spacer { flex: 1; }
.log-head button { background: none; border: 0; color: rgba(255, 255, 255, 0.55); padding: 4px; display: inline-flex; }
.log-head button:hover { color: #fff; }
.pulse { position: relative; width: 8px; height: 8px; }
.pulse::before, .pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #4ade80; }
.pulse::before { animation: ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite; opacity: 0.6; }
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
.log-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.log-empty { text-align: center; color: rgba(255, 255, 255, 0.5); font-size: 13px; padding: 40px 16px; line-height: 1.5; }
.log-item { background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 10px; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.log-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.log-copy {
  margin-left: auto; flex-shrink: 0; width: 24px; height: 24px; border: 0; border-radius: 6px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.75); opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.log-copy svg { width: 13px; height: 13px; }
.log-item:hover .log-copy, .log-copy:focus-visible, .log-copy.done { opacity: 1; }
.log-copy:hover { background: #22c55e; color: #052e16; }
.log-copy.done { background: #22c55e; color: #052e16; }
@media (hover: none) { .log-copy { opacity: 1; } }
.log-path { font-family: var(--mono); font-size: 11.5px; color: rgba(255, 255, 255, 0.92); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-body pre { margin: 8px 0 0; max-height: 110px; overflow: auto; background: rgba(0, 0, 0, 0.3); border-radius: 6px; padding: 8px; font-family: var(--mono); font-size: 11px; line-height: 1.5; color: rgba(255, 255, 255, 0.72); }
.log-result { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; }
.log-result.ok { color: #86efac; }
.log-result.err { color: #fca5a5; }
.log-result .ms { margin-left: auto; color: rgba(255, 255, 255, 0.4); }
.log-result svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ---------- Methods ---------- */
.method { flex-shrink: 0; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 2px 6px; letter-spacing: 0.02em; }
.m-GET { background: #dbeafe; color: #1e40af; }
.m-POST { background: #dcfce7; color: #166534; }
.m-PATCH { background: #f3e8ff; color: #6b21a8; }
.m-PUT { background: #fef9c3; color: #854d0e; }
.m-DELETE { background: #fee2e2; color: #991b1b; }

/* ---------- Primitives ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; border: 1px solid transparent;
  padding: 8px 14px; font-size: 14px; font-weight: 600; background: var(--primary); color: var(--primary-fg); white-space: nowrap; text-decoration: none;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.btn:hover:not(:disabled) { background: var(--primary-hover); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-outline { background: var(--card); color: var(--fg); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--secondary); border-color: rgba(45, 122, 79, 0.35); }
.btn-ghost { background: transparent; color: var(--fg-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--secondary); color: var(--fg); }
.btn-danger, .btn.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #a3182f; border-color: #a3182f; color: #fff; }
.btn-warn, .btn.btn-warn { background: #f59e0b; border-color: #f59e0b; color: #422006; }
.btn-warn:hover:not(:disabled) { background: #d97706; border-color: #d97706; color: #422006; }
/* Armed "click again to confirm" state for destructive buttons. */
.btn.armed { background: var(--danger); border-color: var(--danger); color: #fff; animation: armPulse 1s ease-in-out infinite; }
.btn.armed:hover:not(:disabled) { background: #a3182f; border-color: #a3182f; color: #fff; }
@keyframes armPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(196, 30, 58, 0.35); } 50% { box-shadow: 0 0 0 5px rgba(196, 30, 58, 0); } }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; padding: 4px; color: var(--fg-mute); display: inline-flex; border-radius: 6px; }
.icon-btn { transition: color .15s, background .15s; }
.icon-btn:hover { color: var(--fg); background: var(--secondary); }
.icon-btn.danger:hover { color: var(--danger); background: #fee2e2; }
.icon-btn.armed, .icon-btn.armed:hover { background: var(--danger); color: #fff; padding: 4px 8px; font-size: 12px; font-weight: 600; gap: 4px; align-items: center; }
.icon-btn svg { width: 15px; height: 15px; }

.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border); background: var(--input); border-radius: 9px; padding: 8px 11px; font-size: 14px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45, 122, 79, 0.15); }
.textarea { resize: vertical; min-height: 90px; }

.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.badge-low { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge-medium { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-hard { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
.badge-expert { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.badge-mobile { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.chip { border: 0; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 500; background: var(--secondary); color: var(--fg-soft); transition: background .15s, color .15s; }
.chip:hover:not(.active) { background: #e7dfd3; color: var(--fg); }
.chip.active { background: var(--primary); color: var(--primary-fg); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--fg-mute); }
.soft { color: var(--fg-soft); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 8px; }
.grid { display: grid; gap: 12px; }
.title { font-size: 20px; font-weight: 700; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-mute); }
.skeleton { background: var(--secondary); border-radius: 10px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
.error-banner { margin-bottom: 14px; border: 1px solid rgba(196, 30, 58, 0.3); background: rgba(196, 30, 58, 0.08); color: var(--danger); padding: 9px 12px; border-radius: 10px; font-size: 13px; }
.hide-sm { }
@media (max-width: 640px) { .hide-sm { display: none !important; } }

/* ---------- Modal ---------- */
.leaf-overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 40, 24, 0.45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.leaf-modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); border-radius: 20px;
  box-shadow: 0 25px 60px rgba(15, 40, 24, 0.3); animation: popIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.modal-hero { padding: 22px 22px 0; display: flex; gap: 14px; align-items: flex-start; }
.modal-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #dcfce7; color: var(--primary); }
.modal-icon.warn { background: #fef3c7; color: #b45309; }
.modal-icon.err { background: #ffe4e6; color: #be123c; }
.modal-icon svg { width: 22px; height: 22px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-sub { font-size: 13.5px; color: var(--fg-soft); margin-top: 4px; line-height: 1.5; }
.modal-body { padding: 18px 22px 22px; }
.modal-close { margin-left: auto; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--fg-soft); margin-bottom: 6px; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 8px; }
.key-input { font-family: var(--mono); letter-spacing: 0.02em; }
.hint { font-size: 12px; color: var(--fg-mute); margin-top: 8px; line-height: 1.5; }
.account-note { display: flex; align-items: center; gap: 6px; color: var(--primary); }
.account-note svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-google { width: 100%; gap: 10px; padding: 10px 14px; color: var(--primary); border-color: var(--primary); }
.btn-google svg { width: 18px; height: 18px; }
.or-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 14px; font-size: 12px; color: var(--fg-mute); }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--secondary); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 19px; }
.stat span { font-size: 11px; color: var(--fg-soft); }
.meter { height: 6px; background: var(--secondary); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.5s ease; }
.meter.warn > i { background: #f59e0b; }
.meter.full > i { background: var(--danger); }
.res-list { display: flex; flex-direction: column; gap: 6px; }
.res-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 11px; padding: 9px 10px; }
.res-item.current { border-color: var(--primary); background: rgba(45, 122, 79, 0.05); }
.res-item .grow { flex: 1; min-width: 0; }
.res-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-meta { font-size: 11.5px; color: var(--fg-mute); }
.tag { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 5px; background: var(--secondary); color: var(--fg-soft); }
.tag.green { background: #dcfce7; color: #166534; }
.tag.red { background: #ffe4e6; color: #9f1239; }
.need-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border: 1px dashed #c4b5fd; background: #f5f3ff; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.need-box p { flex-basis: 100%; margin: 0; }
.need-facts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--fg-soft); }
.need-facts b { color: #6d28d9; }
.need-count { display: flex; align-items: baseline; gap: 6px; }
.need-count b { font-size: 30px; font-weight: 800; color: #6d28d9; line-height: 1; transition: transform .2s; }
.need-count span { font-size: 12px; color: var(--fg-soft); }
.need-slots { display: flex; gap: 5px; }
.need-slots i { width: 22px; height: 22px; border-radius: 6px; background: #ddd6fe; border: 2px solid #c4b5fd; }
.need-slots i.used { background: #7c3aed; border-color: #7c3aed; }
.need-slots i.just-freed { animation: popIn .35s ease; background: #dcfce7; border-color: #22c55e; }
.res-item.freed { opacity: .55; border-style: dashed; }
/* Project choice rows: info on the left, the two choices (each with an optional Recommended badge) on the right. */
.res-item.res-choice { flex-wrap: wrap; row-gap: 10px; }
.res-choice-info { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; min-width: 0; }
.res-choice-actions { display: flex; align-items: flex-end; gap: 8px; margin-left: auto; }
.choice { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.choice.recommended .btn-warn { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3); }
.choice.recommended .btn-danger { box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.22); }
.rec-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.rec-badge svg { width: 10px; height: 10px; fill: currentColor; }
.rec-badge.use { background: #fef3c7; color: #92400e; }
.rec-badge.delete { background: #ffe4e6; color: #9f1239; }
.res-meta.fit-ok { color: #166534; }
.res-meta.fit-short { color: #9f1239; }
.res-meta.fit-tight { color: #92400e; }
.res-item.suggested { border-color: rgba(196, 30, 58, 0.45); background: rgba(196, 30, 58, 0.04); }
.ok-box { border-radius: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.warn-box { border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.progress-line { height: 4px; background: var(--secondary); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress-line > i { display: block; height: 100%; background: var(--primary); transition: width 0.25s; }

/* ---------- Toast ---------- */
.leaf-toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; background: var(--dark); color: #fff;
  padding: 10px 16px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: popIn 0.25s ease;
}

/* ==========================================================================
   Device preview (website / tablet / mobile): only the demo goes in the frame
   ========================================================================== */
.leaf-statusbar, .leaf-homebar { display: none; }
.leaf-device { position: relative; }
html:not([data-device="desktop"]) .leaf-layout { align-items: stretch; }
html:not([data-device="desktop"]) .leaf-stage {
  display: flex; justify-content: center; align-items: flex-start; padding: 18px 12px; border-radius: 18px; border: 1px solid var(--border);
  background: radial-gradient(circle at 30% 20%, rgba(45,122,79,.12), transparent 50%), radial-gradient(circle at 80% 80%, rgba(139,92,246,.10), transparent 45%), #ece7df;
}
html:not([data-device="desktop"]) .leaf-device {
  display: flex; flex-direction: column; overflow: hidden; background: var(--card); flex-shrink: 0;
  border: 12px solid #121212; box-shadow: 0 0 0 2px #3a3a3a, 0 30px 70px rgba(0,0,0,.28);
}
/* Real device proportions (390×844 phone, 820×1180 tablet). leaf-api.js zooms the whole frame down to fit the
   window instead of squashing its height, so the preview always has the shape of a real device. */
html[data-device="mobile"] .leaf-device { width: 390px; height: 844px; border-radius: 56px; --leaf-screen-r: 44px; }
html[data-device="tablet"] .leaf-device { width: 820px; height: 1180px; border-radius: 38px; border-width: 16px; --leaf-screen-r: 22px; }
html:not([data-device="desktop"]) .leaf-screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
/* Chrome (GPU compositing) ignores the frame's rounded overflow clip for backdrop-filter, so a blurred bottom nav or
   sheet backdrop paints square corners over the frame. A solid mask forces a real mask layer that clips to the
   element's own rounded corners (radius = frame radius - border). clip-path: inset() is not enough for sticky navs. */
html:not([data-device="desktop"]) .leaf-screen,
html:not([data-device="desktop"]) .leaf-device > .in-device { -webkit-mask-image: linear-gradient(#000, #000); mask-image: linear-gradient(#000, #000); }
html:not([data-device="desktop"]) .leaf-screen { border-radius: 0 0 var(--leaf-screen-r) var(--leaf-screen-r); }
html:not([data-device="desktop"]) .leaf-device > .in-device { border-radius: var(--leaf-screen-r); overflow: hidden; }
html:not([data-device="desktop"]) .leaf-screen::-webkit-scrollbar { width: 0; }
html:not([data-device="desktop"]) .leaf-app { border: 0; border-radius: 0; box-shadow: none; min-height: 100%; padding: 16px 16px 28px; }
/* Apps drawn edge to edge (chat, full-screen tools): a root with .leaf-bleed fills the whole device screen with no
   white gutter around it, the way a native app does. */
html:not([data-device="desktop"]) .leaf-app:has(> .leaf-bleed) { padding: 0; display: flex; flex-direction: column; }
html:not([data-device="desktop"]) .leaf-app > .leaf-bleed { flex: 1; min-height: 0; border: 0; border-radius: 0; }
/* The API calls panel stays beside the device and matches its height. */
html:not([data-device="desktop"]) .leaf-log { height: auto; contain: size; position: static; }
@media (max-width: 960px) { html:not([data-device="desktop"]) .leaf-log { contain: none; height: 360px; } }
html:not([data-device="desktop"]) .leaf-statusbar {
  display: flex; align-items: center; justify-content: space-between; position: relative; flex-shrink: 0;
  padding: 0 26px; height: 48px; font-size: 15px; font-weight: 600; color: #111; background: var(--card);
}
html[data-device="tablet"] .leaf-statusbar { height: 30px; font-size: 12px; padding: 0 20px; }
.sb-island { position: absolute; left: 50%; top: 11px; width: 122px; height: 34px; transform: translateX(-50%); background: #000; border-radius: 999px; }
html[data-device="tablet"] .sb-island { width: 8px; height: 8px; top: 11px; background: #2a2a2a; }
.sb-icons { display: inline-flex; align-items: center; gap: 6px; }
.sb-icons svg { fill: #111; }
.sb-battery { position: relative; width: 25px; height: 12px; border: 1.5px solid rgba(0,0,0,.45); border-radius: 4px; padding: 1.5px; }
.sb-battery::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: rgba(0,0,0,.45); border-radius: 0 2px 2px 0; }
.sb-level { display: block; height: 100%; width: 100%; background: #111; border-radius: 1.5px; }
.sb-level.low { background: #ef4444; }
html:not([data-device="desktop"]) .leaf-homebar {
  display: block; position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: 134px; height: 5px; border-radius: 999px; background: #111; opacity: .85; z-index: 5; pointer-events: none;
}
html[data-device="tablet"] .leaf-homebar { width: 180px; }
/* The demo's own toasts appear on the device screen. */
.leaf-device > .leaf-toast { position: absolute; }

/* ---------- Top bar controls: preview size + settings ---------- */
.tb-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; }
.tb-seg-btn, .tb-btn {
  width: 30px; height: 28px; border: 0; border-radius: 999px; background: transparent; color: var(--fg-mute);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: background .15s, color .15s;
}
.tb-seg-btn svg, .tb-btn svg { width: 16px; height: 16px; }
.tb-seg-btn:hover, .tb-btn:hover { color: var(--fg); background: var(--secondary); }
.tb-seg-btn.on { background: var(--primary); color: var(--primary-fg); }
.tb-btn { width: 36px; height: 36px; border: 1px solid var(--border); background: var(--card); }
.tb-btn:hover svg { animation: spin 2s linear infinite; }
@media (max-width: 600px) { .tb-seg { display: none; } }

/* ---------- Narrow demo widths (mobile preview, small screens) ---------- */
@media (max-width: 480px) {
  .leaf-shell { padding: 12px; }
  .leaf-status .status-chip { font-size: 11px; }
  .stat-grid { gap: 6px; }
}
@container site (max-width: 480px) {
  .leaf-app { padding: 14px; border-radius: 14px; min-height: 0; }
  .title { font-size: 18px; }
}

/* ---------- KinWork ----------
   A professional network: feed with reactions and comments, invitations, jobs with easy apply, profile strength.
   Every class is prefixed with `kw-`. Palette, radius scale and motion tokens live on the root below. */
.kw, .kw-sheet-host {
  --kw-ink: #0f1b2d;
  --kw-ink-2: #3a4a5f;
  --kw-mute: #6b7a8d;
  --kw-bg: #f1f3f6;
  --kw-card: #ffffff;
  --kw-line: #e3e8ee;
  --kw-hover: #f2f5f8;
  --kw-pri: #0e7c86;
  --kw-pri-h: #0a666f;
  --kw-pri-soft: #e4f4f3;
  --kw-amber: #f2a93b;
  --kw-amber-soft: #fff6e5;
  --kw-green: #15803d;
  --kw-green-soft: #e7f7ec;
  --kw-red: #e11d48;
  --kw-r-sm: 10px;
  --kw-r: 16px;
  --kw-r-lg: 22px;
  --kw-ease: cubic-bezier(.2, .8, .2, 1);
  --kw-shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 1px 3px rgba(15, 27, 45, .06);
  --kw-shadow-lg: 0 14px 40px rgba(15, 27, 45, .16);
  /* base.css tokens, re-pointed at this palette */
  --primary: var(--kw-pri);
  --primary-hover: var(--kw-pri-h);
  --fg: var(--kw-ink);
  --border: var(--kw-line);
  font-family: var(--font);
  color: var(--kw-ink);
  -webkit-tap-highlight-color: transparent;
}
.leaf-app:has(> .kw) { padding: 0; overflow: clip; background: var(--kw-bg, #f1f3f6); display: flex; flex-direction: column; }
.kw { flex: 1; display: flex; flex-direction: column; min-height: 100%; background: var(--kw-bg); }
.kw :focus-visible, .kw-sheet-host :focus-visible { outline: 2.5px solid var(--kw-pri); outline-offset: 2px; }
.kw button, .kw-sheet-host button { font: inherit; color: inherit; -webkit-user-select: none; user-select: none; }
.kw button:disabled, .kw-sheet-host button:disabled { opacity: .45; cursor: not-allowed; }
.kw-ic { width: 20px; height: 20px; flex-shrink: 0; }
.kw .grow, .kw-sheet-host .grow { flex: 1; min-width: 0; }
.kw .spacer, .kw-sheet-host .spacer { flex: 1; }
.kw-muted { color: var(--kw-mute); }
.kw .small, .kw-sheet-host .small { font-size: 13px; line-height: 1.5; }
.kw-center { text-align: center; }
.kw-clamp1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kw-strong { color: var(--kw-pri); font-weight: 700; }

/* ---------- Header ---------- */
.kw-top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--kw-line); }
.kw-top-in { display: flex; align-items: center; gap: 10px; padding: 8px 16px; min-height: 60px; max-width: 1200px; margin: 0 auto; }
.kw-brand { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px; margin-left: -4px; border-radius: 12px; transition: transform .15s var(--kw-ease); }
.kw-brand:active { transform: scale(.97); }
.kw-brand b { font-size: 19px; font-weight: 800; letter-spacing: -.035em; color: var(--kw-ink); }
.kw-mark { width: 32px; height: 32px; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(14, 124, 134, .25)); }
.kw-topnav { display: none; }
.kw-persona { position: relative; margin-left: auto; display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; }
.kw-persona-lbl { font-size: 11.5px; font-weight: 600; color: var(--kw-mute); white-space: nowrap; }
.kw-persona-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 3px 10px 3px 4px; border: 1px solid var(--kw-line); border-radius: 999px; background: var(--kw-card); transition: border-color .15s, box-shadow .15s, transform .12s var(--kw-ease); }
.kw-persona-name { font-size: 13.5px; font-weight: 700; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-caret { width: 15px; height: 15px; color: var(--kw-mute); }
.kw-persona select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; font-size: 16px; }
.kw-persona:focus-within .kw-persona-chip { outline: 2.5px solid var(--kw-pri); outline-offset: 2px; }
.kw-persona:active .kw-persona-chip { transform: scale(.97); }
.kw-skel-chip { display: inline-block; width: 86px; height: 30px; margin: 0; border-radius: 999px; }

/* ---------- Body columns ---------- */
.kw-body { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 12px 16px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.kw-left, .kw-right { display: none; }
.kw-main { min-width: 0; }
.kw-stack-v { display: grid; gap: 12px; }

/* ---------- Bottom nav (phone) ---------- */
.kw-nav { position: sticky; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 4px 6px 6px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--kw-line); }
html:not([data-device="desktop"]) .kw-nav { padding-bottom: 22px; }
.kw-nav-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; border: 0; background: none; border-radius: 14px; color: var(--kw-mute); transition: color .15s, background .15s, transform .12s var(--kw-ease); }
.kw-nav-btn::before { content: ""; position: absolute; top: 0; left: 50%; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--kw-ink); transform: translateX(-50%) scaleX(0); transition: transform .25s var(--kw-ease); }
.kw-nav-btn.on { color: var(--kw-ink); }
.kw-nav-btn.on::before { transform: translateX(-50%) scaleX(1); }
.kw-nav-btn:active { transform: scale(.94); }
.kw-nav-ico { position: relative; display: inline-flex; height: 24px; align-items: center; }
.kw-nav-ico .kw-ic { width: 23px; height: 23px; }
.kw-nav-btn.on .kw-nav-ico .kw-av { box-shadow: 0 0 0 2px var(--kw-card), 0 0 0 3.5px var(--kw-ink); }
.kw-nav-lbl { font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.kw-badge { position: absolute; top: -5px; left: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--kw-red); color: #fff; font-size: 10.5px; font-weight: 700; font-style: normal; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--kw-card); animation: kwPop .35s var(--kw-ease); }
.kw-nav-post { justify-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; padding: 0; background: none; }
.kw-nav-post span { width: 48px; height: 48px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--kw-pri), #22b3a6); box-shadow: 0 6px 16px rgba(14, 124, 134, .35); transition: transform .15s var(--kw-ease), box-shadow .15s; }
.kw-nav-post span .kw-ic { width: 24px; height: 24px; stroke-width: 2.6; }
.kw-nav-post:active span { transform: scale(.92); }
@media (hover: hover) { .kw-nav-post:hover span { transform: translateY(-2px) rotate(90deg); box-shadow: 0 10px 22px rgba(14, 124, 134, .4); } .kw-nav-btn:hover { color: var(--kw-ink); } }

/* ---------- Avatars, logos ---------- */
.kw-av { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--g, #cbd5e1); color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .02em; text-shadow: 0 1px 1px rgba(0, 0, 0, .15); user-select: none; }
.kw-av.xxs { width: 20px; height: 20px; font-size: 7.5px; box-shadow: 0 0 0 2px var(--kw-card); }
.kw-av.xs { width: 28px; height: 28px; font-size: 10.5px; }
.kw-av.sm { width: 38px; height: 38px; font-size: 13px; }
.kw-av.lg { width: 60px; height: 60px; font-size: 20px; }
.kw-av.xl { width: 104px; height: 104px; font-size: 34px; box-shadow: 0 0 0 4px var(--kw-card); }
.kw-av.otw { box-shadow: 0 0 0 2px var(--kw-card), 0 0 0 4px #22c55e; }
.kw-av.xxs.otw { box-shadow: 0 0 0 2px var(--kw-card); }
.kw-av.xl.otw { box-shadow: 0 0 0 4px var(--kw-card), 0 0 0 8px #22c55e; }
.kw-av-btn { border: 0; background: none; padding: 0; border-radius: 50%; display: inline-flex; flex-shrink: 0; transition: transform .15s var(--kw-ease); }
.kw-av-btn:active { transform: scale(.95); }
@media (hover: hover) { .kw-av-btn:hover { transform: scale(1.05); } }
.kw-mini-stack { display: inline-flex; margin-right: 6px; vertical-align: middle; }
.kw-mini-stack .kw-av + .kw-av { margin-left: -6px; }
.kw-logo { width: 50px; height: 50px; border-radius: 13px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 25px; background: color-mix(in srgb, var(--c) 13%, #fff); border: 1px solid color-mix(in srgb, var(--c) 24%, #fff); }
.kw-logo.sm { width: 42px; height: 42px; font-size: 21px; border-radius: 11px; }
.kw-logo.lg { width: 68px; height: 68px; font-size: 34px; border-radius: 18px; }

/* ---------- Buttons ---------- */
.kw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent; background: var(--kw-pri); color: #fff !important; font-size: 14px; font-weight: 650; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s, transform .12s var(--kw-ease); }
.kw-btn .kw-ic { width: 17px; height: 17px; }
.kw-btn:active:not(:disabled) { transform: scale(.97); }
.kw-btn.sm { min-height: 38px; padding: 0 14px; font-size: 13px; }
.kw-btn.lg { min-height: 50px; padding: 0 22px; font-size: 15px; }
.kw-btn.outline { background: var(--kw-card); color: var(--kw-pri) !important; border-color: var(--kw-pri); }
.kw-btn.ghost { background: var(--kw-hover); color: var(--kw-ink-2) !important; }
.kw-btn.pending { color: var(--kw-mute) !important; }
.kw-btn.saved { background: var(--kw-pri-soft); border-color: transparent; }
.kw-btn.saved .kw-ic { fill: currentColor; }
.kw-block { width: 100%; }
@media (hover: hover) {
  .kw-btn:hover:not(:disabled) { background: var(--kw-pri-h); box-shadow: 0 4px 12px rgba(14, 124, 134, .22); }
  .kw-btn.outline:hover:not(:disabled) { background: var(--kw-pri-soft); box-shadow: none; }
  .kw-btn.ghost:hover:not(:disabled) { background: #e6ebf0; color: var(--kw-ink) !important; box-shadow: none; }
}
.kw-round { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--kw-line); background: var(--kw-card); color: var(--kw-ink-2); cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .12s var(--kw-ease); }
.kw-round .kw-ic { width: 18px; height: 18px; }
.kw-round.sm { width: 36px; height: 36px; }
.kw-round.sm .kw-ic { width: 16px; height: 16px; }
.kw-round.ghost { border-color: transparent; background: transparent; color: var(--kw-mute); }
.kw-round.primary { background: var(--kw-pri); border-color: var(--kw-pri); color: #fff; }
.kw-round.on { background: var(--kw-pri-soft); color: var(--kw-pri); border-color: transparent; }
.kw-round:active:not(:disabled) { transform: scale(.92); }
@media (hover: hover) {
  .kw-round:hover:not(:disabled) { background: var(--kw-hover); color: var(--kw-ink); }
  .kw-round.primary:hover:not(:disabled) { background: var(--kw-pri-h); color: #fff; }
  .kw-round.ghost:hover:not(:disabled) { color: var(--kw-red); background: #fff1f2; }
}

/* ---------- Cards, sections ---------- */
.kw-card { background: var(--kw-card); border: 1px solid var(--kw-line); border-radius: var(--kw-r); box-shadow: var(--kw-shadow); }
.kw-sec { padding: 16px; }
.kw-sec-flat { padding: 4px 0 0; }
.kw-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 36px; }
.kw-sec-head h2 { font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.kw-count { font-size: 12px; font-weight: 700; color: var(--kw-ink-2); background: var(--kw-hover); padding: 2px 9px; border-radius: 999px; }
.kw-h3 { font-size: 15px; font-weight: 750; letter-spacing: -.015em; margin: 20px 0 8px; }
.kw-para { font-size: 14.5px; line-height: 1.6; color: var(--kw-ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.kw-skel { border-radius: var(--kw-r); margin-bottom: 12px; background: linear-gradient(90deg, #e8ecf1 0%, #f4f6f9 40%, #e8ecf1 80%); background-size: 200% 100%; animation: kwShimmer 1.3s linear infinite; }
.kw-empty { text-align: center; padding: 22px 12px 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kw-empty-ico { width: 64px; height: 64px; border-radius: 22px; background: linear-gradient(135deg, var(--kw-pri-soft), #eef2ff); display: inline-flex; align-items: center; justify-content: center; font-size: 30px; margin-bottom: 8px; }
.kw-empty b { font-size: 15px; }
.kw-empty p { font-size: 13px; color: var(--kw-mute); line-height: 1.5; max-width: 280px; margin-bottom: 10px; }
.kw-pill { font-size: 11.5px; font-weight: 650; color: var(--kw-mute); background: var(--kw-hover); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }

/* ---------- Text bits ---------- */
.kw-name-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.kw-link-name { border: 0; background: none; padding: 0; font-size: 14.5px; font-weight: 700; color: var(--kw-ink) !important; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
@media (hover: hover) { .kw-link-name:hover { color: var(--kw-pri) !important; text-decoration: underline; text-underline-offset: 2px; } }
.kw-deg { font-size: 12.5px; color: var(--kw-mute); white-space: nowrap; }
.kw-headline { font-size: 12.5px; color: var(--kw-mute); line-height: 1.4; }
.kw-time { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--kw-mute); margin-top: 2px; }
.kw-time .kw-ic { width: 13px; height: 13px; }

/* ---------- Composer card ---------- */
.kw-composer { padding: 14px 14px 8px; }
.kw-composer-top { display: flex; align-items: center; gap: 10px; }
.kw-start { flex: 1; min-height: 50px; text-align: left; padding: 0 18px; border-radius: 999px; border: 1px solid #cfd8e2; background: var(--kw-card); color: var(--kw-mute) !important; font-size: 14.5px; font-weight: 600; transition: background .15s, border-color .15s, transform .12s var(--kw-ease); }
.kw-start:active { transform: scale(.98); }
@media (hover: hover) { .kw-start:hover { background: var(--kw-hover); border-color: #b9c4d0; } }
.kw-composer-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; margin-top: 8px; }
.kw-composer-kinds button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 0; background: none; border-radius: 12px; font-size: 12.5px; font-weight: 650; color: var(--kw-ink-2); transition: background .15s, transform .12s var(--kw-ease); }
.kw-composer-kinds button .kw-ic { color: #2f80ed; width: 19px; height: 19px; }
.kw-composer-kinds button:active { transform: scale(.96); }
@media (hover: hover) { .kw-composer-kinds button:hover { background: var(--kw-hover); } }
.kw-emo { font-size: 16px; line-height: 1; }

/* ---------- Post card ---------- */
.kw-feed { display: grid; gap: 12px; margin-top: 12px; }
.kw-post { position: relative; padding: 14px 16px 4px; transition: opacity .22s, transform .22s var(--kw-ease); }
.kw-post.kw-leaving { opacity: 0; transform: scale(.97); }
.kw-ribbon { margin: -14px -16px 12px; padding: 9px 16px; border-bottom: 1px solid var(--kw-line); border-radius: var(--kw-r) var(--kw-r) 0 0; font-size: 12.5px; font-weight: 650; color: var(--kw-ink-2); }
.kw-ribbon.milestone { background: linear-gradient(90deg, #fff6e5, #fdf0f6); }
.kw-ribbon.hiring { background: linear-gradient(90deg, var(--kw-pri-soft), #eef4ff); }
.kw-post-head { display: flex; align-items: flex-start; gap: 10px; }
.kw-del { display: inline-flex; align-items: center; gap: 4px; height: 36px; min-width: 36px; justify-content: center; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: var(--kw-mute); font-size: 12px; font-weight: 700; transition: background .15s, color .15s; }
.kw-del .kw-ic { width: 17px; height: 17px; }
.kw-del.armed { background: var(--kw-red); color: #fff; padding: 0 12px; animation: kwPop .25s var(--kw-ease); }
@media (hover: hover) { .kw-del:not(.armed):hover { background: #fff1f2; color: var(--kw-red); } }
.kw-follow { display: inline-flex; align-items: center; gap: 3px; height: 34px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--kw-pri) !important; font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .15s; }
.kw-follow .kw-ic { width: 16px; height: 16px; stroke-width: 2.6; }
@media (hover: hover) { .kw-follow:hover { background: var(--kw-pri-soft); } }
.kw-text { margin: 12px 0; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--kw-ink); }
.kw-more { border: 0; background: none; padding: 0 0 0 4px; font-size: 14px; font-weight: 600; color: var(--kw-mute) !important; }
@media (hover: hover) { .kw-more:hover { color: var(--kw-pri) !important; text-decoration: underline; } }

.kw-milestone { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 22px 16px 18px; margin-bottom: 12px; border-radius: 14px; text-align: center; background: radial-gradient(circle at 20% 10%, #ffe7b8, transparent 55%), radial-gradient(circle at 85% 90%, #fbd3e9, transparent 50%), #fff8ec; }
.kw-ms-emoji { font-size: 40px; line-height: 1.1; margin-bottom: 4px; }
.kw-milestone b { font-size: 15.5px; letter-spacing: -.01em; }
.kw-milestone > span:last-child { font-size: 12.5px; color: var(--kw-ink-2); }
.kw-conf { position: absolute; inset: 0; pointer-events: none; }
.kw-conf i { position: absolute; width: 7px; height: 12px; border-radius: 2px; top: 14%; left: 6%; background: #f59e0b; transform: rotate(calc(var(--k) * 47deg)); opacity: .8; }
.kw-conf i:nth-child(2) { top: 70%; left: 9%; }
.kw-conf i:nth-child(3) { top: 18%; left: 86%; }
.kw-conf i:nth-child(4) { top: 64%; left: 92%; }
.kw-conf i:nth-child(5) { top: 9%; left: 28%; }
.kw-conf i:nth-child(6) { top: 12%; left: 70%; }
.kw-conf i:nth-child(3n + 2) { background: #ec4899; }
.kw-conf i:nth-child(3n) { background: var(--kw-pri); }

.kw-hire { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 12px; border: 1px solid var(--kw-line); border-radius: 14px; background: linear-gradient(135deg, #f5fbfb, #f6f8ff); }
.kw-hire-ico { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; background: var(--kw-card); box-shadow: var(--kw-shadow); flex-shrink: 0; }
.kw-hire b { font-size: 14.5px; line-height: 1.3; }
.kw-hire .grow > span { font-size: 12.5px; color: var(--kw-mute); }
.kw-photo { margin: 0 -16px 12px; background: #0f1b2d; overflow: hidden; }
.kw-photo img { display: block; width: 100%; max-height: 440px; object-fit: cover; }
.kw-linkcard { display: flex; align-items: stretch; margin-bottom: 12px; border: 1px solid var(--kw-line); border-radius: 14px; overflow: hidden; background: #f8fafc; transition: border-color .15s; }
.kw-link-art { width: 86px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; background: linear-gradient(135deg, #dbeafe, var(--kw-pri-soft)); }
.kw-linkcard .grow { padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.kw-linkcard b { font-size: 14px; line-height: 1.35; }
.kw-linkcard .grow > span { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--kw-mute); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-linkcard .kw-ic { width: 13px; height: 13px; }

.kw-summary { display: flex; align-items: center; gap: 6px; padding: 2px 0 10px; font-size: 12.5px; color: var(--kw-mute); border-bottom: 1px solid var(--kw-line); min-width: 0; }
.kw-stack { display: inline-flex; flex-shrink: 0; }
.kw-stack i { position: relative; width: 21px; height: 21px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-style: normal; background: var(--kw-card); box-shadow: 0 0 0 2px var(--kw-card), 0 1px 3px rgba(15, 27, 45, .2); }
.kw-stack i + i { margin-left: -6px; }
.kw-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kw-sum-link { border: 0; background: none; padding: 4px 0; font-size: 12.5px; color: var(--kw-mute) !important; white-space: nowrap; }
@media (hover: hover) { .kw-sum-link:hover { color: var(--kw-pri) !important; text-decoration: underline; } }
.kw-summary > span:last-child { white-space: nowrap; }
.kw-dotsep { opacity: .6; }

.kw-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 4px 0; }
.kw-act { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; border: 0; background: none; border-radius: 12px; font-size: 13.5px; font-weight: 650; color: var(--kw-ink-2); transition: background .15s, color .15s, transform .12s var(--kw-ease); touch-action: manipulation; -webkit-touch-callout: none; }
.kw-act .kw-ic { width: 19px; height: 19px; }
.kw-act:active { transform: scale(.96); }
.kw-act.active { color: var(--kw-pri); }
.kw-act.reposted { color: var(--kw-green); }
.kw-act-emo { font-size: 18px; line-height: 1; display: inline-block; }
.kw-act.pop .kw-act-emo { animation: kwBounce .55s var(--kw-ease); }
.kw-burst { position: absolute; left: 50%; top: 50%; font-size: 26px; pointer-events: none; animation: kwBurst .7s var(--kw-ease) forwards; }
@media (hover: hover) { .kw-act:hover { background: var(--kw-hover); } }

/* Reaction picker: pops above the Like button on hover (mouse) or long-press (touch). */
.kw-react-wrap { position: relative; }
.kw-picker { position: absolute; left: -4px; bottom: calc(100% + 8px); z-index: 12; display: flex; gap: 2px; padding: 5px 6px; border-radius: 999px; background: var(--kw-card); border: 1px solid var(--kw-line); box-shadow: var(--kw-shadow-lg); opacity: 0; transform: translateY(8px) scale(.92); transform-origin: 30px 100%; pointer-events: none; transition: opacity .16s, transform .22s var(--kw-ease); transition-delay: 0s; }
.kw-picker::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }
.kw-picker button { position: relative; width: 44px; height: 44px; border: 0; padding: 0; border-radius: 50%; background: none; display: inline-flex; align-items: center; justify-content: center; }
.kw-picker button span { font-size: 27px; line-height: 1; display: inline-block; transform: translateY(14px) scale(.5); opacity: 0; transition: transform .28s var(--kw-ease), opacity .2s; transition-delay: calc(var(--d) * 35ms); }
.kw-picker button em { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translate(-50%, 4px); padding: 3px 8px; border-radius: 999px; background: var(--kw-ink); color: #fff; font-size: 11px; font-weight: 650; font-style: normal; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s, transform .15s var(--kw-ease); }
.kw-picker button.on { background: var(--kw-pri-soft); }
.kw-picker.open, .kw-picker:focus-within { opacity: 1; transform: none; pointer-events: auto; }
.kw-picker.open button span, .kw-picker:focus-within button span { transform: none; opacity: 1; }
.kw-picker button:focus-visible em { opacity: 1; transform: translate(-50%, 0); }
.kw-picker button:active span { transform: scale(.9) !important; }
@media (hover: hover) {
  .kw-react-wrap:not(.nohover):hover .kw-picker { opacity: 1; transform: none; pointer-events: auto; transition-delay: .4s; }
  .kw-react-wrap:not(.nohover):hover .kw-picker button span { transform: none; opacity: 1; transition-delay: calc(.4s + var(--d) * 35ms); }
  .kw-picker button:hover span { transform: translateY(-5px) scale(1.32) !important; transition-delay: 0s !important; }
  .kw-picker button:hover em { opacity: 1; transform: translate(-50%, 0); }
}

/* Comments */
.kw-comments { padding: 6px 0 14px; border-top: 1px solid var(--kw-line); }
.kw-cform { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.kw-cinput { flex: 1; min-width: 0; border: 1px solid #d5dde6; border-radius: 22px; background: var(--kw-card); transition: border-color .15s, box-shadow .15s; }
.kw-cinput:focus-within { border-color: var(--kw-pri); box-shadow: 0 0 0 3px rgba(14, 124, 134, .15); }
.kw-cinput input { display: block; width: 100%; min-height: 42px; padding: 0 16px; border: 0; background: transparent; outline: none; font-size: 14px; }
.kw-replying { display: flex; align-items: center; gap: 4px; padding: 7px 8px 0 16px; font-size: 11.5px; color: var(--kw-mute); }
.kw-replying button { margin-left: auto; width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--kw-hover); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.kw-replying .kw-ic { width: 12px; height: 12px; }
.kw-comment { display: flex; gap: 8px; margin-top: 12px; }
.kw-comment.nested { margin-left: 46px; margin-top: 8px; }
.kw-bubble { padding: 8px 12px 10px; border-radius: 4px 16px 16px 16px; background: #f2f4f7; min-width: 0; }
.kw-bubble .kw-link-name { font-size: 13.5px; }
.kw-bubble .kw-time { margin: 0; flex-shrink: 0; }
.kw-author-tag { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--kw-ink); color: #fff; }
.kw-bubble .kw-headline { font-size: 11.5px; }
.kw-ctext { margin-top: 6px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.kw-cacts { display: flex; gap: 2px; margin: 2px 0 0 4px; }
.kw-cacts button { min-height: 34px; padding: 0 8px; border: 0; background: none; border-radius: 8px; font-size: 12.5px; font-weight: 650; color: var(--kw-mute) !important; transition: background .15s, color .15s; }
@media (hover: hover) { .kw-cacts button:hover { background: var(--kw-hover); color: var(--kw-ink) !important; } }
.kw-first { padding: 12px 4px 0; }

/* ---------- Left / right rails ---------- */
.kw-mini { overflow: hidden; text-align: center; }
.kw-mini-banner { height: 58px; }
.kw-mini-body { padding: 0 14px 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kw-mini-body .kw-av-btn { margin-top: -30px; }
.kw-mini-body .kw-av { box-shadow: 0 0 0 3px var(--kw-card); }
.kw-mini-body .kw-av.otw { box-shadow: 0 0 0 3px var(--kw-card), 0 0 0 5px #22c55e; }
.kw-mini-name { border: 0; background: none; padding: 0; margin-top: 4px; font-size: 15.5px; font-weight: 750; letter-spacing: -.015em; color: var(--kw-ink) !important; }
@media (hover: hover) { .kw-mini-name:hover { text-decoration: underline; } }
.kw-mini-head { font-size: 12px; color: var(--kw-mute); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kw-mini-stats { border-top: 1px solid var(--kw-line); padding: 6px 0; }
.kw-mini-stats button, .kw-mini-strength { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; border: 0; background: none; font-size: 12.5px; color: var(--kw-mute) !important; font-weight: 600; transition: background .15s; }
.kw-mini-stats b { color: var(--kw-pri); font-weight: 750; }
.kw-mini-strength { flex-direction: column; align-items: stretch; border-top: 1px solid var(--kw-line); padding: 12px 14px 14px; }
.kw-mini-strength > span:first-child { display: flex; justify-content: space-between; }
.kw-mini-strength b { color: var(--kw-ink); }
@media (hover: hover) { .kw-mini-stats button:hover, .kw-mini-strength:hover { background: var(--kw-hover); } }
.kw-bar { display: block; height: 7px; border-radius: 999px; background: #e6ebf0; overflow: hidden; }
.kw-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--kw-pri), #2dd4bf); transition: width .6s var(--kw-ease); }
.kw-side { padding: 14px; }
.kw-side-h { font-size: 15px; font-weight: 750; letter-spacing: -.015em; margin-bottom: 6px; }
.kw-side-person { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.kw-side-person p { font-size: 12px; color: var(--kw-mute); }
.kw-side-person .kw-link-name { font-size: 13.5px; }
.kw-side-more { width: 100%; margin-top: 4px; min-height: 40px; border: 0; background: none; border-radius: 10px; font-size: 13px; font-weight: 650; color: var(--kw-mute) !important; transition: background .15s, color .15s; }
@media (hover: hover) { .kw-side-more:hover { background: var(--kw-hover); color: var(--kw-ink) !important; } }
.kw-news { list-style: none; margin: 0; padding: 0; }
.kw-news li { position: relative; padding: 8px 0 8px 14px; }
.kw-news li::before { content: ""; position: absolute; left: 0; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--kw-ink-2); }
.kw-news b { display: block; font-size: 13px; font-weight: 650; line-height: 1.35; }
.kw-news span { font-size: 11.5px; color: var(--kw-mute); }
.kw-foot { font-size: 11.5px; color: var(--kw-mute); text-align: center; padding: 4px; }

/* ---------- My Network ---------- */
.kw-net-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px; }
.kw-net-stats div { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 12px; }
.kw-net-stats div + div { border-left: 1px solid var(--kw-line); border-radius: 0; }
.kw-net-stats b { font-size: 22px; font-weight: 800; letter-spacing: -.03em; color: var(--kw-ink); }
.kw-net-stats span { font-size: 12px; color: var(--kw-mute); font-weight: 600; }
.kw-invite { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--kw-line); overflow: hidden; transition: height .32s var(--kw-ease), padding .32s var(--kw-ease), opacity .25s, transform .32s var(--kw-ease), background .2s; }
.kw-sec-head + .kw-invite { border-top: 0; padding-top: 6px; }
.kw-invite.accepted { background: linear-gradient(90deg, var(--kw-green-soft), transparent); }
.kw-invite.kw-collapsing { height: 0 !important; padding-top: 0; padding-bottom: 0; opacity: 0; transform: translateX(24px); }
.kw-invite.ignored.kw-collapsing { transform: translateX(-24px); }
.kw-note { margin-top: 8px; padding: 8px 12px; font-size: 13px; line-height: 1.5; color: var(--kw-ink-2); background: #f6f8fa; border-left: 3px solid var(--kw-pri); border-radius: 4px 10px 10px 4px; font-style: italic; overflow-wrap: anywhere; }
.kw-invite-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.kw-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--kw-line); }
.kw-sec-head + .kw-row { border-top: 0; }
.kw-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kw-person { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 12px 14px; text-align: center; transition: transform .2s var(--kw-ease), box-shadow .2s; }
.kw-person-banner { align-self: stretch; height: 52px; margin: 0 -12px; }
.kw-person .kw-av-btn { margin-top: -30px; }
.kw-person .kw-av { box-shadow: 0 0 0 3px var(--kw-card); }
.kw-person .kw-av.otw { box-shadow: 0 0 0 3px var(--kw-card), 0 0 0 5px #22c55e; }
.kw-person .kw-link-name { margin-top: 4px; }
.kw-person .kw-headline { min-height: 35px; font-size: 12px; }
.kw-mutual { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; color: var(--kw-mute); min-height: 22px; margin-bottom: 6px; max-width: 100%; overflow: hidden; white-space: nowrap; }
.kw-mutual .kw-ic { width: 13px; height: 13px; }
.kw-person .kw-btn { width: 100%; margin-top: auto; }
@media (hover: hover) { .kw-person:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 27, 45, .1); } }

/* ---------- Jobs ---------- */
.kw-jobs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.kw-search { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 6px 0 14px; border: 1px solid #d5dde6; border-radius: 14px; background: var(--kw-card); box-shadow: var(--kw-shadow); transition: border-color .15s, box-shadow .15s; }
.kw-search:focus-within { border-color: var(--kw-pri); box-shadow: 0 0 0 3px rgba(14, 124, 134, .15); }
.kw-search > .kw-ic { color: var(--kw-mute); width: 19px; height: 19px; }
.kw-search input { flex: 1; min-width: 0; height: 46px; border: 0; outline: none; background: transparent; font-size: 15px; }
.kw-search-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--kw-hover); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.kw-search-x .kw-ic { width: 15px; height: 15px; }
.kw-chips { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin-left: -2px; margin-right: -2px; }
.kw-chips::-webkit-scrollbar { display: none; }
.kw-chip { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid #d5dde6; background: var(--kw-card); font-size: 13px; font-weight: 650; color: var(--kw-ink-2) !important; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .12s var(--kw-ease); }
.kw-chip .kw-ic { width: 15px; height: 15px; }
.kw-chip:active { transform: scale(.96); }
.kw-chip.on { background: var(--kw-ink); border-color: var(--kw-ink); color: #fff !important; }
.kw-chip.on .kw-ic { fill: currentColor; }
@media (hover: hover) { .kw-chip:not(.on):hover { border-color: var(--kw-pri); color: var(--kw-pri) !important; } }
.kw-result { margin: 14px 2px 8px; font-size: 12.5px; font-weight: 650; color: var(--kw-mute); }
.kw-job-list { display: grid; gap: 10px; }
.kw-job { display: flex; align-items: flex-start; gap: 12px; padding: 14px 8px 14px 14px; cursor: pointer; transition: border-color .15s, box-shadow .2s, transform .2s var(--kw-ease); outline: none; }
.kw-job:active { transform: scale(.99); }
.kw-job.sel { border-color: var(--kw-pri); box-shadow: 0 0 0 1.5px var(--kw-pri), var(--kw-shadow); }
.kw-job:focus-visible { outline: 2.5px solid var(--kw-pri); outline-offset: 2px; }
@media (hover: hover) { .kw-job:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15, 27, 45, .09); } .kw-job:hover .kw-job-title { color: var(--kw-pri); } }
.kw-job-title { display: block; font-size: 15px; font-weight: 750; letter-spacing: -.01em; line-height: 1.3; transition: color .15s; }
.kw-job-co { font-size: 13px; color: var(--kw-ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-job-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.kw-tag { font-size: 11.5px; font-weight: 650; padding: 3px 8px; border-radius: 7px; background: var(--kw-hover); color: var(--kw-ink-2); white-space: nowrap; }
.kw-tag.mode-remote { background: var(--kw-green-soft); color: var(--kw-green); }
.kw-tag.mode-hybrid { background: #eef0ff; color: #4338ca; }
.kw-tag.mode-on-site { background: var(--kw-amber-soft); color: #9a5b00; }
.kw-tag.cash { background: var(--kw-pri-soft); color: var(--kw-pri-h); }
.kw-applied { display: inline-flex; align-items: center; gap: 3px; color: var(--kw-green); font-weight: 700; }
.kw-applied .kw-ic { width: 13px; height: 13px; stroke-width: 3; }
.kw-save { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: none; color: var(--kw-mute); display: inline-flex; align-items: center; justify-content: center; padding: 0; margin-top: -6px; transition: color .15s, background .15s, transform .12s var(--kw-ease); }
.kw-save .kw-ic { width: 21px; height: 21px; transition: fill .15s; }
.kw-save.on { color: var(--kw-pri); }
.kw-save.on .kw-ic { fill: currentColor; animation: kwBounce .45s var(--kw-ease); }
.kw-save:active { transform: scale(.88); }
@media (hover: hover) { .kw-save:hover { background: var(--kw-hover); color: var(--kw-pri); } }

.kw-jd { padding: 18px; }
.kw-back { display: inline-flex; align-items: center; gap: 4px; min-height: 38px; padding: 0 12px 0 6px; margin: -6px 0 12px -6px; border: 0; border-radius: 999px; background: none; font-size: 13.5px; font-weight: 650; color: var(--kw-ink-2) !important; transition: background .15s; }
.kw-back .kw-ic { width: 18px; height: 18px; }
@media (hover: hover) { .kw-back:hover { background: var(--kw-hover); } }
.kw-back.on-dark { position: absolute; top: 10px; left: 10px; margin: 0; color: #fff !important; background: rgba(15, 27, 45, .35); backdrop-filter: blur(6px); z-index: 1; }
.kw-jd-head { display: flex; gap: 14px; align-items: flex-start; }
.kw-jd-co { font-size: 13px; font-weight: 700; color: var(--kw-pri); }
.kw-jd-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin: 2px 0 4px; overflow-wrap: anywhere; }
.kw-jd-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 14px; }
.kw-jd-facts span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: #f6f8fa; min-width: 0; }
.kw-jd-facts .kw-ic { color: var(--kw-pri); width: 18px; height: 18px; margin-bottom: 4px; }
.kw-jd-facts b { font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.kw-jd-facts em { font-size: 11px; font-style: normal; color: var(--kw-mute); }
.kw-jd-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.kw-jd-cta > .kw-btn:first-child, .kw-applied-box { flex: 1 1 180px; }
.kw-bolt { font-size: 15px; }
.kw-applied-box { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--kw-green-soft); color: var(--kw-green); animation: kwPop .35s var(--kw-ease); }
.kw-applied-box > .kw-ic { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--kw-green); color: #fff; stroke-width: 3; }
.kw-applied-box b { display: block; font-size: 14px; }
.kw-applied-box span { font-size: 12px; color: var(--kw-ink-2); }
.kw-known { display: flex; align-items: center; margin-top: 14px; font-size: 12.5px; color: var(--kw-ink-2); }
.kw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kw-list li { display: flex; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--kw-ink-2); }
.kw-list .kw-ic { width: 18px; height: 18px; color: var(--kw-pri); margin-top: 1px; stroke-width: 2.6; }

/* ---------- Profile ---------- */
.kw-prof { overflow: hidden; }
.kw-banner { position: relative; height: 128px; }
.kw-banner-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.kw-prof-body { padding: 0 16px 16px; }
.kw-prof-av { position: relative; display: inline-flex; margin-top: -56px; margin-left: 2px; }
.kw-otw-tag { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); padding: 3px 8px; border-radius: 999px; background: #16a34a; color: #fff; font-size: 10.5px; font-weight: 800; white-space: nowrap; box-shadow: 0 0 0 2px var(--kw-card); animation: kwPop .35s var(--kw-ease); }
.kw-prof-id { margin-top: 12px; }
.kw-prof-id h1 { font-size: 23px; font-weight: 800; letter-spacing: -.035em; line-height: 1.2; overflow-wrap: anywhere; }
.kw-prof-head { font-size: 14.5px; line-height: 1.45; color: var(--kw-ink-2); margin: 4px 0 6px; overflow-wrap: anywhere; }
.kw-prof-id .kw-time { font-size: 13px; }
.kw-prof-acts { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.kw-toggle { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border: 1px solid var(--kw-line); border-radius: 14px; background: var(--kw-card); text-align: left; transition: border-color .2s, background .2s, transform .12s var(--kw-ease); }
.kw-toggle:active { transform: scale(.99); }
.kw-toggle b { display: block; font-size: 14px; }
.kw-toggle em { display: block; font-style: normal; font-size: 12px; color: var(--kw-mute); }
.kw-switch { position: relative; width: 46px; height: 28px; flex-shrink: 0; border-radius: 999px; background: #cfd7e0; transition: background .2s; }
.kw-switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--kw-ease); }
.kw-toggle.on { border-color: #86efac; background: #f3fcf6; }
.kw-toggle.on .kw-switch { background: #16a34a; }
.kw-toggle.on .kw-switch i { transform: translateX(18px); }
@media (hover: hover) { .kw-toggle:hover { border-color: #b9c4d0; } }

.kw-strength { display: flex; gap: 16px; align-items: flex-start; }
.kw-strength h2 { font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.kw-ring { position: relative; width: 84px; height: 84px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.kw-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.kw-ring circle { fill: none; stroke-width: 8; }
.kw-ring-bg { stroke: #e6ebf0; }
.kw-ring-fg { stroke: var(--kw-pri); stroke-linecap: round; transition: stroke-dashoffset 1s var(--kw-ease), stroke .3s; }
.kw-ring-fg.full { stroke: #f59e0b; }
.kw-ring b { position: relative; font-size: 19px; font-weight: 800; letter-spacing: -.03em; }
.kw-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kw-check { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 11px; border-radius: 999px; border: 1.5px dashed #c3ccd7; background: var(--kw-card); font-size: 12.5px; font-weight: 650; color: var(--kw-ink-2) !important; transition: border-color .15s, background .15s, color .15s, transform .12s var(--kw-ease); }
.kw-check .kw-ic { width: 14px; height: 14px; stroke-width: 2.6; }
.kw-check:active:not(:disabled) { transform: scale(.96); }
.kw .kw-check.done:disabled { opacity: 1; cursor: default; border: 1.5px solid transparent; background: var(--kw-green-soft); color: var(--kw-green) !important; }
@media (hover: hover) { .kw-check:not(.done):hover { border-color: var(--kw-pri); color: var(--kw-pri) !important; background: var(--kw-pri-soft); } }

.kw-inline { display: grid; gap: 8px; margin-bottom: 8px; animation: kwFade .25s var(--kw-ease); }
.kw-prof-body .kw-inline { margin-top: 12px; }
.kw-label { font-size: 12.5px; font-weight: 700; color: var(--kw-ink-2); margin-top: 4px; }
.kw-input { width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid #d5dde6; border-radius: 12px; background: var(--kw-card); font: inherit; font-size: 15px; color: var(--kw-ink); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.kw-input { resize: vertical; line-height: 1.5; }
.kw-input:focus-visible, .kw-cinput input:focus-visible, .kw-search input:focus-visible, .kw-row-form .kw-input:focus-visible { outline: none; }
.kw-input:focus { border-color: var(--kw-pri); box-shadow: 0 0 0 3px rgba(14, 124, 134, .15); }
.kw-input::placeholder { color: #98a4b3; }
.kw-inline-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.kw-row-form { display: flex; align-items: center; gap: 8px; }
.kw-row-form .kw-input { flex: 1; min-width: 0; }
.kw-exp { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--kw-line); }
.kw-sec-head + .kw-exp { border-top: 0; padding-top: 4px; }
.kw-exp-logo { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--g); color: #fff; font-weight: 800; font-size: 19px; }
.kw-exp b { font-size: 14.5px; }
.kw-exp p { font-size: 13.5px; color: var(--kw-ink-2); }
.kw-skill { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--kw-line); }
.kw-sec-head + .kw-skill { border-top: 0; padding-top: 4px; }
.kw-skill b { font-size: 14.5px; }
.kw-endorse { position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--kw-pri); background: var(--kw-card); color: var(--kw-pri) !important; font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .15s, transform .12s var(--kw-ease); }
.kw-endorse .kw-ic { width: 15px; height: 15px; stroke-width: 2.6; }
.kw-endorse.on { background: var(--kw-pri-soft); border-color: transparent; }
.kw-endorse:active { transform: scale(.95); }
@media (hover: hover) { .kw-endorse:hover { background: var(--kw-pri-soft); } }
.kw-plus1 { position: absolute; right: 10px; top: -4px; font-size: 15px; font-weight: 800; color: var(--kw-pri); pointer-events: none; animation: kwPlus .9s var(--kw-ease) forwards; }
.kw-activity { width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 10px; margin: 0 -10px; width: calc(100% + 20px); border: 0; background: none; text-align: left; border-radius: 12px; font-size: 13.5px; line-height: 1.45; color: var(--kw-ink) !important; transition: background .15s; }
.kw-activity .grow { display: flex; flex-direction: column; gap: 2px; }
.kw-act-kind { width: 38px; height: 38px; border-radius: 12px; background: var(--kw-hover); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
@media (hover: hover) { .kw-activity:hover { background: var(--kw-hover); } }
.kw-act-new { margin-top: 8px; }

/* ---------- Bottom sheet (inside the phone frame in device preview, a dialog on desktop) ---------- */
.kw-sheet-host { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.kw-sheet-host.in-device { position: absolute; border-radius: inherit; overflow: hidden; }
.kw-backdrop { position: absolute; inset: 0; background: rgba(15, 27, 45, .45); opacity: 0; transition: opacity .28s; backdrop-filter: blur(2px); }
.kw-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 92%; overflow-y: auto; overscroll-behavior: contain; background: var(--kw-card); border-radius: 26px 26px 0 0; padding: 0 18px 22px; transform: translateY(100%); transition: transform .34s var(--kw-ease); box-shadow: 0 -12px 40px rgba(15, 27, 45, .2); }
.kw-sheet-host.in-device .kw-sheet { padding-bottom: 34px; }
.kw-sheet-host.open { pointer-events: auto; }
.kw-sheet-host.open .kw-backdrop { opacity: 1; }
.kw-sheet-host.open .kw-sheet { transform: none; }
.kw-grab { display: flex; justify-content: center; padding: 10px 0 8px; }
.kw-grab i { width: 40px; height: 5px; border-radius: 999px; background: #d5dde6; }
.kw-form { display: flex; flex-direction: column; gap: 12px; }
.kw-sheet-head { display: flex; align-items: center; gap: 10px; }
.kw-sheet-head b { display: block; font-size: 15.5px; letter-spacing: -.01em; }
.kw-sheet-head .kw-time { margin: 0; }
.kw-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kw-kinds button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; border: 1.5px solid var(--kw-line); border-radius: 14px; background: var(--kw-card); font-size: 12px; font-weight: 700; color: var(--kw-ink-2); transition: border-color .15s, background .15s, color .15s, transform .12s var(--kw-ease); }
.kw-kinds button span { font-size: 21px; transition: transform .25s var(--kw-ease); }
.kw-kinds button.on { border-color: var(--kw-pri); background: var(--kw-pri-soft); color: var(--kw-pri-h); }
.kw-kinds button.on span { transform: scale(1.15); }
.kw-kinds button:active { transform: scale(.96); }
@media (hover: hover) { .kw-kinds button:not(.on):hover { border-color: #b9c4d0; } }
.kw-kind-note { padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; background: var(--kw-amber-soft); color: #7a4a00; animation: kwFade .25s var(--kw-ease); }
.kw-compose-text { min-height: 130px; font-size: 15.5px; }
.kw-article-fields { display: grid; gap: 8px; }
.kw-compose-photo { position: relative; margin: 0; border-radius: 14px; }
.kw-compose-photo img { max-height: 240px; }
.kw-round.on-photo { position: absolute; top: 8px; right: 8px; background: rgba(15, 27, 45, .6); color: #fff; border: 0; }
.kw-compose-bar { display: flex; align-items: center; gap: 10px; padding-top: 4px; border-top: 1px solid var(--kw-line); padding-top: 12px; }
.kw-compose-bar label .kw-ic { color: #2f80ed; }
.kw-counter { font-size: 12px; color: var(--kw-mute); font-variant-numeric: tabular-nums; }
.kw-compose-bar .kw-btn { min-width: 96px; }

.kw-progress { height: 6px; border-radius: 999px; background: #e6ebf0; overflow: hidden; }
.kw-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--kw-pri), #2dd4bf); transition: width .4s var(--kw-ease); }
.kw-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.kw-steps span { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; color: var(--kw-mute); }
.kw-steps b, .kw-steps .kw-ic { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; border: 1.5px solid #d5dde6; background: var(--kw-card); transition: background .2s, border-color .2s, color .2s; }
.kw-steps .kw-ic { padding: 4px; background: var(--kw-green); border-color: var(--kw-green); color: #fff; stroke-width: 3; }
.kw-steps span.on { color: var(--kw-ink); }
.kw-steps span.on b { background: var(--kw-pri); border-color: var(--kw-pri); color: #fff; box-shadow: 0 0 0 4px var(--kw-pri-soft); }
.kw-steps span.done { color: var(--kw-green); }
.kw-step-body { display: flex; flex-direction: column; gap: 8px; min-height: 230px; }
.kw-apply-me { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #f6f8fa; }
.kw-apply-me > div { min-width: 0; }
.kw-apply-me b { display: block; font-size: 14.5px; }
.kw-apply-me .kw-headline { display: block; }
.kw-resumes { display: grid; gap: 8px; }
.kw-resume { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid var(--kw-line); border-radius: 14px; background: var(--kw-card); text-align: left; transition: border-color .15s, background .15s, transform .12s var(--kw-ease); }
.kw-resume:active { transform: scale(.99); }
.kw-resume.on { border-color: var(--kw-pri); background: var(--kw-pri-soft); }
.kw-resume b { display: block; font-size: 13.5px; }
.kw-resume .kw-time { margin: 0; }
.kw-pdf { width: 40px; height: 48px; flex-shrink: 0; border-radius: 8px; background: #fee2e2; color: #b91c1c; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.kw-radio { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 2px solid #c3ccd7; background: var(--kw-card); transition: border-color .15s, box-shadow .15s, background .15s; }
.kw-resume.on .kw-radio { border-color: var(--kw-pri); background: var(--kw-pri); box-shadow: inset 0 0 0 4px #fff; }
@media (hover: hover) { .kw-resume:not(.on):hover { border-color: #b9c4d0; } }
.kw-step-body .kw-chips { margin-top: 0; flex-wrap: wrap; }
.kw-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--kw-hover); }
.kw-seg button { min-height: 44px; border: 0; border-radius: 10px; background: none; font-size: 13px; font-weight: 650; color: var(--kw-ink-2); transition: background .15s, box-shadow .15s, color .15s; }
.kw-seg button.on { background: var(--kw-card); color: var(--kw-ink); box-shadow: var(--kw-shadow); }
.kw-review { margin: 0; }
.kw-review > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 12px 0; border-bottom: 1px solid var(--kw-line); }
.kw-review dt { font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--kw-mute); }
.kw-review dd { grid-column: 1; margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.kw-review button { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--kw-pri) !important; font-weight: 700; font-size: 13px; }
@media (hover: hover) { .kw-review button:hover { background: var(--kw-pri-soft); } }
.kw-apply-bar { display: flex; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--kw-line); }
.kw-apply-bar .kw-btn:last-child { min-width: 150px; min-height: 48px; }
.kw-success { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 8px 8px; text-align: center; }
.kw-success .kw-btn { position: relative; z-index: 1; }
.kw-success-ico { position: relative; width: 76px; height: 76px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; box-shadow: 0 10px 28px rgba(21, 128, 61, .35); animation: kwPop .5s var(--kw-ease); }
.kw-success-ico .kw-ic { width: 38px; height: 38px; stroke-width: 3; }
.kw-success h2 { position: relative; font-size: 23px; font-weight: 800; letter-spacing: -.03em; margin-top: 8px; }
.kw-success p { position: relative; font-size: 14px; line-height: 1.55; color: var(--kw-ink-2); max-width: 320px; margin-bottom: 14px; }
.kw-conf.big i { top: -14px; bottom: auto; left: calc(3% + var(--k) * 6.8%); opacity: 0; animation: kwFall 1.6s cubic-bezier(.3, .6, .5, 1) forwards; animation-delay: calc(var(--k) * 55ms); }
.kw-thread { display: flex; flex-direction: column; gap: 6px; max-height: 300px; min-height: 120px; overflow-y: auto; padding: 8px 2px; }
.kw-msg { align-self: flex-start; max-width: 82%; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--kw-hover); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; animation: kwUp .25s var(--kw-ease); }
.kw-msg.mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--kw-pri); color: #fff; }
.kw-msg span { display: block; margin-top: 2px; font-size: 10.5px; opacity: .7; }
@media (min-width: 700px) {
  .kw-sheet-host:not(.in-device) .kw-sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: 540px; max-height: 88vh; border-radius: 24px; padding-bottom: 22px; transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .28s var(--kw-ease), opacity .2s; }
  .kw-sheet-host.open:not(.in-device) .kw-sheet { transform: translate(-50%, -50%); opacity: 1; }
  .kw-sheet-host:not(.in-device) .kw-grab { visibility: hidden; padding: 6px 0; }
}

/* ---------- Motion ---------- */
@keyframes kwUp { from { opacity: 0; transform: translateY(14px); } }
@keyframes kwFade { from { opacity: 0; transform: translateY(4px); } }
@keyframes kwPop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes kwBounce { 0% { transform: scale(1); } 30% { transform: scale(1.45) rotate(-10deg); } 60% { transform: scale(.9); } 100% { transform: scale(1); } }
@keyframes kwBurst { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.6); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1.5); } }
@keyframes kwPlus { 0% { opacity: 0; transform: translateY(6px) scale(.7); } 25% { opacity: 1; transform: translateY(-6px) scale(1.15); } 100% { opacity: 0; transform: translateY(-30px) scale(1); } }
@keyframes kwShimmer { to { background-position: -200% 0; } }
@keyframes kwFall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(330px) rotate(calc(var(--k) * 70deg + 200deg)); } }
@keyframes kwSlide { from { opacity: 0; transform: translateX(22px); } }
@media (prefers-reduced-motion: no-preference) {
  .kw-enter { animation: kwUp .45s var(--kw-ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
  .kw-view-in { animation: kwFade .3s var(--kw-ease); }
  .kw-step-in { animation: kwSlide .3s var(--kw-ease); }
}
@media (prefers-reduced-motion: reduce) {
  .kw *, .kw-sheet-host * { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ---------- Tablet / desktop layouts (container queries on the demo's real width) ---------- */
@container site (min-width: 640px) {
  .kw-nav { display: none; }
  .kw-top-in { padding: 6px 20px; gap: 16px; }
  .kw-topnav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
  .kw-persona { margin-left: 0; }
  .kw-topnav .kw-nav-btn { min-width: 70px; min-height: 52px; padding: 0 6px; }
  .kw-topnav .kw-nav-btn::before { top: auto; bottom: -6px; border-radius: 3px 3px 0 0; width: 100%; }
  .kw-topnav .kw-nav-lbl { font-size: 11.5px; }
  .kw-topnav .kw-nav-post { margin: 0 6px; }
  .kw-topnav .kw-nav-post span { width: auto; height: 38px; padding: 0 14px 0 10px; border-radius: 999px; gap: 4px; font-size: 13.5px; font-weight: 700; box-shadow: 0 4px 12px rgba(14, 124, 134, .3); }
  .kw-topnav .kw-nav-post span .kw-ic { width: 18px; height: 18px; }
  .kw-body { grid-template-columns: 210px minmax(0, 1fr); padding: 18px 20px 28px; gap: 16px; }
  .kw-left { display: block; position: sticky; top: 80px; }
  .kw-people { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kw.tab-jobs .kw-body { grid-template-columns: minmax(0, 1fr); }
  .kw.tab-jobs .kw-left { display: none; }
  .kw-jobs { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .kw-jobs-detail { position: sticky; top: 80px; }
  .kw-sec { padding: 18px 20px; }
  .kw-post { padding: 16px 18px 4px; }
  .kw-ribbon { margin: -16px -18px 12px; padding: 9px 18px; }
  .kw-photo { margin: 0 -18px 12px; }
  .kw-compose-photo { margin: 0; }
}
@container site (min-width: 640px) and (max-width: 779px) {
  .kw-persona-lbl { display: none; }
  .kw-topnav .kw-nav-btn { min-width: 58px; }
}
@container site (min-width: 820px) {
  .kw-body { grid-template-columns: 182px minmax(0, 1fr) 222px; gap: 12px; padding: 16px 12px 28px; }
  .kw-right { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 80px; }
  .kw.tab-jobs .kw-right { display: none; }
  .kw-people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container site (min-width: 1040px) {
  .kw-body { grid-template-columns: 225px minmax(0, 1fr) 290px; gap: 20px; padding: 22px 24px 32px; }
  .kw-people { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kw.tab-jobs .kw-body { grid-template-columns: 225px minmax(0, 1fr); }
  .kw.tab-jobs .kw-left { display: block; }
}

/* Single-column grids never grow past their container (long one-line headlines would otherwise widen them). */
.kw-feed, .kw-stack-v, .kw-job-list, .kw-resumes, .kw-article-fields, .kw-inline, .kw-list { grid-template-columns: minmax(0, 1fr); }
.kw-card, .kw-main > *, .kw-jobs > * { min-width: 0; }

/* Keep the shared toast above the bottom tab bar inside the phone frame, and let taps pass through it. */
html[data-device="mobile"] .leaf-device:has(.kw) > .leaf-toast { bottom: 98px; }
.leaf-device:has(.kw) > .leaf-toast, body:has(.kw) > .leaf-toast { pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
