/* Settings: shell, categories, and the detail pages. */
.nook-settings-backdrop { display:flex; position:fixed; inset:0; z-index:100; align-items:center; justify-content:center; padding:24px; }
.nook-settings-shell { display:flex; flex-direction:row; width:min(860px,100%); height:min(86dvh,800px); max-height:calc(100dvh - 48px); overflow:hidden; }
.nook-settings-master { flex:0 0 260px; min-width:0; display:flex; flex-direction:column; border-right:1px solid var(--border-color); }
.nook-settings-header { display:flex; flex-shrink:0; gap:8px; align-items:center; min-height:53px; padding:4px 8px; }
.nook-settings-header h2 { flex:1; min-width:0; font-size:20px; line-height:24px; font-weight:800; margin:0; outline:none; }
.nook-master-header h2 { flex:0 1 auto; }
.nook-master-header .nook-demo-badge { margin-right:auto; margin-left:-6px; font-size:20px; }
/* "Replay mode" at title size doesn't fit beside "Settings" in the 260px column. */
.nook-master-header .nook-replay-badge { margin-left:0; font-size:13px; line-height:16px; font-weight:700; white-space:nowrap; }
/* X dialog header: close at the left, then the title; the commit action sits at the far right. */
.nook-master-header { gap:12px; padding-left:8px; }
@media (min-width:800px) { .nook-settings-exit { display:none; } }
@media (max-width:799px) { .nook-settings-close { display:none; } }
.nook-settings-master-intro { padding:4px 16px 24px; font-size:13px; line-height:18px; color:var(--text-secondary); }
.nook-settings-navigation { overflow-y:auto; flex:1; }
.nook-settings-nav { display:flex; align-items:center; gap:12px; width:100%; min-height:48px; padding:12px 16px; background:transparent; border:0; border-right:2px solid transparent; text-align:left; cursor:pointer; color:var(--text-primary); }
.nook-settings-nav:hover { background:var(--hover-bg); }
.nook-settings-nav[aria-current="page"] { background:var(--bg-secondary); border-right-color:var(--accent-color); }
.nook-category-icon { color:var(--text-secondary); flex:0 0 24px; }
.nook-category-icon svg { width:24px; height:24px; }
.nook-category-copy { flex:1; min-width:0; }
.nook-category-copy > span { display:block; font-size:15px; line-height:20px; }
.nook-category-arrow { color:var(--text-secondary); flex:0 0 18px; }
.nook-nav-count { min-width:20px; height:20px; padding:0 6px; border-radius:var(--radius-full); background:var(--accent-color); color:var(--accent-text,#fff); font-size:12px; font-weight:700; line-height:20px; text-align:center; }
.nook-category-arrow svg { width:18px; height:18px; }
.nook-settings-detail { flex:1; min-width:0; display:flex; flex-direction:column; overflow:hidden; }
.nook-detail-header { border-bottom:1px solid transparent; padding-left:16px; padding-right:16px; transition:border-color 120ms ease; }
.nook-detail-header.is-scrolled { border-bottom-color:var(--border-color); }
.nook-detail-actions { display:flex; align-items:center; gap:4px; flex-shrink:0; }
.nook-settings-back { display:none; }
.nook-setting-body { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:0 16px 24px; font-size:var(--font-size-base); line-height:20px; }
.nook-settings-intro { padding:16px 0; }
.nook-settings-intro p { margin:0 0 4px; color:var(--text-primary); font-size:15px; line-height:20px; }
.nook-settings-intro > span { color:var(--text-secondary); font-size:13px; line-height:18px; }
.nook-setting-section { padding:20px 0; border-bottom:1px solid var(--border-color); }
.nook-setting-section:last-child { border-bottom:0; }
.nook-setting-section h3 { margin:0 0 16px; color:var(--heading-color); font-size:20px; line-height:24px; font-weight:800; }
.nook-section-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.nook-section-title > span { color:var(--text-secondary); font-size:13px; line-height:18px; }
.nook-font-slider { display:flex; gap:16px; align-items:center; padding:8px 0; }
.nook-small-aa { font-size:13px; }
.nook-large-aa { font-size:22px; }
.nook-font-slider input { flex:1; width:0; height:24px; appearance:none; -webkit-appearance:none; background:transparent; cursor:pointer; }
.nook-font-slider input::-webkit-slider-runnable-track { height:4px; border-radius:var(--radius-full); background:linear-gradient(to right,var(--accent-color) 0 var(--range-progress),color-mix(in srgb,var(--accent-color) 45%,var(--bg-primary)) var(--range-progress) 100%); }
.nook-font-slider input::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:20px; height:20px; margin-top:-8px; border:0; border-radius:50%; background:var(--accent-color); }
.nook-font-slider input::-moz-range-track { height:4px; border-radius:var(--radius-full); background:color-mix(in srgb,var(--accent-color) 45%,var(--bg-primary)); }
.nook-font-slider input::-moz-range-progress { background:var(--accent-color); height:4px; }
.nook-font-slider input::-moz-range-thumb { width:20px; height:20px; border:0; border-radius:50%; background:var(--accent-color); }
.nook-accent-choices { display:flex; flex-wrap:wrap; gap:8px; max-width:410px; }
.nook-accent-choice { flex:0 0 44px; display:flex; align-items:center; justify-content:center; width:44px; height:44px; padding:2px; border:0; background:transparent; border-radius:50%; cursor:pointer; }
.nook-accent-choice > span { display:flex; align-items:center; justify-content:center; width:40px; height:40px; background:var(--swatch); color:var(--swatch-text); border-radius:50%; }
.nook-accent-choice svg { width:22px; height:22px; opacity:0; }
.nook-accent-choice[aria-checked="true"] svg { opacity:1; }
.nook-choice-row { width:100%; min-height:64px; display:flex; gap:16px; align-items:center; justify-content:space-between; padding:12px 0; color:var(--text-primary); text-align:left; border:0; background:transparent; cursor:pointer; }
.nook-choice-row > span:first-child { min-width:0; }
.nook-choice-row strong { display:block; font-size:15px; font-weight:400; line-height:20px; }
.nook-choice-row > span > span { display:block; font-size:13px; color:var(--text-secondary); line-height:18px; margin-top:3px; }
/* An input inside a shared field (.nook-field, .nook-input, .nook-search) is framed by the field's own focus ring.
   A tab keeps its own inset ring, which its scrolling strip would clip if drawn outside. */
.nook-settings-shell button:focus-visible:not(.nook-tab),.nook-settings-shell input:focus-visible:not(:is(.nook-field, .nook-input, .nook-search) input),.nook-settings-shell select:focus-visible,.nook-settings-shell summary:focus-visible { outline:2px solid var(--accent-color); outline-offset:2px; }
.nook-original-body { padding-top:16px; }
/* Logs rows align with the detail title instead of sitting in a second inset. */
.nook-original-body[x-show="settingsTab === 'logs'"] > .p-4 { padding:0; }
.nook-original-body[x-show="settingsTab === 'logs'"] > .p-4 > button { padding:16px 0; }
.nook-original-body h3 { font-size:20px; line-height:24px; font-weight:800; }
.nook-original-body .text-sm { font-size:13px; line-height:18px; }
.nook-original-body .mb-8 { padding-bottom:20px; margin-bottom:20px; border-bottom:1px solid var(--border-color); }
.nook-original-body .uppercase { text-transform:none; letter-spacing:normal; }
.nook-original-body label:has(> input[role="switch"]) { min-height:44px; padding:12px 2px; border-radius:var(--radius-full); }
.nook-original-body label:has(> input[role="switch"]):focus-within { outline:2px solid var(--accent-color); outline-offset:2px; }
.nook-original-body .notice-item { border:0; border-radius:0; padding:16px 0; margin:0; border-bottom:1px solid var(--border-color); background:transparent; }
.nook-original-body .setup-card[x-show="notices.length === 0"] { border:0; padding:4px 0; border-radius:0; background:transparent; }
.nook-original-body .setup-card { border:0; border-radius:0; padding:0; background:transparent; }
.nook-original-body .setup-card:not(.notice-item) + .setup-card { padding-top:20px; border-top:1px solid var(--border-color); }
.nook-original-body .setup-card > .border-t { border-color:var(--border-color); }
.nook-original-body .notice-item { border-left:0; }
.nook-setting-help { color:var(--text-secondary); font-size:13px; line-height:18px; margin:8px 0 0; }
@media (max-width:799px) {
  .nook-settings-backdrop { padding:0; }
  .nook-settings-shell { width:100%; height:100dvh; max-height:none; border-radius:0; }
  .nook-settings-master { flex:1; width:100%; border:0; }
  .nook-settings-detail { flex:1; width:100%; }
  .nook-settings-shell.is-menu .nook-settings-detail,.nook-settings-shell.is-detail .nook-settings-master { display:none; }
  .nook-settings-back { display:flex; }
  .nook-detail-header { padding-left:8px; }
  .nook-settings-nav { min-height:48px; }
  .nook-settings-nav[aria-current="page"] { border-right-color:transparent; background:transparent; }
  .nook-settings-shell.is-detail .nook-master-header { display:none; }
  .nook-original-body .flex-1 { min-width:0; }
  .nook-tag-search input { font-size:16px; }
}
@media (max-width:359px) {
  .nook-settings-header h2 { font-size:18px; }
}
@media (prefers-reduced-motion:reduce) { .nook-settings-shell * { transition:none!important; } }

/* ---- Shared controls ---- */
.nook-help-above { margin:-8px 0 16px; }
.nook-empty { display:flex; flex-direction:column; gap:4px; padding:24px 0; color:var(--text-secondary); font-size:15px; }
.nook-empty strong { color:var(--text-primary); font-size:20px; line-height:24px; font-weight:800; }
.nook-inline-status { margin:0 0 12px; padding:10px 14px; border-radius:var(--radius-lg); background:var(--bg-secondary); color:var(--text-primary); font-size:14px; line-height:18px; }
.nook-menu { position:absolute; z-index:5; min-width:232px; max-width:320px; padding:4px 0; }
.nook-menu [role="menuitem"] > span { display:flex; }
.nook-menu svg { width:18.75px; height:18.75px; }
.nook-sheet-backdrop { position:fixed; inset:0; z-index:130; display:flex; align-items:center; justify-content:center; padding:16px; }
.nook-sheet { width:min(480px,100%); max-height:calc(100dvh - 32px); overflow:auto; }
.nook-sheet-header { position:sticky; top:0; display:flex; align-items:center; gap:8px; min-height:56px; padding:6px 16px 6px 8px; background:var(--dialog-bg); }
.nook-sheet-header h3 { flex:1; margin:0; font-size:20px; line-height:24px; font-weight:800; }
.nook-sheet-body { padding:0 16px 16px; }
.nook-sheet-lede { margin:0 0 4px; color:var(--text-secondary); font-size:15px; line-height:20px; }
.nook-sheet .nook-choice-row { border-bottom:1px solid var(--border-color); }
.nook-confirm { width:min(320px,100%); display:flex; flex-direction:column; gap:12px; padding:32px; }
.nook-confirm h3 { margin:0; font-size:20px; line-height:24px; font-weight:800; overflow-wrap:anywhere; }
.nook-confirm p { margin:0 0 12px; color:var(--text-secondary); font-size:15px; line-height:20px; }

/* ---- Tags ---- */
.nook-tags-page { position:relative; padding-bottom:0; }
.nook-tag-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:0 0 12px; }
.nook-tag-controls { display:flex; align-items:center; gap:8px; }
.nook-tag-list { list-style:none; margin:0 -16px; padding:0; border-top:1px solid var(--border-color); }
.nook-tag-row { display:flex; align-items:center; gap:4px; padding:0 8px 0 16px; border-bottom:1px solid var(--border-color); }
.nook-tag-row:hover { background:var(--hover-bg); }
.nook-tag-row.is-selected { background:color-mix(in srgb,var(--accent-color) 8%,transparent); }
.nook-tag-list.is-selecting .nook-tag-row { padding-right:16px; }
.nook-tag-main { flex:1; min-width:0; display:flex; align-items:center; gap:12px; min-height:60px; padding:10px 0; border:0; background:transparent; color:var(--text-primary); text-align:left; cursor:pointer; }
.nook-tag-copy { flex:1; min-width:0; }
.nook-tag-name { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:15px; line-height:20px; font-weight:700; }
.nook-tag-count { display:block; color:var(--text-secondary); font-size:13px; line-height:16px; margin-top:2px; }
.nook-tag-share { flex:0 0 64px; height:4px; border-radius:var(--radius-full); background:var(--border-color); overflow:hidden; }
.nook-tag-share > span { display:block; height:100%; border-radius:inherit; background:color-mix(in srgb,var(--accent-color) 70%,transparent); }
.nook-selection-bar { position:sticky; bottom:0; z-index:4; display:flex; align-items:center; gap:8px; margin:0 -16px; padding:12px 16px; border-top:1px solid var(--border-color); background:var(--dialog-bg); }
.nook-selection-bar > span { flex:1; min-width:0; font-size:15px; font-weight:700; }
.nook-tags-page .nook-tag-list:last-of-type { margin-bottom:24px; }
.nook-tag-pagination { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding-bottom:24px; }
.nook-tag-pagination > span { flex:1; min-width:140px; color:var(--text-secondary); font-size:13px; }

