* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --accent: #4f46e5;
  --bg: #f3f4f6;
  --card-bg: #fff;
  --border: #e5e7eb;
  --text: #111827;
  --sub: #6b7280;
  --header-h: 48px;
  --nav-h: 60px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* ── Header ── */
.hub-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}
.hub-logo { font-size: 20px; font-weight: 700; color: var(--accent); letter-spacing: -0.5px; }
.hub-btn-add {
  width: 34px; height: 34px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 50%;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.hub-btn-add:hover { opacity: 0.85; }

/* ── Body / panels ── */
.hub-body {
  position: fixed;
  top: var(--header-h); left: 0; right: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}
.tab-panel { display: flex; flex-direction: column; height: 100%; }
.tab-panel.hidden { display: none; }

/* ── Panel bar ── */
.panel-bar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 14px; font-weight: 600; color: var(--sub); flex: 1; }
.bar-btn {
  background: none; border: none;
  font-size: 18px; cursor: pointer;
  color: var(--sub); padding: 4px 8px; border-radius: 6px;
}
.bar-btn:hover { background: #f3f4f6; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinning { animation: spin 0.7s linear infinite; display: inline-block; }

/* Search bar */
.search-bar-wrap { padding: 8px 12px; }
.search-bar-wrap input {
  flex: 1; border: none; outline: none;
  font-size: 14px; font-family: inherit;
  background: transparent; color: var(--text);
}
.search-icon-inline { font-size: 16px; flex-shrink: 0; }

/* Review bar */
.strategy-select {
  flex: 1;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 8px; font-size: 13px; font-family: inherit;
  background: #fff; outline: none;
}
.mode-toggle { display: flex; gap: 4px; }
.mode-btn {
  border: 1px solid var(--border); background: #fff;
  color: var(--sub); border-radius: 6px;
  padding: 5px 10px; font-size: 14px; cursor: pointer;
}
.mode-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Scroll area ── */
.panel-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 12px 16px 16px;
  -webkit-overflow-scrolling: touch;
}

/* ── Note cards ── */
.note-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 12px 14px 10px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(3px); } to { opacity:1; transform:none; } }
.note-body {
  font-size: 14px; line-height: 1.65;
  color: var(--text); word-break: break-word;
  margin-bottom: 8px; min-width: 0;
}


