/* KD Client Hub – same visual language as KD Partner (wp-admin neutrals, white panels, thin lines, one accent). */
:root {
	--ink: #1d2327; --muted: #646970; --line: #dcdcde; --line2: #f0f0f1; --paper: #fff; --soft: #f6f7f7; --bg: #f0f0f1;
	--ok: #1e8e5a; --warn: #b7791f; --bad: #cc3b3b; --info: #8c8f94;
	--kd-accent: #2F4BD8;
	--accent-soft: color-mix(in srgb, var(--kd-accent) 9%, #fff);
	--accent-ink: color-mix(in srgb, var(--kd-accent) 80%, #000);
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
.kdh, .kdh-body { color: var(--ink); font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.kdh *, .kdh *::before, .kdh *::after, .kdh-body *, .kdh-body *::before, .kdh-body *::after { box-sizing: border-box; }
.kdh a, .kdh-body a { color: var(--kd-accent); }
.kdh :focus-visible, .kdh-body :focus-visible { outline: 2px solid var(--kd-accent); outline-offset: 2px; box-shadow: none; }
.kdh h1, .kdh h2, .kdh h3, .kdh h4, .kdh-body h1, .kdh-body h2, .kdh-body h3 { color: var(--ink); margin: 0; }
.kdh p, .kdh-body p { margin: 0; }
.kdh-muted { color: var(--muted); }
.kdh-ic { display: inline-block; flex: none; vertical-align: middle; }
.kdh-flag { flex: none; display: block; }

/* ---------- admin frame ---------- */
.kdh-admin { max-width: 1280px; margin: 8px 20px 40px 2px; }
.kdh-top { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding: 6px 0 18px; }
.kdh-brands { display: flex; align-items: center; gap: 14px; min-width: 0; flex-wrap: wrap; }
.kdh-client-logo { height: 40px; width: auto; max-width: 220px; display: block; }
.kdh-client-name { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.kdh-x { color: var(--muted); font-size: 18px; font-weight: 300; }
.kdh-partner-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink) !important; font-weight: 600; font-size: 15px; }
.kdh-partner-brand img { display: block; }
.kdh-host { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.kdh-host strong { display: block; color: var(--ink); font-weight: 600; }
.kdh-host span span { display: block; }
.kdh-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.kdh-tabs a { padding: 9px 14px 11px; text-decoration: none; color: var(--muted) !important; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.kdh-tabs a:hover { color: var(--ink) !important; }
.kdh-tabs a[aria-current="page"] { color: var(--ink) !important; border-bottom-color: var(--kd-accent); }
.kdh-tabs a:last-child { margin-left: auto; }
.kdh-flash { background: var(--accent-soft); border-left: 3px solid var(--kd-accent); padding: 10px 14px; margin: -6px 0 18px; }
.kdh-flash-warn { background: #fbf1dc; border-left-color: var(--warn); margin-top: 16px; }

.kdh-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 22px 24px; min-width: 0; }
.kdh-panel + .kdh-panel, .kdh-panel + .kdh-actions, .kdh-vital + .kdh-lower, .kdh-hero-panel + .kdh-panel { margin-top: 20px; }
.kdh-panel h3 { font-size: 16px; margin-bottom: 12px; }
.kdh-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.kdh-panel-head h3 { margin-bottom: 2px; }
.kdh-hero-panel { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 26px 30px; }
.kdh-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kdh-kicker { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kdh-h1 { font-size: 30px !important; line-height: 1.12 !important; font-weight: 640 !important; letter-spacing: -0.02em; margin: 6px 0 8px !important; padding: 0 !important; }
.kdh-sub { color: var(--muted); max-width: 70ch; }
.kdh-strong { font-weight: 600; text-decoration: none; }
td > .kdh-muted { display: block; font-size: 12.5px; }

.kdh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 6px 14px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--kd-accent) 45%, var(--line)); background: #fff; color: var(--ink) !important; font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.kdh-btn:hover { border-color: var(--kd-accent); }
.kdh-btn .kdh-ic { color: var(--kd-accent); }
.kdh-btn-main { background: var(--kd-accent); border-color: var(--kd-accent); color: #fff !important; }
.kdh-btn-main .kdh-ic { color: #fff; }
.kdh-btn-main:hover { filter: brightness(1.08); }
.kdh-btn[disabled] { opacity: .55; cursor: default; filter: none; }
.kdh-btn-sm { min-height: 28px; padding: 3px 10px; font-size: 13px; }
.kdh-btn-wide { width: 100%; min-height: 40px; }
.kdh-btn-ghost { border-color: transparent; background: transparent; }
.kdh-btn-ghost:hover { background: var(--soft); border-color: var(--line); }
.kdh-linkbtn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 12.5px; text-decoration: underline; }
.kdh-linkbtn:hover { color: var(--bad); }

.kdh-table { width: 100%; border-collapse: collapse; }
.kdh-table th, .kdh-table td { text-align: left; padding: 10px 12px 10px 0; border-top: 1px solid var(--line2); vertical-align: top; }
.kdh-table th { font-weight: 600; color: var(--muted); font-size: 12.5px; border-top: 0; }
.kdh-table .num { text-align: right; white-space: nowrap; }
.kdh-chip { display: inline-block; font-size: 11.5px; line-height: 1.6; padding: 0 8px; border-radius: 10px; background: #f0f0f1; color: var(--muted); white-space: nowrap; font-weight: 500; }
.kdh-chip-live, .kdh-chip-open, .kdh-chip-r-done, .kdh-chip-st-done { background: #e3f4ea; color: #1b6b45; }
.kdh-chip-staging, .kdh-chip-ro, .kdh-chip-r-queued, .kdh-chip-st-progress { background: #fbf1dc; color: #7a5410; }
.kdh-chip-r-running { background: var(--accent-soft); color: var(--accent-ink); }
.kdh-chip-r-failed, .kdh-chip-arch { background: #fbe7e7; color: #8e2626; }
.kdh-chip-st-open { background: var(--accent-soft); color: var(--accent-ink); }
.kdh-chip-r-imported { background: #eef0f2; color: #50575e; }

/* overview */
.kdh-vital { display: grid; grid-template-columns: minmax(0, 1fr) 340px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; position: relative; }
.kdh-vital::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ok); }
.kdh-vital.kdh-is-warn::before { background: var(--warn); }
.kdh-vital-main { padding: 26px 30px 22px 34px; min-width: 0; }
.kdh-status { font-size: 36px !important; line-height: 1.08 !important; font-weight: 640 !important; letter-spacing: -0.025em; margin: 8px 0 6px !important; padding: 0 !important; }
.kdh-figs { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.kdh-figs dt { color: var(--muted); font-size: 12px; }
.kdh-figs dd { margin: 2px 0 0; font-size: 18px; font-weight: 600; }
.kdh-side-card { background: var(--soft); border-left: 1px solid var(--line); padding: 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.kdh-copy { display: flex; gap: 6px; margin-top: 4px; }
.kdh-copy input { flex: 1; min-width: 0; font-size: 13px; background: #fff; }
.kdh-warn-t { color: var(--warn); font-size: 13px; margin-top: 4px !important; }
.kdh-help { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 6px !important; }
.kdh-lower { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; }
.kdh-side { display: grid; gap: 20px; align-content: start; }
.kdh-side .kdh-panel + .kdh-panel { margin-top: 0; }
.kdh-timeline { margin: 0; padding: 0; list-style: none; position: relative; }
.kdh-timeline::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.kdh-timeline li { position: relative; padding: 0 0 14px 22px; margin: 0; }
.kdh-timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--kd-accent); }
.kdh-timeline time { color: var(--muted); font-size: 12.5px; margin-right: 8px; }
.kdh-timeline p { margin-top: 2px; }
.kdh-quote { color: var(--muted); font-size: 13px; }
.kdh-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.kdh-seg button { border: 0; background: #fff; padding: 6px 14px; font: inherit; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.kdh-seg button + button { border-left: 1px solid var(--line); }
.kdh-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.kdh-seg button[aria-pressed="true"] .kdh-ic { color: var(--kd-accent); }
.kdh-seg button[disabled] { opacity: .5; cursor: default; }
.kdh-kv { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 4px 10px; margin: 14px 0 0; font-size: 13px; }
.kdh-kv dt { color: var(--muted); }
.kdh-kv dd { margin: 0; overflow-wrap: anywhere; }
.kdh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kdh-chips span { font-size: 12.5px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 10px; }

/* pages + forms */
.kdh-pages-table input[type="text"], .kdh-pages-table input:not([type]) { width: 100%; }
.kdh-in-num { width: 70px; }
.kdh-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; }
.kdh-off td { opacity: .5; }
.kdh-off td:first-child { opacity: 1; }
.kdh-del { font-size: 12px; color: var(--muted); white-space: nowrap; }
.kdh-addrow { display: grid; gap: 6px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.kdh-addrow textarea { width: 100%; }
.kdh-logrow td { border-top: 0; padding-top: 0; }
.kdh-pre { white-space: pre-wrap; font-size: 12px; background: var(--soft); padding: 10px; border-radius: 4px; max-height: 320px; overflow: auto; }
.kdh-inline { display: inline; }
.kdh-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.kdh-field label { display: block; font-weight: 600; margin-bottom: 4px; }
.kdh-field input:not([type="checkbox"]):not([type="radio"]), .kdh-field select, .kdh-field textarea { width: 100%; max-width: 100%; }
.kdh-radios { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.kdh-radios label { font-weight: 400; margin: 0; }
.kdh-actions { margin-top: 20px; }
.kdh-clientrow { display: grid; grid-template-columns: 22px minmax(140px, 1fr) minmax(200px, 2fr) 110px auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line2); }
.kdh-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); }

@media (max-width: 960px) {
	.kdh-admin { margin-right: 10px; }
	.kdh-vital, .kdh-lower, .kdh-grid2 { grid-template-columns: 1fr; }
	.kdh-side-card { border-left: 0; border-top: 1px solid var(--line); }
	.kdh-status { font-size: 28px !important; }
	.kdh-clientrow { grid-template-columns: 22px 1fr; }
	.kdh-clientrow input, .kdh-clientrow button { grid-column: 2; }
}

/* =====================================================================
   Front: review.kostaras.digital and desk.kostaras.digital
   ===================================================================== */
html, .kdh-body { margin: 0; background: var(--bg); font-family: var(--font); -webkit-font-smoothing: antialiased; }
.kdh-body { min-height: 100vh; }
.kdh-body input, .kdh-body textarea, .kdh-body select, .kdh-body button { font: inherit; color: inherit; }
.kdh-body input[type="text"], .kdh-body input[type="password"], .kdh-body input:not([type]), .kdh-body textarea, .kdh-body select {
	border: 1px solid #8c8f94; border-radius: 4px; padding: 7px 10px; background: #fff; min-height: 36px; width: 100%;
}
.kdh-body textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
.kdh-body input:focus, .kdh-body textarea:focus, .kdh-body select:focus { border-color: var(--kd-accent); outline: 1px solid var(--kd-accent); outline-offset: 0; }
.kdh-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60vh; color: var(--muted); }
.kdh-spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--kd-accent); border-radius: 50%; animation: kdh-rot .8s linear infinite; display: inline-block; }
@keyframes kdh-rot { to { transform: rotate(360deg); } }
.kdh-noscript { padding: 40px 16px; text-align: center; }
.kdh-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* gate: passcode + who are you */
.kdh-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.kdh-gate-card { width: min(460px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 30px 30px 26px; position: relative; overflow: hidden; }
.kdh-gate-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--kd-accent); }
.kdh-gate-brands { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.kdh-gate-brands img.kdh-cl { max-height: 38px; max-width: 200px; }
.kdh-gate h1 { font-size: 24px; font-weight: 640; letter-spacing: -0.015em; line-height: 1.2; margin: 2px 0 6px; }
.kdh-gate p.kdh-lead { color: var(--muted); margin-bottom: 18px; }
.kdh-gate form { display: grid; gap: 10px; }
.kdh-gate label { font-weight: 600; }
.kdh-err { color: var(--bad); font-size: 13px; min-height: 1em; }
.kdh-names { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.kdh-names button { border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 6px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.kdh-names button:hover { border-color: var(--kd-accent); background: var(--accent-soft); }
.kdh-ava { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; flex: none; letter-spacing: .02em; }
.kdh-names .kdh-ava { width: 22px; height: 22px; font-size: 10.5px; }
.kdh-ava-agency { background: var(--ink); color: #fff; }
.kdh-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 6px 0; }
.kdh-or::before, .kdh-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.kdh-row { display: flex; gap: 8px; }
.kdh-row > input { flex: 1; }
.kdh-gate-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.kdh-gate-foot .kdh-host { font-size: 12.5px; }

/* app shell */
.kdh-screen-review { overflow: hidden; }
.kdh-shell { display: grid; grid-template-rows: auto auto minmax(0, 1fr); height: 100vh; height: 100dvh; }
.kdh-bar { display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: var(--paper); border-bottom: 1px solid var(--line); min-width: 0; }
.kdh-bar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
.kdh-bar-brand img.kdh-cl { height: 28px; max-width: 150px; width: auto; display: block; }
.kdh-bar-brand .kdh-x { font-size: 15px; }
.kdh-bar-brand .kdh-kd { height: 22px; width: auto; display: block; }
.kdh-bar-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.kdh-bar-title strong { font-size: 15px; font-weight: 640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kdh-bar-tabs { display: flex; gap: 2px; }
.kdh-bar-tabs button { border: 0; background: transparent; padding: 7px 12px; border-radius: 4px; cursor: pointer; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
.kdh-bar-tabs button:hover { background: var(--soft); color: var(--ink); }
.kdh-bar-tabs button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); }
.kdh-bar-tabs button[aria-pressed="true"] .kdh-ic { color: var(--kd-accent); }
.kdh-count { font-size: 11px; background: var(--kd-accent); color: #fff; border-radius: 9px; padding: 0 6px; line-height: 1.6; font-weight: 600; }
.kdh-me { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 3px 12px 3px 4px; cursor: pointer; max-width: 200px; }
.kdh-me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kdh-me:hover { border-color: var(--kd-accent); }
.kdh-round select { min-height: 32px !important; padding: 4px 28px 4px 10px !important; width: auto !important; font-size: 13px; }
.kdh-env { font-size: 11.5px; padding: 1px 8px; border-radius: 10px; background: #fbf1dc; color: #7a5410; white-space: nowrap; font-weight: 500; }
.kdh-env-live { background: #e3f4ea; color: #1b6b45; }
.kdh-banner { background: #fbf8ec; border-bottom: 1px solid #efe4c2; padding: 8px 16px; font-size: 13px; display: flex; gap: 10px; align-items: center; }
.kdh-banner button { margin-left: auto; }
.kdh-banner-ro { background: #fbe7e7; border-color: #f2c9c9; }

.kdh-main { display: grid; grid-template-columns: var(--rail, 260px) minmax(0, 1fr) var(--pane, 360px); min-height: 0; }
.kdh-main.kdh-no-rail { --rail: 0px; }
.kdh-main.kdh-no-pane { --pane: 0px; }
.kdh-rail, .kdh-pane { background: var(--paper); min-height: 0; overflow: auto; }
.kdh-rail { border-right: 1px solid var(--line); padding: 10px 0 20px; }
.kdh-no-rail .kdh-rail, .kdh-no-pane .kdh-pane { display: none; }
.kdh-rail-search { padding: 2px 12px 8px; }
.kdh-rail-search input { min-height: 32px !important; font-size: 13px; }
.kdh-grp { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 16px 4px; }
.kdh-pg { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 6px 12px 6px 14px; cursor: pointer; border-left: 3px solid transparent; }
.kdh-pg:hover { background: var(--soft); }
.kdh-pg[aria-current="true"] { background: var(--accent-soft); border-left-color: var(--kd-accent); }
.kdh-pg-thumb { width: 44px; height: 30px; border-radius: 3px; border: 1px solid var(--line); background: var(--soft) center top / cover no-repeat; }
.kdh-pg-t { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kdh-pg-n { font-size: 11px; min-width: 20px; text-align: center; border-radius: 9px; padding: 0 6px; background: var(--kd-accent); color: #fff; font-weight: 600; line-height: 1.6; }
.kdh-pg-n.kdh-zero { background: transparent; color: var(--muted); font-weight: 400; }

.kdh-stage { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }
.kdh-tools { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--paper); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.kdh-tools .kdh-seg button { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.kdh-tools .kdh-sp { flex: 1; }
.kdh-tools-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; }
.kdh-icbtn { border: 1px solid transparent; background: transparent; border-radius: 4px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); }
.kdh-icbtn:hover { background: var(--soft); border-color: var(--line); color: var(--ink); }
.kdh-icbtn[aria-pressed="true"] { color: var(--kd-accent); }
.kdh-viewer { overflow: auto; position: relative; background: #e6e7e9; overscroll-behavior: contain; }
.kdh-canvas { position: relative; margin: 24px auto 60px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 30px rgba(0,0,0,.08); cursor: crosshair; transform-origin: 0 0; }
.kdh-canvas.kdh-readonly { cursor: default; }
.kdh-canvas img.kdh-shot { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.kdh-older { position: sticky; top: 10px; z-index: 6; width: max-content; max-width: calc(100% - 20px); margin: 10px auto -40px; background: var(--ink); color: #fff; font-size: 12.5px; padding: 5px 12px; border-radius: 14px; }
.kdh-empty { max-width: 460px; margin: 12vh auto; text-align: center; color: var(--muted); padding: 0 16px; }
.kdh-empty h2 { color: var(--ink); font-size: 18px; margin-bottom: 6px; }

.kdh-pin { position: absolute; transform: translate(-50%, -100%); width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; rotate: -45deg; background: var(--kd-accent); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; z-index: 3; transform-origin: 50% 100%; }
.kdh-pin span { rotate: 45deg; font-size: 12px; font-weight: 700; line-height: 1; }
.kdh-pin:hover, .kdh-pin.kdh-on { z-index: 5; box-shadow: 0 0 0 4px color-mix(in srgb, var(--kd-accent) 30%, transparent), 0 2px 6px rgba(0,0,0,.3); }
.kdh-pin.kdh-st-done, .kdh-pin.kdh-st-wontfix { background: #7c8389; }
.kdh-pin.kdh-st-progress { background: var(--warn); }
.kdh-pin.kdh-draft { background: var(--ink); }
.kdh-pin.kdh-old { opacity: .75; }
.kdh-pop { position: absolute; z-index: 8; width: 300px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.2); padding: 14px; cursor: default; }
.kdh-pop textarea { min-height: 84px; }
.kdh-pop-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.kdh-pop-actions .kdh-sp { flex: 1; }
.kdh-pop-who { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.kdh-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.kdh-files a, .kdh-files span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; max-width: 100%; }
.kdh-files img { width: 64px; height: 44px; object-fit: cover; border-radius: 3px; display: block; }
.kdh-files a.kdh-fimg { padding: 0; overflow: hidden; }

/* comments pane */
.kdh-pane { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.kdh-pane-head { position: sticky; top: 0; background: var(--paper); z-index: 2; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.kdh-pane-head h2 { font-size: 15px; font-weight: 640; }
.kdh-filter { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; width: max-content; max-width: 100%; }
.kdh-filter button { border: 0; background: #fff; padding: 4px 10px; cursor: pointer; color: var(--muted); font-size: 12.5px; }
.kdh-filter button + button { border-left: 1px solid var(--line); }
.kdh-filter button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.kdh-hint { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.kdh-hint .kdh-ic { color: var(--kd-accent); margin-top: 1px; }
.kdh-list { list-style: none; margin: 0; padding: 0; }
.kdh-c { border-bottom: 1px solid var(--line2); padding: 12px 14px; cursor: pointer; }
.kdh-c:hover { background: #fafafa; }
.kdh-c.kdh-on { background: var(--accent-soft); }
.kdh-c-head { display: flex; align-items: center; gap: 8px; }
.kdh-c-num { width: 22px; height: 22px; border-radius: 50%; background: var(--kd-accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.kdh-st-done .kdh-c-num, .kdh-st-wontfix .kdh-c-num { background: #7c8389; }
.kdh-st-progress .kdh-c-num { background: var(--warn); }
.kdh-c-who { font-weight: 600; font-size: 13px; }
.kdh-c-when { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.kdh-c-text { margin-top: 6px !important; white-space: pre-wrap; overflow-wrap: anywhere; }
.kdh-st-done .kdh-c-text, .kdh-st-wontfix .kdh-c-text { color: var(--muted); }
.kdh-c-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.kdh-c-meta select { width: auto !important; min-height: 26px !important; padding: 1px 24px 1px 8px !important; font-size: 12px; }
.kdh-c-meta .kdh-linkbtn { font-size: 12px; }
.kdh-replies { margin: 10px 0 0 8px; padding-left: 12px; border-left: 2px solid var(--line); display: grid; gap: 8px; }
.kdh-reply .kdh-c-who { font-size: 12.5px; }
.kdh-reply .kdh-c-text { margin-top: 2px !important; font-size: 13.5px; }
.kdh-replyform { margin-top: 8px; display: grid; gap: 6px; }
.kdh-replyform textarea { min-height: 54px; font-size: 13.5px; }
.kdh-badge-round { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; padding: 0 6px; }
.kdh-pane-empty { padding: 28px 18px; color: var(--muted); text-align: center; font-size: 13.5px; }
.kdh-pane-foot { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }

/* board */
.kdh-board { overflow: auto; padding: 20px; min-height: 0; grid-column: 1 / -1; }
.kdh-board-in { max-width: 1180px; margin: 0 auto; }
.kdh-board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.kdh-board-head h1 { font-size: 26px; font-weight: 640; letter-spacing: -0.02em; }
.kdh-board-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kdh-board-filters select, .kdh-board-filters input { width: auto !important; min-height: 32px !important; font-size: 13px; }
.kdh-stats { display: flex; gap: 8px 30px; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 14px 20px; margin-bottom: 14px; }
.kdh-stats div { display: grid; }
.kdh-stats dt { font-size: 12px; color: var(--muted); }
.kdh-stats dd { margin: 0; font-size: 20px; font-weight: 640; }
.kdh-cards { display: grid; gap: 10px; }
.kdh-card { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 12px; cursor: pointer; align-items: start; }
.kdh-card:hover { border-color: var(--kd-accent); }
.kdh-card-shot { width: 120px; height: 80px; border-radius: 4px; border: 1px solid var(--line); background: var(--soft) no-repeat; background-size: 360px auto; position: relative; overflow: hidden; }
.kdh-card-shot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: var(--kd-accent); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.kdh-card h3 { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kdh-card .kdh-c-text { margin-top: 4px !important; }
.kdh-card-side { display: grid; gap: 6px; justify-items: end; }

/* toast + dialog */
.kdh-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 20px; font-size: 13.5px; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.kdh-dialog { border: 0; border-radius: 8px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink); }
.kdh-dialog::backdrop { background: rgba(20, 24, 32, .45); }
.kdh-dialog > div { padding: 22px 24px; }
.kdh-lightbox { position: fixed; inset: 0; background: rgba(20,24,32,.85); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.kdh-lightbox img { max-width: 100%; max-height: 100%; border-radius: 4px; }

/* home + desk */
.kdh-home { max-width: 980px; margin: 0 auto; padding: 40px 16px; }
.kdh-home .kdh-top { padding-bottom: 24px; }
.kdh-home-list { display: grid; gap: 10px; margin-top: 16px; }
.kdh-home-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px; text-decoration: none; color: var(--ink) !important; }
.kdh-home-item:hover { border-color: var(--kd-accent); }
.kdh-home-item strong { font-size: 15px; }

@media (max-width: 1100px) { .kdh-main { --rail: 220px; --pane: 320px; } }
@media (max-width: 860px) {
	.kdh-screen-review { overflow: auto; }
	.kdh-shell { height: auto; min-height: 100dvh; grid-template-rows: auto auto auto; }
	.kdh-bar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
	.kdh-bar-title { order: 3; flex-basis: 100%; flex-wrap: wrap; row-gap: 6px; }
	.kdh-bar-title strong { flex: 1 1 100%; white-space: normal; }
	.kdh-round select { max-width: 100%; }
	.kdh-bar-brand img.kdh-cl { height: 24px; }
	.kdh-me { margin-left: auto; padding-right: 4px; }
	.kdh-me span:last-child { display: none; }
	.kdh-main { grid-template-columns: 1fr; }
	.kdh-rail { display: none !important; }
	.kdh-viewer { height: 72dvh; }
	.kdh-pane { border-left: 0; border-top: 1px solid var(--line); display: flex !important; }
	.kdh-pane-head { position: static; }
	.kdh-tools { position: sticky; top: 0; z-index: 7; }
	.kdh-pagesel { display: block !important; flex: 1 1 160px; min-width: 0; }
	.kdh-pagesel select { min-height: 32px !important; font-size: 13px; padding: 4px 8px !important; }
	.kdh-tools-title, .kdh-desk-only { display: none !important; }
	.kdh-card { grid-template-columns: 80px minmax(0, 1fr); }
	.kdh-card-shot { width: 80px; height: 60px; background-size: 240px auto; }
	.kdh-card-side { grid-column: 1 / -1; justify-items: start; grid-auto-flow: column; justify-content: start; }
	.kdh-board { padding: 14px 12px; }
	.kdh-pop { width: min(300px, calc(100vw - 40px)); }
}
.kdh-pagesel { display: none; }
@media print {
	.kdh-bar, .kdh-tools, .kdh-board-filters, .kdh-rail, .kdh-pane { display: none !important; }
	.kdh-screen-review { overflow: visible; }
	.kdh-shell { height: auto; display: block; }
}
