/* 핀지 AI (금융 대화) — 모바일 우선. 색은 Finji 공통 테마 변수를 쓴다. */
.tk { --tk-surface: var(--card-bg, var(--card-bg)); --tk-surface-2: var(--card-bg-2, var(--card-bg-2));
  --tk-line: var(--border-color, var(--border-color)); --tk-line-2: #2d3b5e; --tk-text: var(--text-primary, var(--text-primary));
  --tk-text-2: #a8b3c7; --tk-text-3: #7f8da6; --tk-primary: var(--primary-color, var(--primary-color));
  --tk-link: var(--blue-text); --tk-up: var(--red-text); --tk-down: var(--blue-text); --tk-long: var(--green-text); --tk-short: var(--red-text);
  --tk-wait: var(--text-2); --tk-warn: var(--amber-text); --tk-sky: #38bdf8; --tk-orange: #fdba74;
  position: relative; max-width: 720px; margin: 0 auto; min-height: calc(100vh - 140px);
  display: flex; flex-direction: column; color: var(--tk-text); font-size: 16px; line-height: 1.5;
  overflow-wrap: break-word; }
.tk [hidden] { display: none !important; }
.tk button, .tk input, .tk textarea, .tk select { font: inherit; color: inherit; }
.tk button { cursor: pointer; }
.tk a { color: var(--tk-link); text-decoration: none; }
.tk :focus-visible { outline: 3px solid #7aa8ff; outline-offset: 2px; }
.tk .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tk svg { flex: none; }

/* ---- 상단 바 ---- */
.tk-bar { height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 6px; }
.tk-bar .tk-icon { width: 48px; height: 48px; border: 0; background: transparent; color: var(--text-2); border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; }
.tk-bar .tk-icon:hover { background: var(--tk-surface); color: var(--tk-text); }
.tk-bar .lbl { display: none; }
.tk-box-tools { display: none; }
.tk-brand { flex: 1; text-align: center; font-weight: 800; font-size: 17px; }

/* ---- 홈 ---- */
.tk-home { display: flex; flex-direction: column; gap: 20px; padding: 0 16px 8px; }
.tk-hero { text-align: center; display: flex; flex-direction: column; gap: 8px; padding: 26px 16px 20px; }
.tk-hero h1 { margin: 0; font-size: 27px; line-height: 1.3; letter-spacing: -.03em; }
.tk-hero p { margin: 0; font-size: 15.5px; color: var(--tk-text-2); line-height: 1.6; }
.tk-doors { display: flex; flex-direction: column; gap: 10px; }
.tk-door { position: relative; display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 14px 16px; width: 100%;
  border-radius: 18px; background: var(--tk-surface); border: 1px solid var(--tk-line-2); color: var(--tk-text); text-align: left; }
.tk-door:hover { background: var(--tk-surface-2); }
.tk-door.hot { border: 1.5px solid rgba(56,189,248,.55); }
.tk-door-badge { position: absolute; top: -10px; left: 16px; padding: 2px 9px; border-radius: 999px; background: var(--tk-sky); color: var(--bg); font-size: 11.5px; font-weight: 800; }
.tk-tile { flex: none; display: inline-flex; width: 48px; height: 48px; border-radius: 14px; align-items: center; justify-content: center; }
.tk-tile.sky { background: rgba(56,189,248,.16); color: var(--tk-sky); }
.tk-tile.blue { background: rgba(96,165,250,.16); color: var(--blue-text); }
.tk-tile.orange { background: rgba(251,146,60,.16); color: var(--tk-orange); }
.tk-tile.green { background: rgba(16,185,129,.16); color: var(--tk-long); }
.tk-door-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tk-door-text strong { font-size: 17px; }
.tk-door-text span { font-size: 13.5px; color: var(--tk-text-2); line-height: 1.45; }
.tk-chev { color: var(--tk-text-3); }
.tk-examples { display: flex; flex-direction: column; }
.tk-examples-head { display: flex; align-items: baseline; padding: 0 2px 6px; font-size: 14px; }
.tk-examples-head b { color: var(--text-2); font-weight: 700; }
.tk-examples-head span { margin-left: auto; font-size: 12.5px; color: var(--tk-text-3); }
.tk-example { display: flex; align-items: center; min-height: 46px; padding: 0 4px; border: 0; border-top: 1px solid var(--tk-line); background: transparent; color: var(--text-primary); font-size: 15px; text-align: left; width: 100%; }
.tk-example:last-child { border-bottom: 1px solid var(--tk-line); }
.tk-example svg { margin-left: auto; color: var(--tk-text-3); }
.tk-example:hover { color: var(--tk-text); }

/* ---- 대화 ---- */
.tk-thread { display: flex; flex-direction: column; gap: 18px; padding: 8px 16px 12px; flex: 1; }
.tk-msg-user { display: flex; justify-content: flex-end; }
.tk-msg-user .in { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 86%; }
.tk-bubble { padding: 9px 14px; border-radius: 14px 14px 4px 14px; background: var(--tk-primary); color: #fff; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.tk-att { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tk-att img { width: 96px; height: 68px; object-fit: cover; border-radius: 9px; border: 1px solid var(--tk-line-2); }
.tk-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; background: var(--tk-surface); border: 1px solid var(--tk-line); font-size: 13px; color: var(--tk-text-2); }
.tk-msg-ai { display: flex; flex-direction: column; gap: 12px; }
.tk-steps { display: flex; flex-wrap: wrap; gap: 5px; }
.tk-step { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--tk-surface); border: 1px solid var(--tk-line); font-size: 12px; color: var(--tk-text-2); }
.tk-step.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--tk-sky); animation: tkpulse 1s ease-in-out infinite; }
.tk-step.done::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--tk-long); }
@keyframes tkpulse { 0%,100% { opacity: .25 } 50% { opacity: 1 } }
.tk-answer { font-size: 15.5px; line-height: 1.72; }
.tk-answer > :first-child { margin-top: 0; } .tk-answer > :last-child { margin-bottom: 0; }
.tk-answer h1, .tk-answer h2, .tk-answer h3 { font-size: 1rem; margin: 1rem 0 .4rem; font-weight: 700; }
.tk-answer p { margin: .5rem 0; } .tk-answer ul, .tk-answer ol { margin: .5rem 0 .5rem 1.1rem; } .tk-answer li { margin: .2rem 0; }
.tk-answer strong { color: #fff; }
.tk-answer code { background: var(--tk-surface-2); padding: .1rem .35rem; border-radius: 4px; font-size: .9em; }
.tk-answer pre { background: var(--tk-surface-2); padding: .7rem; border-radius: 10px; overflow-x: auto; }
.tk-answer blockquote { border-left: 3px solid var(--tk-line-2); padding-left: .8rem; color: var(--tk-text-2); margin: .5rem 0; }
.tk-answer a { text-decoration: underline; }
.tk-table { overflow-x: auto; margin: .6rem 0; }
.tk-answer table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.tk-answer th, .tk-answer td { border: 1px solid var(--tk-line); padding: .4rem .6rem; text-align: right; white-space: nowrap; }
.tk-answer th { background: var(--tk-surface-2); text-align: center; }
.tk-answer td:first-child, .tk-answer th:first-child { text-align: left; }
.tk-cursor::after { content: '▍'; color: var(--tk-sky); animation: tkpulse .9s infinite; }
.tk-src { border-top: 1px solid var(--tk-line); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.tk-src-h { font-size: 12.5px; color: var(--tk-text-3); margin-bottom: 2px; }
.tk-src a { display: flex; gap: 8px; min-height: 32px; align-items: center; font-size: 13.5px; color: var(--tk-text-2); overflow: hidden; }
.tk-src a span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-src .n { color: var(--tk-text-3); flex: none; }
.tk-err { padding: 12px 14px; border-radius: 12px; font-size: 14.5px; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.35); color: var(--red-text); }
.tk-warn { padding: 10px 14px; border-radius: 12px; font-size: 14px; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: var(--amber-text); }
.tk-follow { display: flex; flex-direction: column; gap: 8px; }
.tk-follow-h { font-size: 14px; color: var(--tk-text-2); padding-left: 2px; }
.tk-follow button { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 14px; background: var(--tk-surface); border: 1px solid var(--tk-line); color: var(--tk-text); font-size: 15px; text-align: left; width: 100%; }
.tk-follow button svg { margin-left: auto; color: var(--tk-text-3); }
.tk-follow button:hover { background: var(--tk-surface-2); }

/* ---- 카드 공통 ---- */
.tk-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; background: var(--tk-surface); border: 1px solid var(--tk-line-2); }
.tk-card-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tk-text-2); flex-wrap: wrap; }
.tk-card-head .right { margin-left: auto; }
.tk-card-title { font-size: 15.5px; font-weight: 700; color: var(--text-primary); }
.tk-lead { margin: 0; font-size: 17px; line-height: 1.55; color: var(--text-primary); }
.tk-pill { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 16px; }
.tk-pill.long { background: rgba(16,185,129,.18); color: var(--tk-long); }
.tk-pill.short { background: rgba(239,68,68,.16); color: var(--tk-short); }
.tk-pill.wait { background: rgba(148,163,184,.16); color: var(--tk-wait); }
.tk-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tk-badge.low { background: rgba(16,185,129,.18); color: var(--tk-long); }
.tk-badge.medium { background: rgba(245,158,11,.18); color: var(--tk-warn); }
.tk-badge.high { background: rgba(239,68,68,.18); color: var(--tk-short); }
.tk-badge.neutral { background: var(--tk-surface-2); color: var(--tk-text-2); }
.tk-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tk-num { padding: 12px 10px; border-radius: 14px; background: var(--card-bg); display: flex; flex-direction: column; gap: 3px; text-align: center; }
.tk-num .k { font-size: 12.5px; color: var(--tk-text-2); }
.tk-num .v { font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.tk-num .s { font-size: 12px; color: var(--tk-text-3); }
.tk-num .v.stop { color: var(--tk-short); } .tk-num .v.target { color: var(--tk-long); }
.tk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--tk-line-2); background: var(--tk-surface-2); color: var(--tk-text); font-size: 15.5px; font-weight: 700; width: 100%; text-decoration: none; }
.tk-btn:hover { filter: brightness(1.08); }
.tk-btn.primary { background: var(--tk-primary); border-color: transparent; color: #fff; min-height: 54px; font-size: 16.5px; font-weight: 800; }
.tk-btn.small { min-height: 40px; font-size: 13.5px; width: auto; padding: 0 12px; border-radius: 10px; }
.tk-btn:disabled { opacity: .5; cursor: not-allowed; }
.tk-note { margin: 0; font-size: 12.5px; color: var(--tk-text-3); line-height: 1.5; }
.tk-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tk-kv { padding: 11px 13px; border-radius: 14px; background: var(--tk-surface); border: 1px solid var(--tk-line); display: flex; flex-direction: column; gap: 2px; }
.tk-kv .k { font-size: 12.5px; color: var(--tk-text-2); } .tk-kv .v { font-size: 17px; font-weight: 700; } .tk-kv .s { font-size: 12.5px; color: var(--tk-text-2); }
.tk-up { color: var(--tk-up); } .tk-down { color: var(--tk-down); } .tk-pos { color: var(--tk-long); } .tk-neg { color: var(--tk-short); }
.tk-facts { display: flex; flex-direction: column; gap: 10px; }
.tk-fact { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--card-bg); border: 1px solid var(--tk-line); color: inherit; }
.tk-fact .tk-tile { width: 42px; height: 42px; border-radius: 12px; }
.tk-fact .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tk-fact strong { font-size: 15.5px; } .tk-fact span { font-size: 13.5px; color: var(--tk-text-2); }
.tk-price { display: flex; align-items: flex-end; gap: 14px; }
.tk-price .p { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.tk-price .c { font-size: 15.5px; font-weight: 700; }
.tk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--tk-surface-2); border: 1px solid var(--tk-line); font-size: 13px; color: var(--text-primary); }
/* 제품 카드 */
.tk-sec { display: flex; flex-direction: column; gap: 6px; }
.tk-sec-h { font-size: 12.5px; font-weight: 700; color: var(--tk-text-3); }
.tk-co { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 12px; border-radius: 12px; background: var(--card-bg); border: 1px solid var(--tk-line); color: var(--tk-text); text-align: left; width: 100%; box-sizing: border-box; }
button.tk-co:hover { background: var(--tk-surface-2); }
.tk-co .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-co .nm { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tk-co .nm strong { font-size: 15px; }
.tk-co .why { font-size: 13px; color: var(--tk-text-2); line-height: 1.4; }
.tk-co .txt small { font-size: 12px; color: var(--tk-text-3); }
.tk-product button.tk-chip { font-size: 14px; min-height: 36px; }
.tk-co .q { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 12.5px; white-space: nowrap; }
.tk-co .q strong { font-size: 14.5px; }
.tk-role { flex: none; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--tk-surface-2); color: var(--tk-text-2); }
.tk-role.competitor { background: rgba(239,68,68,.16); color: var(--tk-short); }
.tk-role.supplier { background: rgba(56,189,248,.16); color: var(--tk-sky); }
.tk-role.customer { background: rgba(16,185,129,.16); color: var(--tk-long); }
.tk-role.partner { background: rgba(251,146,60,.16); color: var(--tk-orange); }
.tk-conf { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tk-conf.high { background: rgba(16,185,129,.18); color: var(--tk-long); }
.tk-conf.medium { background: rgba(245,158,11,.18); color: var(--tk-warn); }
.tk-conf.low { background: rgba(239,68,68,.18); color: var(--tk-short); }
.tk-inline { display: flex; gap: 8px; }
.tk-inline input { flex: 1; min-width: 0; }
.tk-inline .tk-btn { width: auto; min-height: 48px; padding: 0 18px; }
.tk-mini-table { display: grid; border: 1px solid var(--tk-line); border-radius: 12px; overflow: hidden; font-size: 14px; }
.tk-mini-table > span { padding: 9px 12px; border-top: 1px solid var(--tk-line); }
.tk-mini-table > span.h { background: var(--tk-surface-2); color: var(--tk-text-2); font-size: 12.5px; font-weight: 700; border-top: 0; }
.tk-mini-table > span.r { text-align: right; }
.tk-mini-table > span.l { color: var(--tk-text-2); }
.tk-newslist { display: flex; flex-direction: column; gap: 6px; }
.tk-newslist a { display: flex; flex-direction: column; gap: 1px; padding: 9px 11px; border-radius: 10px; background: var(--card-bg); color: var(--text-primary); font-size: 14px; line-height: 1.45; }
.tk-newslist a small { font-size: 12px; color: var(--tk-text-3); }
.tk-bars { display: flex; align-items: flex-end; gap: 10px; height: 90px; padding: 0 6px; }
.tk-bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; height: 100%; }
.tk-bars .bar { width: 100%; border-radius: 6px 6px 0 0; background: var(--blue); }
.tk-bars .bar.ghost { border: 1.5px dashed #334155; background: transparent; box-sizing: border-box; }
.tk-bars small { font-size: 11.5px; color: var(--tk-text-2); }
.tk-progress { display: flex; flex-direction: column; padding: 4px 14px; border-radius: 16px; background: var(--card-bg); border: 1px solid var(--tk-line); }
.tk-progress .row { display: flex; align-items: center; gap: 12px; min-height: 50px; font-size: 15px; color: var(--tk-text-2); border-top: 1px solid var(--tk-line); }
.tk-progress .row:first-child { border-top: 0; }
.tk-progress .row.on { color: var(--tk-text); font-weight: 700; } .tk-progress .row.todo { color: var(--tk-text-3); }
.tk-dot { flex: none; width: 26px; height: 26px; border-radius: 50%; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
.tk-dot.done { background: rgba(16,185,129,.18); color: var(--tk-long); }
.tk-dot.spin { border: 3px solid var(--tk-surface-2); border-top-color: var(--tk-sky); animation: tkspin 1s linear infinite; }
.tk-dot.todo { border: 2px solid var(--tk-line-2); }
@keyframes tkspin { to { transform: rotate(360deg); } }
.tk-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--tk-surface); border: 1px solid var(--tk-line); }
.tk-tabs button { min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--tk-text-2); font-size: 13.5px; }
.tk-tabs button[aria-selected="true"] { background: var(--tk-surface-2); color: var(--tk-text); font-weight: 700; }
.tk-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tk-tools button, .tk-tools a { min-height: 46px; border-radius: 12px; background: var(--tk-surface-2); border: 1px solid var(--tk-line-2); color: var(--tk-text); font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; text-align: center; padding: 0 6px; }
.tk-toolpanel { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: var(--card-bg); border: 1px solid var(--tk-line); }
.tk-toolpanel input[type=text], .tk-toolpanel input[type=number], .tk-toolpanel select, .tk-toolpanel textarea { min-height: 46px; box-sizing: border-box; padding: 0 12px; border-radius: 12px; background: var(--tk-surface); border: 1px solid var(--tk-line-2); color: var(--tk-text); width: 100%; outline: 0; }
.tk-toolpanel textarea { padding: 10px 12px; min-height: 70px; resize: vertical; }
.tk-toolpanel label { font-size: 13.5px; color: var(--tk-text-2); display: flex; flex-direction: column; gap: 6px; }
.tk-radio { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--tk-surface); border: 1px solid var(--tk-line); font-size: 14.5px; cursor: pointer; }
.tk-radio input { accent-color: var(--tk-primary); width: 18px; height: 18px; margin: 0; }
.tk-status { font-size: 13.5px; color: var(--tk-long); min-height: 1.2em; }
.tk-status.err { color: var(--tk-short); }
.tk-imgs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tk-imgs img { width: 100%; border-radius: 12px; border: 1px solid var(--tk-line); }
.tk-debate { display: flex; flex-direction: column; gap: 6px; }
.tk-debate .row { display: flex; gap: 10px; padding: 9px 11px; border-radius: 10px; background: var(--card-bg); font-size: 14px; line-height: 1.5; }
.tk-debate .who { flex: none; width: 62px; font-weight: 700; }
.tk-levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tk-levels ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tk-levels li { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 10px; background: var(--card-bg); font-size: 14px; }
.tk-levels li small { font-size: 12px; color: var(--tk-text-2); }
.tk-h { font-size: 15.5px; font-weight: 700; margin: 0; }
.tk-rating { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--tk-text-2); }

