/* Standalone naming surface, isolated from portal and writer themes. */
dialog.lk-name-dialog {
  --name-ink:#2c4037; --name-muted:#78837a; --name-green:#315f50; --name-border:#e3e8df; --name-paper:#fcfcf9;
  box-sizing:border-box; position:fixed; inset:0; display:none; width:min(1160px,calc(100vw - 48px)); max-width:1160px;
  height:min(760px,calc(100dvh - 48px)); max-height:calc(100dvh - 48px); margin:auto; padding:0;
  border:1px solid var(--name-border); border-radius:22px; overflow:hidden; background:var(--name-paper); color:var(--name-ink);
  box-shadow:0 24px 90px #14271f2e,0 2px 8px #14271f0a;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',sans-serif;
  font-size:14px; font-weight:400; line-height:1.5; text-align:left; letter-spacing:0; color-scheme:light; transform:none; animation:none;
}
dialog.lk-name-dialog[open] { display:flex; flex-direction:column; }
dialog.lk-name-dialog::backdrop { background:#14271f66; backdrop-filter:blur(7px); }
.lk-name-dialog *, .lk-name-dialog *::before, .lk-name-dialog *::after { box-sizing:border-box; }
.lk-name-dialog :is(h2,h3,p) { margin:0; padding:0; }
.lk-name-dialog :is(button,input,select,textarea) { font:inherit; color:inherit; letter-spacing:0; box-shadow:none; text-transform:none; }
.lk-name-dialog button { cursor:pointer; margin:0; width:auto; min-width:0; max-width:none; height:auto; min-height:0; border:0; border-radius:0; background:transparent; line-height:1.5; font-weight:400; text-align:center; }
.lk-name-dialog :is(button,select,input,textarea,summary):focus-visible { outline:2px solid #739b82; outline-offset:3px; }
.lk-name-dialog :is(button,select):disabled { opacity:.48; cursor:not-allowed; }
.lk-name-select-wrap:has(select:disabled) { background:#f0f2ed; }
.lk-name-dialog [hidden] { display:none!important; }
.lk-name-dialog .lk-name-header { flex:0 0 86px; display:flex; align-items:center; justify-content:space-between; gap:20px; min-height:86px; margin:0; padding:0 26px; border-bottom:1px solid var(--name-border); background:#fffefa; }
.lk-name-brand { display:flex; align-items:center; gap:13px; min-width:0; }
.lk-name-brand-icon { display:grid; place-items:center; flex:0 0 42px; width:42px; height:42px; border:1px solid #dce5d8; border-radius:13px; color:var(--name-green); background:#f0f4e9; }
.lk-name-brand-icon svg { width:23px; height:23px; }
.lk-name-dialog .lk-name-title { color:var(--name-ink); font-size:23px; line-height:1.3; font-weight:600; letter-spacing:.4px; }
.lk-name-dialog .lk-name-subtitle { margin-top:5px; color:var(--name-muted); font-size:12px; line-height:1.5; }
.lk-name-header-actions { display:flex; align-items:center; gap:14px; flex-shrink:0; }
.lk-name-dialog .lk-name-favorites-toggle { display:flex; align-items:center; gap:6px; padding:8px 12px; border:1px solid var(--name-border); border-radius:9px; color:#637365; background:#fffefa; font-size:13px; }
.lk-name-favorites-toggle svg { width:15px; height:15px; }
.lk-name-dialog .lk-name-favorites-toggle:is(:hover,.is-active) { background:#eaf1e7; color:var(--name-green); border-color:#b9cdbb; }
.lk-name-dialog .lk-name-close { display:grid; place-items:center; width:36px; height:36px; padding:8px; border-radius:50%; color:#7d867e; }
.lk-name-dialog .lk-name-close:hover { background:#edf0e8; color:var(--name-ink); }
.lk-name-close svg { width:20px; height:20px; }
.lk-name-body { display:grid; grid-template-columns:92px 306px minmax(0,1fr); flex:1; min-height:0; }
.lk-name-categories { padding:18px 10px; border-right:1px solid var(--name-border); background:#f5f6ef; overflow-y:auto; scrollbar-width:thin; }
.lk-name-dialog .lk-name-category { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; width:100%; min-height:65px; margin-bottom:7px; padding:10px 6px; border-radius:12px; color:#7b8579; font-size:13px; }
.lk-name-category-icon { display:inline-flex; }
.lk-name-category-icon svg { width:19px; height:19px; }
.lk-name-dialog .lk-name-category:hover { background:#e9eee2; color:var(--name-green); }
.lk-name-dialog .lk-name-category.is-selected { color:#fffef7; background:var(--name-green); box-shadow:0 3px 8px #244f3d1a; }
.lk-name-controls { display:flex; flex-direction:column; min-height:0; gap:15px; padding:24px 22px 22px; border-right:1px solid var(--name-border); background:#fafbf6; overflow-y:auto; scrollbar-width:thin; scrollbar-color:#d5dece transparent; }
.lk-name-control-row { display:grid; grid-template-columns:minmax(0,.87fr) minmax(0,1.13fr); gap:8px; }
.lk-name-select-wrap { display:flex; flex-shrink:0; align-items:center; position:relative; min-width:0; min-height:42px; border:1px solid #dce3d8; border-radius:9px; background:#fff; }
.lk-name-select-prefix { padding-left:10px; color:#8a9386; font-size:12px; flex-shrink:0; pointer-events:none; }
.lk-name-dialog .lk-name-select { min-width:0; width:100%; height:40px; margin:0; padding:8px 26px 8px 12px; border:0; border-radius:9px; appearance:none; background:transparent; cursor:pointer; font-size:14px; }
.lk-name-dialog .has-prefix .lk-name-select { padding-left:7px; font-size:13px; }
.lk-name-select-arrow { position:absolute; right:12px; top:16px; width:6px; height:6px; border:0; border-right:1.5px solid #788572; border-bottom:1.5px solid #788572; transform:rotate(45deg); pointer-events:none; }
.lk-name-field { flex-shrink:0; }
.lk-name-field-heading { display:flex; justify-content:space-between; align-items:baseline; gap:6px; min-height:20px; margin:0 0 8px; color:#667362; font-size:12px; }
.lk-name-field-actions { display:flex; align-items:center; gap:9px; }
.lk-name-dialog .lk-name-text-button { padding:0; color:#527b60; font-size:12px; white-space:nowrap; }
.lk-name-dialog .lk-name-text-button:hover { text-decoration:underline; text-underline-offset:3px; }
.lk-name-segments { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.lk-name-segments:has(> :last-child:nth-child(2)) { grid-template-columns:repeat(2,minmax(0,1fr)); }
.lk-name-dialog .lk-name-segment { min-height:38px; padding:8px 4px; border:1px solid #e0e5db; border-radius:8px; color:#707c6c; background:#fff; font-size:13px; white-space:nowrap; }
.lk-name-dialog .lk-name-segment:hover { border-color:#a4bca2; background:#f2f6ed; }
.lk-name-dialog .lk-name-segment.is-selected { border-color:#9db395; background:#eaf1e2; color:#3c623f; font-weight:500; }
.lk-name-text-wrap { position:relative; height:42px; }
.lk-name-dialog .lk-name-input { display:block; width:100%; height:42px; padding:9px 52px 9px 11px; border:1px solid #dce3d8; border-radius:9px; background:#fff; font-size:13px; }
.lk-name-dialog :is(input,textarea)::placeholder { color:#a1aa9c; opacity:1; }
.lk-name-char-count { position:absolute; right:12px; bottom:11px; color:#9ba693; font-size:11px; pointer-events:none; white-space:nowrap; }
.lk-name-requirements { display:flex; flex-direction:column; flex:1 0 124px; min-height:124px; }
.lk-name-unlimited { color:#859576; font-size:10px; white-space:nowrap; }
.lk-name-textarea-wrap { position:relative; display:flex; flex:1; min-height:94px; }
.lk-name-dialog .lk-name-textarea { display:block; width:100%; min-height:94px; height:100%; resize:none; padding:10px 11px 29px; margin:0; border:1px solid #dce3d8; border-radius:9px; background:#fff; line-height:1.7; font-size:13px; }
.lk-name-dialog .lk-name-guidance { margin-top:-5px; font-size:10px; line-height:1.7; color:#929c89; }
.lk-name-dialog .lk-name-generate { display:flex; flex:0 0 46px; align-items:center; justify-content:center; gap:9px; width:100%; min-height:46px; margin-top:auto; padding:10px 14px; border-radius:10px; color:#fffef8; background:var(--name-green); box-shadow:0 4px 10px #315f5014; font-size:15px; font-weight:500; }
.lk-name-dialog .lk-name-generate:hover { background:#254c3f; }
.lk-name-generate svg { width:17px; height:17px; }
.lk-name-results { display:flex; flex-direction:column; min-width:0; min-height:0; gap:12px; padding:24px 26px 17px; background:var(--name-paper); }
.lk-name-results-header { display:flex; flex:0 0 auto; flex-direction:column; gap:6px; }
.lk-name-results-heading { display:flex; align-items:center; gap:10px; }
.lk-name-dialog .lk-name-results-title { font-size:17px; font-weight:600; line-height:1.5; color:#354c3b; }
.lk-name-results-count { border:1px solid #e2e7d9; border-radius:20px; padding:2px 8px; color:#829074; background:#f3f5ec; font-size:10px; }
.lk-name-dialog .lk-name-result-hint { font-size:11px; line-height:1.6; color:#9aa28f; text-align:left; }
.lk-name-grid { display:grid; flex:1; min-height:0; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:repeat(7,minmax(46px,1fr)); gap:8px; align-items:stretch; padding:2px; overflow-y:auto; scrollbar-width:thin; scrollbar-color:#d5dece transparent; }
.lk-name-grid.is-favorites { grid-template-rows:none; grid-auto-rows:minmax(59px,auto); align-content:start; }
.lk-name-result { display:flex; position:relative; align-items:center; justify-content:center; min-width:0; min-height:0; border:1px solid #e7ebdf; border-radius:11px; background:#fffefa; transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease; }
.lk-name-result:hover { border-color:#a8bca0; background:#f5f8ee; box-shadow:0 2px 8px #5777480a; }
.lk-name-dialog .lk-name-result-copy { display:grid; place-items:center; width:100%; height:100%; min-height:44px; padding:9px 20px; border-radius:10px; word-break:break-word; line-height:1.45; font-family:'Noto Serif SC','Songti SC',SimSun,serif; font-size:19px; font-weight:500; color:#3a513e; user-select:text; }
.lk-name-dialog .lk-name-star { display:grid; place-items:center; position:absolute; right:3px; top:3px; width:25px; height:25px; padding:5px; border-radius:6px; color:#aeb8a1; opacity:.25; }
.lk-name-star svg { width:14px; height:14px; }
.lk-name-result:hover .lk-name-star, .lk-name-result:focus-within .lk-name-star, .lk-name-dialog .lk-name-star.is-saved { opacity:1; }
.lk-name-dialog .lk-name-star.is-saved { color:#b69144; }
.lk-name-star.is-saved svg { fill:#ead899; }
.lk-name-dialog .lk-name-star:hover { background:#e7eedc; }
.lk-name-dialog .lk-name-notice { flex:0 0 auto; padding:7px 10px; border:1px solid #ece8d9; background:#f6f4eb; border-radius:8px; color:#96896c; font-size:10px; line-height:1.6; }
.lk-name-dialog .lk-name-status { flex:0 0 auto; min-height:16px; padding:0 2px; font-size:11px; line-height:1.5; text-align:left; color:#72916b; }
.lk-name-vocabulary { flex:0 0 auto; border-top:1px solid var(--name-border); padding-top:10px; color:#87917f; font-size:11px; }
.lk-name-vocabulary-summary { display:flex; align-items:center; gap:9px; cursor:pointer; list-style:none; border-radius:8px; }
.lk-name-vocabulary-summary::-webkit-details-marker { display:none; }
.lk-name-vocabulary-mark { display:grid; place-items:center; flex:0 0 29px; width:29px; height:29px; border:1px solid #e0e8d9; border-radius:9px; background:#f0f4e9; color:#80966e; }
.lk-name-vocabulary-mark svg { width:15px; height:15px; }
.lk-name-vocabulary-summary-copy { flex:1; min-width:0; }
.lk-name-vocabulary-title { display:block; color:#697e5c; font-size:11px; }
.lk-name-vocabulary-compact { display:block; margin-top:2px; color:#939e87; font-size:10px; line-height:1.7; }
.lk-name-vocabulary-chevron { display:flex; color:#a2ad98; }
.lk-name-vocabulary-chevron svg { width:15px; height:15px; }
.lk-name-vocabulary-details[open] .lk-name-vocabulary-chevron { transform:rotate(180deg); }
.lk-name-vocabulary-expanded { margin-top:12px; padding:11px 12px; border-radius:9px; background:#f2f5ec; max-height:145px; overflow-y:auto; scrollbar-width:thin; }
.lk-name-vocabulary-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:11px; }
.lk-name-dialog .lk-name-vocabulary-refresh { flex:0 0 auto; border:1px solid #cfdcc8; border-radius:6px; background:#fcfdf9; color:#60815a; padding:4px 8px; font-size:11px; }
.lk-name-dialog .lk-name-vocabulary-refresh:hover { background:#e4eddb; }
.lk-name-dialog .lk-name-vocabulary-meta { font-size:10px; line-height:1.8; margin-top:6px; overflow-wrap:anywhere; white-space:pre-line; }
.lk-name-dialog .lk-name-vocabulary-warning { margin-top:7px; color:#a56b47; font-size:11px; line-height:1.6; }
.lk-name-vocabulary-sources { margin-top:5px; font-size:10px; line-height:1.9; }
.lk-name-vocabulary-sources summary { cursor:pointer; color:#829573; }
.lk-name-vocabulary-sources a { display:inline-block; color:#5b7e56; margin-right:12px; text-decoration:none; }
.lk-name-vocabulary-sources a:hover { text-decoration:underline; }
.lk-name-empty { grid-column:1/-1; grid-row:1/-1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:25px; text-align:center; color:#98a08f; }
.lk-name-empty strong { font-size:18px; font-weight:500; }
.lk-name-dialog .lk-name-empty p { font-size:12px; line-height:1.8; }
.lk-name-dialog .lk-name-copy-fallback { position:fixed; left:8px; top:8px; width:1px; height:1px; min-height:0; padding:0; opacity:0; }
.workspace-controls .quick-naming-entry { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:32px; padding:4px 10px; border:1px solid #d7e2d0; border-radius:7px; background:#f4f7ee; color:#53704a; font:inherit; font-size:13px; white-space:nowrap; cursor:pointer; }
.workspace-controls .quick-naming-entry:hover { background:#e8f0df; border-color:#a8bd9d; }
.workspace-controls .quick-naming-entry:focus-visible { outline:2px solid #739b82; outline-offset:3px; }
/* Writer :is(dialog,#id) rules give plain dialogs ID specificity too. */
body dialog#lk-name-dialog.lk-name-dialog { background:#fcfcf9; color:#2c4037; border-color:#e3e8df; border-radius:22px; box-shadow:0 24px 90px #14271f2e,0 2px 8px #14271f0a; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',sans-serif; }
body dialog#lk-name-dialog.lk-name-dialog::backdrop { background:#14271f66; backdrop-filter:blur(7px); }
body #lk-name-dialog :is(button,input,select,textarea) { font-family:inherit; }
body #lk-name-dialog .lk-name-result-copy { font-family:'Noto Serif SC','Songti SC',SimSun,serif; }
body #lk-name-dialog :is(button,input,select,textarea,summary):focus-visible { outline:2px solid #739b82; outline-offset:3px; }
@media (max-height:790px) and (min-width:781px) {
  .lk-name-dialog .lk-name-header { flex-basis:72px; min-height:72px; }
  .lk-name-controls { gap:11px; padding-top:19px; padding-bottom:18px; }
  .lk-name-field-heading { margin-bottom:6px; }
  .lk-name-requirements { flex-basis:104px; min-height:104px; }
  .lk-name-textarea-wrap, .lk-name-dialog .lk-name-textarea { min-height:77px; }
  .lk-name-results { padding-top:18px; gap:9px; }
  .lk-name-dialog .lk-name-result-copy { font-size:18px; }
}
@media (max-width:1060px) and (min-width:781px) {
  .lk-name-body { grid-template-columns:78px 280px minmax(0,1fr); }
  .lk-name-controls { padding-left:17px; padding-right:17px; }
  .lk-name-results { padding-left:18px; padding-right:18px; }
  .lk-name-dialog .lk-name-result-copy { font-size:17px; height:auto; min-height:100%; line-height:1.35; padding:6px 12px; }
  .lk-name-grid { gap:6px; grid-template-rows:none; grid-auto-rows:minmax(62px,auto); align-content:start; }
}
@media (max-width:780px) {
  dialog.lk-name-dialog { width:calc(100vw - 20px); height:calc(100dvh - 24px); max-height:calc(100dvh - 24px); font-size:14px; }
  body dialog#lk-name-dialog.lk-name-dialog { border-radius:17px; }
  .lk-name-dialog .lk-name-header { flex-basis:72px; min-height:72px; padding:0 17px; gap:10px; }
  .lk-name-brand { gap:9px; }
  .lk-name-brand-icon { flex-basis:34px; width:34px; height:34px; border-radius:11px; }
  .lk-name-brand-icon svg { width:19px; height:19px; }
  .lk-name-dialog .lk-name-title { font-size:19px; }
  .lk-name-dialog .lk-name-subtitle { font-size:10px; max-width:170px; }
  .lk-name-header-actions { gap:4px; }
  .lk-name-dialog .lk-name-favorites-toggle { padding:7px 8px; font-size:11px; }
  .lk-name-dialog .lk-name-close { width:30px; height:34px; padding:6px; }
  .lk-name-body { display:block; overflow-y:auto; scrollbar-width:thin; }
  .lk-name-categories { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; padding:10px 12px; border-right:0; border-bottom:1px solid var(--name-border); overflow:visible; }
  .lk-name-dialog .lk-name-category { width:100%; min-height:51px; margin:0; padding:7px 2px; gap:4px; font-size:11px; border-radius:9px; }
  .lk-name-category-icon svg { width:17px; height:17px; }
  .lk-name-controls { display:grid; grid-template-columns:1fr 1fr; gap:15px; padding:18px; overflow:visible; border-right:0; border-bottom:1px solid var(--name-border); }
  .lk-name-controls > .lk-name-select-wrap, .lk-name-controls > .lk-name-control-row, .lk-name-controls > .lk-name-requirements, .lk-name-controls > .lk-name-guidance, .lk-name-controls > .lk-name-generate { grid-column:1/-1; }
  .lk-name-controls > .lk-name-field:has(.lk-name-text-wrap) { grid-column:1/-1; }
  .lk-name-control-row { grid-template-columns:1fr 1fr; }
  .lk-name-dialog .lk-name-segment { min-height:42px; }
  .lk-name-requirements { min-height:112px; }
  .lk-name-textarea-wrap, .lk-name-dialog .lk-name-textarea { min-height:84px; }
  .lk-name-dialog .lk-name-guidance { font-size:11px; }
  .lk-name-results { min-height:630px; padding:19px 18px; gap:12px; }
  .lk-name-grid { min-height:440px; grid-template-rows:repeat(7,minmax(55px,1fr)); gap:7px; overflow:visible; }
  .lk-name-dialog .lk-name-result-copy { font-size:17px; padding:10px 10px; }
  .lk-name-dialog .lk-name-star { opacity:.5; }
  .lk-name-grid.is-favorites { min-height:200px; grid-template-rows:none; }
  .lk-name-vocabulary-expanded { max-height:none; }
}
@media (max-width:390px) {
  .lk-name-dialog .lk-name-header { padding:0 12px; }
  .lk-name-brand-icon { display:none; }
  .lk-name-dialog .lk-name-subtitle { font-size:9px; }
  .lk-name-controls, .lk-name-results { padding-left:13px; padding-right:13px; }
  .lk-name-dialog .lk-name-result-copy { font-size:16px; }
}
@media (prefers-reduced-motion:reduce) { .lk-name-result { transition:none; } }