/* ---- Logs ---- */
@keyframes nook-spin { to { transform:rotate(360deg); } }
.nook-detail-header.is-nested .nook-settings-back { display:flex; }

/* ---- Theme tiles: every theme is visible ---- */
.nook-theme-group + .nook-theme-group { margin-top:16px; }
.nook-theme-group h4 { margin:0 0 8px; color:var(--text-secondary); font-size:13px; line-height:16px; font-weight:700; }
.nook-theme-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(136px,1fr)); gap:12px; }
/* Theme tiles: one miniature tweet painted with the theme's own roles, name underneath. */
.nook-theme-tile { min-width:0; display:flex; flex-direction:column; gap:8px; padding:0; border:0; background:transparent; color:var(--text-primary); text-align:left; cursor:pointer; }
.nook-theme-sample { position:relative; display:block; overflow:hidden; border-radius:var(--radius-lg); background:var(--t-bg); box-shadow:inset 0 0 0 1px var(--t-border),0 0 0 1px color-mix(in srgb,var(--text-primary) 10%,transparent); transition:box-shadow 120ms ease; }
.nook-theme-tile:hover .nook-theme-sample { box-shadow:inset 0 0 0 1px var(--t-border),0 0 0 1px color-mix(in srgb,var(--text-primary) 35%,transparent); }
.nook-theme-tile[aria-checked="true"] .nook-theme-sample { box-shadow:inset 0 0 0 1px var(--t-border),0 0 0 2px var(--bg-primary),0 0 0 4px var(--accent-color); }
.nook-theme-sample i { display:block; height:4px; border-radius:var(--radius-full); }
.cts-post { display:flex; gap:8px; padding:12px; }
.cts-avatar { flex:0 0 18px; height:18px; border-radius:var(--radius-full); background:var(--t-surface); box-shadow:inset 0 0 0 1px var(--t-border); }
.cts-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; padding-top:2px; }
.cts-identity { display:flex; align-items:center; gap:4px; }
.nook-theme-sample .cts-name { width:30%; background:var(--t-text); }
.nook-theme-sample .cts-handle { width:24%; height:3px; background:var(--t-muted); opacity:.75; }
.nook-theme-sample .cts-text { width:92%; height:3px; background:var(--t-text); opacity:.8; }
.nook-theme-sample .cts-text.is-short { width:40%; }
.nook-theme-sample .cts-link { width:28%; height:3px; background:var(--t-accent); }
.cts-actions { display:flex; justify-content:space-between; padding:4px 10% 0 0; }
.nook-theme-sample .cts-actions i { width:5px; height:5px; border-radius:50%; background:var(--t-muted); opacity:.7; }
.nook-theme-sample .cts-actions i.is-like { background:var(--t-like); opacity:1; }
.nook-theme-label { display:flex; align-items:center; gap:4px; min-width:0; padding:0 2px; font-size:13px; line-height:16px; }
.nook-theme-label > span:first-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nook-theme-check { flex:0 0 16px; display:flex; color:var(--accent-color); visibility:hidden; }
.nook-theme-check svg { width:16px; height:16px; }
.nook-theme-tile[aria-checked="true"] .nook-theme-check { visibility:visible; }
.nook-theme-tile:focus-visible { outline:none!important; }
.nook-theme-tile:focus-visible .nook-theme-sample { outline:2px solid var(--accent-color); outline-offset:6px; }
@media (prefers-reduced-motion:reduce) { .nook-theme-sample { transition:none; } }
/* Media layout tiles: the theme-tile recipe, with only the layout drawn in the sample. */
.nook-media-tiles { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.nook-media-tile { gap:6px; }
.nook-media-tile .nook-theme-sample { --t-bg:var(--bg-primary); --t-border:var(--border-color); padding:8px; }
.cms-media { display:grid; gap:2px; height:40px; overflow:hidden; border-radius:var(--radius-md); }
.cms-media span { min-width:0; background:color-mix(in srgb,var(--text-secondary) 45%,var(--bg-primary)); }
.cms-media span:nth-child(2n) { background:color-mix(in srgb,var(--text-secondary) 28%,var(--bg-primary)); }
.cms-media.is-grid { grid-template:1fr 1fr / 1fr 1fr; }
.cms-media.is-carousel { display:flex; gap:3px; border-radius:0; }
.cms-media.is-carousel span { flex:0 0 72%; border-radius:var(--radius-md); }
.cms-media.is-date { grid-template-columns:1fr 1fr; gap:6px; border-radius:0; }
.cms-media.is-date .cms-media { background:none; }
.nook-media-tile-help { padding:0 2px; color:var(--text-secondary); font-size:13px; line-height:16px; }
@media (max-width:599px) {
  .nook-media-tiles { grid-template-columns:1fr; gap:16px; }
  .nook-media-tile { display:grid; grid-template-columns:96px minmax(0,1fr); grid-template-rows:auto auto; align-content:center; column-gap:12px; row-gap:2px; }
  .nook-media-tile .nook-theme-sample { grid-row:span 2; align-self:center; }
  .nook-media-tile .nook-theme-label { align-self:end; font-size:15px; line-height:20px; }
  .nook-media-tile .nook-theme-label:last-child { grid-row:span 2; align-self:center; }
}

/* Setup keeps every theme and its accent palette visible in a short dialog. */
.setup-modal-shell.is-appearance .setup-modal-inner { max-width:544px; padding-top:16px; padding-bottom:16px; }
.setup-appearance .setup-step-header { margin-bottom:12px; }
.setup-appearance .nook-theme-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.setup-appearance .nook-theme-tile { gap:6px; }
.setup-appearance .nook-theme-group + .nook-theme-group { margin-top:12px; }
.setup-appearance .nook-theme-label { font-size:12px; }
.setup-appearance .cts-post { padding:8px; gap:6px; }
.setup-appearance .cts-avatar { flex-basis:14px; height:14px; }
.setup-appearance .cts-body { gap:4px; }
.setup-appearance .cts-actions { display:none; }
.setup-accent-section { margin-top:16px; }
.setup-accent-section h3 { margin:0; font-size:15px; line-height:20px; font-weight:700; }
.setup-accent-section .nook-accent-choices { margin-top:6px; }
.setup-appearance button:focus-visible { outline:2px solid var(--accent-color); outline-offset:2px; }

@media (max-width:799px) { .nook-tag-share { display:none; } }
@media (max-width:599px) { .nook-tag-controls { width:100%; justify-content:space-between; } }

/* ---- Custom dropdown: outlined field (label above value) + anchored listbox menu ---- */

/* ---- Schedule ---- */
.nook-schedule-page { padding-top:4px; }
.nook-schedule-error { color:var(--destructive-color); }
.nook-schedule-summary { display:flex; align-items:flex-start; gap:12px; margin:0; padding:8px 0 12px; color:var(--text-secondary); }
.nook-schedule-icon { flex:0 0 20px; display:flex; padding-top:0; color:var(--text-secondary); }
.nook-schedule-icon svg { width:20px; height:20px; }
.nook-schedule-copy { min-width:0; }
.nook-schedule-when { display:block; font-size:15px; line-height:20px; }
.nook-schedule-next { display:block; margin-top:2px; font-size:13px; line-height:16px; }
.nook-schedule-summary.is-dirty .nook-schedule-next { color:var(--text-primary); font-weight:700; }
.nook-schedule-master { border-bottom:1px solid var(--border-color); padding:16px 0; }
.nook-schedule-fields { min-width:0; margin:0; padding:0; border:0; transition:opacity 120ms ease; }
.nook-schedule-fields:disabled { opacity:.5; }
.nook-schedule-detail { margin-top:16px; }
.nook-group-label { display:block; margin-bottom:8px; color:var(--text-secondary); font-size:13px; line-height:16px; }
/* Time and delay rows span the full width so their right edge lines up with the time zone field. */
.nook-time-row { display:flex; align-items:center; gap:8px; }
.nook-time-row .nook-select { flex:1 1 0; }
.nook-time-colon { color:var(--text-secondary); font-size:20px; font-weight:700; }
.nook-period { flex-shrink:0; align-self:stretch; align-items:center; }
.nook-period button { min-height:44px; padding:0 16px; }
.nook-delay-row { display:flex; align-items:center; gap:10px; margin-top:4px; }
.nook-delay-row .nook-select { flex:1 1 0; }
.nook-delay-to { color:var(--text-secondary); font-size:15px; }
.nook-field-error { margin:8px 0 0; color:var(--destructive-color); font-size:13px; line-height:18px; }
@media (max-width:420px) { .nook-day-chips button { font-size:13px; } .nook-period button { padding:0 12px; } }
@media (prefers-reduced-motion:reduce) { .nook-select-chevron svg,.nook-schedule-fields { transition:none; } }

/* ---- Configuration ---- */
.nook-switch-button.nook-config-advanced { flex-basis:auto; gap:8px; margin-right:8px; color:var(--text-secondary); font-size:13px; line-height:16px; white-space:nowrap; }
@media (max-width:599px) {
  .nook-config-advanced > span:first-child { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
}
@media (max-width:420px) {
  .nook-detail-header.is-config { gap:4px; padding-left:8px; padding-right:8px; }
  .nook-switch-button.nook-config-advanced { margin-right:0; }
}
/* Compact rows: label, help, and state on the left; a small control on the right. */
.nook-config-page { padding-top:4px; }
.nook-config-page .nook-setting-section { padding:16px 0; }
.nook-config-page .nook-setting-section h3 { margin-bottom:12px; }
.nook-config-page .nook-help-above { margin:-6px 0 12px; }
.nook-config-list { display:flex; flex-direction:column; gap:16px; }
.nook-config-row { min-width:0; }
.nook-config-row.is-disabled { opacity:.5; }
.nook-config-line { display:flex; align-items:center; justify-content:space-between; gap:16px; min-width:0; }
.nook-config-copy { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.nook-config-copy .nook-setting-help { margin:0; }
.nook-config-label { color:var(--text-primary); font-size:15px; line-height:20px; }
/* Configuration values share one column width, wider for text. */
.nook-config-input { flex:0 0 auto; width:128px; }
.nook-config-input.is-text,.nook-config-input.is-long { width:176px; }
.nook-config-row.is-dirty .nook-config-input:not(:focus-within),.nook-config-row.is-dirty .nook-select-trigger:not([aria-expanded="true"]) { border-color:color-mix(in srgb,var(--accent-color) 55%,var(--input-border)); }
.nook-config-reveal { padding:0; border:0; background:transparent; color:var(--accent-color); font-size:13px; font-weight:700; cursor:pointer; }
.nook-config-state { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 8px; color:var(--text-secondary); font-size:13px; line-height:18px; }
.nook-config-row.is-dirty .nook-config-state > span { color:var(--text-primary); font-weight:700; }
.nook-config-state button { padding:0; border:0; background:transparent; color:var(--accent-color); font-size:13px; font-weight:700; cursor:pointer; }
.nook-config-state button:hover { text-decoration:underline; }
.nook-config-label-line { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; }
.nook-config-page .nook-setting-section h3 { display:flex; align-items:center; gap:10px; }
/* Advanced settings: a quiet gray status pill (design.md's Creator Studio eligibility pills),
   on the heading of an advanced-only section or on the row in a mixed one. */
.nook-config-tag { display:inline-flex; align-items:center; height:20px; padding:0 8px; border:1px solid var(--border-color); border-radius:var(--radius-full); background:var(--bg-secondary); color:var(--text-secondary); font-size:12px; line-height:16px; font-weight:400; letter-spacing:0; white-space:nowrap; }
.nook-config-confirm { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; padding:12px 16px; border:1px solid var(--border-color); border-radius:var(--radius-lg); font-size:15px; line-height:20px; }
.nook-config-confirm-actions { display:flex; gap:8px; margin-left:auto; }
/* Compact dropdown: no inner label, sits at the end of a row, menu aligned to its right edge. */
@media (max-width:420px) { .nook-config-input.is-text { width:150px; } }

/* ---- Logs: tabs, run list and log panel, theme colors only ---- */
.nook-log-row { display:flex; align-items:center; gap:12px; width:calc(100% + 32px); min-height:64px; margin:0 -16px; padding:12px 8px 12px 16px; border:0; border-bottom:1px solid var(--border-color); background:transparent; color:var(--text-primary); text-align:left; cursor:pointer; }
.nook-log-row:hover { background:var(--hover-bg); }
.nook-log-copy { flex:1; min-width:0; }
.nook-log-copy strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:15px; line-height:20px; font-weight:700; }
.nook-log-meta { display:block; margin:4px 0 0; color:var(--text-secondary); font-size:14px; line-height:18px; }
.nook-log-copy .nook-log-meta { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nook-log-state.is-failed { color:var(--destructive-color); font-weight:700; }
.nook-log-state.is-running { color:var(--accent-color); font-weight:700; }
.nook-log-detail { padding-top:12px; }
.nook-logs-tabs { margin:0 -16px; border-bottom:1px solid var(--border-color); }
.nook-log-summary { margin:0; color:var(--text-primary); font-size:15px; line-height:20px; }
.nook-log-summary + .nook-log-meta { margin-top:4px; }
.nook-log-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px; margin:16px 0 8px; }
.nook-log-counts { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; color:var(--text-secondary); font-size:13px; line-height:18px; }
.nook-log-counts button { padding:0; border:0; background:transparent; font-size:13px; font-weight:700; cursor:pointer; }
.nook-log-counts button:hover { text-decoration:underline; }
.nook-log-counts .is-error { color:var(--destructive-color); }
.nook-log-counts .is-warning { color:var(--accent-color); }
.nook-log-actions { display:flex; align-items:center; gap:8px 12px; }
.nook-log-verbose { display:flex; align-items:center; gap:4px; color:var(--text-primary); font-size:14px; font-weight:600; cursor:pointer; }
.nook-log-panel { --log-time-width:64px; --log-column-gap:12px; margin-bottom:8px; padding:12px 0; border:1px solid var(--border-color); border-radius:var(--radius-lg); background:var(--bg-secondary); color:var(--text-primary); font:13px/20px ui-monospace,SFMono-Regular,Menlo,monospace; }
.nook-log-line { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--log-column-gap); padding:0 16px; }
.nook-log-panel.has-time .nook-log-line { grid-template-columns:var(--log-time-width) minmax(0,1fr); }
.nook-log-line time { color:var(--text-secondary); }
.nook-log-panel:not(.has-time) .nook-log-line time { display:none; }
/* Server log times can carry a day ("Nov 14 23:59:59"). */
.nook-log-panel.is-dated { --log-time-width:128px; }
.nook-log-line > span { white-space:pre-wrap; overflow-wrap:anywhere; }
.nook-log-line.is-quiet { color:var(--text-secondary); }
.nook-log-line.is-warning { color:var(--accent-color); }
.nook-log-line.is-error { color:var(--destructive-color); }
.nook-log-line.is-flash { background:var(--hover-bg); box-shadow:inset 3px 0 0 currentColor; }
.nook-log-fold { display:flex; align-items:center; gap:4px; padding:0 16px; border:0; background:transparent; color:var(--accent-color); font:inherit; cursor:pointer; }
.nook-log-panel.has-time .nook-log-fold { margin-left:calc(var(--log-time-width) + var(--log-column-gap)); }
.nook-log-fold:hover { text-decoration:underline; }
.nook-log-fold > span:first-child { display:flex; }
.nook-log-fold svg { width:14px; height:14px; transition:transform 120ms ease; }
.nook-log-fold[aria-expanded="true"] svg { transform:rotate(90deg); }
.nook-log-placeholder { padding:0 16px; color:var(--text-secondary); }
@media (prefers-reduced-motion:reduce) { .nook-log-fold svg { transition:none; } }

/* What to sync, mirrored from the sync panel: rows with X's trailing blue check. */
.nook-sync-what { padding-top:16px; }
.nook-sync-choice { min-height:56px; padding:8px 0; }
.nook-sync-choice:focus-visible { outline:2px solid var(--accent-color); outline-offset:-2px; border-radius:4px; }

/* ---- Tag dialog (a tweet's tags and description) ---- */
/* 600px dialog toward the top, fixed header, scrolling body; full-screen sheet on phones. */
.nook-td-layer { position:fixed; inset:0; z-index:100; display:flex; justify-content:center; align-items:flex-start; padding:max(24px,6vh) 16px 24px; }
.nook-td-backdrop { position:absolute; inset:0; }
.nook-td { position:relative; display:flex; flex-direction:column; width:100%; max-width:600px; max-height:min(820px,calc(100dvh - max(24px,6vh) - 24px)); overflow:hidden; font-size:15px; line-height:20px; }
.nook-td button,.nook-td input,.nook-td textarea { font-family:inherit; }
/* A text box inside a shared field is framed by the field's own focus ring. */
.nook-td :focus-visible:not(:is(.nook-field, .nook-input, .nook-search) :is(input, textarea)),.nook-td-confirm :focus-visible { outline:2px solid var(--accent-color); outline-offset:2px; }
@media (prefers-reduced-motion:no-preference) {
  .nook-td,.nook-td-confirm { animation:nook-td-pop .14s ease-out; }
  @keyframes nook-td-pop { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
}
.nook-td-head { flex:none; display:flex; align-items:center; gap:16px; min-height:53px; padding:0 16px 0 8px; border-bottom:1px solid var(--border-color); }
.nook-td-title { flex:1; min-width:0; margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:20px; line-height:24px; font-weight:700; }
.nook-td-save[aria-disabled="true"] { opacity:.5; cursor:default; }
.nook-td-body { flex:1; min-height:0; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; padding-bottom:8px; }
.nook-td-error { display:flex; align-items:flex-start; gap:8px; margin:12px 16px 0; padding:12px; border:1px solid color-mix(in srgb,var(--destructive-color) 40%,transparent); border-radius:var(--radius-lg); background:color-mix(in srgb,var(--destructive-color) 8%,transparent); font-size:14px; line-height:18px; }
.nook-td-error svg { flex:none; width:18px; height:18px; color:var(--destructive-color); }

/* The tweet being tagged, as a quoted-post card. */
.nook-td-tweet { margin:12px 16px 4px; padding:12px; border:1px solid var(--input-border); border-radius:var(--radius-xl); }
.nook-td-tweet-head { display:flex; align-items:center; gap:4px; min-width:0; }
.nook-td-avatar { flex:none; display:flex; align-items:center; justify-content:center; width:24px; height:24px; margin-right:4px; border-radius:var(--radius-full); background:color-mix(in srgb,var(--accent-color) 18%,transparent); color:var(--accent-color); font-size:12px; font-weight:700; text-transform:uppercase; }
.nook-td-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:700; }
.nook-td-handle { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-secondary); }
.nook-td-tweet-text { display:-webkit-box; margin:4px 0 0; overflow:hidden; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow-wrap:anywhere; }