/* ---- 입력창 ---- */
.tk-compose { position: sticky; bottom: 0; z-index: 20; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); margin-top: auto;
  background: linear-gradient(180deg, rgba(11,18,32,0), var(--dark-bg, var(--bg)) 28%); display: flex; flex-direction: column; gap: 8px; }
.tk-chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-pending { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 10px; background: var(--tk-surface-2); border: 1px solid var(--tk-line); font-size: 12.5px; color: var(--text-2); }
.tk-pending img { width: 44px; height: 32px; object-fit: cover; border-radius: 6px; }
.tk-pending button { border: 0; background: transparent; color: var(--tk-text-3); font-size: 15px; line-height: 1; padding: 0 2px; }
.tk-pending button:hover { color: var(--tk-short); }
.tk-box { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px; background: var(--tk-surface); border: 1px solid var(--tk-line-2); box-shadow: 0 10px 30px var(--shadow); }
.tk-box.multi { border-radius: 22px; align-items: flex-end; }
.tk-box.hot { border-color: var(--tk-link); }
.tk-round { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--tk-surface-2); color: var(--tk-text); display: inline-flex; align-items: center; justify-content: center; }
.tk-round.send { color: var(--tk-text-3); }
.tk-round.send.ready { background: var(--tk-primary); color: #fff; }
.tk-input { flex: 1; min-width: 0; min-height: 44px; max-height: 160px; background: transparent; border: 0; outline: 0; resize: none; color: var(--tk-text); font-size: 16.5px; line-height: 1.5; padding: 9px 4px; }
.tk-hint { margin: 0; text-align: center; font-size: 12.5px; color: var(--tk-text-3); min-height: 1.2em; }
.tk-hint.on { color: var(--text-2); }

/* ---- 서랍·시트·안내 ---- */
.tk-overlay { position: fixed; inset: 0; background: rgba(3,6,16,.62); z-index: 3000; }
.tk-drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); z-index: 3001; background: var(--tk-surface); padding: 18px 14px 20px;
  box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; box-shadow: 12px 0 40px var(--shadow); transform: translateX(-100%); transition: transform .18s ease; }
