/* ProjectNotes — single-owner project knowledge base */

:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e3e6ec;
  --border-strong: #cfd4dd;
  --text: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-text: #3730a3;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, 0.12);
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar-w: 260px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1015;
    --surface: #161922;
    --surface-2: #1c2029;
    --border: #262b37;
    --border-strong: #353c4a;
    --text: #e7e9ef;
    --muted: #9aa3b5;
    --faint: #6b7385;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: #1f2242;
    --accent-text: #c7d2fe;
    --danger: #f87171;
    --danger-soft: #3a1c1c;
    --success: #34d399;
    --success-soft: #0f2e25;
    --warn: #fbbf24;
    --warn-soft: #362a10;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.spacer { flex: 1; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  cursor: pointer; font-weight: 500; line-height: 1.2; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn-lg { padding: 11px 18px; font-size: 15px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px; border: none; background: transparent;
  color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn svg { width: 16px; height: 16px; }
.btn svg { width: 15px; height: 15px; }

/* ---------- Forms ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 5px; }
input[type="text"], input[type="password"], select, textarea {
  width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.key-row { display: flex; gap: 6px; }
.key-row input { flex: 1; }

/* ---------- Auth screen ---------- */
.auth-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%), var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px 32px; box-shadow: var(--shadow-lg); text-align: center;
}
.auth-card .logo { margin: 0 auto 14px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card p { color: var(--muted); margin-bottom: 26px; }
.auth-card .btn-lg { width: 100%; justify-content: center; }
.auth-error {
  margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-sm); text-align: left;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); font-size: 13px;
}
.auth-error ol { margin: 8px 0 0; padding-left: 18px; }
.auth-error li { margin: 3px 0; }
.logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent); color: #fff;
}
.logo svg { width: 24px; height: 24px; }

/* ---------- Shell ---------- */
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 26px; height: 26px; border-radius: 7px; }
.brand .logo svg { width: 15px; height: 15px; }
.user { display: flex; align-items: center; gap: 8px; }
.user img { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); }
.user .email { font-size: 12.5px; color: var(--muted); }
#btn-menu { display: none; }

