/* =============================================================================
   CSS 변수 & 테마
   ============================================================================= */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface2: #f8f9fa;
  --surface3: #e9ecef;
  --border: #dee2e6;
  --text: #212529;
  --text2: #495057;
  --text3: #868e96;
  --primary: #339af0;
  --primary-a05: rgba(51, 154, 240, 0.05);
  --primary-a08: rgba(51, 154, 240, 0.08);
  --primary-a10: rgba(51, 154, 240, 0.10);
  --primary-a15: rgba(51, 154, 240, 0.15);
  --pri-issue-bg: #ffe3e3;   --pri-issue-color: #e03131;
  --pri-season-bg: #ffe8cc;  --pri-season-color: #e8590c;
  --pri-steady-bg: #d0ebff;  --pri-steady-color: #1971c2;
}

[data-theme="dark"] {
  --bg: #121212;
  --surface: #1e1e1e;
  --surface2: #2b2b2b;
  --surface3: #3b3b3b;
  --border: #333333;
  --text: #e9ecef;
  --text2: #ced4da;
  --text3: #868e96;
  --primary: #4dabf7; 
  --primary-a05: rgba(77, 171, 247, 0.05);
  --primary-a08: rgba(77, 171, 247, 0.08);
  --primary-a10: rgba(77, 171, 247, 0.10);
  --primary-a15: rgba(77, 171, 247, 0.15);
  --pri-issue-bg: #4a1919;   --pri-issue-color: #ff8787;
  --pri-season-bg: #4a2a10;  --pri-season-color: #ffa94d;
  --pri-steady-bg: #18334a;  --pri-steady-color: #74c0fc;
}


/* =============================================================================
   리셋 & 베이스
   ============================================================================= */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Pretendard Variable", Pretendard, Roboto, "Segoe UI", "Malgun Gothic",
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

input, select, textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  outline: none;
  font-family: inherit;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #adb5bd; }

* {
  scrollbar-width: thin;
  scrollbar-color: #ced4da transparent;
}


/* =============================================================================
   애니메이션
   ============================================================================= */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-4px); }
  75%       { transform: translateX(4px); }
}

@keyframes toastSlideIn {
  from { transform: translateX(50px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes flash-update {
  0%   { background-color: var(--surface); }
  30%  { background-color: var(--primary-a15); border-color: var(--primary); transform: scale(1.01); }
  100% { background-color: var(--surface); transform: scale(1); }
}

.updated-flash {
  animation: flash-update 1.5s ease-in-out;
  z-index: 10;
}


/* =============================================================================
   헤더
   ============================================================================= */

header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, background-color 0.3s;
}

[data-theme="dark"] header { background: rgba(30, 30, 30, 0.95); }

header.scrolled { transform: translateY(-78px); }
header.scrolled .dynamic-title { opacity: 1; visibility: visible; }

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  height: 50px;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-bottom { padding: 10px 20px; }

.logo {
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
  color: #ff5a4a;
  letter-spacing: -0.5px;
  cursor: pointer;
}

.dynamic-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
}

.backup-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 20px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text3);
  min-height: 28px;
}

.backup-warn { color: #e8590c; font-weight: 700; }
.backup-ok   { color: #40c057; font-weight: 700; }

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text3);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.tab-btn.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.tab-icon {
  display: none;
  width: 18px;
  height: 18px;
}
.tab-text {
  display: inline;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface2);
  border-radius: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
}

.global-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  width: 140px;
  font-family: inherit;
  margin-left: 4px;
  color: var(--text);
}

.global-search-result {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 280px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 200;
  display: none;
  border-radius: 8px;
}
.global-search-result.active { display: block; }

.gs-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gs-item:hover { background: var(--surface2); }
.gs-title { font-size: 12px; font-weight: 700; color: var(--text); }
.gs-meta  { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text3); }
.gs-badge { padding: 2px 4px; border-radius: 4px; background: var(--surface3); font-weight: 700; }


/* =============================================================================
   레이아웃
   ============================================================================= */

.main {
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.sub-tabs {
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  display: flex;
  justify-content: space-between !important;
  align-items: center;
}
.sub-tabs .tab-btn {
  border-radius: 6px 6px 0 0;
  border: none;
  border-bottom: 2px solid transparent;
}
.sub-tabs .tab-btn.active {
  background: transparent;
  border-bottom-color: var(--primary);
  color: var(--primary);
  box-shadow: none;
}

.archive-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding-left: 4px;
}


