/* Keerki Chat Bridge — one stylesheet for the public site, sign-in and factory workspace.
   Logical properties (inline-start/end) keep Arabic right-to-left layouts correct. */

:root {
  --brand: #0E5E4F;
  --brand-600: color-mix(in srgb, var(--brand) 88%, black);
  --brand-50: color-mix(in srgb, var(--brand) 7%, white);
  --brand-100: color-mix(in srgb, var(--brand) 14%, white);
  --ink: #14211D;
  --ink-2: #33403B;
  --ink-3: #5F6B66;
  --paper: #FAF7F1;
  --paper-2: #F2EDE3;
  --rule: rgba(20, 33, 29, .09);
  --rule-strong: rgba(20, 33, 29, .16);
  --seal: #C23B22;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", "Amiri", "Noto Naskh Arabic", "Times New Roman", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --hand: "Bradley Hand", "Segoe Print", "Kaiti SC", "STKaiti", "KaiTi", "Noteworthy", "Comic Neue", cursive;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.13 0 0 0 0 0.11 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --muted: #6B746F;
  --line: #E4E0D6;
  --line-2: #EFEBE3;
  --bg: #FFFFFF;
  --bg-soft: #F6F3EC;
  --bg-chat: #F1EEE6;
  --danger: #DC2626;
  --danger-50: #FEF2F2;
  --warn: #B45309;
  --warn-50: #FFFBEB;
  --ok: #15803D;
  --ok-50: #F0FDF4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans Arabic", "Geeza Pro", Tahoma, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 15px; -webkit-font-smoothing: antialiased; }
html[dir="rtl"] body { line-height: 1.75; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; flex-shrink: 0; }
.flip-rtl { }
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* ───── Buttons & form controls ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none !important; transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap; line-height: 1.3; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-soft { background: var(--brand-50); color: var(--brand); }
.btn-soft:hover { background: var(--brand-100); }
.btn-danger { background: var(--danger-50); color: var(--danger); }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--bg-soft); }