.body { display: flex; flex: 1; min-height: 0; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 54px; height: calc(100vh - 54px); overflow-y: auto;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 6px; }
.sidebar-head span { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.project-list { display: flex; flex-direction: column; gap: 2px; }
.project-link {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 500; overflow: hidden;
}
.project-link:hover { background: var(--surface-2); text-decoration: none; }
.project-link.active { background: var(--accent-soft); color: var(--accent-text); }
.project-link .name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-link .count { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.project-link.active .count { color: var(--accent-text); opacity: .8; }
.sidebar .empty { padding: 10px; font-size: 12.5px; color: var(--muted); }
.sidebar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.all-link { display: block; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; }
.all-link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.all-link.active { color: var(--accent-text); background: var(--accent-soft); }

.main { flex: 1; min-width: 0; padding: 24px 28px 60px; }
.container { max-width: 1000px; margin: 0 auto; }

/* ---------- Dashboard ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text);
  transition: border-color .12s, transform .12s;
}
.card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.card h3 { font-size: 15px; }
.card .overview { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--faint); display: flex; gap: 10px; flex-wrap: wrap; }
.card .cats { display: flex; gap: 4px; flex-wrap: wrap; }
.empty-state {
  padding: 48px 24px; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong);
  border-radius: var(--radius); color: var(--muted);
}
.empty-state h3 { color: var(--text); margin-bottom: 6px; }
.empty-state .btn { margin-top: 16px; }

/* ---------- Project header & tabs ---------- */
.project-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.project-head .titles { flex: 1; min-width: 200px; }
.project-head h2 { font-size: 22px; }
.project-head .desc { color: var(--muted); margin-top: 2px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent-text); border-color: var(--accent); }
.tab .n { font-size: 11.5px; color: var(--faint); margin-left: 4px; }

/* ---------- Capture ---------- */
.capture { display: flex; flex-direction: column; gap: 14px; }
.capture-intro h3 { font-size: 16px; margin-bottom: 4px; }
.capture-intro p { color: var(--muted); max-width: 640px; }
#capture-text { min-height: 280px; padding: 14px; font-size: 14px; }
.capture-bar { display: flex; align-items: center; gap: 12px; }
.status {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent-text); font-weight: 500;
}
.status.error { background: var(--danger-soft); color: var(--danger); }
.status.ok { background: var(--success-soft); color: var(--success); }
.status svg { width: 18px; height: 18px; flex-shrink: 0; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.result h4 { font-size: 14px; margin-bottom: 10px; }
.result ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.result li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.result .actions { margin-top: 14px; display: flex; gap: 8px; }

/* ---------- Review ---------- */
.overview-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.overview-card h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.overview-card p { white-space: pre-wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input[type="text"] { max-width: 320px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .n { opacity: .7; font-variant-numeric: tabular-nums; }
.group { margin-bottom: 26px; }
.group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.group-head h3 { font-size: 14px; }
.group-head .n { font-size: 12px; color: var(--faint); }
.entries { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 10px; }
.entry {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
  border-left: 3px solid var(--c, var(--border)); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
}
.entry-head { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; user-select: none; margin: -4px -6px; padding: 4px 6px; border-radius: var(--radius-sm); }
.entry-head:hover { background: var(--surface-2); }
.entry-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.entry-head h4 { flex: 1; font-size: 16px; font-weight: 600; line-height: 1.35; }
.chev { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--faint); display: grid; place-items: center; transition: transform .15s ease; }
.chev svg { width: 16px; height: 16px; }
.entry.collapsed .chev { transform: rotate(-90deg); }
.entry.collapsed .entry-body, .entry.collapsed .fields, .entry.collapsed .entry-foot { display: none; }
.entry:not(.collapsed) .entry-preview { display: none; }
.entry-preview { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 26px; }
.entry-preview b { font-weight: 500; color: var(--text); }
.entry.collapsed { gap: 4px; }
.entry-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.entry:hover .entry-actions, .entry:focus-within .entry-actions { opacity: 1; }
.entry-body { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; color: var(--text); }
.entry-body a { word-break: break-all; }
.fields { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.field { display: contents; }
.field dt, .field dd { margin: 0; padding: 5px 10px; border-top: 1px solid var(--border); font-size: 12.5px; }
.field:first-child dt, .field:first-child dd { border-top: none; }
.field dt { color: var(--muted); background: var(--surface-2); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.field dd { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.field .val { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }
.field .val a { word-break: break-all; }
.field.secret .val { cursor: pointer; letter-spacing: .08em; color: var(--muted); }
.field.secret.revealed .val { cursor: pointer; letter-spacing: 0; color: var(--text); }
.icon-btn.mini { width: 22px; height: 22px; opacity: 0; flex-shrink: 0; }
.icon-btn.mini svg { width: 13px; height: 13px; }
.field:hover .icon-btn.mini, .entry:focus-within .icon-btn.mini { opacity: 1; }
@media (hover: none) { .icon-btn.mini { opacity: .6; } .entry-actions { opacity: 1; } }
.tag.upd { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); background: var(--success-soft); }
.result li .faint { font-size: 12px; }
.entry-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.entry-foot time { margin-left: auto; white-space: nowrap; }
.tag { padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
.imp { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 7px; background: var(--faint); }
.imp.high { background: var(--danger); }
.imp.medium { background: var(--warn); }
.imp.low { background: var(--faint); opacity: .6; }
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
  background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: color-mix(in srgb, var(--c) 70%, var(--text));
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.cat-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex-shrink: 0; }

/* ---------- Notes history ---------- */
.notes { display: flex; flex-direction: column; gap: 10px; }
.note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.note-head { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.note-head .entries-n { font-weight: 500; color: var(--text); }
.note-text { margin-top: 8px; white-space: pre-wrap; word-break: break-word; font-size: 13px; color: var(--text); }
.note-text.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.note .btn-ghost { padding: 2px 6px; font-size: 12px; }

/* ---------- Dialogs ---------- */
dialog {
  border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(10, 12, 20, .45); backdrop-filter: blur(2px); }
.dlg { padding: 22px 24px; }
.dlg h3 { font-size: 17px; margin-bottom: 16px; }
.dlg code { font-family: var(--mono); font-size: 12px; }
#entry-fields { font-family: var(--mono); font-size: 12.5px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dlg-actions .btn-danger { margin-right: auto; }
.dlg .account { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 16px; font-size: 13px; }
.dlg .account img { width: 24px; height: 24px; border-radius: 50%; }
.dlg .warn { font-size: 12.5px; color: var(--muted); padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  padding: 10px 14px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); font-weight: 500;
  box-shadow: var(--shadow-lg); animation: toast-in .18s ease-out; max-width: 360px;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--success); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  #btn-menu { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 54px; bottom: 0; height: auto; z-index: 30; transform: translateX(-100%);
    transition: transform .18s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .main { padding: 18px 16px 60px; }
  .user .email { display: none; }
  #capture-text { min-height: 220px; }
}
@media (max-width: 480px) {
  .topbar { gap: 6px; padding: 0 12px; }
  .brand .brand-text, #btn-settings .label { display: none; }
  .user { gap: 4px; }
}

/* ---------- Proposal review (analysis -> apply) ---------- */
.proposal { display: flex; flex-direction: column; gap: 12px; }
.proposal-head, .proposal-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.proposal-head h4 { font-size: 15px; }
.proposal-foot { justify-content: flex-end; }
.proposal-list { display: flex; flex-direction: column; gap: 10px; }
.prop {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--c, var(--border));
  border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow);
}
.prop.skipped { opacity: .55; border-left-color: var(--border); }
.prop-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prop-head .badge { font-size: 12px; }
.prop-target-title { font-weight: 600; font-size: 14.5px; }
.prop-head select { width: auto; padding: 4px 8px; font-size: 12.5px; }
.prop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.prop label > span, .prop-fields-head > span:first-child { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.prop-fields-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.prop-fields-head .faint { font-size: 12px; }
.prop-field-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.prop-field { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto auto; gap: 6px; align-items: start; }
.prop-field input, .prop-field textarea { padding: 5px 8px; font-size: 13px; }
.prop-field .pf-value { font-family: var(--mono); font-size: 12.5px; resize: none; min-height: 0; field-sizing: content; line-height: 1.4; }
.prop-field .icon-btn.mini { opacity: .7; margin-top: 3px; }
.pf-hint { font-size: 11.5px; align-self: center; white-space: nowrap; min-width: 48px; }
.fh { display: inline-block; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.fh.new { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); background: var(--success-soft); }
.fh.replace { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.fh.replace s { opacity: .8; }
.prop-notes textarea { font-size: 13px; min-height: 56px; }
.prop-overview { font-size: 13px; min-height: 72px; }
.prop-field .icon-btn.mini { opacity: .85; }
.overview-prop { border-left-color: var(--accent); }
@media (max-width: 640px) {
  .prop-field { grid-template-columns: minmax(0, 1fr) auto; }
  .prop-field .pf-value { grid-column: 1 / -1; }
  .pf-hint { grid-row: 1; grid-column: 2; }
  .prop-field .icon-btn.mini { grid-row: 1; grid-column: 3; }
  .prop-field { grid-template-columns: minmax(0, 1fr) auto auto; }
}

/* ---------- Admin panel launcher ---------- */
.panel-launch { position: relative; display: inline-flex; }
.panel-open { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.panel-open:hover { text-decoration: none; }
.panel-more {
  border-top-left-radius: 0; border-bottom-left-radius: 0; padding-left: 6px; padding-right: 6px;
  border-left: 1px solid color-mix(in srgb, #fff 35%, transparent);
}
.panel-more svg { transition: transform .15s ease; }
.panel-more.open svg { transform: rotate(180deg); }
.panel-launch .btn svg { width: 14px; height: 14px; }
.menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; min-width: 300px; max-width: min(420px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 5px; max-height: 60vh; overflow-y: auto;
}
.menu-head {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 6px 9px 5px;
}
.menu-row { display: flex; align-items: center; gap: 2px; border-radius: var(--radius-sm); }
.menu-row:hover { background: var(--surface-2); }
.menu-link { flex: 1; min-width: 0; display: block; padding: 7px 9px; color: var(--text); }
.menu-link:hover { text-decoration: none; }
.menu-name { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-url {
  display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu-actions { display: flex; gap: 1px; padding-right: 5px; flex-shrink: 0; }
.menu-actions .icon-btn.mini { width: 26px; height: 26px; opacity: .65; }
.menu-actions .icon-btn.mini:hover { opacity: 1; }
.menu-actions .icon-btn.mini svg { width: 14px; height: 14px; }

/* dashboard card shortcut */
.card { position: relative; }
.card-main { display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.card-main:hover { text-decoration: none; }
.card .meta { align-items: center; }
.card-panel { margin-left: auto; padding: 3px 8px; font-size: 12px; }
.card-panel:hover { text-decoration: none; border-color: var(--accent); color: var(--accent-text); }
.card-panel svg { width: 12px; height: 12px; }