.note-meta {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; font-size: 11px; color: var(--sub);
  margin-top: 4px;
}
.note-date { margin-left: auto; }
.card-actions { display: flex; gap: 4px; }
.btn-icon {
  background: none; border: none; cursor: pointer;
  font-size: 14px; padding: 2px 4px; border-radius: 4px; opacity: 0.6;
}
.btn-icon:hover { opacity: 1; background: #f3f4f6; }
.source-link {
  color: var(--accent); text-decoration: none; font-size: 11px;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.source-link:hover { text-decoration: underline; }

/* ── Buttons ── */
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 9px 18px;
  font-size: 14px; font-family: inherit; font-weight: 600; cursor: pointer;
}
.btn-secondary {
  background: #f3f4f6; color: #374151; border: none;
  border-radius: 8px; padding: 9px 18px;
  font-size: 14px; font-family: inherit; cursor: pointer;
}
.btn-danger {
  background: #ef4444; color: #fff; border: none;
  border-radius: 8px; padding: 9px 18px;
  font-size: 14px; font-family: inherit; cursor: pointer;
}
.btn-sm {
  padding: 5px 12px; font-size: 12px;
  border-radius: 6px; border: none; cursor: pointer; font-family: inherit;
}
.btn-sm.primary { background: var(--accent); color: #fff; }
.btn-sm.secondary { background: #f3f4f6; color: #374151; }

/* ── Status / empty ── */
.status-msg { text-align: center; font-size: 13px; color: var(--sub); padding: 12px 0; min-height: 40px; }
.empty-msg { text-align: center; font-size: 14px; color: var(--sub); padding: 48px 0 24px; }
.state-msg { text-align: center; font-size: 14px; color: var(--sub); padding: 48px 16px; }
.sentinel { height: 1px; }
@keyframes spin2 { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #d1d5db; border-top-color: var(--accent);
  border-radius: 50%; animation: spin2 0.6s linear infinite;
  vertical-align: middle; margin-right: 6px;
}

/* Dedup */
.sim-badge { background: #e0e7ff; color: #3730a3; display:inline-block; padding:1px 6px; border-radius:4px; font-size:11px; font-weight:600; margin-right:4px; }
.sim-badge-yellow { background: #fef3c7; color: #92400e; display:inline-block; padding:1px 6px; border-radius:4px; font-size:11px; font-weight:600; }
.sim-badge-red { background: #fee2e2; color: #991b1b; display:inline-block; padding:1px 6px; border-radius:4px; font-size:11px; font-weight:600; }
.dedup-area { margin: 10px 0 0; border-top: 1px solid var(--border); padding-top: 10px; }
.dedup-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.match-card { background: #f9fafb; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; font-size: 12px; line-height: 1.5; }
.match-row { display: flex; align-items: flex-start; gap: 8px; }
.match-body { flex: 1; min-width: 0; }
.match-content { max-height: 180px; overflow-y: auto; margin-top: 4px; font-size: 12px; line-height: 1.55; }
.btn-replace-match {
  background: #f59e0b; color: #fff; border: none;
  border-radius: 6px; padding: 4px 10px;
  font-size: 12px; font-family: inherit;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.btn-replace-match:hover { opacity: 0.85; }

/* ── Review styles ── */
.review-card {
  background: var(--card-bg); border-radius: 12px;
  padding: 20px 16px 14px; margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  position: relative;
}
.btn-edit-note {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; opacity: 0.6; padding: 4px;
}
.btn-edit-note:hover { opacity: 1; }
.note-text { font-size: 15px; line-height: 1.65; color: var(--text); margin-bottom: 8px; }
.note-source { font-size: 12px; color: var(--sub); margin-top: 4px; }
.note-source a { color: var(--accent); text-decoration: none; }
.review-actions {
  display: flex; gap: 10px; justify-content: center;
  padding: 4px 0 16px;
}
.btn-skip {
  background: #f3f4f6; color: #374151; border: none;
  border-radius: 10px; padding: 12px 24px;
  font-size: 15px; cursor: pointer; font-family: inherit;
}
.btn-mastered {
  background: #059669; color: #fff; border: none;
  border-radius: 10px; padding: 12px 24px;
  font-size: 15px; cursor: pointer; font-family: inherit;
}
.btn-forgot {
  background: #fee2e2; color: #991b1b; border: none;
  border-radius: 10px; padding: 12px 18px;
  font-size: 15px; cursor: pointer; font-family: inherit; flex: 1;
}
.btn-recalled {
  background: #fef3c7; color: #92400e; border: none;
  border-radius: 10px; padding: 12px 18px;
  font-size: 15px; cursor: pointer; font-family: inherit; flex: 1;
}
.btn-sr-mastered {
  background: #059669; color: #fff; border: none;
  border-radius: 10px; padding: 12px 18px;
  font-size: 15px; cursor: pointer; font-family: inherit; flex: 1;
}
.sr-status-bar {
  margin-top: 10px; font-size: 12px; color: var(--sub);
  text-align: right; padding: 0 2px;
}
.sr-btn-days {
  display: block; font-size: 11px; opacity: 0.75;
  margin-top: 2px; font-weight: 400;
}
.sr-interval-hint {
  text-align: center; font-size: 12px; color: var(--sub);
  padding: 4px 0 8px; min-height: 22px;
}
.rv-badge {
  display: inline-block; background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  padding: 2px 4px; border-radius: 8px;
  vertical-align: top; margin-left: 1px; margin-top: -2px;
  min-width: 14px; text-align: center;
}
.rv-badge.hidden { display: none; }
.progress { text-align: center; font-size: 13px; color: var(--sub); margin-bottom: 6px; }
.progress-bar { height: 4px; background: #e5e7eb; border-radius: 2px; margin-bottom: 14px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }

/* List mode */
.list-note-card {
  background: var(--card-bg); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: background 0.2s;
}
.list-note-card.mastered { background: #f0fdf4; }
.list-note-top { display: flex; align-items: flex-start; gap: 8px; }
.list-note-body { flex: 1; min-width: 0; font-size: 14px; line-height: 1.6; word-break: break-word; }
.list-note-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.list-btn-master {
  background: #d1fae5; color: #065f46; border: none;
  border-radius: 6px; padding: 4px 8px; font-size: 12px;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.list-note-card.mastered .list-btn-master { background: #059669; color: #fff; }
.list-btn-edit { background: none; border: none; font-size: 14px; cursor: pointer; color: var(--sub); padding: 4px; text-align: center; }
.list-note-src { font-size: 11px; color: var(--sub); margin-top: 4px; }
.list-note-src a { color: var(--accent); text-decoration: none; }
.list-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 8px; border-top: 1px solid var(--border);
  margin-top: 4px; position: sticky; bottom: 0; background: var(--bg);
}
.list-footer-info { font-size: 13px; color: var(--sub); }
.btn-finish {
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 8px 18px;
  font-size: 14px; cursor: pointer; font-family: inherit; font-weight: 600;
}
.summary { text-align: center; padding: 32px 16px; }
.summary-icon { font-size: 40px; margin-bottom: 12px; }
.summary-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.summary-stats { font-size: 14px; color: var(--sub); line-height: 1.8; margin-bottom: 20px; }
.btn-restart {
  background: var(--accent); color: #fff; border: none;
  border-radius: 10px; padding: 12px 32px;
  font-size: 15px; cursor: pointer; font-family: inherit; font-weight: 600;
}

/* ── Settings ── */
.settings-scroll { padding: 16px; }
.settings-section {
  background: var(--card-bg); border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.settings-section-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.settings-section-header .settings-section-title { flex: 1; margin-bottom: 0; }
.settings-section-title {
  font-size: 11px; font-weight: 600; color: var(--sub);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px;
}
.btn-test {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 10px; font-size: 12px; font-family: inherit;
  cursor: pointer; color: var(--sub); white-space: nowrap;
}
.btn-test:hover { background: #f3f4f6; border-color: #9ca3af; }
.btn-test:disabled { opacity: 0.5; cursor: not-allowed; }
.test-result { font-size: 11px; }
.test-ok { color: #059669; }
.test-err { color: #dc2626; }
.settings-textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; font-family: inherit;
  outline: none; color: var(--text); resize: vertical;
  min-height: 110px; line-height: 1.6;
}
.settings-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.settings-field { margin-bottom: 12px; }
.settings-field:last-child { margin-bottom: 0; }
.settings-field label { display: block; font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 4px; }
.settings-field input {
  width: 100%; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px;
  font-size: 13px; font-family: inherit; outline: none; color: var(--text);
}
.settings-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.settings-hint { display: block; font-size: 11px; color: #9ca3af; margin-top: 4px; }
.btn-cfg-save {
  width: 100%; padding: 12px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 10px; font-size: 15px; font-weight: 600;
  font-family: inherit; cursor: pointer; margin-top: 4px;
}

/* ── Bottom nav ── */
.hub-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #fff; border-top: 1px solid var(--border);
  display: flex; z-index: 100;
  transform: translateZ(0);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  background: none; border: none; cursor: pointer; padding: 6px 0;
  color: var(--sub); font-family: inherit;
}
.nav-btn.active { color: var(--accent); }
.nav-icon { font-size: 20px; line-height: 1; }
.nav-label { font-size: 11px; }

/* ── Modal (bottom sheet on mobile) ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 300;
  transition: bottom 0.15s ease;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 20px 20px 32px; width: 100%; max-width: 640px;
  max-height: 85vh; overflow-y: auto;
}
.modal-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 0; }
.modal-box textarea {
  width: 100%; min-height: 120px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  outline: none; resize: vertical; color: var(--text);
  line-height: 1.6; margin-bottom: 10px;
}
.modal-box textarea:focus { border-color: var(--accent); }
.md-toolbar {
  display: flex; align-items: center; gap: 1px; flex-wrap: wrap;
  padding: 4px 6px; background: #f9fafb;
  border: 1px solid var(--border); border-radius: 8px 8px 0 0; border-bottom: none;
  margin-bottom: 0;
}
.md-toolbar + textarea { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: 0; }
.tb-btn {
  background: none; border: 1px solid transparent; border-radius: 4px;
  padding: 2px 6px; font-size: 12px; font-family: inherit; cursor: pointer;
  color: #374151; line-height: 1.5; min-width: 26px; text-align: center; font-weight: 500;
}
.tb-btn:hover { background: #e5e7eb; border-color: #d1d5db; }
.tb-sep { width: 1px; height: 14px; background: #e5e7eb; margin: 0 3px; flex-shrink: 0; }
.tb-status { font-size: 11px; color: #6b7280; padding: 2px 4px; align-self: center; }
.url-label-text { display: block; font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 4px; }
.url-input-row { display: flex; gap: 6px; align-items: center; }
.url-input-row input { flex: 1; }
.btn-fetch-title {
  flex-shrink: 0; padding: 7px 10px;
  background: #f3f4f6; border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; color: #374151; cursor: pointer; font-family: inherit;
  white-space: nowrap; line-height: 1;
}
.btn-fetch-title:hover { background: #e5e7eb; }
.btn-fetch-title:disabled { opacity: 0.5; cursor: not-allowed; }
.stitle-fetch-status {
  font-size: 12px; margin-top: -6px; margin-bottom: 6px; padding: 3px 0;
}
.stitle-fetch-status.loading { color: #6b7280; }
.stitle-fetch-status.loading::before { content: ''; display: inline-block; width: 10px; height: 10px; border: 2px solid #d1d5db; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; margin-right: 5px; }
.stitle-fetch-status.ok  { color: #059669; }
.stitle-fetch-status.err { color: #9ca3af; }
#modal-url-wrap input,
#modal-stitle-wrap input {
  width: 100%; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px;
  font-size: 13px; font-family: inherit; outline: none; color: var(--text);
  margin-bottom: 10px;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

.hidden { display: none !important; }

/* ── Collapse ── */
.note-body.is-collapsed,
.note-text.is-collapsed,
.list-note-body.is-collapsed {
  max-height: 200px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.btn-toggle-collapse {
  display: block; width: 100%; background: none; border: none;
  color: #9ca3af; font-size: 12px; cursor: pointer;
  padding: 4px 0 0; text-align: center; font-family: inherit; margin-top: 4px;
}
.btn-toggle-collapse:hover { color: #4f46e5; }

/* ── Toast ── */
.hub-toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px); left: 50%;
  transform: translateX(-50%);
  background: #064e3b; color: #fff;
  padding: 9px 18px; border-radius: 8px;
  font-size: 13px; opacity: 0; transition: opacity 0.3s;
  pointer-events: none; z-index: 400; white-space: nowrap;
}
.hub-toast.show { opacity: 1; }

/* ── Categories ── */
.cat-filter {
  flex-shrink: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 7px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.cat-pill {
  border: none; border-radius: 20px;
  padding: 3px 10px; font-size: 12px;
  cursor: pointer; font-family: inherit; line-height: 1.6;
  transition: opacity 0.15s;
}
.cat-pill-all { background: #f3f4f6; color: var(--sub); }
.cat-pill-all.active { background: var(--accent); color: #fff; }
.cat-pill:hover { opacity: 0.8; }

.note-cat-tag {
  display: inline-block;
  border-radius: 4px; padding: 1px 7px;
  font-size: 11px; font-weight: 500;
  white-space: nowrap;
}

/* Modal category selector */
.modal-cat-row { margin-bottom: 10px; }
.modal-cat-label { display: block; font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.modal-cat-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-cat-pill {
  border: none; border-radius: 20px;
  padding: 4px 12px; font-size: 12px;
  cursor: pointer; font-family: inherit; line-height: 1.6;
}

/* Settings category management */
.cat-list-items { margin-bottom: 6px; }
.cat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid #f3f4f6;
}
.cat-item:last-child { border-bottom: none; }
.cat-color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.cat-item-name { flex: 1; font-size: 13px; }
.cat-del-btn { background: none; border: none; cursor: pointer; color: #9ca3af; font-size: 18px; padding: 0 4px; line-height: 1; }
.cat-del-btn:hover { color: #ef4444; }
.sr-cat-check-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; cursor: pointer;
}
.sr-cat-check-row:last-child { border-bottom: none; }
.sr-cat-check-row input { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; accent-color: var(--accent); }
.add-cat-row { display: flex; gap: 6px; align-items: center; margin-top: 10px; }
.add-cat-name {
  flex: 1; border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px;
  font-size: 13px; font-family: inherit; outline: none; color: var(--text);
}
.add-cat-name:focus { border-color: var(--accent); }
.add-cat-color { width: 36px; height: 34px; border-radius: 6px; border: 1px solid var(--border); padding: 2px; cursor: pointer; }
.add-cat-btn {
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 7px 12px;
  font-size: 13px; font-family: inherit; cursor: pointer; white-space: nowrap;
}

/* ── Polish button ── */
.polish-row { display: flex; justify-content: flex-end; margin: -2px 0 8px; }
.btn-polish {
  background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 12px;
  font-size: 12px; font-family: inherit; cursor: pointer;
  color: var(--sub); display: inline-flex; align-items: center; gap: 4px;
  transition: border-color 0.15s;
}
.btn-polish:hover { background: #f9fafb; border-color: #d1d5db; }
.btn-polish:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-polish-undo { margin-right: 6px; }
.polish-row { gap: 0; }
@keyframes polish-press {
  0%   { box-shadow: 0 0 0 0 rgba(99,102,241,0); border-color: var(--border); }
  100% { box-shadow: 0 0 0 3px rgba(99,102,241,0.5); border-color: #6366f1; }
}
.btn-polish-pressing { animation: polish-press 500ms linear forwards; }
.polish-custom-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.polish-custom-box {
  background: #fff; border-radius: 10px; padding: 18px 20px; width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.polish-custom-box h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: #111827; }
.polish-custom-box p { margin: 0 0 10px; font-size: 12px; color: #6b7280; line-height: 1.5; }
.polish-custom-ta {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 10px; font-size: 13px; font-family: inherit;
  resize: vertical; min-height: 72px; outline: none; color: #111827;
}
.polish-custom-ta:focus { border-color: #6366f1; }
.polish-custom-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ── Modal title row (title + edit/preview tabs) ── */
.modal-title-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.modal-title-row h3 { font-size: 16px; font-weight: 700; margin-bottom: 0; }
.modal-edit-tabs {
  display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.edit-tab {
  padding: 4px 14px; font-size: 12px; border: none; cursor: pointer;
  background: none; color: var(--sub); font-family: inherit; line-height: 1.6;
}
.edit-tab.active { background: var(--accent); color: #fff; }
.modal-preview-area {
  min-height: 120px; max-height: 320px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 10px; font-size: 14px;
}

/* ── Clipboard banner ── */
.clip-banner {
  display: flex; align-items: center; gap: 8px;
  background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 10px;
}
.clip-msg { flex: 1; font-size: 13px; color: #1d4ed8; }
.clip-btn-paste {
  background: #3b82f6; color: #fff; border: none;
  border-radius: 6px; padding: 4px 10px;
  font-size: 12px; cursor: pointer; font-family: inherit;
}
.clip-btn-x {
  background: none; border: none; cursor: pointer;
  color: #6b7280; font-size: 18px; padding: 0 4px; line-height: 1;
}