.tk-drawer.on { transform: none; }
.tk-drawer .tk-search { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--tk-line); }
.tk-drawer .tk-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--tk-text); font-size: 15px; }
.tk-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 10px; background: var(--bg); border: 1px solid var(--tk-line); }
.tk-seg button { min-height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--tk-text-2); font-size: 13px; }
.tk-seg button[aria-pressed="true"] { background: var(--tk-surface-2); color: var(--tk-text); font-weight: 700; }
.tk-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.tk-list .sec { font-size: 12.5px; font-weight: 700; color: var(--tk-text-3); padding: 10px 8px 4px; }
.tk-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 8px; border-radius: 12px; color: var(--text-primary); font-size: 14.5px; }
.tk-row:hover, .tk-row.on { background: var(--tk-surface-2); }
.tk-row a { flex: 1; min-width: 0; color: inherit; display: flex; align-items: center; gap: 10px; min-height: 48px; }
.tk-row .ttl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-row .tag { font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.tk-row .tag.long { background: rgba(16,185,129,.18); color: var(--tk-long); } .tk-row .tag.short { background: rgba(239,68,68,.18); color: var(--tk-short); } .tk-row .tag.wait { background: rgba(148,163,184,.18); color: var(--tk-wait); }
.tk-row .del { border: 0; background: transparent; color: var(--tk-text-3); width: 36px; height: 36px; border-radius: 8px; opacity: .6; }
.tk-row .del:hover { color: var(--tk-short); opacity: 1; }
.tk-drawer-foot { border-top: 1px solid var(--tk-line-2); padding-top: 8px; display: flex; flex-direction: column; }
.tk-drawer-foot a, .tk-drawer-foot button { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 8px; border-radius: 12px; color: var(--text-primary); font-size: 15px; border: 0; background: transparent; width: 100%; text-align: left; }
.tk-empty { padding: 14px 8px; font-size: 14px; color: var(--tk-text-3); line-height: 1.6; }

.tk-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3001; max-height: 92vh; overflow-y: auto; background: var(--tk-surface); border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 -20px 60px var(--shadow); }
.tk-sheet .grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--tk-line-2); margin: 0 auto; }
.tk-sheet h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; line-height: 1.3; }
.tk-sheet .sub { margin: 0; font-size: 15px; color: var(--tk-text-2); line-height: 1.6; }
.tk-sheet-head { display: flex; align-items: center; gap: 8px; }
.tk-sheet-head h2 { flex: 1; font-size: 19px; }
.tk-sheet-head .tk-icon { width: 44px; height: 44px; border: 0; background: transparent; color: var(--text-2); border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
.tk-choice { display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 14px 16px; border-radius: 18px; background: var(--card-bg); border: 1px solid var(--tk-line-2); color: var(--tk-text); text-align: left; width: 100%; }
.tk-choice.hot { border: 1.5px solid rgba(56,189,248,.55); }
.tk-examples2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tk-examples2 figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.tk-examples2 svg { width: 100%; height: auto; border-radius: 10px; }
.tk-examples2 figcaption { display: flex; align-items: flex-start; gap: 5px; font-size: 12.5px; color: var(--tk-text-2); line-height: 1.4; }
.tk-preview { position: relative; }
.tk-preview-imgs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.tk-preview-imgs img { height: 150px; border-radius: 14px; border: 1px solid var(--tk-line-2); flex: none; max-width: 100%; object-fit: cover; }
.tk-preview-imgs .pdf { height: 150px; width: 120px; border-radius: 14px; border: 1px solid var(--tk-line-2); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--tk-text-2); background: var(--card-bg); flex: none; }
.tk-rowcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card-bg); border: 1px solid var(--tk-line); }
.tk-rowcard .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tk-rowcard strong { font-size: 15.5px; } .tk-rowcard span { font-size: 13px; color: var(--tk-text-2); }
.tk-rowcard a, .tk-rowcard button.link { font-size: 14.5px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; border: 0; background: transparent; color: var(--tk-link); }
.tk-tfs { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-tf { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--tk-line); background: transparent; color: var(--tk-text-2); font-size: 14.5px; }
.tk-tf[aria-pressed="true"] { border: 1.5px solid var(--tk-link); background: rgba(96,165,250,.14); color: var(--tk-text); font-weight: 700; }
.tk-field { display: flex; flex-direction: column; gap: 6px; }
.tk-field > span { font-size: 14px; color: var(--tk-text-2); }
.tk-field input[type=text], .tk-field input[type=search] { min-height: 48px; box-sizing: border-box; padding: 0 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--tk-line-2); color: var(--tk-text); font-size: 15.5px; outline: 0; width: 100%; }
.tk-field input:focus { border-color: var(--tk-link); }
.tk-adv summary { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--tk-text-2); font-size: 14.5px; cursor: pointer; list-style: none; }
.tk-adv summary::-webkit-details-marker { display: none; }
.tk-adv summary small { color: var(--tk-text-3); }
.tk-adv summary svg { margin-left: auto; }
.tk-adv[open] summary svg { transform: rotate(90deg); }
.tk-adv .body { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 4px; }
.tk-results { display: flex; flex-direction: column; }
.tk-result { display: flex; align-items: center; gap: 14px; min-height: 64px; border: 0; border-bottom: 1px solid var(--tk-line); background: transparent; color: var(--tk-text); text-align: left; width: 100%; padding: 0; }
.tk-result .ini { flex: none; display: inline-flex; width: 42px; height: 42px; border-radius: 12px; background: var(--tk-surface-2); align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: var(--text-2); }
.tk-result .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-result strong { font-size: 16px; } .tk-result span { font-size: 13px; color: var(--tk-text-2); }
.tk-result em { font-style: normal; color: var(--tk-link); }
.tk-foot-note { margin: auto 0 0; text-align: center; font-size: 13px; color: var(--tk-text-3); line-height: 1.6; }
.tk-linkbtn { display: flex; align-items: center; justify-content: center; min-height: 44px; font-size: 15px; color: var(--tk-text-2); border: 0; background: transparent; width: 100%; }

