:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --accent-mm: #2563eb;
  --accent-pr: #0d9488;
  --accent-ap: #d97706;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

/* ---------- App shell: fixed header/title, only content scrolls ---------- */
html { height: 100%; }
body.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.app .site-header { flex: 0 0 auto; margin-bottom: 0; padding: 20px 0; }
body.app .topbar {
  flex: 0 0 auto;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 10px rgba(15, 23, 42, .04);
}
body.app .topbar-inner { max-width: 1040px; margin: 0 auto; padding: 12px 20px; }
body.app .topbar .crumbs { margin-bottom: 8px; }
body.app .topbar .list-head { margin-bottom: 0; }
body.app .topbar .view-bar { margin-bottom: 0; }
body.app .scroll-area {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* Breathing room between the fixed title bar and the list (category page) */
body.app .scroll-area > .wrap { padding-top: 24px; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Malgun Gothic",
    "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(120deg, #1e293b, #0f172a);
  color: #fff;
  padding: 36px 0 30px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}
.site-header .wrap { padding-bottom: 0; }
.site-header h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.02em; }
.site-header p { margin: 6px 0 0; color: #cbd5e1; font-size: .95rem; }

/* ---------- Breadcrumb ---------- */
.crumbs {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 22px;
}
.crumbs a:hover { color: var(--brand); }
.crumbs span { margin: 0 8px; color: var(--line); }

/* ---------- Category grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px 20px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  border-top: 4px solid var(--accent);
}
.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, .12), 0 14px 36px rgba(15, 23, 42, .10);
}
.cat-card .icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 1.3rem;
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  color: var(--accent);
  margin-bottom: 14px;
}
.cat-card h2 { margin: 0 0 4px; font-size: 1.15rem; }
.cat-card .desc { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }
.cat-card .count {
  display: inline-block;
  margin-top: 12px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  padding: 3px 10px;
  border-radius: 999px;
}
/* Per-category to-do / link stats on the home cards */
.cat-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  width: 100%;
}
.cat-stats .cstat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
}
.cat-stats .cstat b { font-weight: 800; }
.cat-stats .cstat.open { background: #eff6ff; color: #1e3a5f; }
.cat-stats .cstat.pending { background: #fef3c7; color: #92400e; }
.cat-stats .cstat.done { background: #dcfce7; color: #166534; }
.cat-stats .cstat.link { background: #ede9fe; color: #5b21b6; }
.cat-stats .cstat.zero { opacity: .45; }

/* ---------- Meeting list ---------- */
.list-head { margin-bottom: 20px; }
.list-head h2 { margin: 0; font-size: 1.45rem; }
.list-head p { margin: 4px 0 0; color: var(--muted); }

.meeting-list { list-style: none; margin: 0; padding: 0; }
.meeting-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .1s ease;
}
.meeting-item:hover { border-color: var(--brand); transform: translateX(2px); }
/* The whole row is the link */
.meeting-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  color: inherit;
}
.meeting-item .date {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--brand);
  font-size: .9rem;
  background: #eff6ff;
  padding: 6px 10px;
  border-radius: 8px;
  min-width: 92px;
  text-align: center;
}
.meeting-item .meta { flex: 1 1 auto; min-width: 0; }
.meeting-item .title { font-weight: 600; font-size: 1.02rem; }
.meeting-item .tags { display: block; margin-top: 3px; font-size: .82rem; color: var(--muted); }
.meeting-item .chev { color: var(--line); font-size: 1.2rem; }
.meeting-item .cm-count {
  display: inline-block;
  margin-top: 6px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--brand-dark);
  background: #eef2ff;
  padding: 2px 9px;
  border-radius: 999px;
}