/* Viewing */
.nook-td-section { padding:12px 16px; }
.nook-td-section-head { display:flex; align-items:center; gap:8px; }
.nook-td-section-head h3 { margin:0; font-size:15px; line-height:20px; font-weight:700; }
.nook-td-badge { min-width:20px; padding:2px 7px; border-radius:var(--radius-full); background:var(--accent-color); color:var(--accent-text,#fff); font-size:12px; line-height:16px; font-weight:700; text-align:center; }
.nook-td-chips { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 0; padding:0; list-style:none; }
.nook-td-chips li { min-width:0; max-width:100%; }
.nook-td-chip { display:inline-flex; align-items:center; max-width:100%; min-height:32px; padding:0 14px; border:1px solid color-mix(in srgb,var(--accent-color) 35%,transparent); border-radius:var(--radius-full); background:color-mix(in srgb,var(--accent-color) 10%,transparent); color:var(--accent-color); font-size:14px; line-height:16px; font-weight:600; cursor:pointer; }
.nook-td-chip span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nook-td-chip:hover { background:color-mix(in srgb,var(--accent-color) 20%,transparent); }
.nook-td-description { margin:6px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.nook-td-empty { margin:4px 0 0; color:var(--text-secondary); }
.nook-td-link { padding:0; border:0; background:none; color:var(--accent-color); font-size:inherit; cursor:pointer; }
.nook-td-link:hover { text-decoration:underline; }
.nook-td-rule { height:1px; margin-top:8px; background:var(--border-color); }
.nook-td-delete { display:flex; align-items:center; gap:12px; width:100%; min-height:48px; padding:12px 16px; border:0; background:none; color:var(--destructive-color); font-size:15px; font-weight:700; text-align:left; cursor:pointer; }
.nook-td-delete svg { flex:none; width:18.75px; height:18.75px; }
.nook-td-delete:hover { background:color-mix(in srgb,var(--destructive-color) 8%,transparent); }
.nook-td-delete:focus-visible { outline-offset:-2px; }

/* Editing: outlined fields, label inside above the value, accent outline and label on focus. */
.nook-td-edit { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; padding:8px 16px 8px; }
.nook-td-fieldwrap { position:relative; margin-top:4px; }
.nook-td-field { display:block; padding:8px 11px 10px; }
.nook-td-field-top { display:flex; justify-content:space-between; gap:8px; }
.nook-td-count { visibility:hidden; white-space:nowrap; color:var(--text-secondary); font-size:13px; line-height:16px; font-variant-numeric:tabular-nums; }
.nook-td-field:focus-within .nook-td-count,.nook-td-count.is-near { visibility:visible; }
.nook-td-count.is-near { color:var(--destructive-color); font-weight:700; }
.nook-td-chipflow { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:6px; }
.nook-td-tokens { display:contents; }
.nook-td-field .nook-td-input { flex:1 1 120px; width:auto; min-width:120px; padding:4px 2px; }
.nook-td-input[readonly],.nook-td-textarea[readonly] { opacity:.6; }
.nook-td-field .nook-td-textarea { display:block; min-height:72px; max-height:264px; margin-top:4px; padding:0; overflow-y:auto; overflow-wrap:anywhere; }

/* Suggestions: the menu recipe, with the active row marked by the accent edge. */
.nook-td-options { position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:3; max-height:264px; margin:0; padding:4px 0; overflow-y:auto; overscroll-behavior:contain; list-style:none; }
.nook-td-option { padding:12px 16px; }
.nook-td-option-label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nook-td-option.is-new .nook-td-option-label { display:flex; align-items:center; gap:12px; }
.nook-td-option-label b { font-weight:700; }
.nook-td-option-count { flex:none; color:var(--text-secondary); font-size:13px; line-height:16px; }
.nook-td-option.is-new { color:var(--accent-color); }
.nook-td-option.is-new svg { flex:none; width:18.75px; height:18.75px; }
.nook-td-option + .nook-td-option.is-new { border-top:1px solid var(--border-color); }

/* Delete confirmation */
.nook-td-confirm-layer { position:fixed; inset:0; z-index:110; display:flex; align-items:center; justify-content:center; padding:16px; }
.nook-td-confirm { position:relative; display:flex; flex-direction:column; gap:12px; width:100%; max-width:320px; padding:32px; }
.nook-td-confirm h2 { margin:0; font-size:20px; line-height:24px; font-weight:800; }
.nook-td-confirm p { margin:0 0 12px; color:var(--text-secondary); font-size:15px; line-height:20px; }
.nook-td-confirm .nook-td-confirm-error { color:var(--destructive-color); font-weight:700; }
.nook-td-confirm [aria-disabled="true"] { opacity:.5; cursor:default; }

@media (max-width:599px) {
  .nook-td-layer { padding:0; }
  .nook-td-layer > .nook-td-backdrop { display:none; }
  .nook-td { max-width:none; height:100dvh; max-height:none; border-radius:0; }
  .nook-td-textarea { max-height:40dvh; }
}

/* Missing-tweet marker and the History dialog */
.tweet-missing-badge { display:inline-flex; flex:none; align-items:center; justify-content:center; width:20px; height:20px; padding:0; border:0; background:none; color:var(--destructive-color); cursor:pointer; }
.tweet-missing-badge svg { width:17px; height:17px; }
.nook-history {
  --history-on:var(--accent-color);
  --history-missing:var(--destructive-color);
  --history-quiet:var(--text-secondary);
  --history-rail-on:color-mix(in srgb,var(--history-on) 55%,var(--bg-primary));
  --history-rail-missing:color-mix(in srgb,var(--history-missing) 55%,var(--bg-primary));
  --history-rail-quiet:color-mix(in srgb,var(--history-quiet) 65%,var(--bg-primary));
}
.nook-post-history .nook-td-head { gap:20px; padding-top:4px; padding-bottom:4px; border-bottom:0; }
.nook-post-history .nook-td-title { font-weight:800; }
.nook-post-history .nook-td-body { padding-bottom:0; }
/* The body drops its padding for the status list's own rule; an error box
   in its place needs the gap back. */
.nook-post-history .nook-td-error { margin-bottom:16px; }
.nook-history-status { display:grid; grid-template-columns:24px minmax(0,1fr); gap:12px; padding:20px 16px 24px; border-bottom:1px solid var(--border-color); }
.nook-history-status > div { display:flex; flex-direction:column; gap:4px; min-width:0; }
.nook-history-status strong { color:var(--text-primary); font-size:17px; line-height:24px; font-weight:700; }
.nook-history-status span:not(.nook-history-status-icon) { color:var(--text-secondary); }
.nook-history-status-meta { font-size:13px; line-height:16px; }
.nook-history-status-icon { display:grid; place-items:center; align-self:start; height:24px; color:var(--history-on); }
.nook-history-status.is-missing .nook-history-status-icon { color:var(--history-missing); }
.nook-history-status-icon svg { width:20px; height:20px; }
.nook-history-empty { margin:0; padding:16px; color:var(--text-secondary); }
.nook-post-history .nook-history-empty { padding:24px 16px 32px 52px; }
/* Vertical timeline, newest first: a dot per event; the rail below each dot is coloured
   by the tweet's state from the older event up to that one. */
.nook-timeline { margin:0; padding:24px 16px 0; list-style:none; }
.nook-timeline-item { position:relative; display:grid; grid-template-columns:24px minmax(0,1fr); column-gap:12px; padding-bottom:24px; }
.nook-timeline-rail { position:relative; display:flex; justify-content:center; padding-top:5px; }
.nook-timeline-item::before { content:""; position:absolute; left:11.5px; top:14px; bottom:-5px; width:1px; background:var(--border-color); }
.nook-timeline-item.seg-none::before { display:none; }
.nook-timeline-item.seg-on::before { background:var(--history-rail-on); }
.nook-timeline-item.seg-missing::before { background:var(--history-rail-missing); }
.nook-timeline-item.seg-protected::before { background:repeating-linear-gradient(to bottom, var(--history-rail-quiet) 0 3px, transparent 3px 7px); }
.nook-timeline-dot { position:relative; z-index:1; width:10px; height:10px; border-radius:9999px; border:2px solid var(--history-quiet); background:var(--bg-primary); }
.nook-timeline-item.is-available .nook-timeline-dot { border-color:var(--history-on); background:var(--history-on); }
.nook-timeline-item.is-missing .nook-timeline-dot { border-color:var(--history-missing); background:var(--history-missing); }
.nook-timeline-item.is-note .nook-timeline-dot { border-color:var(--accent-color); }
.nook-timeline-title { color:var(--text-primary); font-size:15px; line-height:20px; font-weight:700; }
.nook-timeline-meta { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; color:var(--text-secondary); font-size:13px; line-height:16px; }
.nook-timeline-detail { margin:8px 0 0; color:var(--text-secondary); overflow-wrap:anywhere; }
.nook-timeline-legend { display:flex; flex-wrap:wrap; gap:12px 24px; padding:16px 16px 20px 52px; border-top:1px solid var(--border-color); color:var(--text-secondary); font-size:13px; line-height:16px; }
.nook-timeline-legend span { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.nook-timeline-legend span::before { content:""; width:16px; height:1px; background:var(--history-rail-on); }
.nook-timeline-legend .seg-missing::before { background:var(--history-rail-missing); }
.nook-timeline-legend .seg-protected::before { background:repeating-linear-gradient(to right, var(--history-rail-quiet) 0 3px, transparent 3px 6px); }
@media (max-width:599px) {
  .nook-timeline-legend { column-gap:16px; padding-left:16px; }
}
/* Community notes dialog: each version is the feed's note card; section titles and
   fine rules group the current note and earlier ones. */
.nook-notes-section + .nook-notes-section { border-top:1px solid var(--border-color); }
.nook-notes-heading { margin:0; padding:16px 16px 0; font-size:15px; line-height:20px; font-weight:700; }
.nook-notes-version { padding:12px 16px 4px; }
.nook-notes-version .community-note-detail { margin-top:0; }
.nook-notes-version .community-note svg { width:18.75px; height:18.75px; flex:0 0 auto; }
.nook-notes-version.is-earlier .community-note-body { color:var(--text-secondary); }
.nook-notes-dates { margin:6px 0 8px; color:var(--text-secondary); font-size:13px; line-height:16px; }
.nook-notes-none { margin:0; padding:16px 16px 0; color:var(--text-secondary); }