dialog.tk-guide { z-index: 3002; border: 0; border-radius: 22px; background: var(--tk-surface); color: var(--tk-text); padding: 22px 20px; max-width: 440px; width: calc(100% - 32px); box-sizing: border-box; }
dialog.tk-guide::backdrop { background: rgba(3,6,16,.65); }
.tk-guide h2 { margin: 6px 0 8px; font-size: 21px; letter-spacing: -.02em; line-height: 1.3; }
.tk-guide ol { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.tk-guide li { display: flex; gap: 12px; }
.tk-guide li > span { flex: none; width: 28px; color: var(--tk-link); font-weight: 800; font-size: 13px; padding-top: 3px; }
.tk-guide li strong { display: block; font-size: 15.5px; margin-bottom: 3px; }
.tk-guide li p { margin: 0; font-size: 14px; color: var(--tk-text-2); line-height: 1.6; }

/* ---- 둘러보기 ---- */
.tk-explore { display: flex; flex-direction: column; gap: 14px; padding: 6px 16px 20px; }
.tk-explore h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.tk-feed { display: flex; flex-direction: column; gap: 10px; }
.tk-feed a { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 16px; background: var(--tk-surface); border: 1px solid var(--tk-line); color: var(--tk-text); }
.tk-feed .top { display: flex; align-items: center; gap: 8px; } .tk-feed .top strong { font-size: 16px; } .tk-feed .top span { font-size: 13px; color: var(--tk-text-2); }
.tk-feed p { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tk-feed .bot { display: flex; font-size: 12.5px; color: var(--tk-text-3); } .tk-feed .bot span:last-child { margin-left: auto; }

/* ---- 데스크톱 (≥ 900px): 시안의 데스크톱 구성 ---- */
@media (min-width: 900px) {
  .tk { max-width: 1040px; padding: 0 16px; min-height: calc(100vh - 150px); }
  .tk-bar { height: 64px; gap: 8px; padding: 0; }
  .tk-brand { order: 0; flex: 1; text-align: left; font-size: 15px; }
  .tk-brand::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tk-sky); margin-right: 8px; vertical-align: 1px; }
  .tk-bar .tk-icon { width: auto; height: 40px; padding: 0 12px; gap: 7px; border: 1px solid var(--tk-line); border-radius: 10px; background: transparent; font-size: 14px; color: var(--text-2); }
  .tk-bar .tk-icon svg { width: 18px; height: 18px; }
  .tk-bar .lbl { display: inline; }
  #tkHistoryBtn { order: 1; } #tkGuideBtn { order: 2; } #tkNewBtn { order: 3; }
  .tk-bar .tk-icon:hover { background: var(--tk-surface); color: var(--tk-text); }

  /* 홈: 제목 → 큰 입력창 → 문 4개 → 예시 */
  .tk-hero { order: 1; padding: 44px 0 26px; }
  .tk-hero h1 { font-size: 36px; } .tk-hero p { font-size: 17px; }
  .tk.view-home .tk-compose { order: 2; position: static; background: none; padding: 0; margin: 0 auto 28px; width: 100%; max-width: 760px; }
  .tk.view-home .tk-box { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "input input input" "attach tools send"; align-items: center;
    gap: 10px 8px; padding: 16px 16px 12px; border-radius: 20px; box-shadow: 0 16px 48px var(--shadow); }
  .tk.view-home .tk-input { grid-area: input; min-height: 64px; font-size: 18px; padding: 2px 4px; }
  .tk.view-home #tkAttachBtn { grid-area: attach; }
  .tk.view-home #tkSend { grid-area: send; }
  .tk.view-home .tk-box-tools { grid-area: tools; display: flex; align-items: center; gap: 8px; min-width: 0; }
  .tk.view-home .tk-box-tools .tk-chip { flex: none; white-space: nowrap; min-height: 38px; padding: 0 12px; font-size: 14px; font-weight: 600; color: var(--tk-text); background: var(--tk-surface-2); border-color: var(--tk-line-2); }
  .tk.view-home .tk-box-tools .tk-chip svg { width: 17px; height: 17px; }
  .tk.view-home .tk-box-tools #tkBoxChart svg { color: var(--tk-sky); } .tk.view-home .tk-box-tools #tkBoxTicker svg { color: var(--blue-text); }
  .tk.view-home .tk-box-tools #tkBoxProduct svg { color: var(--tk-long); }
  /* 바로가기는 줄바꿈하지 않는다. 자리가 모자라면(영어) 안내 문구가 두 줄로 접힌다. */
  .tk-box-hint { margin-left: auto; min-width: 0; font-size: 13px; line-height: 1.35; text-align: right; color: var(--tk-text-3); }
  .tk.view-home .tk-hint { display: none; }
  .tk.view-home .tk-chips-row:not(:empty) { margin-bottom: 8px; }
  .tk-home { order: 3; padding: 0; gap: 28px; width: 100%; max-width: 760px; margin: 0 auto; }
  .tk-doors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .tk-door { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 150px; padding: 18px; }
  .tk-door-badge { left: 18px; }
  .tk-door .tk-chev { display: none; }
  .tk-examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .tk-examples-head { grid-column: 1 / -1; }
  .tk-example { min-height: 56px; padding: 0 14px; border: 1px solid var(--tk-line) !important; border-radius: 14px; background: var(--tk-surface); font-size: 14.5px; line-height: 1.4; }
  .tk-example:hover { background: var(--tk-surface-2); }
  .tk-explore { order: 1; width: 100%; max-width: 820px; margin: 0 auto; }

  /* 대화: 넓은 기둥 + 아래 고정 입력창 */
  .tk-thread { order: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 14px 0 18px; gap: 22px; }
  .tk.view-thread .tk-compose, .tk.view-explore .tk-compose { order: 2; width: 100%; max-width: 820px; margin: auto auto 0; padding: 12px 0 18px; }
  .tk-msg-user .in { max-width: 70%; }
  .tk-nums .v { font-size: 17px; }
  .tk-tools { grid-template-columns: repeat(6, minmax(0, 1fr)); }

  .tk-sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 32px)); max-height: 88vh; border-radius: 22px; padding: 18px 22px 24px; }
  .tk-sheet .grab { display: none; }
}