/* Language badges (indicators next to the title) */
.lang-badges { white-space: nowrap; }
.lang-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 1px 7px;
  margin-left: 6px;
  border-radius: 999px;
  vertical-align: middle;
  border: 1px solid var(--brand);
  color: var(--brand);
  background: #eff6ff;
}
.lang-badge.ko { border-color: #475569; color: #475569; background: #f1f5f9; }
.lang-badge .lb-count { font-weight: 700; }

/* Language toggle pills (used in the meeting viewer top bar) */
.lang-links { flex: 0 0 auto; display: flex; gap: 6px; }
.lang-pill {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--brand);
  color: var(--brand);
  background: #fff;
  transition: background .12s ease, color .12s ease;
}
.lang-pill:hover, .lang-pill.active { background: var(--brand); color: #fff; }
.lang-pill.ko { border-color: #475569; color: #475569; }
.lang-pill.ko:hover, .lang-pill.ko.active { background: #475569; color: #fff; }

/* Meeting viewer header area */
.view-head { max-width: 1040px; margin: 0 auto; padding: 18px 20px 0; }
.view-head .crumbs { margin-bottom: 12px; }
.view-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin-bottom: 0;
}
.back-btn {
  flex: 0 0 auto;
  font-weight: 600;
  font-size: .9rem;
  color: var(--brand);
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.back-btn:hover { background: #eff6ff; border-color: var(--brand); }
.view-title { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.view-date {
  font-variant-numeric: tabular-nums;
  color: var(--brand);
  background: #eff6ff;
  padding: 3px 8px;
  border-radius: 6px;
  margin-right: 8px;
  font-size: .85rem;
}

.empty {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Category body: meeting list + right links panel ---------- */
.cat-body {
  max-width: 1240px; margin: 0 auto;
  padding: 24px 20px 64px;
  display: flex; gap: 20px; align-items: flex-start;
}
.cat-main { flex: 1 1 auto; min-width: 0; }

.links-panel {
  flex: 0 0 auto; width: 210px;
  position: sticky; top: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
  padding: 12px; overflow: hidden;
  transition: width .2s ease;
}
.links-panel.expanded { width: 380px; }
.lp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.lp-title { font-weight: 700; font-size: .92rem; white-space: nowrap; }
.lp-head-actions { display: inline-flex; gap: 4px; align-items: center; flex: 0 0 auto; }
.lp-iconbtn {
  background: none; border: 1px solid var(--line); border-radius: 7px;
  padding: 2px 8px; font-size: 1rem; line-height: 1.3;
  color: var(--brand); cursor: pointer;
}
.lp-iconbtn:hover { border-color: var(--brand); background: #eff6ff; }
.lp-list { display: flex; flex-direction: column; gap: 6px; }
.lp-item {
  display: block; padding: 9px 10px; border-radius: 9px;
  border: 1px solid var(--line); color: inherit;
  transition: border-color .12s ease, background .12s ease;
}
.lp-item:hover { border-color: var(--brand); background: #f8fbff; }
.lp-item-title {
  display: block; font-weight: 600; font-size: .88rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-item-title .ext { color: var(--muted); font-size: .8rem; }
.lp-item-desc { display: block; margin-top: 3px; font-size: .8rem; color: var(--muted); }
.links-panel:not(.expanded) .lp-item-desc { display: none; }
.lp-empty { color: var(--muted); font-size: .85rem; padding: 8px 4px; }

/* link row + edit/delete (only shown when expanded) */
.lp-item-row { display: flex; align-items: flex-start; gap: 2px; }
.lp-item-row .lp-item { flex: 1 1 auto; min-width: 0; }
.lp-drag {
  flex: 0 0 auto; cursor: grab; color: var(--line);
  padding: 7px 2px 0; font-size: .9rem; line-height: 1; user-select: none;
}
.lp-drag:active { cursor: grabbing; }
.lp-item-row.dragging { opacity: .45; }
.lp-item-row.drop-before { box-shadow: inset 0 3px 0 -1px var(--brand); }
.lp-item-row.drop-after { box-shadow: inset 0 -3px 0 -1px var(--brand); }
.lp-item-actions { flex: 0 0 auto; display: inline-flex; gap: 1px; }
.links-panel:not(.expanded) .lp-item-actions { display: none; }
.lp-edit, .lp-del {
  background: none; border: none; cursor: pointer; line-height: 1; padding: 6px 5px;
}
.lp-edit { color: var(--muted); font-size: .92rem; }
.lp-edit:hover { color: var(--brand); }
.lp-del { color: #b91c1c; font-size: 1.05rem; }
.lp-del:hover { color: #7f1d1d; }

/* ---------- Tasks dock (pinned to the bottom of the category page) ---------- */
.task-dock {
  flex: 0 0 auto;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, .07);
}
.task-dock-inner { max-width: 1240px; margin: 0 auto; padding: 10px 20px 14px; }
.task-list { max-height: 150px; overflow: hidden; transition: max-height .2s ease; }
.task-list.expanded { max-height: 46vh; overflow-y: auto; }
.task-expand {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font-size: .8rem; font-weight: 600; color: var(--brand); cursor: pointer; white-space: nowrap;
}
.task-expand:hover { border-color: var(--brand); background: #eff6ff; }

.task-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.task-title { font-size: 1.1rem; margin: 0; }
.task-head-actions { display: inline-flex; gap: 8px; align-items: center; }
.task-add-btn {
  background: var(--brand); color: #fff; border: none; padding: 8px 14px;
  border-radius: 8px; font-weight: 600; font-size: .85rem; cursor: pointer;
}
.task-add-btn:hover { background: var(--brand-dark); }
.task-lock {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer;
}
.task-lock:hover { border-color: var(--brand); color: var(--brand); }

.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-row {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.task-row.done { background: #f8fafc; }
.task-info { flex: 1 1 auto; min-width: 0; }
.task-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 5px; }
.task-badge {
  font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  border: 0; cursor: pointer; font-family: inherit; line-height: 1.5;
}
.task-badge.open { background: #eff6ff; color: var(--brand-dark); }
.task-badge.pending { background: #fef3c7; color: #92400e; }
.task-badge.done, .task-badge.complete { background: #dcfce7; color: #166534; }
.task-due {
  font-size: .8rem; font-weight: 600; color: var(--muted);
  background: #f1f5f9; padding: 2px 8px; border-radius: 6px; font-variant-numeric: tabular-nums;
}
.task-due.overdue { background: #fee2e2; color: #b91c1c; }
.task-due-btn {
  font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer;
  background: #f1f5f9; border: 1px solid transparent; padding: 2px 8px;
  border-radius: 6px; font-variant-numeric: tabular-nums;
}
.task-due-btn:hover { border-color: var(--brand); color: var(--brand); }
.task-due-btn.overdue { background: #fee2e2; color: #b91c1c; }
.task-due-btn.empty { background: #fff; border: 1px dashed var(--line); color: var(--brand); }
.task-who { font-size: .82rem; color: var(--muted); }
.task-what { font-weight: 600; font-size: 1rem; word-break: break-word; }
.task-row.done .task-what { color: #64748b; }
.task-detail { margin-top: 2px; font-size: .88rem; color: #475569; white-space: pre-wrap; word-break: break-word; }
.task-result {
  margin-top: 6px; font-size: .88rem; color: #475569; word-break: break-word;
  background: #f0fdf4; border-left: 3px solid #22c55e; border-radius: 6px; padding: 7px 10px;
}
.task-result .rk { font-weight: 700; color: #166534; margin-right: 4px; }
.task-result a { color: var(--brand); font-weight: 600; margin-left: 6px; white-space: nowrap; }
.task-actions { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; }
.task-result-btn {
  font-size: .8rem; font-weight: 600; color: var(--brand); background: #fff;
  border: 1px solid var(--brand); border-radius: 8px; padding: 6px 11px; cursor: pointer; white-space: nowrap;
}
.task-result-btn:hover { background: var(--brand); color: #fff; }
.task-edit, .task-del { background: none; border: none; cursor: pointer; line-height: 1; padding: 6px 5px; }
.task-edit { color: var(--muted); font-size: .92rem; }
.task-edit:hover { color: var(--brand); }
.task-del { color: #b91c1c; font-size: 1.05rem; }
.task-del:hover { color: #7f1d1d; }
.task-empty { color: var(--muted); padding: 14px 2px; }
.task-modal-what { font-weight: 600; margin-bottom: 4px; color: var(--ink); }

@media (max-width: 560px) {
  .task-row { flex-direction: column; }
  .task-actions { align-self: flex-end; }
}

/* ---------- Modal (Add / Edit link) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px; z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--card); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  width: 100%; max-width: 480px; max-height: 84vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-close { background: none; border: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-close:hover { color: var(--ink); }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 16px 20px; overflow-y: auto; }

/* shared form styles (used inside the modal) */
.lp-form { display: flex; flex-direction: column; gap: 7px; }
.lp-f-label { font-size: .72rem; color: var(--muted); font-weight: 600; }
.lp-input {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 7px; font-size: .82rem; font-family: inherit;
}
.lp-input:focus { outline: none; border-color: var(--brand); }
textarea.lp-input { resize: vertical; }
.lp-form-actions { text-align: right; }
.lp-save {
  background: var(--brand); color: #fff; border: none; padding: 7px 14px;
  border-radius: 7px; font-weight: 600; font-size: .82rem; cursor: pointer;
}
.lp-save:hover { background: var(--brand-dark); }
.lp-save:disabled { opacity: .6; cursor: default; }
.lp-form-actions .lp-clear {
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 7px 12px; border-radius: 7px; font-weight: 600; font-size: .82rem; cursor: pointer; margin-right: 8px;
}
.lp-form-actions .lp-clear:hover { border-color: #b91c1c; color: #b91c1c; }

@media (max-width: 760px) {
  .cat-body { flex-direction: column; }
  .links-panel, .links-panel.expanded { width: 100%; position: static; order: -1; }
  .links-panel:not(.expanded) .lp-item-desc { display: block; }
}

/* ---------- Meeting document ---------- */
.doc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 36px 40px 44px;
}
.doc-head {
  border-bottom: 2px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 24px;
}
.doc-head .kicker {
  font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand);
}
.doc-head h1 { margin: 6px 0 12px; font-size: 1.7rem; letter-spacing: -.02em; }
.doc-meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-size: .88rem; color: var(--muted);
}
.doc-meta b { color: var(--ink); font-weight: 600; }

.doc h2 {
  font-size: 1.15rem;
  margin: 28px 0 10px;
  padding-left: 10px;
  border-left: 4px solid var(--brand);
}
.doc h3 { font-size: 1rem; margin: 18px 0 6px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc table {
  width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .92rem;
}
.doc th, .doc td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.doc th { background: #f8fafc; font-weight: 600; }
.doc .tag {
  display: inline-block; font-size: .78rem; font-weight: 600;
  background: #eef2ff; color: var(--brand-dark);
  padding: 2px 9px; border-radius: 999px; margin-right: 6px;
}
.action-table td:first-child { white-space: nowrap; font-weight: 600; }

.lang-switch {
  float: right;
  margin-left: 8px;
  font-size: .82rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}
.lang-switch:hover { border-color: var(--brand); color: var(--brand); }

.print-btn {
  float: right;
  font-size: .85rem;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.print-btn:hover { background: var(--brand-dark); }

/* ---------- Comments ---------- */
.cm-wrap { max-width: 1060px; margin: 0 auto; padding: 8px 32px 48px; }
.cm-title {
  font-size: 1.2rem; margin: 8px 0 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.cm-form {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.cm-name {
  width: 260px; max-width: 100%; display: block; margin-bottom: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: .92rem;
}
.cm-text {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: .95rem; font-family: inherit; resize: vertical;
}
.cm-name:focus, .cm-text:focus { outline: none; border-color: var(--brand); }
.cm-actions { margin-top: 10px; text-align: right; }
.cm-submit {
  background: var(--brand); color: #fff; border: none; padding: 9px 18px;
  border-radius: 8px; font-weight: 600; cursor: pointer;
}
.cm-submit:hover { background: var(--brand-dark); }
.cm-submit:disabled { opacity: .6; cursor: default; }
.cm-list { display: flex; flex-direction: column; gap: 10px; }
.cm-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; box-shadow: var(--shadow);
}
.cm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.cm-author { font-weight: 700; color: var(--ink); }
.cm-meta { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.cm-time { font-size: .78rem; color: var(--muted); }
.cm-del {
  font-size: .76rem; color: #b91c1c; background: none; border: none;
  padding: 0; cursor: pointer; text-decoration: underline;
}
.cm-del:hover { color: #7f1d1d; }
.cm-del:disabled { opacity: .5; cursor: default; }
.cm-body { white-space: pre-wrap; word-break: break-word; font-size: .95rem; }
.cm-empty { color: var(--muted); padding: 14px 2px; }

.site-footer {
  text-align: center; color: var(--muted); font-size: .85rem;
  padding: 28px 0; border-top: 1px solid var(--line); margin-top: 40px;
}

@media print {
  .site-header, .crumbs, .print-btn, .site-footer { display: none; }
  .doc { border: none; box-shadow: none; padding: 0; }
  body { background: #fff; }
}

@media (max-width: 560px) {
  .meeting-item a { flex-wrap: wrap; }
  .doc { padding: 24px 20px 30px; }
}

/* ---------- In-browser meeting editor (edit mode + download) ---------- */
.edit-btn {
  flex: 0 0 auto;
  font-weight: 600;
  font-size: .9rem;
  color: var(--brand);
  background: #eff6ff;
  padding: 7px 12px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  cursor: pointer;
}
.edit-btn:hover { background: var(--brand); color: #fff; }

#viewContent.editing {
  outline: 2px dashed #2d6da8;
  outline-offset: 6px;
  border-radius: 8px;
}
#viewContent.editing [contenteditable] { cursor: text; }

#editBar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: #1e3a5f;
  color: #fff;
  box-shadow: 0 -3px 14px rgba(0,0,0,.25);
}
#editBar .eb-hint { font-size: .9rem; line-height: 1.5; flex: 1 1 240px; }
#editBar .eb-hint.ok { color: #6ee7c8; }
#editBar .eb-hint.err { color: #fca5a5; }
#editBar .eb-hint a { color: #93c5fd; text-decoration: underline; }
#editBar .eb-token {
  display: flex; align-items: center; gap: 8px;
  flex: 1 1 320px;
}
#editBar .eb-token input {
  flex: 1 1 auto; min-width: 180px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #fff; color: #1e293b;
  font-size: .88rem;
}
#editBar .eb-help { color: #93c5fd; font-size: .82rem; text-decoration: underline; white-space: nowrap; }
#editBar .eb-actions { display: flex; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; }
.eb-btn {
  font-weight: 700;
  font-size: .9rem;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}
.eb-btn.small { padding: 8px 12px; }
.eb-btn.save { background: #16a085; color: #fff; }
.eb-btn.save:hover { background: #12876f; }
.eb-btn.ghost { background: transparent; color: #cbd5e1; border-color: #475569; }
.eb-btn.ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.eb-btn.cancel { background: transparent; color: #cbd5e1; border-color: #475569; }
.eb-btn.cancel:hover { background: rgba(255,255,255,.1); color: #fff; }