.field { margin-bottom: 16px; }
.label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.input, .select, .textarea { width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.textarea { resize: vertical; min-height: 90px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 5px; }
.error-text { font-size: 13px; color: var(--danger); margin-top: 5px; }
.checkbox { display: flex; gap: 8px; align-items: center; font-size: 14px; }

/* "!" help tip (click, not hover — works on phones) */
.tip { position: relative; display: inline-flex; }
.tip-btn { width: 18px; height: 18px; border-radius: 999px; border: 0; background: var(--line-2); color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; line-height: 18px; padding: 0; }
.tip-body { position: absolute; z-index: 30; inset-inline-start: -8px; top: 26px; width: 240px; background: var(--ink); color: #fff; font-weight: 400; font-size: 13px; padding: 10px 12px; border-radius: 10px; box-shadow: var(--shadow-lg); }

/* ───── Alerts, badges, cards ───── */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: var(--danger-50); color: #991B1B; }
.alert-ok { background: var(--ok-50); color: #166534; }
.alert-warn { background: var(--warn-50); color: #92400E; }
.alert-info { background: var(--brand-50); color: var(--brand-600); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; font-size: 12px; font-weight: 600; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-50); color: var(--ok); }
.badge-warn { background: var(--warn-50); color: var(--warn); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-brand { background: var(--brand-50); color: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: 99px; background: currentColor; display: inline-block; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; }

/* ───── Toast ───── */
.toasts { position: fixed; z-index: 100; bottom: 20px; inset-inline-end: 20px; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 40px); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.toast.is-error { background: var(--danger); }

/* ───── Public site ───── */
/* Paper, ink and a vermilion seal: warm editorial look, still calm and easy to read. */
.site { background-color: var(--paper); background-image: var(--grain); color: var(--ink); }
.serif { font-family: var(--serif); font-weight: 600; letter-spacing: -.015em; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }
.announcement { background: var(--ink); color: #F5F1E8; text-align: center; font-size: 14px; padding: 9px 16px; }
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 82%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--rule); }
.site-header .bar { display: flex; align-items: center; gap: 20px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16.5px; color: var(--ink); text-decoration: none !important; letter-spacing: -.01em; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px 10px 10px 3px; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
html[dir="rtl"] .logo-mark { border-radius: 10px 10px 3px 10px; }
.logo img { height: 34px; width: auto; }
.nav { display: none; gap: 2px; margin-inline-start: 18px; }
.nav a { color: var(--ink-2); font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.nav a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.header-actions .btn-ghost { display: none; }
@media (min-width: 900px) { .nav { display: flex; } .header-actions .btn-ghost { display: inline-flex; } }
.site .btn { border-radius: 10px; }
.site .btn-ghost { border-color: var(--rule-strong); background: transparent; }
.site .btn-ghost:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.site .btn-primary { background: var(--ink); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 18px rgba(20,33,29,.18); }
.site .btn-primary:hover { background: var(--brand); }
.lang-switch { position: relative; }
.lang-menu { position: absolute; top: 44px; inset-inline-end: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 150px; z-index: 50; }
.lang-menu a { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 8px; color: var(--ink); font-size: 14px; text-decoration: none; }
.lang-menu a:hover, .lang-menu a.is-active { background: var(--brand-50); }
.mobile-menu { border-top: 1px solid var(--rule); padding: 10px 0 16px; }
.mobile-menu a { display: block; padding: 10px 4px; color: var(--ink); font-weight: 500; }
@media (min-width: 900px) { .mobile-menu, .menu-toggle { display: none !important; } }

.section { padding: 76px 0; position: relative; }
@media (min-width: 900px) { .section { padding: 112px 0; } }
.section-muted { background: color-mix(in srgb, var(--paper-2) 75%, transparent); border-block: 1px solid var(--rule); }
.kicker { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); margin-bottom: 18px; }
.kicker::after { content: ""; height: 1px; width: 48px; background: currentColor; opacity: .5; }
.section-head { max-width: 760px; margin: 0 0 52px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .kicker { justify-content: center; }
.section-head.center .kicker::before { content: ""; height: 1px; width: 48px; background: currentColor; opacity: .5; }
.section-head h2 { font-family: var(--serif); font-size: clamp(30px, 4.4vw, 48px); font-weight: 600; letter-spacing: -.02em; line-height: 1.12; }
html[lang="zh"] .section-head h2, html[lang="ar"] .section-head h2 { letter-spacing: 0; line-height: 1.35; }
.section-head p { color: var(--ink-3); font-size: 18px; max-width: 620px; }
.section-head.center p { margin-inline: auto; }

/* Hero */
.hero { position: relative; padding: 56px 0 40px; overflow: hidden; }
@media (min-width: 980px) { .hero { padding: 88px 0 64px; } }
.hero-grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 1020px) { .hero-grid { grid-template-columns: 1fr 1.02fr; gap: 40px; } }
.hero-tag { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); padding: 6px 14px 6px 6px; border: 1px solid var(--rule-strong); border-radius: 999px; background: color-mix(in srgb, #fff 55%, transparent); margin-bottom: 26px; }
html[dir="rtl"] .hero-tag { padding: 6px 6px 6px 14px; }
.hero-tag b { background: var(--brand); color: #fff; font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; letter-spacing: .04em; }
.hero h1 { font-family: var(--serif); font-size: clamp(36px, 5.6vw, 66px); font-weight: 600; letter-spacing: -.028em; line-height: 1.06; margin-bottom: 24px; }
html[lang="zh"] .hero h1 { letter-spacing: .01em; line-height: 1.28; font-size: clamp(34px, 5vw, 58px); }
html[lang="ar"] .hero h1 { letter-spacing: 0; line-height: 1.4; font-size: clamp(32px, 4.6vw, 54px); }
.scribble { position: relative; white-space: nowrap; color: var(--brand); }
.scribble svg { position: absolute; inset-inline-start: -2%; bottom: -.18em; width: 104%; height: .42em; overflow: visible; }
.scribble path { fill: none; stroke: var(--seal); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw 1.1s .5s cubic-bezier(.6,.1,.2,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero p.lead { font-size: clamp(16.5px, 1.6vw, 19px); color: var(--ink-2); max-width: 540px; margin-bottom: 32px; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { display: flex; align-items: center; gap: 10px; margin-top: 30px; color: var(--ink-3); font-size: 13.5px; }
.hero-note .faces { display: flex; }
.hero-note .faces span { width: 28px; height: 28px; border-radius: 99px; border: 2px solid var(--paper); margin-inline-start: -8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.hero-note .faces span:first-child { margin-inline-start: 0; }

/* Hero composition: customer phone overlapping the factory window */
.stage { position: relative; min-height: 470px; max-width: 600px; margin: 0 auto; width: 100%; }
@media (max-width: 560px) { .stage { min-height: 560px; } }
.win { position: absolute; inset-inline-end: 0; top: 0; width: 86%; background: #fff; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 30px 60px -20px rgba(20,33,29,.28), 0 2px 6px rgba(20,33,29,.06); overflow: hidden; transform: rotate(1.2deg); }
html[dir="rtl"] .win { transform: rotate(-1.2deg); }
.win-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); background: #FBFAF7; }
.win-bar i { width: 9px; height: 9px; border-radius: 99px; background: #E3DED3; display: block; }
.win-bar span { margin-inline-start: 10px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.win-body { display: grid; grid-template-columns: 130px 1fr; min-height: 300px; }
.win-list { border-inline-end: 1px solid var(--line-2); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.win-list div { padding: 8px; border-radius: 8px; font-size: 11.5px; line-height: 1.35; color: var(--ink-3); }
.win-list div b { display: block; color: var(--ink); font-size: 12px; }
.win-list div.on { background: var(--brand-50); }
.win-chat { background: var(--bg-chat); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.win-chat .bubble { font-size: 12.5px; max-width: 92%; }
.win-chat .bubble .tr { font-size: 11.5px; }
.mini-composer { margin-top: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mini-composer em { font-style: normal; background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 7px; }
.handset { position: absolute; inset-inline-start: 0; bottom: 0; width: 230px; background: #111; border-radius: 30px; padding: 7px; box-shadow: 0 30px 60px -18px rgba(20,33,29,.45); transform: rotate(-4deg); z-index: 3; }
html[dir="rtl"] .handset { transform: rotate(4deg); }
.handset-screen { background: #EFE7DE; border-radius: 24px; overflow: hidden; }
.handset-top { background: #075E54; color: #fff; padding: 12px 12px 10px; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.handset-top .avatar { width: 26px; height: 26px; font-size: 11px; background: #fff3; color: #fff; }
.handset-body { padding: 10px 8px 14px; display: flex; flex-direction: column; gap: 6px; min-height: 230px; }
.wa { font-size: 12px; line-height: 1.45; padding: 6px 9px 4px; border-radius: 9px; max-width: 88%; box-shadow: 0 1px .5px rgba(0,0,0,.13); }
.wa-out { align-self: flex-end; background: #D9FDD3; }
.wa-in { align-self: flex-start; background: #fff; }
.wa small { display: block; text-align: end; font-size: 9.5px; color: #667781; margin-top: 2px; }
.wa small b { color: #53BDEB; font-weight: 400; }
.sticker { position: absolute; z-index: 4; background: #FFF9E8; border: 1px solid #EBDDB2; box-shadow: 0 10px 24px -10px rgba(120,90,20,.35); padding: 10px 12px; border-radius: 4px; font-size: 12px; color: #5A4A1E; transform: rotate(2.5deg); }
.sticker .mono { display: block; font-size: 12.5px; color: var(--ink); margin-top: 4px; }
.sticker .mono b { background: #FDE68A; padding: 0 3px; font-weight: 600; }
.sticker-lock { top: 46%; inset-inline-end: -6px; }
@media (max-width: 560px) { .sticker-lock { top: auto; bottom: 230px; inset-inline-end: 0; } }
.seal { position: absolute; z-index: 5; width: 82px; height: 82px; border: 3px solid var(--seal); color: var(--seal); border-radius: 8px; display: grid; place-items: center; text-align: center; font-family: var(--serif); font-weight: 700; font-size: 17px; line-height: 1.15; letter-spacing: .08em; transform: rotate(-9deg); background: color-mix(in srgb, var(--paper) 40%, transparent); mix-blend-mode: multiply; opacity: .92; }
.seal::before { content: ""; position: absolute; inset: 4px; border: 1px solid currentColor; border-radius: 4px; opacity: .6; }
.seal small { display: block; font-family: var(--mono); font-size: 7.5px; letter-spacing: .08em; font-weight: 600; margin-top: 3px; }
.hero .seal { bottom: 34px; inset-inline-end: 22%; }
.arrow-note { position: absolute; z-index: 4; font-family: var(--hand); font-size: 16px; color: var(--ink-2); display: flex; align-items: flex-end; gap: 6px; }
.arrow-note svg { width: 60px; height: 40px; fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-linecap: round; }
.hero .arrow-note { top: -30px; inset-inline-start: 4%; }
@media (max-width: 1019px) { .hero .arrow-note { display: none; } }

/* Trade route strip */
.route { border-block: 1px solid var(--rule); background: color-mix(in srgb, #fff 45%, transparent); }
.route-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; padding: 22px 0; }
.ports { display: flex; align-items: center; flex: 1; min-width: 280px; gap: 0; }
.port { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.port i { width: 10px; height: 10px; border-radius: 99px; border: 2px solid var(--brand); background: var(--paper); display: block; }
.port.origin i { background: var(--brand); }
.port span { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.port small { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.leg { flex: 1; height: 2px; min-width: 18px; margin: 0 6px 30px; background-image: linear-gradient(90deg, var(--brand) 50%, transparent 50%); background-size: 8px 2px; opacity: .55; }
.clocks { display: flex; gap: 22px; }
.clock { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.clock b { display: block; font-size: 20px; color: var(--ink); font-weight: 500; letter-spacing: -.02em; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--rule); }
@media (min-width: 900px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.fact { padding: 22px 20px; border-inline-end: 1px solid var(--rule); }
.fact:last-child { border-inline-end: 0; }
.fact strong { display: block; font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.fact span { color: var(--ink-3); font-size: 13.5px; }

/* Steps: editorial numbered columns */
.steps { display: grid; gap: 0; border-top: 1px solid var(--rule-strong); }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 28px 0 8px; position: relative; }
@media (min-width: 900px) { .step { padding: 30px 32px 8px 0; } html[dir="rtl"] .step { padding: 30px 0 8px 32px; } .step + .step { padding-inline-start: 32px; border-inline-start: 1px solid var(--rule); } }
.step-num { font-family: var(--serif); font-size: 56px; line-height: 1; color: var(--brand); font-weight: 500; margin-bottom: 18px; display: block; font-feature-settings: "lnum"; }
.step h3 { font-size: 19px; font-weight: 650; }
.step p { color: var(--ink-3); margin: 0; }
.step .mono { display: inline-block; margin-top: 14px; color: var(--ink-3); background: color-mix(in srgb, var(--ink) 5%, transparent); padding: 3px 8px; border-radius: 6px; }

/* Bento features */
.bento { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .bento { grid-template-columns: repeat(6, 1fr); } .tile { grid-column: span 3; } .tile.wide { grid-column: span 4; } .tile.narrow { grid-column: span 2; } }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; }
.tile h3 { font-size: 18px; font-weight: 650; margin: 0; }
.tile p { color: var(--ink-3); margin: 0; font-size: 14.5px; }
.tile .art { margin-top: auto; padding-top: 18px; }
.tile.dark { background: var(--ink); color: #EDE8DD; border-color: var(--ink); }
.tile.dark p { color: #B9B3A5; }
.tile.dark h3 { color: #fff; }
.lockdiff { font-family: var(--mono); font-size: 12.5px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.lockdiff div { padding: 10px 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lockdiff div + div { border-top: 1px dashed var(--line); }
.lockdiff .lbl { color: var(--ink-3); width: 54px; flex-shrink: 0; }
.lockdiff mark { background: #FEF3C7; color: var(--ink); padding: 1px 5px; border-radius: 4px; display: inline-flex; gap: 4px; align-items: center; }
.tile.dark .lockdiff { border-color: #ffffff22; } .tile.dark .lockdiff div + div { border-color: #ffffff22; } .tile.dark .lockdiff .lbl { color: #8F897C; }
.tile.dark .lockdiff mark { background: #3F3A20; color: #FDE68A; }
.gloss { width: 100%; border-collapse: collapse; font-size: 13px; }
.gloss td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); }
.gloss td:first-child { font-weight: 600; }
.avatars { display: flex; }
.avatars span { width: 36px; height: 36px; border-radius: 99px; border: 3px solid #fff; margin-inline-start: -10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.avatars span:first-child { margin-inline-start: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; background: var(--paper); }
.tile .seal { position: static; transform: rotate(-8deg); margin: 4px 0 0 4px; }

/* Side-by-side conversation */
.dual { display: grid; gap: 20px; }
@media (min-width: 900px) { .dual { grid-template-columns: 1fr auto 1fr; align-items: center; } }
.dual-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.dual-card .cap { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.dual-card .cap .mono { color: var(--ink-3); font-weight: 400; }
.dual-feed { background: var(--bg-chat); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dual-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-3); font-family: var(--mono); font-size: 11px; text-align: center; }
.dual-mid svg { width: 46px; height: 46px; color: var(--brand); }
@media (max-width: 899px) { .dual-mid { flex-direction: row; justify-content: center; } .dual-mid svg { transform: rotate(90deg); } }

/* Pricing */
.plans { display: grid; gap: 18px; align-items: stretch; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(var(--plan-count, 3), 1fr); } }
.plan { padding: 30px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.plan.is-featured { background: var(--ink); color: #EDE8DD; border-color: var(--ink); position: relative; }
.plan.is-featured h3, .plan.is-featured .price { color: #fff; }
.plan.is-featured .muted, .plan.is-featured .price small { color: #A9A397; }
.plan.is-featured li svg { color: #7DD3C0; }
.plan.is-featured .btn-primary { background: #fff; color: var(--ink); }
.plan h3 { font-size: 19px; }
.plan .price { font-family: var(--serif); font-size: 46px; font-weight: 600; letter-spacing: -.02em; margin: 14px 0 4px; }
.plan .price small { font-family: var(--font); font-size: 15px; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 10px; font-size: 14.5px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li svg { color: var(--brand); margin-top: 3px; }
.plan .btn { margin-top: auto; }
.plan .ribbon { position: absolute; top: 18px; inset-inline-end: 18px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #FDE68A; }

/* FAQ: two-column editorial */
.faq-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .faq-grid { grid-template-columns: .8fr 1.2fr; gap: 64px; } }
.faq details { border-bottom: 1px solid var(--rule-strong); }
.faq details:first-child { border-top: 1px solid var(--rule-strong); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 0; font-weight: 600; font-size: 16.5px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 24px; line-height: 1; font-weight: 400; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); padding-bottom: 20px; margin: 0; max-width: 620px; }

/* Founder note */
.letter { max-width: 760px; margin: 0 auto; position: relative; }
.letter blockquote { margin: 0; font-family: var(--serif); font-size: clamp(21px, 2.5vw, 28px); line-height: 1.5; color: var(--ink); font-weight: 500; }
html[lang="zh"] .letter blockquote, html[lang="ar"] .letter blockquote { line-height: 1.8; }
.letter blockquote::before { content: "“"; display: block; font-size: 84px; line-height: .6; color: var(--seal); margin-bottom: 14px; }
.letter .sign { display: flex; align-items: center; gap: 16px; margin-top: 30px; }
.letter .sign .signature { font-family: var(--hand); font-size: 30px; color: var(--ink); line-height: 1; }
.letter .sign .who { font-size: 14px; color: var(--ink-3); border-inline-start: 1px solid var(--rule-strong); padding-inline-start: 16px; }
.letter .seal { position: absolute; inset-inline-end: 0; bottom: -10px; }

/* CTA */
.cta-band { position: relative; overflow: hidden; background: var(--ink); color: #EDE8DD; border-radius: 26px; padding: 64px 28px; text-align: center; background-image: radial-gradient(600px 240px at 85% 0%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 70%), var(--grain); }
.cta-band h2 { font-family: var(--serif); font-size: clamp(26px, 3.8vw, 42px); font-weight: 600; color: #fff; max-width: 760px; margin: 0 auto 14px; }
.cta-band p { color: #B9B3A5; font-size: 17px; margin-bottom: 28px; }
.cta-band .btn-primary { background: #fff; color: var(--ink); }
.cta-band .seal { color: #F2A48C; border-color: #F2A48C; top: 22px; inset-inline-start: 26px; mix-blend-mode: normal; background: transparent; width: 70px; height: 70px; font-size: 14px; }
@media (max-width: 700px) { .cta-band .seal { display: none; } }

.prose { max-width: 740px; margin: 0 auto; font-size: 16.5px; color: var(--ink-2); line-height: 1.75; }
.prose h1 { font-family: var(--serif); font-size: clamp(32px, 4vw, 44px); color: var(--ink); margin-bottom: 28px; }

.contact-grid { display: grid; gap: 36px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: .8fr 1.2fr; gap: 64px; } }
.contact-aside p { color: var(--ink-3); }
.contact-aside .line { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }

.site-footer { border-top: 1px solid var(--rule-strong); padding: 44px 0; color: var(--ink-3); font-size: 14px; }
.site-footer .row { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--ink-3); }
.site-footer .made { font-family: var(--mono); font-size: 11.5px; }

/* ───── Chat bubbles (shared by homepage preview and workspace) ───── */
.bubble { max-width: 82%; padding: 9px 13px 7px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; box-shadow: 0 1px 1px rgba(0,0,0,.05); position: relative; word-wrap: break-word; overflow-wrap: anywhere; }
.bubble .txt { white-space: pre-wrap; }
.bubble-in { align-self: flex-start; background: #fff; border-start-start-radius: 4px; }
.bubble-out { align-self: flex-end; background: color-mix(in srgb, var(--brand) 13%, white); border-start-end-radius: 4px; }
.bubble .tr { margin-top: 6px; padding-top: 6px; border-top: 1px dashed color-mix(in srgb, var(--ink) 15%, transparent); color: var(--ink-2); font-size: 13.5px; }
.bubble .tr-label { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.bubble .meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.bubble .tick-read { color: #2563EB; }
.bubble.is-failed { background: var(--danger-50); }
.bubble-media img { display: block; border-radius: 10px; max-height: 260px; margin-bottom: 4px; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(15,23,42,.05); color: var(--ink); text-decoration: none !important; }
.day-sep { align-self: center; font-size: 12px; color: var(--muted); background: rgba(255,255,255,.85); padding: 3px 12px; border-radius: 999px; margin: 8px 0; }

/* ───── Auth pages ───── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(900px 420px at 50% -10%, var(--brand-50), transparent 70%), var(--bg-soft); }
.auth-card { width: 100%; max-width: 430px; padding: 34px 30px; }
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 26px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-wechat { background: #07C160; color: #fff; }
.btn-wechat:hover { background: #06AD56; }

/* ───── Workspace shell ───── */
.ws { display: flex; height: 100vh; height: 100dvh; background: var(--bg-soft); overflow: hidden; }
.ws-side { display: none; width: 232px; flex-shrink: 0; flex-direction: column; background: #fff; border-inline-end: 1px solid var(--line); padding: 16px 12px; }
@media (min-width: 1024px) { .ws-side { display: flex; } }
.ws-side .logo { padding: 4px 8px 18px; font-size: 15px; }
.ws-nav { display: flex; flex-direction: column; gap: 2px; }
.ws-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; text-decoration: none; }
.ws-nav a:hover { background: var(--bg-soft); }
.ws-nav a.is-active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.ws-nav .count { margin-inline-start: auto; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.ws-side-foot { margin-top: auto; border-top: 1px solid var(--line-2); padding-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--brand-100); color: var(--brand); font-weight: 700; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; object-fit: cover; }
.avatar-lg { width: 44px; height: 44px; font-size: 16px; }
.ws-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ws-top { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.ws-top h1 { font-size: 17px; margin: 0; }
.ws-content { flex: 1; overflow: auto; padding: 20px 16px 96px; }
@media (min-width: 1024px) { .ws-content { padding: 28px 32px 40px; } }
.ws-tabbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 40; display: flex; justify-content: space-around; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { .ws-tabbar { display: none; } }
.ws-tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 8px; text-decoration: none; position: relative; }
.ws-tabbar a.is-active { color: var(--brand); }
.ws-tabbar .count { position: absolute; top: 0; inset-inline-end: 4px; background: var(--danger); color: #fff; font-size: 10px; border-radius: 999px; padding: 0 5px; }
.impersonation { background: var(--warn-50); color: #92400E; text-align: center; font-size: 13px; padding: 7px 12px; }
.page-narrow { max-width: 920px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 22px; }

/* Inbox: list + chat */
.inbox { flex: 1; display: flex; min-height: 0; }
.conv-list { width: 100%; display: flex; flex-direction: column; background: #fff; border-inline-end: 1px solid var(--line); min-height: 0; }
@media (min-width: 900px) { .conv-list { width: 340px; flex-shrink: 0; } }
.conv-search { padding: 12px; border-bottom: 1px solid var(--line-2); }
.conv-search .input { border-radius: 999px; padding: 9px 14px; background: var(--bg-soft); border-color: transparent; }
.conv-tabs { display: flex; gap: 6px; padding: 10px 12px 0; }
.conv-tabs button { border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.conv-tabs button.is-active { background: var(--brand-50); color: var(--brand); }
.conv-items { overflow-y: auto; flex: 1; padding: 6px; padding-bottom: 80px; }
@media (min-width: 1024px) { .conv-items { padding-bottom: 6px; } }
.conv { display: flex; gap: 12px; padding: 11px 10px; border-radius: 12px; cursor: pointer; text-decoration: none !important; color: var(--ink); width: 100%; border: 0; background: transparent; font: inherit; text-align: start; }
.conv:hover { background: var(--bg-soft); }
.conv.is-active { background: var(--brand-50); }
.conv-body { flex: 1; min-width: 0; }
.conv-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.conv-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.conv-preview { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-unread { background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; }
.chat { flex: 1; display: none; flex-direction: column; min-width: 0; background: var(--bg-chat); }
@media (min-width: 900px) { .chat { display: flex; } }
.inbox.has-chat .conv-list { display: none; }
.inbox.has-chat .chat { display: flex; }
@media (min-width: 900px) { .inbox.has-chat .conv-list { display: flex; } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); min-height: 64px; }
.chat-head .who { flex: 1; min-width: 0; }
.chat-head .who strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-back { display: inline-flex; }
@media (min-width: 900px) { .chat-back { display: none; } }
.chat-scroll { flex: 1; overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 900px) { .chat-scroll { padding: 22px 6%; } }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 32px; }
.composer { background: #fff; border-top: 1px solid var(--line); padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; border: 1px solid var(--line); border-radius: 18px; padding: 10px 14px; font: inherit; font-size: 15px; resize: none; max-height: 160px; min-height: 44px; background: var(--bg-soft); }
.composer textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-100); }
.composer .lang-pill { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.draft { border: 1px solid var(--brand-100); background: var(--brand-50); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.draft-label { font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.draft textarea { width: 100%; border: 1px solid var(--brand-100); background: #fff; border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 15px; min-height: 64px; resize: vertical; }
.draft .back { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); background: #fff; border-radius: 10px; padding: 8px 12px; }
.window-banner { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-50); color: #92400E; padding: 10px 14px; font-size: 13.5px; }
.status-banner { background: var(--danger-50); color: #991B1B; padding: 9px 16px; font-size: 13.5px; text-align: center; }
.info-panel { display: none; width: 300px; flex-shrink: 0; background: #fff; border-inline-start: 1px solid var(--line); overflow-y: auto; padding: 20px; }
@media (min-width: 1280px) { .info-panel.is-open { display: block; } }

/* Tables & lists inside the workspace */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty h3 { color: var(--ink); font-size: 17px; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 480px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 24px; max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 18px; }

.loading-dots::after { content: "…"; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .5s ease both; }
@media (prefers-reduced-motion: reduce) { .rise, .feature, .btn { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin-bottom: 8px; }

/* Small phones: keep the logo on one line and simplify the hero picture. */
.logo span:last-child { white-space: nowrap; }
@media (max-width: 560px) {
  .site-header .bar { gap: 10px; }
  .logo { font-size: 15px; }
  .stage { min-height: 520px; }
  .win { width: 100%; top: 26px; transform: none !important; }
  .win-body { grid-template-columns: 1fr; min-height: 250px; }
  .win-list { display: none; }
  .handset { width: 190px; transform: rotate(-3deg); }
  html[dir="rtl"] .handset { transform: rotate(3deg); }
  .sticker-lock { top: -4px; bottom: auto; inset-inline-end: 6px; }
  .hero .seal { width: 66px; height: 66px; font-size: 14px; bottom: 18px; inset-inline-end: 8px; }
}
@media (max-width: 380px) { .header-actions .btn-primary { padding: 6px 10px; } }

/* ───── "!" help tips (shared by workspace and admin) ───── */
.kk-tip { position: relative; display: inline-flex; vertical-align: middle; }
.kk-tip-btn { width: 22px; height: 22px; border-radius: 999px; border: 1.5px solid currentColor; background: transparent; color: var(--brand, #0E5E4F); font: 700 12px/1 Georgia, serif; cursor: pointer; display: grid; place-items: center; padding: 0; opacity: .75; transition: opacity .15s, transform .15s; }
.kk-tip-btn:hover { opacity: 1; transform: scale(1.08); }
.kk-tip-sm .kk-tip-btn { width: 18px; height: 18px; font-size: 11px; }
.kk-tip-pop { position: absolute; z-index: 60; top: 30px; inset-inline-start: 0; width: min(340px, 86vw); background: #1C1F1E; color: #F2EFE8; border-radius: 14px; padding: 14px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.28); font-size: 13.5px; line-height: 1.55; text-align: start; }
.kk-tip-pop::before { content: ""; position: absolute; top: -6px; inset-inline-start: 7px; width: 12px; height: 12px; background: #1C1F1E; transform: rotate(45deg); border-radius: 2px; }
.kk-tip-title { font-weight: 700; margin-bottom: 4px; font-size: 14px; }
.kk-tip-body { color: #D7D2C8; }
.kk-tip-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; }
.kk-tip-close { border: 0; background: #fff; color: #1C1F1E; font: 600 12.5px system-ui, sans-serif; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.kk-tip-hide { border: 0; background: none; color: #A39E93; font: 12px system-ui, sans-serif; cursor: pointer; text-decoration: underline; padding: 0; }
.kk-tip-pop.align-end { inset-inline-start: auto; inset-inline-end: 0; }
.kk-tip-pop.align-end::before { inset-inline-start: auto; inset-inline-end: 7px; }
@media (max-width: 560px) { .chat-head .who span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .chat-head .btn-sm { padding: 6px 8px; } }