/* =============================================================================
   공통 컴포넌트
   ============================================================================= */

.section-title {
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
}

.title-with-icon { display: flex; align-items: center; gap: 8px; }
.title-icon { color: var(--primary); width: 20px; height: 20px; stroke-width: 2.5px; }

.list-count-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--surface3);
  color: var(--text2);
  border-radius: 10px;
  padding: 2px 7px;
  line-height: 1.4;
}

.empty-state {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  padding: 24px;
}

.btn {
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary { background: var(--primary); color: #fff; border: none; }
[data-theme="dark"] .btn-primary { background: #1971c2; }

.btn-sm { padding: 4px 8px; font-size: 11px; }
.btn:hover { filter: brightness(0.93); }

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s, background-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  border-radius: 5px;
  outline: none;
}
.btn-icon:hover { color: var(--primary); background: var(--surface2); }
.btn-icon.delete { color: #ced4da; }
.btn-icon.delete:hover {
  background-color: #fa5252 !important;
  color: #ffffff !important;
}

.btn-icon:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sort-group {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.sort-group .btn.active {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: var(--primary-a08) !important;
  font-weight: 800 !important;
}

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
button .spinner { margin-right: 0; }
button:disabled { opacity: 0.7; cursor: not-allowed; }

.clear-search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 12px;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}
.clear-search-btn:hover { background: var(--surface3); color: var(--text); }

.clear-search-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}


/* =============================================================================
   강조 (하이라이트)
   ============================================================================= */

tr.highlight,
.inbox-item.highlight,
.tbd-item.highlight,
.memo-card.highlight {
  background: #fff3bf !important;
  border-color: #fcc419 !important;
  transition: background 0.3s;
}
[data-theme="dark"] tr.highlight,
[data-theme="dark"] .inbox-item.highlight,
[data-theme="dark"] .tbd-item.highlight,
[data-theme="dark"] .memo-card.highlight {
  background: rgba(252, 196, 25, 0.2) !important;
  border-color: #fcc419 !important;
}

.inbox-item.trash-highlight { background-color: #adb5bd !important; border-color: #868e96 !important; transition: background 0.3s; }
[data-theme="dark"] .inbox-item.trash-highlight { background-color: #495057 !important; border-color: #868e96 !important; }

.inbox-item.duplicate-highlight {
  background-color: #fff3bf !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
  animation: none !important;
}
[data-theme="dark"] .inbox-item.duplicate-highlight {
  background-color: rgba(252, 196, 25, 0.2) !important;
  border-color: var(--border) !important;
}

.inbox-item.is-dup-highlight {
  background-color: #fff3bf !important;
  border: 2px solid var(--primary) !important;
  transform: scale(1.02);
  transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
  z-index: 10;
}
[data-theme="dark"] .inbox-item.is-dup-highlight {
  background-color: rgba(252, 196, 25, 0.2) !important;
  border-color: #fcc419 !important;
}


/* =============================================================================
   토스트 알림
   ============================================================================= */

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast-item {
  background: var(--text);
  color: var(--surface);
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
  cursor: pointer;
  min-width: 240px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, opacity 0.3s;
}
.toast-item:hover { transform: translateY(-2px) scale(1.02); filter: brightness(1.1); }

.scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--text);
  color: var(--surface);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0.3;
  transition: opacity 0.3s, transform 0.3s, background-color 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: none;
}
.scroll-to-top:hover { opacity: 0.9; transform: translateY(-4px); }
[data-theme="dark"] .scroll-to-top { background: var(--primary); color: #fff; }


/* =============================================================================
   블로그 홈 (대시보드)
   ============================================================================= */

.home-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}

.blog-home-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}

.blog-home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.blog-home-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.blog-home-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.blog-home-title:hover { opacity: 0.8; }

.blog-home-cat {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 900;
  white-space: nowrap;
}

.blog-home-rev {
  font-size: 13px;
  font-weight: 900;
  color: #40c057;
  background: rgba(64, 192, 87, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  margin-left: 8px;
}

.blog-home-stats {
  display: flex;
  background: var(--surface2);
  border-radius: 8px;
  padding: 12px 10px;
  justify-content: space-between;
  border: 1px solid var(--border);
}

.blog-home-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.blog-home-stat-item:not(:last-child) {
  border-right: 1px dashed var(--border);
}

.bh-stat-num { font-size: 18px; font-weight: 900; color: var(--text); line-height: 1; }
.bh-stat-lbl { font-size: 11px; color: var(--text3); font-weight: 700; }

.blog-home-memo {
  width: 100%;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  outline: none;
  min-height: 80px;
  line-height: 1.5;
  transition: border-color 0.2s, background-color 0.2s;
}

.blog-home-memo:focus {
  border-color: var(--primary);
  border-style: solid;
  background: var(--surface);
}


/* =============================================================================
   인박스 (키워드 수집)
   ============================================================================= */

.inbox-cat-summary { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

.inbox-cat-chip {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--c);
  font-weight: 700;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: opacity 0.2s, background-color 0.2s, border-color 0.2s, color 0.2s;
  user-select: none;
}
.inbox-cat-chip:hover { opacity: 0.8; background: var(--surface3); }
.inbox-cat-chip.active { background: var(--primary-a10); border-color: var(--primary); color: var(--text); }

.bulk-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.bulk-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  transition: border-color 0.15s;
  min-height: 40px;
  line-height: 1.4;
}

.bulk-input:focus { border-color: var(--primary); }

.bulk-input-row .btn {
  height: 40px;
  width: 60px;
  padding: 0;
  box-sizing: border-box !important;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

textarea#quick-kw::placeholder {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bulk-input-row .clear-search-btn {
  top: 11px;
  transform: none;
}

.dup-warn-msg {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  display: none;
}
.dup-warn-msg.show-exact { display: block; color: #e03131; background: #fff5f5; border: 1px solid #ffc9c9; }
.dup-warn-msg.show-fuzzy { display: block; color: #e8590c; background: #fff9f0; border: 1px solid #ffd8a8; }
[data-theme="dark"] .dup-warn-msg.show-exact { background: #3b1c1c; border-color: #fa5252; color: #ff8787; }
[data-theme="dark"] .dup-warn-msg.show-fuzzy { background: #3b2a1a; border-color: #fd7e14; color: #ffa94d; }

.sort-row { margin-bottom: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inbox-search { padding: 4px 8px; border-radius: 6px; font-size: 11px; }

.inbox-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

.inbox-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  /* [수정] transition: all → 필요한 속성만 명시 */
  transition: border-color 0.3s, background-color 0.3s, transform 0.3s;
  position: relative;
  border-left-width: 4px;
}
.inbox-item:hover { border-color: #adb5bd; }

.inbox-row { display: flex; align-items: center; gap: 6px; }
.row-1 { flex: 1; min-width: 200px; justify-content: space-between; }
.row-2 { flex-shrink: 0; gap: 10px; }
.row-3 { flex-shrink: 0; }

.row-1 .search-icons { margin-left: 6px; }

.title-input {
  flex: 1;
  min-width: 0;
  border: none;
  border-bottom: 1px solid transparent;
  outline: none;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
  transition: border-color 0.2s;
  color: var(--text);
}
.title-input:focus { border-bottom-color: #ddd; }

.search-icons { display: flex; align-items: center; gap: 2px; }
.quick-select { padding: 5px 4px; border-radius: 6px; font-size: 11px; font-weight: 700; width: 90px; }

.pri-badge-group {
  display: flex;
  gap: 4px;
  align-items: center;
  background: var(--surface2);
  padding: 3px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.pri-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text3);
  transition: background-color 0.15s, color 0.15s;
}
.pri-badge:hover { background: rgba(0, 0, 0, 0.05); }
.pri-badge.issue.active,
.planner-pri-badge.issue  { background: var(--pri-issue-bg);  color: var(--pri-issue-color); }

.pri-badge.season.active,
.planner-pri-badge.season { background: var(--pri-season-bg); color: var(--pri-season-color); }

.pri-badge.steady.active,
.planner-pri-badge.steady { background: var(--pri-steady-bg); color: var(--pri-steady-color); }

.pri-badge.none.active,
.planner-pri-badge.none   { background: var(--surface3); color: var(--text2); }


/* =============================================================================
   발행 플래너
   ============================================================================= */

.planner-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
}

.panel-col { display: flex; flex-direction: column; gap: 14px; }

.planner-pri-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 700; }

.tbd-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.tbd-list  { min-height: 50px; }
.due-list  { min-height: 50px; }

.tbd-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--color, #ccc);
  border-radius: 6px;
  padding: 10px;
  padding-right: 26px;
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.tbd-item:active { cursor: grabbing; opacity: 0.75; }

.tbd-title {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  word-break: keep-all;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-direction: column;
  color: var(--text);
}

.tbd-meta {
  font-size: 10px;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-back-inbox {
  position: absolute;
  top: 6px;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  font-weight: 900;
  outline: none;
}
.btn-back-inbox:hover { color: #fa5252; }


/* =============================================================================
   캘린더
   ============================================================================= */

.cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 900;
  font-size: 16px;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  table-layout: fixed;
  width: 100%;
}

.cal-header { text-align: center; font-size: 11px; font-weight: 700; color: var(--text3); padding-bottom: 6px; }

.cal-day {
  min-height: 90px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  transition: border-color 0.15s, background-color 0.15s;
  position: relative;
  cursor: pointer;
  background: var(--surface);
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cal-day:hover           { border-color: #adb5bd; }
.cal-day.drag-over       { background: var(--primary-a05); border-style: dashed; border-color: var(--primary); }
.cal-day.other-month     { opacity: 0.35; background: var(--surface2); }
.cal-day.today           { border-color: var(--primary); background: #f0f7ff; }
.cal-day.today .cal-date { color: var(--primary); }
[data-theme="dark"] .cal-day.today { background: #102a43; border-color: var(--primary); }

.cal-date {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
}

.cal-load-dot  { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.cal-load-0    { background: transparent; }
.cal-load-1    { background: #40c057; }
.cal-load-2    { background: #fcc419; }
.cal-load-3    { background: #fd7e14; }
.cal-load-4    { background: #fa5252; box-shadow: 0 0 4px #fa5252; }

.cal-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 30px;
  padding-bottom: 5px;
}

.cal-kw-bar {
  font-size: 10px;
  padding: 3px 5px;
  border-radius: 3px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  transition: opacity 0.2s;
  box-sizing: border-box;
  width: 100%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.cal-kw-bar.cal-past-repost { opacity: 0.35; filter: grayscale(0.4); }
.cal-kw-bar.completed       { text-decoration: line-through; opacity: 0.45; filter: grayscale(0.5); }

.cal-more {
  font-size: 10px;
  color: var(--text3);
  text-align: center;
  font-weight: 700;
  padding: 2px 0;
  border-radius: 3px;
  background: var(--surface2);
  margin-top: 2px;
}
.cal-more:hover { background: var(--surface3); }

.upcoming-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.upcoming-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 11px;
  gap: 6px;
  color: var(--text);
}

.day-modal-item .remove-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background-color 0.15s;
}
.day-modal-item:hover .remove-btn { display: block; }
.day-modal-item .remove-btn:hover { color: #fff; background: #fa5252; }


/* =============================================================================
   DB 테이블
   ============================================================================= */

.db-table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.db-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }

.db-table th,
.db-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
  color: var(--text);
}

.db-table th {
  background: var(--surface2);
  font-weight: 700;
  color: var(--text2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.db-table tr:hover td { background: var(--surface2); }

.db-title-cell {
  font-weight: 700;
  white-space: nowrap;
  min-width: 120px;
  word-break: keep-all;
  padding-left: 6px !important;
  padding-right: 6px !important;
}

.db-title-seed.with-url {
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}
.db-title-seed.with-url:hover { text-decoration: underline; }

.db-title-seed.no-url {
  color: var(--text);
  font-weight: 900;
  text-decoration: underline dashed var(--border);
  text-underline-offset: 4px;
}
.db-title-seed.no-url:hover { color: var(--primary); }

.db-ext-title {
  color: var(--text3);
  font-size: 11px;
  font-weight: 400;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
  white-space: nowrap;
}

[data-theme="dark"] .db-title-cell a { color: #74c0fc; }

.repost-clickable {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text3);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.repost-clickable:hover { color: var(--primary); }

.db-end-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 24px;
  line-height: 1;
}

.db-end-date-text {
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.btn-reset-date {
  color: var(--text3);
  transition: color 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
}
.btn-reset-date:hover { color: #fd7e14; transform: rotate(-45deg); }

.calendar-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text3);
  cursor: pointer;
  transition: color 0.2s;
}

.db-header-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 4px;
  font-family: inherit;
  outline: none;
  transition: background-color 0.2s;
}
.db-header-btn:hover { background: var(--surface3); }

.db-header-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}


/* =============================================================================
   모달
   ============================================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
  padding: 16px;
}
.modal-overlay.active { display: flex; }

.modal-content {
  background: var(--surface);
  color: var(--text);
  padding: 22px;
  border-radius: 12px;
  width: 420px;
  max-width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11px; color: var(--text2); margin-bottom: 6px; font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.priority-select-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.priority-radio { display: none; }
.priority-label {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  flex: 1;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  background: var(--surface);
  color: var(--text2);
}
.priority-radio:checked + .priority-label { border-color: currentColor; background: var(--surface); box-shadow: inset 0 0 0 1px currentColor; }
.priority-label.lbl-issue  { color: #fa5252; }
.priority-label.lbl-season { color: #fd7e14; }
.priority-label.lbl-steady { color: #228be6; }
.priority-label.lbl-none   { color: var(--text3); }


/* =============================================================================
   루틴 패널
   ============================================================================= */

.routine-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 14px;
}
.routine-panel h3 { font-size: 14px; font-weight: 900; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.routine-panel h3 svg { width: 20px; height: 20px; stroke-width: 2.5px; }

.routine-progress-bar { height: 6px; background: var(--surface3); border-radius: 99px; margin-bottom: 16px; overflow: hidden; }
.routine-progress-fill { height: 100%; background: #40c057; border-radius: 99px; transition: width 0.3s ease-out; }

.today-kw-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }

.today-kw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  min-width: 140px;
  flex: 1;
}

.today-kw-card.selected  { border-color: var(--primary); background: var(--primary-a05); }
.today-kw-card .kw-cat   { font-size: 10px; font-weight: 700; margin-bottom: 4px; }
.today-kw-card .kw-title { font-size: 13px; font-weight: 700; color: var(--text); }

.internal-link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.2s, filter 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  max-width: max-content;
}
.internal-link-card:hover    { border-color: var(--primary); filter: brightness(0.97); }
.internal-link-card.selected { border-color: var(--primary); background: var(--primary-a05); }

.ai-launch-btn {
  background: linear-gradient(135deg, var(--primary), #228be6);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 0.15s;
  width: 100%;
  outline: none;
}
.ai-launch-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.ai-launch-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cat-url-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cat-url-table th,
.cat-url-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.cat-url-table th { font-weight: 700; background: var(--surface2); font-size: 11px; color: var(--text2); }
.cat-url-table input { border: none; outline: none; font-family: inherit; font-size: 12px; background: transparent; width: 100%; color: var(--text); }

.action-textarea { width: 100%; padding: 10px; border-radius: 8px; font-size: 12px; margin-bottom: 10px; resize: vertical; }
.action-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color 0.15s;
  user-select: none;
}

.strategy-guide-box {
  margin-top: 10px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--surface2);
  border: 1px solid var(--primary);
  border-radius: 10px;
  display: none;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .strategy-guide-box { background: var(--surface3); border-color: var(--primary); }
.strategy-guide-box.active { display: block; }

.strategy-title { font-size: 13px; font-weight: 900; color: var(--primary); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.strategy-options { display: flex; gap: 8px; }

#strategy-desc { font-size: 12px; line-height: 1.6; color: var(--text); margin-bottom: 12px; }
#strategy-desc b { color: var(--primary); font-weight: 900; }

.btn-strategy {
  flex: 1;
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-strategy:hover { background: var(--primary); color: #fff !important; border-color: var(--primary); transform: translateY(-1px); }
[data-theme="dark"] .btn-strategy { background: var(--surface2); border-color: var(--border); }


/* =============================================================================
   메모장
   ============================================================================= */

.memo-layout { display: flex; flex-direction: column; gap: 16px; max-width: 800px; margin: 0 auto; }

.memo-quick-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  position: relative;
}

.memo-quick-input input[type="text"] {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  padding: 4px 12px;
  margin-bottom: 10px;
  background: transparent;
  color: var(--text);
}

.memo-quick-input textarea {
  width: 100%;
  border: none;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  min-height: 100px;
  background: transparent;
  padding-bottom: 10px;
  line-height: 1.5;
  overflow: hidden;
  color: var(--text);
}

.memo-date-info { text-align: right; font-size: 10px; color: var(--text3); margin-top: 15px; opacity: 0.8; user-select: none; }

.memo-search { position: relative; display: flex; align-items: center; margin-bottom: 16px; width: 100%; }
.memo-search > svg { position: absolute; left: 14px; color: var(--text3); width: 16px; height: 16px; pointer-events: none; transition: color 0.2s; }
.memo-search input {
  flex: 1;
  padding: 10px 16px 10px 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.memo-search input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-a10); }

.memo-search:focus-within > svg { color: var(--primary); }

.memo-cards { display: flex; flex-direction: column; gap: 10px; }

.memo-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 !important;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.memo-card.expanded  { border-left: 4px solid var(--primary); }
.memo-card.completed { border-color: var(--border); background: var(--surface2); }
.memo-card.pinned    { border-color: var(--primary) !important; background: var(--primary-a05) !important; }

.memo-card-header { padding: 14px 16px !important; display: flex; align-items: center; justify-content: space-between; }
.memo-card-body   { display: none !important; padding: 0 16px 16px 16px !important; margin-top: 0 !important; cursor: default; }
.memo-card.expanded .memo-card-body { display: block !important; }

.memo-title-direct {
  display: inline-block;
  min-width: 50px;
  max-width: calc(100% - 100px);
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 14px;
  outline: none;
  color: var(--text);
  font-family: inherit;
  padding: 2px 4px;
  margin-right: auto;
  cursor: text;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memo-card.selected {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 0.5px var(--primary);
}

.memo-card.completed.selected {
  border-color: var(--primary) !important;
}

.memo-card.completed .memo-title-direct { text-decoration: line-through; opacity: 0.5; }

.memo-card-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.memo-action-bar   { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }

.memo-check-btn {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s, border-color 0.2s;
}
.memo-card.completed .memo-check-btn { background: var(--primary) !important; border-color: var(--primary) !important; }

.memo-edit-mode { display: none; }
.memo-card.editing .memo-edit-mode    { display: block; }
.memo-card.editing .memo-render-body  { display: none; }

.memo-toolbar {
  display: flex;
  gap: 4px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 6px 6px 0 0;
}
.memo-toolbar .btn-icon { width: 26px; height: 26px; font-size: 13px; border-radius: 4px; }

.memo-quick-input textarea,
.memo-edit-body {
  padding: 16px 12px 12px 12px !important;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  background: var(--surface);
  max-height: 500px;
  overflow-y: auto !important;
}

.memo-edit-body {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  min-height: 150px;
  line-height: 1.6;
  color: var(--text);
  box-sizing: border-box;
}

.memo-render-body { font-size: 13px; line-height: 1.6; color: var(--text); padding: 4px; }
.memo-render-body ul,
.memo-render-body ol  { padding-left: 28px !important; margin: 10px 0; }
.memo-render-body li  { margin-bottom: 4px; }

.memo-render-body li:has(input[type="checkbox"]) { list-style-type: none !important; margin-left: -28px !important; }
.memo-render-body input[type="checkbox"]          { margin-right: 6px; transform: translateY(2px); cursor: pointer; }

.memo-render-body li:has(input[data-state="cancel"]) { color: var(--text3) !important; text-decoration: line-through; opacity: 0.6; }
.memo-render-body input[type="checkbox"][data-state="cancel"] { filter: grayscale(1); opacity: 0.5; cursor: default; }

.memo-render-body pre  { background: var(--surface2); padding: 12px; border-radius: 6px; overflow-x: auto; font-family: monospace; border: 1px solid var(--border); margin: 10px 0; }
.memo-render-body code { background: var(--surface2); padding: 2px 4px; border-radius: 4px; font-family: monospace; font-size: 12px; color: #e8590c; }
.memo-render-body pre code { padding: 0; background: transparent; color: inherit; }

.memo-render-body strong { font-weight: 900; color: var(--text); }

.memo-render-body h2 {
  font-size: 16px !important;
  margin-top: 15px;
  margin-bottom: 10px;
}

.memo-render-body h3 {
  font-size: 14px !important;
  margin-top: 12px;
  margin-bottom: 8px;
}

.memo-render-body li:has(h2, h3) {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.memo-render-body li h2,
.memo-render-body li h3 {
  display: inline !important;
  margin: 0 !important;
  line-height: 1.2;
}

.memo-render-body input[type="checkbox"] {
  margin: 0 !important;
  flex-shrink: 0;
}


/* =============================================================================
   통계
   ============================================================================= */

.stat-blog-btn {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.stat-blog-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.stat-board-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; }

.stat-board-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-board-card:hover  { border-color: var(--primary); }
.stat-board-card.active { border-color: var(--primary); background: var(--primary-a05); }

.stat-board-date  { font-size: 13px; font-weight: 900; color: var(--text); }
.stat-board-views { font-size: 11px; color: var(--text3); display: flex; justify-content: space-between; }

.split-list-item .btn-icon.stat-del-btn:hover { color: #fa5252 !important; background: rgba(250, 82, 82, 0.1); transform: scale(1.1); }

.stat-dropped-item { background: #fff5f5; border: 1px solid #ffc9c9; }
[data-theme="dark"] .stat-dropped-item { background: #3b1c1c; border-color: #fa5252; color: #e9ecef; }

.split-list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.split-list-item:hover  { border-color: var(--primary); transform: translateY(-1px); }
.split-list-item.active { border-color: var(--primary); background: var(--primary-a05); }

.split-list-date { font-size: 14px; font-weight: 900; color: var(--text); }
.split-list-meta { font-size: 11px; color: var(--text3); display: flex; justify-content: space-between; font-weight: 700; }

.rev-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.rev-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }

.rev-stat-box { background: var(--surface2); border-radius: 8px; padding: 12px; text-align: center; border: 1px solid var(--border); }
.rev-stat-val { font-size: 20px; font-weight: 900; color: var(--text); margin-bottom: 4px; }
.rev-stat-lbl { font-size: 11px; color: var(--text3); font-weight: 700; }

#stat-top-dashboard > div,
#integrated-split-view > div { min-width: 0; overflow: hidden; }


/* =============================================================================
   블로그 설정
   ============================================================================= */

.blog-config-item {
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
}
.blog-config-item:active  { cursor: grabbing; }
.blog-config-item.dragging {
  opacity: 0.5;
  border: 2px dashed var(--primary) !important;
  transform: scale(0.98);
}


/* =============================================================================
   반응형 (PC / 태블릿 / 모바일)
   ============================================================================= */

@media (min-width: 1280px) {
  .scroll-to-top   { right: calc(50% - 620px); }
  #toast-container { right: calc(50% - 620px); }
}

@media (max-width: 900px) {
  #stat-top-dashboard    { grid-template-columns: 1fr !important; }
  #integrated-split-view { grid-template-columns: 1fr !important; }
}

@media (max-width: 768px) {
  .memo-edit-mode .memo-toolbar,
  .memo-quick-input .memo-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--surface2);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 0;
    overflow-x: auto;
    white-space: nowrap;
    padding: 8px 10px;
  }

  .memo-edit-mode .memo-edit-body,
  .memo-quick-input textarea {
    padding-bottom: 50px !important;
  }

  .db-title-cell {
    min-width: 120px !important;
    white-space: nowrap !important;
    line-height: 1.4 !important;
  }

  .hide-on-mobile { display: none !important; }
  .dynamic-title  { display: none !important; }
  .logo           { font-size: 14px; }

  .backup-bar { padding: 4px 10px; flex-wrap: wrap; justify-content: space-between; }
  .backup-bar .btn-text { display: none; }
  .backup-bar input#gemini-api-key { width: 80px; }

  .header-bottom .tabs .tab-icon { display: block; }
  .header-bottom .tabs .tab-text { display: none; }
  .header-bottom .tabs .tab-btn  { padding: 10px 14px; }

  .planner-layout   { display: flex; flex-direction: column; gap: 14px; }
  #col-left         { display: flex; flex-direction: column; gap: 14px; width: 100%; }
  #col-left > .card { flex: 1; min-width: 0; margin-bottom: 0; }
  #col-right        { display: flex; flex-direction: column; gap: 14px; width: 100%; }
  #cal-container    { order: 3; width: 100%; }
  #upcoming-container { order: 4; width: 100%; }
  #tbd-list, #due-list { max-height: 250px; }

  .cal-day    { min-height: 60px !important; }
  .cal-date   { font-size: 10px; }
  .cal-kw-bar { font-size: 9px; padding: 1px 2px; }

  .day-modal-item .remove-btn {
    display: block !important;
    background: rgba(250, 82, 82, 0.1);
    color: #fa5252;
    padding: 6px;
  }

  #blog-settings-modal .modal-content { width: 95%; max-height: 90vh; padding: 16px; }

  #tab-inbox .section-title { flex-direction: column; align-items: flex-start; gap: 8px; }
  #tab-inbox .section-title > div:last-child { width: 100%; margin-left: 0 !important; }
  #tab-inbox .inbox-search { width: 100%; }

  .bulk-input {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 11px;
    padding: 10px 8px;
  }

  .bulk-input-row .btn .btn-text       { display: none !important; }
  .bulk-input-row .btn .mobile-only-icon { display: block !important; }
  .bulk-input-row .btn { height: 38px !important; width: 44px !important; }
  textarea#quick-kw    { min-height: 38px !important; }

  .inbox-item .row-1 { width: 100%; }
  .inbox-item .row-2 {
    width: 100%;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
  }
  .inbox-item .row-2 .pri-badge-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    flex: none !important;
    width: auto !important;
  }
  .inbox-item .row-2 .pri-badge {
    padding: 0 6px !important;
    font-size: 10px !important;
    height: 26px !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }
  .inbox-item .row-2 .quick-select {
    height: 26px !important;
    box-sizing: border-box !important;
    padding: 0 4px !important;
    width: auto !important;
    flex: 1 !important;
    max-width: 110px;
    font-size: 11px;
  }
  .inbox-item .row-3 { width: 100%; display: flex; justify-content: space-between !important; align-items: center; }

  .db-table-wrapper { margin: 0 !important; border-radius: 8px !important; border: 1px solid var(--border) !important; overflow-x: auto !important; }

  .scroll-to-top { right: 15px; bottom: 15px; z-index: 9999; opacity: 0.6; }

  #stat-saved-dates { max-height: 220px !important; overflow-y: auto !important; }
  #integrated-chart-container { padding: 10px; }
  .stat-blog-btn { padding: 4px 8px; font-size: 11px; }
}

/* 모바일 최적화 (가로 600px 이하) */
@media (max-width: 600px) {
  #gemini-api-key { 
    width: 65px !important; 
    font-size: 9px !important;
  }

  .logout-text, #user-name { 
    display: none !important; 
  }
  
  #user-auth-info { 
    padding-right: 8px !important; 
    gap: 4px !important; 
  }

  .backup-bar { 
    font-size: 9px; 
  }
}


/* =============================================================================
   드래그 앤 드롭
   ============================================================================= */

.sortable-ghost {
  opacity: 0.3 !important;
  background-color: var(--primary-a10) !important;
  border: 2px dashed var(--primary) !important;
}
.sortable-drag {
  cursor: grabbing !important;
}
.sortable-fallback {
  opacity: 1 !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
  transform: scale(1.02);
  pointer-events: none !important;
  z-index: 9999 !important;
}


/* =============================================================================
   백업 바 경고
   ============================================================================= */

.backup-bar.critical-full {
  background-color: #fa5252 !important;
  color: #ffffff !important;
  border-bottom: 2px solid #e03131 !important;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.backup-bar.critical-full * {
  color: #ffffff !important;
}

.backup-bar.warning-full {
  background-color: #fd7e14 !important;
  color: #ffffff !important;
  border-bottom: 2px solid #e8590c !important;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.backup-bar.warning-full * {
  color: #ffffff !important;
}


/* =============================================================================
   시즌 키워드
   ============================================================================= */

@keyframes vault-wakeup-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.vault-wakeup-badge {
  animation: vault-wakeup-pulse 1.5s ease-in-out infinite;
  background: #ffe3e3;
  color: #e03131;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.inbox-stale-badge {
  background: #fff3bf;
  color: #e67700;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}