/* ============================================================
   CSS CUSTOM PROPERTIES — LIGHT THEME (default)
   ============================================================ */
:root {
  /* Brand */
  --primary: #1a73e8;
  --primary-light: #e8f0fe;
  --primary-hover: #1557b0;
  --primary-container: #d2e3fc;

  /* Semantic */
  --success: #1e8e3e;
  --success-light: #e6f4ea;
  --warning: #f9ab00;
  --warning-light: #fef7e0;
  --danger: #d93025;
  --danger-light: #fce8e6;
  --info: #1565c0;
  --info-light: #e3f2fd;

  /* Accent */
  --purple: #9334e6;
  --purple-light: #f3e8fd;
  --teal: #00897b;
  --teal-light: #e0f2f1;
  --orange: #e37400;

  /* Neutrals */
  --grey-50: #f8f9fa;
  --grey-100: #f1f3f4;
  --grey-200: #e8eaed;
  --grey-300: #dadce0;
  --grey-400: #bdc1c6;
  --grey-500: #9aa0a6;
  --grey-600: #80868b;
  --grey-700: #5f6368;
  --grey-800: #3c4043;
  --grey-900: #202124;

  /* Surfaces */
  --surface: #ffffff;
  --surface-variant: #f8f9fa;
  --background: #f8f9fa;
  --on-surface: #202124;
  --on-surface-variant: #5f6368;
  --outline: #dadce0;
  --outline-variant: #e8eaed;

  /* Elevation */
  --shadow-1: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  --shadow-2: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
  --shadow-3: 0 4px 8px 3px rgba(60,64,67,0.15), 0 1px 3px rgba(60,64,67,0.3);
  --shadow-4: 0 6px 10px 4px rgba(60,64,67,0.15), 0 2px 3px rgba(60,64,67,0.3);

  /* Shape */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Motion */
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --drawer-width: 480px;
  --header-height: 64px;
  --header-offset: var(--header-height);
  --runtime-banner-height: 0px;
  --section-subnav-height: 48px;
  --board-filter-height: 0px;

  /* Z-index hierarchy */
  --z-header: 50;
  --z-section-subnav: 45;
  --z-filter-bar: 44;
  --z-board-headers: 40;
  --z-drawer-overlay: 70;
  --z-drawer: 80;
  --z-modal: 90;
  --z-search: 100;
  --z-popover: 110;
  --z-toast: 200;
  --z-login: 999;
}

/* ============================================================
   DARK THEME
   ============================================================ */
[data-theme="dark"] {
  --primary: #8ab4f8;
  --primary-light: #1a3355;
  --primary-hover: #aecbfa;
  --primary-container: #1a3355;

  --success: #81c995;
  --success-light: #1b3626;
  --warning: #fdd663;
  --warning-light: #3e3014;
  --danger: #f28b82;
  --danger-light: #3c1f1e;
  --info: #8ab4f8;
  --info-light: #1a3355;

  --purple: #c58af9;
  --purple-light: #2d1b4e;
  --teal: #4db6ac;
  --teal-light: #1a3330;
  --orange: #fcad70;

  --grey-50: #292a2d;
  --grey-100: #303134;
  --grey-200: #3c4043;
  --grey-300: #5f6368;
  --grey-400: #80868b;
  --grey-500: #9aa0a6;
  --grey-600: #bdc1c6;
  --grey-700: #dadce0;
  --grey-800: #e8eaed;
  --grey-900: #f1f3f4;

  --surface: #1e1f21;
  --surface-variant: #292a2d;
  --background: #131314;
  --on-surface: #e8eaed;
  --on-surface-variant: #bdc1c6;
  --outline: #5f6368;
  --outline-variant: #3c4043;

  --shadow-1: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.6);
  --shadow-2: 0 2px 6px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.4);
  --shadow-3: 0 4px 12px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.5);
  --shadow-4: 0 8px 16px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.5);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Google Sans', 'Roboto', -apple-system, 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--on-surface);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

html.kanban-page,
body.kanban-page {
  height: 100%;
  overflow: hidden;
}

input, select, textarea, button { font-family: inherit; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--grey-400); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--grey-500); }

/* ============================================================
   HEADER
   ============================================================ */
header {
  background: var(--surface);
  padding: 0 32px;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--outline-variant);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.header-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.header-left .logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px;
}
[data-theme="dark"] .header-left .logo-icon { color: #131314; }

header h1 {
  font-size: 20px; font-weight: 500;
  color: var(--on-surface); letter-spacing: -0.3px;
}

.header-right {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  flex: 1 1 auto; min-width: 0;
}

.runtime-banner {
  display: none;
  padding: 12px 32px 0;
}

.runtime-banner.show {
  display: block;
}

.runtime-banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--outline);
  box-shadow: var(--shadow-1);
  background: var(--surface);
}

.runtime-banner-card[data-tone="info"] {
  background: linear-gradient(135deg, var(--info-light), var(--surface));
}

.runtime-banner-card[data-tone="warn"] {
  background: linear-gradient(135deg, var(--warning-light), var(--surface));
}

.runtime-banner-card[data-tone="success"] {
  background: linear-gradient(135deg, var(--success-light), var(--surface));
}

.runtime-banner-card[data-tone="error"] {
  background: linear-gradient(135deg, var(--danger-light), var(--surface));
}

.runtime-banner-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.runtime-banner-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 115, 232, 0.12);
  color: var(--primary);
  flex-shrink: 0;
}

.runtime-banner-card[data-tone="warn"] .runtime-banner-icon {
  background: rgba(249, 171, 0, 0.16);
  color: var(--warning);
}

.runtime-banner-card[data-tone="success"] .runtime-banner-icon {
  background: rgba(30, 142, 62, 0.16);
  color: var(--success);
}

.runtime-banner-card[data-tone="error"] .runtime-banner-icon {
  background: rgba(217, 48, 37, 0.16);
  color: var(--danger);
}

.runtime-banner-icon .material-icons-outlined {
  font-size: 18px;
}

.runtime-banner-copy {
  min-width: 0;
}

.runtime-banner-title {
  font-size: 13px;
  font-weight: 700;
}

.runtime-banner-detail {
  margin-top: 2px;
  font-size: 12px;
  color: var(--on-surface-variant);
}

.runtime-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.runtime-banner-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--grey-600);
}

/* ============================================================
   QUICK CAPTURE
   ============================================================ */
.quick-capture-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 1);
  background: rgba(32, 33, 36, 0.28);
  justify-content: flex-end;
}
.quick-capture-overlay.open { display: flex; }
.quick-capture-panel {
  width: min(440px, 100vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-4);
  display: flex;
  flex-direction: column;
  animation: slideInRight 180ms ease-out;
}
.quick-capture-head {
  min-height: 64px;
  padding: 0 16px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--outline-variant);
}
.quick-capture-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.quick-capture-title-wrap .material-icons-outlined {
  color: var(--primary);
  font-size: 22px;
}
.quick-capture-title-wrap h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--on-surface);
}
.quick-capture-body {
  flex: 1;
  min-height: 0;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quick-capture-input {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--on-surface);
  padding: 13px 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
}
.quick-capture-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.quick-capture-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.quick-capture-options label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.quick-capture-options span {
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-variant);
}
.quick-capture-options select,
.quick-capture-options input {
  height: 38px;
  border: 1px solid var(--outline);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--on-surface);
  padding: 0 11px;
  font: inherit;
  font-size: 13px;
}
.quick-capture-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-capture-empty {
  min-height: 92px;
  border: 1px dashed var(--outline-variant);
  border-radius: var(--radius);
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.quick-capture-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--on-surface-variant);
  font-weight: 600;
}
.quick-capture-preview-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quick-capture-preview-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface-variant);
}
.quick-capture-status {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.quick-capture-status.pending {
  background: var(--grey-200);
  color: var(--grey-700);
}
.quick-capture-status.completed {
  background: var(--success-light);
  color: var(--success);
}
.quick-capture-status.record {
  background: var(--primary-light);
  color: var(--primary);
}
.quick-capture-text {
  min-width: 0;
  font-size: 13px;
  color: var(--on-surface);
  overflow-wrap: anywhere;
}
.quick-capture-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-capture-history-card {
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.quick-capture-history-head {
  min-height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--outline-variant);
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 600;
}
.quick-capture-history-date {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--on-surface-variant);
  background: var(--surface-variant);
  border-bottom: 1px solid var(--outline-variant);
  position: sticky;
  top: 0;
}
.quick-capture-history-list {
  display: flex;
  flex-direction: column;
}
.quick-capture-history-item {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px 8px 12px;
  border-bottom: 1px solid var(--outline-variant);
}
.quick-capture-history-item:last-child { border-bottom: none; }
.quick-capture-history-text {
  min-width: 0;
  color: var(--on-surface);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.quick-capture-delete {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}
.quick-capture-delete .material-icons-outlined { font-size: 17px; }
.quick-capture-actions {
  padding: 14px 20px;
  border-top: 1px solid var(--outline-variant);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.quick-capture-actions .btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.quick-capture-task-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.quick-capture-actions .material-icons-outlined { font-size: 18px; }

.header-search-wrap {
  position: relative;
  min-width: 240px;
  width: 240px;
  max-width: 240px;
  flex: 0 0 240px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 12px;
  background: var(--surface-variant);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-pill);
  transition: box-shadow .15s, border-color .15s;
}
.header-search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
  border-radius: 18px 18px 4px 4px;
}

.header-search-icon {
  font-size: 18px;
  color: var(--grey-500);
  flex-shrink: 0;
}

.header-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--on-surface);
  font-size: 13px;
}

.header-search-input::placeholder { color: var(--grey-500); }

.header-search-shortcut {
  height: 22px;
  padding: 0 7px;
  border: none;
  border-radius: 999px;
  background: var(--grey-100);
  color: var(--grey-500);
  font-size: 10px;
  font-family: 'Roboto Mono', monospace;
  pointer-events: none;
  flex-shrink: 0;
}

/* Search dropdown */
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: -1px;
  right: -1px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: calc(var(--z-header) + 10);
  padding: 6px 0;
}
.search-dropdown.open { display: block; }

.search-dropdown .sd-section { padding: 4px 0; }
.search-dropdown .sd-section-title {
  padding: 6px 14px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.search-dropdown .sd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background .1s;
}
.search-dropdown .sd-item:hover,
.search-dropdown .sd-item.selected {
  background: var(--primary-light);
}
.search-dropdown .sd-item .sd-icon {
  font-size: 18px;
  color: var(--grey-500);
  flex-shrink: 0;
}
.search-dropdown .sd-item .sd-main { flex: 1; min-width: 0; }
.search-dropdown .sd-item .sd-title {
  font-size: 13px;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown .sd-item .sd-sub {
  font-size: 11px;
  color: var(--grey-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown .sd-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.search-dropdown .sd-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--grey-400);
  font-size: 13px;
}
.search-dropdown .sd-hint {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 6px 14px;
  border-top: 1px solid var(--outline-variant);
  font-size: 11px;
  color: var(--grey-400);
}

/* Summary chips */
.summary-chips { display: flex; gap: 6px; margin-right: 8px; flex: 0 0 auto; }

.chip {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
  background: var(--grey-100); color: var(--on-surface-variant);
  user-select: none;
}

.chip .chip-dot { width: 7px; height: 7px; border-radius: 50%; }
.chip-pending .chip-dot { background: var(--grey-500); }
.chip-progress .chip-dot { background: var(--primary); }
.chip-done .chip-dot { background: var(--success); }

/* FAB button */
.btn-fab {
  display: flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff; border: none;
  padding: 8px 20px; border-radius: var(--radius-pill); cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-1);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
[data-theme="dark"] .btn-fab { color: #131314; }
.btn-fab:hover { background: var(--primary-hover); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.btn-fab:active { transform: translateY(0); }
.btn-fab .material-icons-outlined { font-size: 20px; }
.btn-quick {
  background: var(--teal);
  color: #fff;
}
.btn-quick:hover { background: #00695c; box-shadow: var(--shadow-2); transform: translateY(-1px); }
[data-theme="dark"] .btn-quick { color: #131314; }

/* ============================================================
   NAV TABS
   ============================================================ */
.nav-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; min-width: 0; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: var(--radius-pill); cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--on-surface-variant);
  border: none; background: none; font-family: inherit;
  flex: 0 0 auto; white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.nav-tab:hover { background: var(--grey-100); }
.nav-tab.active { background: var(--primary-light); color: var(--primary); }
.nav-tab .material-icons-outlined { font-size: 18px; }
.nav-tab.hub-has-service-failure,
.nav-tab.hub-has-service-failure.active {
  background: var(--danger-light);
  color: var(--danger);
  font-weight: 700;
}
.hub-tab-failure-count {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.hub-tab-failure-count[hidden] { display: none; }

.section-subnav {
  min-height: 48px;
  padding: 8px 32px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--outline-variant);
  background: var(--surface);
  position: sticky;
  top: calc(var(--header-offset) + var(--runtime-banner-height));
  z-index: var(--z-section-subnav);
  overflow: visible;
  scrollbar-width: none;
  row-gap: 6px;
  box-shadow: 0 1px 0 rgba(60,64,67,0.04);
}
.section-subnav::-webkit-scrollbar { display: none; }
.section-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--on-surface-variant);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.section-subnav-btn:hover {
  background: var(--grey-100);
  color: var(--on-surface);
}
.section-subnav-btn.active {
  background: var(--primary-light);
  border-color: rgba(26, 115, 232, 0.18);
  color: var(--primary);
}
.section-subnav-btn .material-icons-outlined { font-size: 17px; }
.section-subnav-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(26, 115, 232, 0.24);
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  box-shadow: var(--shadow-1);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
[data-theme="dark"] .section-subnav-action { color: #131314; }
.section-subnav-action:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.section-subnav-action:active { transform: translateY(0); }
.section-subnav-action .material-icons-outlined { font-size: 18px; }

/* ============================================================
   USER MENU
   ============================================================ */
.user-menu-wrapper { position: relative; flex: 0 0 auto; }
.user-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: var(--radius-pill);
  background: var(--grey-100); cursor: pointer; border: none;
  font-family: inherit;
  max-width: min(180px, calc(100vw - 24px));
  min-width: 0;
  transition: box-shadow var(--transition);
}
.user-trigger:hover { box-shadow: 0 0 0 2px var(--primary-light); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
  background: var(--primary);
}
[data-theme="dark"] .user-avatar { color: #131314; }
.user-name {
  min-width: 0; max-width: 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 500; color: var(--on-surface-variant);
}

.user-dropdown {
  display: none; position: fixed; top: calc(var(--header-height) + 8px); right: 16px;
  width: min(280px, calc(100vw - 32px)); background: var(--surface);
  max-height: calc(100vh - var(--header-height) - 24px);
  overflow-y: auto;
  border: 1px solid var(--outline-variant); border-radius: var(--radius);
  box-shadow: var(--shadow-3); z-index: var(--z-popover);
  padding: 4px 0; animation: fadeIn 120ms ease-out;
}
.user-dropdown.open { display: block; }

.user-dropdown-header {
  padding: 14px 16px; border-bottom: 1px solid var(--outline-variant);
}
.user-dropdown-header .ud-name {
  font-size: 15px; font-weight: 600; color: var(--on-surface);
  overflow-wrap: anywhere;
}
.user-dropdown-header .ud-role {
  font-size: 12px; color: var(--on-surface-variant); margin-top: 2px;
  overflow-wrap: anywhere;
}

.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 14px; color: var(--on-surface-variant);
  cursor: pointer; transition: background 0.1s; border: none;
  background: none; width: 100%; font-family: inherit; text-align: left;
}
.user-dropdown-item:hover { background: var(--grey-50); }
.user-dropdown-item .material-icons-outlined { font-size: 20px; color: var(--grey-500); }

.user-dropdown-sep { height: 1px; background: var(--outline-variant); margin: 4px 0; }

.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item.danger:hover { background: var(--danger-light); }
.user-dropdown-item.danger .material-icons-outlined { color: var(--danger); }

/* ============================================================
   NOTIFICATION BELL
   ============================================================ */
.notif-wrapper { position: relative; flex: 0 0 auto; }
.notif-bell {
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--on-surface-variant); background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.notif-bell:hover { background: var(--grey-100); color: var(--on-surface); }
.notif-bell .material-icons-outlined { font-size: 22px; }
.notif-wrapper.has-unread .notif-bell {
  background: var(--primary-light);
  color: var(--primary);
}
.notif-wrapper.has-urgent .notif-bell {
  background: var(--danger-light);
  color: var(--danger);
  box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.12);
  animation: notif-attention 1.6s ease-in-out infinite;
}
@keyframes notif-attention {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 600;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; pointer-events: none;
}

.notif-panel {
  display: none; position: fixed; top: calc(var(--header-height) + 8px); right: 16px;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - var(--header-height) - 24px);
  background: var(--surface);
  border: 1px solid var(--outline-variant); border-radius: var(--radius);
  box-shadow: var(--shadow-3); z-index: var(--z-popover); overflow: hidden;
}
.notif-panel.open { display: flex; flex-direction: column; }
.notif-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--outline-variant);
  flex: 0 0 auto;
  font-size: 14px; font-weight: 500; color: var(--on-surface);
}
.notif-list {
  flex: 1 1 auto; min-height: 0;
  max-height: min(504px, calc(100vh - var(--header-height) - 74px));
  overflow-y: auto;
}
.notif-item {
  min-height: 84px; padding: 12px 16px;
  border-bottom: 1px solid var(--outline-variant);
  overflow: hidden;
}
.notif-item.unread { background: var(--primary-light); }
.notif-item.urgent {
  min-height: 106px;
  border-left: 4px solid var(--danger);
  background: linear-gradient(0deg, rgba(217, 48, 37, 0.05), rgba(217, 48, 37, 0.05)), var(--surface);
}
.notif-item.urgent.unread {
  background: linear-gradient(0deg, rgba(217, 48, 37, 0.08), rgba(217, 48, 37, 0.08)), var(--surface);
}
.notif-item-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--on-surface); margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif-urgent-chip {
  flex-shrink: 0;
  padding: 1px 7px; border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
}
.notif-item-msg {
  font-size: 12px; color: var(--on-surface-variant); margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}
.notif-item-time {
  font-size: 11px; color: var(--grey-500);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif-empty { padding: 32px 16px; text-align: center; color: var(--grey-500); font-size: 13px; }

/* ============================================================
   BOARD LAYOUT
   ============================================================ */
.board-wrapper {
  display: flex; flex-direction: column;
  transition: margin-right var(--transition);
  height: calc(100vh - var(--header-offset) - var(--runtime-banner-height) - var(--section-subnav-height));
  min-height: 0;
  overflow: hidden;
}
.board-wrapper.drawer-open { margin-right: var(--drawer-width); }

/* Filter bar */
.filter-bar {
  display: flex; gap: 8px; padding: 10px 32px;
  align-items: center; flex-wrap: wrap;
  position: sticky;
  top: calc(var(--header-offset) + var(--runtime-banner-height) + var(--section-subnav-height));
  z-index: var(--z-filter-bar);
  background: var(--background);
  border-bottom: 1px solid var(--outline-variant);
  box-shadow: 0 1px 0 rgba(60,64,67,0.04);
}
.filter-bar select {
  padding: 6px 12px; border: 1px solid var(--outline);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 13px;
  background: var(--surface); color: var(--on-surface); cursor: pointer;
  transition: border-color var(--transition);
}
.filter-bar select:focus { outline: none; border-color: var(--primary); }
.filter-bar label { font-size: 13px; color: var(--on-surface-variant); font-weight: 500; }
.filter-bar .filter-reset {
  font-size: 12px; color: var(--primary); cursor: pointer;
  background: none; border: none; font-family: inherit; font-weight: 500;
  padding: 4px 8px; border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.filter-bar .filter-reset:hover { background: var(--primary-light); }

/* Board headers (sticky) */
.board-headers {
  display: flex; gap: 16px; padding: 0 32px;
  position: sticky;
  top: calc(var(--header-offset) + var(--runtime-banner-height) + var(--section-subnav-height) + var(--board-filter-height));
  z-index: var(--z-board-headers);
  background: var(--background);
  flex: 0 0 auto;
}

#board-wrapper #filter-bar {
  top: 0;
}

#board-wrapper #board-headers {
  top: var(--board-filter-height);
}

.column-header {
  flex: 1; min-width: 280px; max-width: 420px;
  padding: 12px 16px; font-size: 14px; font-weight: 500;
  color: var(--on-surface-variant); display: flex; align-items: center;
  gap: 10px; letter-spacing: 0.1px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.column-header .col-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.col-pending .col-icon { background: var(--grey-200); color: var(--grey-600); }
.col-progress .col-icon { background: var(--primary-light); color: var(--primary); }
.col-done .col-icon { background: var(--success-light); color: var(--success); }

.column-header .count {
  margin-left: auto; background: var(--grey-200); color: var(--on-surface-variant);
  padding: 2px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500;
}

/* Board columns */
.board {
  display: flex; gap: 16px; padding: 8px 32px 24px;
  align-items: stretch;
}

.board-wrapper .board {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.initial-board-state {
  width: 100%; min-height: 260px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--grey-500); text-align: center;
}
.initial-board-state .material-icons-outlined {
  font-size: 36px; margin-bottom: 10px; color: var(--primary);
  animation: spin 0.8s linear infinite;
}
.initial-board-state p { font-size: 13px; }

.column {
  flex: 1; min-width: 280px; max-width: 420px;
  display: flex; flex-direction: column;
  min-height: 0;
}

.card-list {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 80px; padding: 4px; border-radius: var(--radius);
  transition: background var(--transition);
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.board-wrapper .card-list {
  min-height: 0;
  max-height: none;
}

/* Subview kanban pages keep the document fixed; only card lists scroll. */
.my-view,
.dept-view.kanban-detail-active,
.members-view.kanban-detail-active {
  height: calc(100vh - var(--header-offset) - var(--runtime-banner-height) - var(--section-subnav-height));
  min-height: 0;
  overflow: hidden;
}

.my-view { display: flex; flex-direction: column; }
.my-task-toolbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 20px 12px; padding: 10px 12px;
  border: 1px solid var(--outline-variant); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-1);
}
.my-task-scope-filters { display: flex; align-items: center; gap: 6px; }
.my-task-filter {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 0 12px; border: 1px solid var(--outline-variant);
  border-radius: var(--radius-pill); background: var(--surface); color: var(--on-surface-variant);
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.my-task-filter span {
  min-width: 20px; padding: 1px 6px; border-radius: var(--radius-pill);
  background: var(--surface-variant); color: inherit; text-align: center;
}
.my-task-filter.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.my-task-filter.active span { background: var(--primary); color: #fff; }
.my-task-department-filter {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 10px; border: 1px solid var(--outline-variant);
  border-radius: var(--radius-pill); color: var(--on-surface-variant); background: var(--surface);
}
.my-task-department-filter[hidden] { display: none !important; }
.my-task-department-filter .material-icons-outlined { font-size: 17px; color: var(--primary); }
.my-task-department-filter select {
  max-width: 180px; border: 0; outline: 0; background: transparent;
  color: var(--on-surface); color-scheme: light;
  font: inherit; font-size: 12px; font-weight: 600;
}
.my-task-department-filter select option {
  background: #fff;
  color: #202124;
}
.my-task-toolbar-help { margin: 0 0 0 auto; color: var(--on-surface-variant); font-size: 12px; }

.dept-view.kanban-detail-active > div,
.members-view.kanban-detail-active > div {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dept-view.kanban-detail-active #dept-detail-view,
.members-view.kanban-detail-active #members-detail-view {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}

.my-view .board,
.dept-view.kanban-detail-active .board,
.members-view.kanban-detail-active .board {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0 !important;
  align-items: stretch !important;
  overflow: hidden;
}

.my-view .column,
.dept-view.kanban-detail-active .column,
.members-view.kanban-detail-active .column {
  min-height: 0;
}

.my-view .column > .column-header,
.dept-view.kanban-detail-active .column > .column-header,
.members-view.kanban-detail-active .column > .column-header {
  flex: 0 0 auto;
}

.my-view .card-list,
.dept-view.kanban-detail-active .card-list,
.members-view.kanban-detail-active .card-list {
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
}
.card-list.drag-over { background: var(--primary-light); }
.card-list.sortable-ghost-parent { background: var(--primary-light); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--outline-variant);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  position: relative;
}
.card:hover {
  box-shadow: var(--shadow-2); border-color: var(--outline);
  transform: translateY(-2px);
}
body.drag-sorting .card:hover {
  transform: none;
}
body.drag-sorting .card {
  transition: none !important;
}
.card[data-dnd-dragging="true"] {
  opacity: 1 !important;
  will-change: translate;
}
.card[data-dnd-placeholder] {
  opacity: 0.24;
}
.card.dnd-source-active {
  opacity: 0.28;
  transform: none !important;
}
.task-drag-preview {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  z-index: calc(var(--z-drawer) + 2);
  width: var(--task-drag-width) !important;
  height: var(--task-drag-height) !important;
  transform: translate3d(var(--task-drag-x, -10000px), var(--task-drag-y, -10000px), 0) !important;
  transition: none !important;
  pointer-events: none !important;
  opacity: 0.96 !important;
  box-shadow: var(--shadow-3) !important;
  will-change: transform;
  contain: layout paint style;
}
.card.dnd-saving {
  pointer-events: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,115,232,0.12);
}
.card.dnd-saving::after {
  content: '저장 중';
  position: absolute;
  top: 8px;
  right: 44px;
  z-index: 4;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(26,115,232,0.24);
}
.card.dnd-drop-target {
  border-color: var(--primary);
}

.card.drop-above,
.card.drop-below {
  position: relative;
}
.card.drop-above::before,
.card.drop-below::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.18), 0 0 6px rgba(26,115,232,0.45);
  pointer-events: none;
  z-index: 3;
}
.card.drop-above::before {
  top: -7px;
}
.card.drop-below::after {
  bottom: -7px;
}

.empty-drop-slot {
  min-height: 84px;
  border: 1px dashed var(--outline);
  border-radius: var(--radius);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  color: var(--on-surface-variant);
  font-size: 13px;
  background: var(--surface-variant);
}

.card-list.is-empty > .empty-drop-slot {
  display: flex;
}

body.drag-sorting .empty-drop-slot {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.empty-drop-slot.dnd-drop-target {
  border-color: var(--primary);
  background: rgba(26,115,232,0.14);
  box-shadow: inset 0 0 0 2px rgba(26,115,232,0.22);
}
.card.sortable-chosen { opacity: 0.85; box-shadow: var(--shadow-3); transform: rotate(2deg); }
.card.sortable-ghost { opacity: 0.3; }

.card-priority-bar {
  position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 4px; border-radius: 0 4px 4px 0;
}
.card-priority-bar.high { background: var(--danger); }
.card-priority-bar.medium { background: var(--warning); }
.card-priority-bar.low { background: var(--success); }

.card-body { padding-left: 10px; }

.card-title {
  font-size: 14px; font-weight: 500; color: var(--on-surface);
  line-height: 1.5; margin-bottom: 6px; word-break: break-word;
  padding-right: 28px;
}

.card-desc {
  font-size: 13px; color: var(--on-surface-variant); line-height: 1.4; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card-activity {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; padding: 6px 8px;
  border-radius: 10px;
  background: var(--grey-100); color: var(--on-surface-variant);
  font-size: 12px;
}
.card-activity .material-icons-outlined { font-size: 15px; }
.card-activity-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; flex-shrink: 0;
}
.card-activity-text {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-activity.progress { background: #eef3fd; color: #1565c0; }
.card-activity.queue { background: #fff3e0; color: #e65100; }
.card-activity.live {
  background: #e3f2fd; color: #1565c0;
  box-shadow: inset 0 0 0 1px rgba(21, 101, 192, 0.18);
}
.card-activity.live .card-activity-label::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  animation: pulse 1.5s infinite;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }

.tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 500; line-height: 1.5;
}
.tag-category { background: var(--primary-light); color: var(--primary); }
.tag-due { background: var(--warning-light); color: var(--orange); }
.tag-due.overdue { background: var(--danger-light); color: var(--danger); }
.tag-due .material-icons-outlined { font-size: 13px; }
.tag-dday { background: var(--grey-100); color: var(--on-surface-variant); font-weight: 600; }
.tag-dday.urgent { background: var(--danger-light); color: var(--danger); animation: pulse 2s ease-in-out infinite; }
.tag-recurrence { background: var(--info-light); color: var(--info); font-weight: 500; }
.tag-priority { font-weight: 500; }
.tag-priority.high { background: var(--danger-light); color: var(--danger); }
.tag-priority.medium { background: var(--warning-light); color: var(--orange); }
.tag-priority.low { background: var(--success-light); color: var(--success); }
.tag-checklist { background: var(--grey-100); color: var(--on-surface-variant); }
.tag-checklist.all-done { background: var(--success-light); color: var(--success); }
.tag-private { background: var(--grey-100); color: var(--on-surface-variant); }
.tag-scope { font-weight: 700; }
.tag-scope .material-icons-outlined { font-size: 13px; }
.tag-scope-personal { background: var(--grey-100); color: var(--on-surface-variant); }
.tag-scope-department { background: var(--primary-light); color: var(--primary); }
.tag-label { padding: 2px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 500; }

/* AI 상태 뱃지 */
.tag-ai { font-weight: 600; }
.tag-ai.queued { background: #fff3e0; color: #e65100; }
.tag-ai.running { background: #e3f2fd; color: #1565c0; animation: pulse 1.5s infinite; }
.tag-ai.done { background: #e8f5e9; color: #2e7d32; }
.tag-ai.failed { background: #ffebee; color: #c62828; }
.tag-ai.clarify { background: #fff8e1; color: #f57f17; }

/* AI 버튼 */
.btn-icon.ai-exec { color: #1565c0; }
.btn-icon.ai-exec:hover { color: #0d47a1; background: #e3f2fd; }
.btn-icon.ai-cancel { color: #c62828; }
.btn-icon.ai-cancel:hover { color: #b71c1c; background: #ffebee; }
.btn-icon.activity-indicator { color: var(--info); }
.btn-icon.activity-indicator:hover { background: var(--info-light); color: #0d47a1; }
.btn-icon.activity-indicator.progress { color: var(--primary); }
.btn-icon.activity-indicator.progress:hover { background: var(--primary-light); color: #1557b0; }
.btn-icon.activity-indicator.queue { color: var(--orange); }
.btn-icon.activity-indicator.queue:hover { background: var(--warning-light); color: #b06000; }
.btn-icon.activity-indicator.live {
  animation: pulse 1.5s infinite;
  box-shadow: inset 0 0 0 1px rgba(21, 101, 192, 0.16);
}

/* ─── AI Global Status (header) ─── */
.ai-global-status {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  background: #e3f2fd; color: #1565c0;
  font-size: 13px; font-weight: 500; cursor: pointer;
  animation: pulse 1.5s infinite;
  transition: background 0.2s, box-shadow 0.2s;
}
.ai-global-status:hover { background: #bbdefb; box-shadow: 0 2px 8px rgba(21,101,192,0.2); }

/* ─── AI Chat Modal ─── */
.ai-chat-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
}
.ai-chat-container {
  width: min(90vw, 800px); height: min(85vh, 700px);
  background: var(--surface); border-radius: 16px; display: flex; flex-direction: column;
  box-shadow: 0 24px 48px rgba(0,0,0,0.2); overflow: hidden;
}
.ai-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--outline-variant);
  background: var(--surface-variant);
}
.ai-chat-header-left { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.ai-chat-header-right { display: flex; gap: 4px; }
.ai-chat-header-btn {
  background: none; border: none; cursor: pointer; color: var(--grey-500); padding: 6px;
  border-radius: 8px; display: flex; align-items: center;
}
.ai-chat-header-btn:hover { background: var(--grey-100); color: var(--on-surface); }

.ai-chat-files {
  padding: 8px 16px; border-bottom: 1px solid var(--outline-variant); background: var(--grey-50);
}
.ai-chat-files-label { font-size: 12px; color: var(--grey-500); display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
#ai-chat-files-list { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.ai-file-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
  background: var(--surface); border: 1px solid var(--outline-variant); border-radius: 12px; font-size: 12px;
}
.ai-file-chip .remove { cursor: pointer; color: var(--grey-400); font-size: 14px; }
.ai-file-chip .remove:hover { color: var(--danger); }
.ai-chat-files-add { display: flex; gap: 6px; }
.ai-chat-files-add input {
  flex: 1; border: 1px solid var(--outline-variant); border-radius: 8px; padding: 4px 10px;
  font-size: 13px; background: var(--surface);
}
.ai-chat-files-add button {
  padding: 4px 12px; border: none; background: var(--primary); color: #fff;
  border-radius: 8px; font-size: 12px; cursor: pointer;
}

.ai-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 16px;
}
.ai-chat-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--grey-400); text-align: center; gap: 8px;
}
.ai-msg { max-width: 95%; }
.ai-msg.user { align-self: flex-end; }
.ai-msg.ai, .ai-msg.system { align-self: flex-start; }

.ai-msg-bubble {
  padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.6;
}
.ai-msg.user .ai-msg-bubble {
  background: var(--primary); color: #fff; border-bottom-right-radius: 4px;
}
.ai-msg.ai .ai-msg-bubble {
  background: var(--grey-50); border: 1px solid var(--outline-variant); border-bottom-left-radius: 4px;
}
.ai-msg.system .ai-msg-bubble {
  background: transparent; color: var(--grey-400); font-size: 12px; text-align: center;
  padding: 4px; border: none;
}
/* AI 메시지 내부 마크다운 */
.ai-msg.ai .ai-msg-bubble h1, .ai-msg.ai .ai-msg-bubble h2, .ai-msg.ai .ai-msg-bubble h3 {
  margin: 8px 0 4px; font-size: 15px; color: var(--on-surface);
}
.ai-msg.ai .ai-msg-bubble h2 { font-size: 14px; }
.ai-msg.ai .ai-msg-bubble h3 { font-size: 13px; }
.ai-msg.ai .ai-msg-bubble pre {
  background: var(--grey-100); border-radius: 8px; padding: 10px; overflow-x: auto;
  font-size: 12px; margin: 8px 0; font-family: 'Roboto Mono', monospace;
}
.ai-msg.ai .ai-msg-bubble code { background: var(--grey-100); padding: 1px 4px; border-radius: 3px; font-size: 13px; }
.ai-msg.ai .ai-msg-bubble pre code { background: none; padding: 0; }
.ai-msg.ai .ai-msg-bubble ul, .ai-msg.ai .ai-msg-bubble ol { padding-left: 20px; margin: 4px 0; }
.ai-msg.ai .ai-msg-bubble table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 13px; }
.ai-msg.ai .ai-msg-bubble th, .ai-msg.ai .ai-msg-bubble td {
  border: 1px solid var(--outline-variant); padding: 6px 10px; text-align: left;
}
.ai-msg.ai .ai-msg-bubble th { background: var(--grey-100); font-weight: 600; }
.ai-msg.ai .ai-msg-bubble p { margin: 4px 0; }

.ai-msg-time { font-size: 11px; color: var(--grey-400); margin-top: 3px; padding: 0 4px; }
.ai-msg.user .ai-msg-time { text-align: right; }

.ai-chat-status {
  padding: 8px 20px; border-top: 1px solid var(--outline-variant); background: #e3f2fd;
}
.ai-running-indicator { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #1565c0; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1.5s linear infinite; }

.ai-chat-input-area {
  display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--outline-variant); background: var(--surface);
}
.ai-chat-attach-btn {
  background: none; border: none; cursor: pointer; color: var(--grey-400); padding: 8px;
  border-radius: 8px; display: flex; align-items: center;
}
.ai-chat-attach-btn:hover { background: var(--grey-100); color: var(--on-surface); }
#ai-chat-input {
  flex: 1; border: 1px solid var(--outline-variant); border-radius: 12px; padding: 10px 14px;
  font-size: 14px; resize: none; min-height: 22px; max-height: 120px; line-height: 1.5;
  font-family: inherit; background: var(--surface);
}
#ai-chat-input:focus { outline: none; border-color: var(--primary); }
.ai-chat-send-btn {
  background: var(--primary); color: #fff; border: none; border-radius: 50%;
  width: 40px; height: 40px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ai-chat-send-btn:hover { filter: brightness(1.1); }
.ai-chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

.card-footer {
  display: flex; justify-content: flex-end; margin-top: 8px; gap: 2px;
  opacity: 0; transition: opacity var(--transition);
}
.card:hover .card-footer { opacity: 1; }

.card-assignee {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #fff;
  position: absolute; top: 12px; right: 12px;
}

/* Icon buttons */
.btn-icon {
  background: none; border: none; color: var(--grey-500); cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.btn-icon:hover { background: var(--grey-100); color: var(--on-surface); }
.btn-icon.delete:hover { background: var(--danger-light); color: var(--danger); }
#drawer-delete[hidden] { display: none !important; }
.btn-icon.scope-move:hover { background: var(--primary-light); color: var(--primary); }
.btn-icon .material-icons-outlined { font-size: 18px; }
.btn-icon.is-busy {
  opacity: 0.58;
  cursor: progress;
  pointer-events: none;
}

/* ============================================================
   SIDE DRAWER
   ============================================================ */
.drawer-overlay {
  display: none; position: fixed; inset: 0; z-index: var(--z-drawer-overlay);
}
.drawer-overlay.open { display: block; }

.drawer {
  position: fixed; top: 0; right: -500px; width: var(--drawer-width);
  height: 100vh; background: var(--surface);
  border-left: 1px solid var(--outline-variant);
  box-shadow: -4px 0 16px rgba(0,0,0,0.08);
  z-index: var(--z-drawer); display: flex; flex-direction: column;
  transition: right var(--transition-slow);
  overflow: hidden;
}
.drawer.open { right: 0; }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--outline-variant);
  flex-shrink: 0;
}
.drawer-header-left { display: flex; align-items: center; gap: 8px; }
.drawer-header .status-select {
  padding: 4px 8px; border: 1px solid var(--outline);
  border-radius: 6px; font-family: inherit; font-size: 13px;
  background: var(--surface); color: var(--on-surface); cursor: pointer;
}
.drawer-header-right { display: flex; align-items: center; gap: 4px; }

.drawer-content { flex: 1; overflow-y: auto; padding: 0; }

.drawer-section { padding: 16px 20px; border-bottom: 1px solid var(--outline-variant); }
.drawer-section:last-child { border-bottom: none; }

.drawer-section-title {
  font-size: 12px; font-weight: 500; color: var(--grey-500);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.drawer-section-title .material-icons-outlined { font-size: 16px; }

/* Title edit */
.drawer-title {
  width: 100%; border: none; font-size: 18px; font-weight: 500;
  font-family: inherit; color: var(--on-surface);
  padding: 4px 0; outline: none; background: transparent;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition);
}
.drawer-title:focus { border-bottom-color: var(--primary); }

/* Metadata grid */
.meta-grid {
  display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; align-items: center;
}
.meta-label { font-size: 13px; color: var(--on-surface-variant); }
.meta-value select, .meta-value input {
  width: 100%; padding: 6px 10px; border: 1px solid var(--outline);
  border-radius: 6px; font-family: inherit; font-size: 13px;
  background: var(--surface); color: var(--on-surface);
}
.meta-value select:focus, .meta-value input:focus {
  outline: none; border-color: var(--primary);
}

/* Commercial core drawer blocks */
.commercial-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.commercial-meta-grid label,
.commercial-field-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.commercial-meta-grid span,
.commercial-field-row span {
  font-size: 12px;
  color: var(--on-surface-variant);
}
.commercial-meta-grid select,
.commercial-meta-grid input,
.commercial-field-row select,
.commercial-field-row input,
.commercial-inline-form select,
.commercial-inline-form input,
.commercial-admin-form input,
.commercial-admin-form select,
.commercial-admin-form textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--outline);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--on-surface);
}
.commercial-list { display: flex; flex-direction: column; gap: 8px; }
.commercial-empty { color: var(--grey-500); font-size: 13px; padding: 6px 0; }
.commercial-empty.inline { padding: 0; }
.commercial-field-row {
  padding: 10px;
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  background: var(--surface-variant);
}
.commercial-field-row em { color: var(--danger); font-style: normal; margin-left: 3px; }
.commercial-mini-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface);
  margin-top: 4px;
}
.commercial-chip-list,
.commercial-subtasks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.commercial-chip,
.commercial-subtask {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  background: var(--surface);
  color: var(--on-surface);
  font-size: 12px;
}
.commercial-chip.warn { background: var(--warning-light); color: var(--orange); border-color: #f8d184; }
.commercial-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  padding: 0;
}
.commercial-chip button .material-icons-outlined { font-size: 14px; }
.commercial-subtask { cursor: pointer; }
.commercial-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.commercial-inline-form.stacked {
  grid-template-columns: 1fr;
}
.commercial-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--on-surface-variant);
}
.commercial-approval-list { display: flex; flex-direction: column; gap: 8px; }
.commercial-approval {
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface);
}
.commercial-approval.pending { border-color: #f8d184; background: var(--warning-light); }
.commercial-approval.approved { border-color: #b7dfc3; background: var(--success-light); }
.commercial-approval.rejected { border-color: #f0b7b1; background: var(--danger-light); }
.commercial-approval div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.commercial-approval p {
  margin-top: 4px;
  color: var(--on-surface-variant);
  font-size: 12px;
}
.commercial-approval-actions {
  justify-content: flex-start !important;
  margin-top: 8px;
}
.btn-cancel.danger { color: var(--danger); }
.commercial-event {
  padding: 8px 0;
  border-bottom: 1px solid var(--outline-variant);
}
.commercial-event:last-child { border-bottom: 0; }
.commercial-event div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.commercial-event span,
.commercial-event em {
  color: var(--grey-500);
  font-style: normal;
}
.commercial-event p {
  margin-top: 4px;
  color: var(--on-surface-variant);
  font-size: 12px;
}

/* Labels */
.labels-container { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.label-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500; cursor: default;
}
.label-chip .remove-label {
  cursor: pointer; font-size: 14px; opacity: 0.6;
  transition: opacity var(--transition);
}
.label-chip .remove-label:hover { opacity: 1; }
.label-add-input {
  border: 1px dashed var(--outline); border-radius: var(--radius-pill);
  padding: 4px 10px; font-size: 12px; font-family: inherit;
  width: 100px; outline: none; background: transparent; color: var(--on-surface);
}
.label-add-input:focus { border-color: var(--primary); }

/* Markdown description */
.desc-editor {
  width: 100%; min-height: 100px; border: 1px solid var(--outline);
  border-radius: var(--radius-sm); padding: 12px;
  font-family: 'Roboto Mono', monospace; font-size: 13px; line-height: 1.6;
  resize: vertical; outline: none; color: var(--on-surface);
  background: var(--surface);
}
.desc-editor:focus { border-color: var(--primary); }

.desc-preview {
  font-size: 14px; line-height: 1.7; color: var(--on-surface);
  cursor: pointer; min-height: 40px; padding: 4px 0;
}
.desc-preview:empty::before {
  content: '\C124\BA85\C744 \D074\B9AD\D558\C5EC \C791\C131\D558\C138\C694 (\B9C8\D06C\B2E4\C6B4 \C9C0\C6D0)';
  color: var(--grey-400); font-style: italic;
}
.desc-preview h1, .desc-preview h2, .desc-preview h3 { margin: 12px 0 6px; }
.desc-preview h1 { font-size: 18px; }
.desc-preview h2 { font-size: 16px; }
.desc-preview h3 { font-size: 14px; }
.desc-preview p { margin: 4px 0; }
.desc-preview ul, .desc-preview ol { padding-left: 20px; margin: 4px 0; }
.desc-preview code {
  background: var(--grey-100); padding: 2px 6px; border-radius: 4px;
  font-size: 13px; font-family: 'Roboto Mono', monospace;
}
.desc-preview pre {
  background: var(--grey-100); padding: 12px; border-radius: var(--radius-sm);
  overflow-x: auto; margin: 8px 0;
}
.desc-preview pre code { background: none; padding: 0; }
.desc-preview blockquote {
  border-left: 3px solid var(--primary); padding-left: 12px;
  color: var(--on-surface-variant); margin: 8px 0;
}
.desc-preview a { color: var(--primary); }
.desc-preview table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.desc-preview th, .desc-preview td {
  border: 1px solid var(--outline); padding: 6px 10px; text-align: left; font-size: 13px;
}
.desc-preview th { background: var(--grey-100); }

.desc-actions { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }

/* Checklist */
.checklist-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.checklist-bar { flex: 1; height: 6px; background: var(--grey-200); border-radius: 3px; overflow: hidden; }
.checklist-bar-fill {
  height: 100%; background: var(--success); border-radius: 3px;
  transition: width var(--transition);
}
.checklist-pct { font-size: 12px; color: var(--on-surface-variant); font-weight: 500; }

.checklist-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid var(--grey-50);
}
.checklist-item input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0;
}
.checklist-item .cl-text {
  flex: 1; min-width: 0; font-size: 14px; color: var(--on-surface); line-height: 1.4;
  border: none; background: none; font-family: inherit; outline: none; padding: 2px 0;
}
.checklist-item .cl-text.checked { text-decoration: line-through; color: var(--grey-400); }
.checklist-item .cl-actions {
  display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.checklist-item .cl-move-btn {
  width: 24px; height: 24px; border: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--grey-500); cursor: pointer;
  transition: background var(--transition), color var(--transition), opacity var(--transition);
}
.checklist-item .cl-move-btn:hover:not(:disabled) {
  background: var(--grey-100); color: var(--primary);
}
.checklist-item .cl-move-btn:disabled {
  opacity: 0.25; cursor: not-allowed;
}
.checklist-item .cl-move-btn .material-icons-outlined { font-size: 18px; }
.checklist-item .cl-delete {
  opacity: 0; cursor: pointer; color: var(--grey-400); font-size: 18px;
  transition: opacity var(--transition), color var(--transition);
}
.checklist-item:hover .cl-delete { opacity: 1; }
.checklist-item .cl-delete:hover { color: var(--danger); }

.cl-add-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; margin-top: 4px; }
.cl-add-input {
  flex: 1; border: none; border-bottom: 1px solid var(--outline);
  padding: 6px 0; font-family: inherit; font-size: 14px;
  outline: none; background: transparent; color: var(--on-surface);
}
.cl-add-input:focus { border-bottom-color: var(--primary); }

/* Comments */
.comment-item { padding: 10px 0; border-bottom: 1px solid var(--grey-50); }
.comment-item:last-child { border-bottom: none; }
.comment-content {
  font-size: 14px; color: var(--on-surface); line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.comment-time { font-size: 11px; color: var(--grey-500); margin-top: 4px; }
.comment-input-row { display: flex; gap: 8px; margin-top: 8px; }
.comment-input {
  flex: 1; border: 1px solid var(--outline); border-radius: var(--radius-sm);
  padding: 10px 12px; font-family: inherit; font-size: 13px;
  resize: none; min-height: 40px; outline: none;
  background: var(--surface); color: var(--on-surface);
}
.comment-input:focus { border-color: var(--primary); }
.comment-submit {
  background: var(--primary); color: #fff; border: none;
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500;
  align-self: flex-end;
  transition: background var(--transition);
}
[data-theme="dark"] .comment-submit { color: #131314; }
.comment-submit:hover { background: var(--primary-hover); }
.comment-submit.is-busy {
  opacity: 0.7;
  cursor: progress;
  pointer-events: none;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.32); z-index: var(--z-modal);
  justify-content: center; align-items: center;
  animation: fadeIn 150ms ease;
}
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.6); }
.modal-overlay.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

.modal {
  background: var(--surface); border-radius: var(--radius-lg); padding: 28px;
  width: 90%; max-width: 520px; box-shadow: var(--shadow-4);
  animation: slideUp 200ms ease;
}
.modal h2 { font-size: 20px; font-weight: 500; color: var(--on-surface); margin-bottom: 24px; }

.shortcut-installer-guide {
  z-index: calc(var(--z-modal) + 2);
  box-sizing: border-box;
  padding: 24px;
}
.shortcut-installer-guide-card {
  display: flex; flex-direction: column; gap: 16px;
  max-width: 520px;
}
.shortcut-installer-guide-head {
  display: flex; align-items: center; gap: 10px;
}
.shortcut-installer-guide-head .material-icons-outlined {
  color: var(--primary); font-size: 24px;
}
.shortcut-installer-guide-head h2 {
  margin: 0; font-size: 20px; line-height: 1.3;
}
.shortcut-installer-guide-summary {
  margin: 0; color: var(--on-surface); line-height: 1.5;
}
.shortcut-installer-guide-summary strong,
.shortcut-installer-guide-steps strong {
  overflow-wrap: anywhere;
}
.shortcut-installer-guide-steps {
  display: flex; flex-direction: column; gap: 8px;
  margin: 0; padding-left: 22px;
  color: var(--on-surface-variant); line-height: 1.55;
}
.shortcut-installer-guide-tip {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-variant); color: var(--on-surface);
  line-height: 1.45;
}
.shortcut-installer-guide-tip .material-icons-outlined {
  color: var(--primary); font-size: 20px; flex: 0 0 auto;
}
.shortcut-installer-guide-actions .btn-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.shortcut-installer-guide-actions .material-icons-outlined { font-size: 18px; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 500; color: var(--on-surface-variant);
  margin-bottom: 6px; letter-spacing: 0.3px; text-transform: uppercase;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: var(--surface);
  border: 1px solid var(--outline); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--on-surface);
  font-family: inherit; font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light);
}
.form-group textarea { resize: vertical; min-height: 72px; }
.form-help { margin-top: 6px; color: var(--on-surface-variant); font-size: 12px; line-height: 1.45; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.task-scope-group[hidden] { display: none !important; }
.task-department-group[hidden], .task-department-fixed[hidden] { display: none !important; }
.task-department-fixed {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--primary); border-radius: var(--radius-sm);
  background: var(--primary-light); color: var(--primary); font-size: 14px; font-weight: 600;
}
.task-department-fixed::before {
  content: 'groups'; font-family: 'Material Icons'; font-size: 19px; font-weight: normal;
  font-feature-settings: 'liga'; -webkit-font-feature-settings: 'liga';
}
.scope-segment {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.scope-option { display: block; cursor: pointer; }
.scope-option input { position: absolute; opacity: 0; pointer-events: none; }
.scope-option-body {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 12px; border: 1px solid var(--outline);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--on-surface-variant); font-size: 14px; font-weight: 500;
  transition: border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
}
.scope-option-body .material-icons-outlined { font-size: 18px; }
.scope-option input:checked + .scope-option-body {
  border-color: var(--primary); background: var(--primary-light);
  color: var(--primary); box-shadow: 0 0 0 1px var(--primary-light);
}

.modal-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

.btn-cancel {
  background: transparent; color: var(--primary); border: none;
  padding: 10px 20px; border-radius: var(--radius-pill); cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 500;
  transition: background var(--transition);
}
.btn-cancel:hover { background: var(--primary-light); }
.btn-cancel.active {
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent);
}

.btn-submit {
  background: var(--primary); color: #fff; border: none;
  padding: 10px 24px; border-radius: var(--radius-pill); cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 500;
  transition: background var(--transition), box-shadow var(--transition);
}
[data-theme="dark"] .btn-submit { color: #131314; }
.btn-submit:hover { background: var(--primary-hover); box-shadow: var(--shadow-1); }
.btn-submit.is-busy {
  opacity: 0.72;
  cursor: progress;
  pointer-events: none;
  box-shadow: none;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--grey-900); color: var(--grey-50);
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; opacity: 0;
  transition: transform 300ms cubic-bezier(0, 0, 0.2, 1), opacity 200ms;
  z-index: var(--z-toast); box-shadow: var(--shadow-2);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 32px 16px;
  color: var(--grey-500); text-align: center;
}
.empty-state .material-icons-outlined { font-size: 40px; margin-bottom: 8px; color: var(--grey-400); }
.empty-state p { font-size: 13px; }
.board-error-state {
  border: 1px dashed var(--danger-light);
  background: rgba(217,48,37,0.08);
  color: var(--danger);
}
.board-error-state .material-icons-outlined {
  color: var(--danger);
}
.board-retry {
  margin-top: 12px;
}

/* ============================================================
   LOADING / SKELETON
   ============================================================ */
.spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 3px solid var(--grey-200); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-center {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; gap: 12px; color: var(--on-surface-variant); font-size: 14px;
}

.skeleton {
  background: linear-gradient(90deg, var(--grey-100) 25%, var(--grey-200) 50%, var(--grey-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skeleton-card {
  height: 100px; margin-bottom: 8px; border-radius: var(--radius);
}

/* ============================================================
   AI TASK CREATION
   ============================================================ */
.btn-ai {
  background: var(--purple); color: #fff;
}
.btn-ai:hover { background: #7b1fa2; box-shadow: var(--shadow-2); transform: translateY(-1px); }
[data-theme="dark"] .btn-ai { color: #131314; }

.ai-task-card {
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
  transition: opacity var(--transition);
}
.ai-task-card.excluded { opacity: 0.35; }
.ai-task-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.ai-task-title {
  flex: 1; border: none; background: transparent;
  font-size: 15px; font-weight: 500; color: var(--on-surface);
  padding: 4px; border-bottom: 1px dashed var(--outline-variant);
  font-family: inherit; outline: none;
}
.ai-task-title:focus { border-bottom-color: var(--purple); }
.ai-task-priority {
  padding: 3px 8px; border: 1px solid var(--outline-variant); border-radius: 4px;
  font-size: 12px; font-family: inherit; background: var(--surface); color: var(--on-surface);
}
.ai-task-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.ai-meta-item {
  display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--on-surface-variant);
}
.ai-meta-item .material-icons-outlined { font-size: 16px; }
.ai-meta-item input, .ai-meta-item select {
  border: none; background: var(--grey-50); padding: 3px 8px; border-radius: 4px;
  font-size: 13px; font-family: inherit; color: var(--on-surface); outline: none;
}
.ai-meta-item input:focus, .ai-meta-item select:focus { box-shadow: 0 0 0 2px var(--purple-light); }
.ai-task-desc {
  margin-top: 6px; font-size: 12px; color: var(--grey-500); line-height: 1.4;
}
.ai-notes {
  background: var(--warning-light); color: var(--on-surface); padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 8px;
}
.ai-notes .material-icons-outlined { font-size: 18px; color: var(--orange); flex-shrink: 0; margin-top: 1px; }

/* ============================================================
   LOGIN OVERLAY
   ============================================================ */
.login-overlay {
  display: flex; position: fixed; inset: 0; z-index: var(--z-login);
  background: linear-gradient(135deg, var(--grey-50) 0%, var(--primary-light) 100%);
  justify-content: center; align-items: center;
}
.login-overlay.hidden { display: none; }
.login-box {
  background: var(--surface); padding: 48px 40px; border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(60,64,67,0.15); width: 380px;
}
.login-header { text-align: center; margin-bottom: 36px; }
.login-header .login-logo {
  width: 56px; height: 56px; margin: 0 auto 16px;
  background: var(--primary); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 32px;
}
.login-header h2 { font-size: 22px; font-weight: 600; color: var(--on-surface); margin-bottom: 6px; }
.login-header p { font-size: 14px; color: var(--grey-500); }

.login-field { margin-bottom: 20px; }
.login-field label {
  display: block; font-size: 13px; font-weight: 500; color: var(--on-surface-variant);
  margin-bottom: 6px;
}
.login-field input {
  width: 100%; height: 48px; padding: 0 16px;
  border: 1px solid var(--outline); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 15px; color: var(--on-surface);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.login-field input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.login-options {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}

.custom-checkbox {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 13px; color: var(--on-surface-variant);
  user-select: none;
}
.custom-checkbox input[type="checkbox"] {
  appearance: none; width: 18px; height: 18px;
  border: 2px solid var(--outline); border-radius: 4px;
  cursor: pointer; position: relative;
  transition: all 0.15s ease; flex-shrink: 0;
}
.custom-checkbox input[type="checkbox"]:checked {
  background: var(--primary); border-color: var(--primary);
}
.custom-checkbox input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 4px; top: 1px;
  width: 6px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.login-btn {
  width: 100%; height: 48px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: 16px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background var(--transition), box-shadow var(--transition);
}
[data-theme="dark"] .login-btn { color: #131314; }
.login-btn:hover { background: var(--primary-hover); box-shadow: var(--shadow-1); }

.login-error {
  color: var(--danger); font-size: 13px; text-align: center;
  margin-top: 12px; min-height: 20px;
}

/* ============================================================
   DAILY CHECK VIEW
   ============================================================ */
.daily-view { padding: 24px 32px; }
.daily-shell { display: flex; flex-direction: column; gap: 16px; }

.daily-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 4px;
}
.daily-title-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.daily-title-wrap h2 {
  font-size: 20px; font-weight: 500; color: var(--on-surface);
  margin: 0; display: flex; align-items: center; gap: 8px;
}
.daily-title-wrap h2 .material-icons-outlined {
  font-size: 22px; color: var(--on-surface-variant);
}
.daily-title-wrap p {
  font-size: 13px; color: var(--on-surface-variant); margin: 0;
}
.daily-date-controls {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
.daily-date-controls input[type="date"] {
  height: 34px; border: 1px solid var(--outline); border-radius: 6px;
  background: var(--surface); color: var(--on-surface); padding: 0 10px;
  font-family: inherit; font-size: 13px;
}
.daily-user-select {
  height: 34px; min-width: 180px;
  border: 1px solid var(--outline); border-radius: 6px;
  background: var(--surface); color: var(--on-surface);
  padding: 0 10px; font-family: inherit; font-size: 13px;
}
.daily-today-btn,
.daily-manage-btn {
  padding: 7px 16px; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.daily-manage-btn .material-icons-outlined { font-size: 17px; }

.daily-summary-card {
  display: grid; grid-template-columns: minmax(200px, auto) minmax(0, 1fr) auto;
  align-items: center; gap: 20px;
  background: var(--surface); border: 1px solid var(--outline-variant);
  border-radius: var(--radius); padding: 16px 20px;
}
.daily-summary-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.daily-percent {
  min-width: 64px; padding: 2px 6px; text-align: center;
  font-size: 26px; font-weight: 600; color: var(--primary);
  font-feature-settings: "tnum" 1;
}
.daily-summary-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.daily-summary-title {
  color: var(--on-surface); font-size: 14px; font-weight: 500;
  word-break: keep-all; overflow-wrap: anywhere;
}
.daily-summary-meta, .daily-required {
  color: var(--on-surface-variant); font-size: 12px;
}
.daily-summary-progress { min-width: 0; }
.daily-progress-track, .daily-history-bar {
  height: 6px; background: var(--surface-variant); border-radius: 999px; overflow: hidden;
}
.daily-progress-fill, .daily-history-bar span {
  display: block; height: 100%; background: var(--primary); border-radius: inherit;
  transition: width .2s ease;
}

.daily-card {
  background: var(--surface); border: 1px solid var(--outline-variant);
  border-radius: var(--radius); padding: 20px;
}
.daily-card-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  color: var(--on-surface);
}
.daily-card-head .material-icons-outlined {
  font-size: 18px; color: var(--on-surface-variant);
}
.daily-card-head h3 {
  font-size: 16px; font-weight: 500; color: var(--on-surface); margin: 0;
}

.daily-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px; align-items: start;
}
.daily-main, .daily-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.daily-items { display: flex; flex-direction: column; gap: 8px; }
.daily-item {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  background: var(--surface-variant); border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 12px 14px;
  transition: border-color var(--transition), background var(--transition);
}
.daily-item:hover { border-color: var(--outline-variant); }
.daily-item.done {
  background: var(--success-light);
  border-color: rgba(30,142,62,.25);
}
[data-theme="dark"] .daily-item.done { background: var(--success-light); }
.daily-check-toggle {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--outline);
  background: var(--surface); color: var(--on-surface-variant);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition); flex-shrink: 0;
}
.daily-check-toggle:hover { border-color: var(--primary); color: var(--primary); }
.daily-check-toggle.checked {
  background: var(--success); color: #fff; border-color: var(--success);
}
[data-theme="dark"] .daily-check-toggle.checked { color: #131314; }
.daily-check-toggle .material-icons-outlined { font-size: 18px; }
.daily-item-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.daily-item-top {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0;
}
.daily-item-top strong {
  font-size: 14px; font-weight: 500; color: var(--on-surface);
  word-break: keep-all; overflow-wrap: anywhere;
}
.daily-item.done .daily-item-top strong {
  text-decoration: line-through; color: var(--on-surface-variant);
}
.daily-item-badge {
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500;
  background: var(--grey-100); color: var(--on-surface-variant); white-space: nowrap;
}
[data-theme="dark"] .daily-item-badge { background: var(--grey-200); }
.daily-item-badge.required { background: var(--warning-light); color: #9a5d00; }
[data-theme="dark"] .daily-item-badge.required { color: var(--warning); }
.daily-item-time { color: var(--on-surface-variant); font-size: 12px; white-space: nowrap; }
.daily-item-desc {
  color: var(--on-surface-variant); font-size: 12.5px; margin: 0;
  line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere;
}
.daily-item-note {
  width: 100%; height: 30px; border: 1px solid var(--outline-variant);
  border-radius: 6px; background: var(--surface); color: var(--on-surface);
  padding: 0 9px; font-family: inherit; font-size: 12.5px;
}
.daily-item-note:focus,
.daily-day-note textarea:focus,
.daily-template-form input:focus,
.daily-template-form select:focus,
.daily-user-select:focus,
.daily-date-controls input[type="date"]:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light);
}
.daily-item-status {
  text-align: right; color: var(--on-surface-variant);
  font-size: 11.5px; padding-top: 7px; word-break: keep-all; min-width: 50px;
}

.daily-day-note textarea {
  width: 100%; min-height: 88px; resize: vertical;
  border: 1px solid var(--outline-variant); border-radius: 6px;
  background: var(--surface); color: var(--on-surface);
  padding: 10px; font-family: inherit; font-size: 13px; line-height: 1.5;
}
.daily-note-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px;
}
.daily-note-actions .btn-cancel,
.daily-note-actions .btn-submit {
  padding: 7px 16px; font-size: 13px;
}

.daily-history-row {
  display: grid; grid-template-columns: 88px minmax(0, 1fr) 44px;
  align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--outline-variant); font-size: 12px;
}
.daily-history-row:last-child { border-bottom: none; }
.daily-history-date { color: var(--on-surface-variant); white-space: nowrap; }
.daily-history-row strong { text-align: right; color: var(--on-surface); font-weight: 500; }
.daily-history-row.closed .daily-history-date::after {
  content: " 마감"; color: var(--success); font-weight: 600;
}
.daily-team-row {
    display: grid; grid-template-columns: 30px minmax(0, 1fr) 44px;
    align-items: center; gap: 10px;
    padding: 9px 0; border-bottom: 1px solid var(--outline-variant);
    cursor: pointer;
}
.daily-team-row:last-child { border-bottom: none; }
.daily-team-row:hover .daily-team-name { color: var(--primary); }
.daily-team-row.selected {
  background: var(--primary-light);
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
}
.daily-team-avatar {
  width: 30px; height: 30px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.daily-team-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.daily-team-name {
  font-size: 13px; color: var(--on-surface); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.daily-team-name span {
  color: var(--on-surface-variant); font-weight: 400; margin-left: 4px;
}
.daily-team-row strong { text-align: right; font-size: 12px; color: var(--on-surface); font-weight: 500; }
.daily-empty, .daily-muted {
  padding: 24px 12px; color: var(--on-surface-variant);
  text-align: center; font-size: 13px;
}
.daily-empty .material-icons-outlined {
  font-size: 36px; display: block; margin-bottom: 8px; color: var(--grey-400);
}

.daily-template-panel {
  background: var(--surface); border: 1px solid var(--outline-variant);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.daily-template-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.daily-template-head h3 {
  font-size: 16px; font-weight: 500; color: var(--on-surface); margin: 0;
}
.daily-template-form {
    display: grid;
    grid-template-columns: minmax(140px, 1.2fr) minmax(160px, 1.4fr) minmax(110px, 0.9fr) 100px minmax(130px, 1fr) minmax(120px, 1fr) auto auto auto;
    gap: 8px; align-items: center;
}
.daily-template-form input,
.daily-template-form select {
  height: 34px; border: 1px solid var(--outline-variant); border-radius: 6px;
  background: var(--surface); color: var(--on-surface);
  padding: 0 9px; font-family: inherit; font-size: 13px; min-width: 0;
}
.daily-template-form select:disabled { opacity: .55; }
.daily-template-form .btn-submit {
  height: 34px; padding: 0 16px; font-size: 13px;
}
.daily-template-form .btn-cancel {
  height: 34px; padding: 0 14px; font-size: 13px;
}
.daily-template-required {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; font-size: 12px; color: var(--on-surface-variant); white-space: nowrap;
}
.daily-template-list { display: flex; flex-direction: column; gap: 8px; }
.daily-template-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-variant);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.daily-template-row:hover { border-color: var(--outline-variant); }
.daily-template-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.daily-template-main strong {
  color: var(--on-surface); font-size: 13.5px; font-weight: 500;
  overflow-wrap: anywhere;
}
.daily-template-main span,
.daily-template-main p {
  color: var(--on-surface-variant); font-size: 12px; margin: 0; overflow-wrap: anywhere;
}
.daily-template-actions {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
}

/* ============================================================
   SYSTEM HUB VIEW
   ============================================================ */
.hub-view { padding: 24px 32px; }
.hub-shell { display: flex; flex-direction: column; gap: 18px; }
.hub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.hub-title-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hub-title-wrap h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--on-surface);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0;
}
.hub-title-wrap h2 .material-icons-outlined { font-size: 22px; color: var(--primary); }
.hub-title-wrap p {
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 13px;
}
.hub-title-wrap p.hub-refresh-stale { color: var(--warning); font-weight: 700; }
.hub-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.hub-refresh-btn .material-icons-outlined { font-size: 17px; }
.hub-service-alert-root:empty { display: none; }
.hub-service-alert {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--danger);
  border-left-width: 5px;
  border-radius: var(--radius-sm);
  background: var(--danger-light);
  color: var(--danger);
  box-shadow: 0 4px 14px rgba(217, 48, 37, 0.12);
}
.hub-service-alert-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  color: var(--danger);
}
.hub-service-alert-icon .material-icons-outlined { font-size: 24px; }
.hub-service-alert-main { min-width: 0; }
.hub-service-alert-main strong { display: block; color: var(--danger); font-size: 15px; }
.hub-service-alert-main p {
  margin: 3px 0 0;
  color: var(--on-surface);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.hub-service-alert-main small {
  display: block;
  margin-top: 4px;
  color: var(--on-surface-variant);
  font-size: 11px;
}
.hub-service-alert-actions { display: flex; align-items: center; gap: 8px; }
.hub-service-alert-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}
.hub-service-alert-actions .material-icons-outlined { font-size: 17px; }
.hub-content { display: flex; flex-direction: column; gap: 20px; }
.hub-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.hub-search-row .material-icons-outlined { font-size: 19px; color: var(--on-surface-variant); }
.hub-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--on-surface);
}
.hub-search-clear {
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--on-surface-variant);
  padding: 2px;
  border-radius: 999px;
}
.hub-search-row.has-query .hub-search-clear { display: inline-flex; }
.hub-search-row.has-query .hub-search-clear:hover { background: var(--surface-variant); }
.hub-audience-filter {
  display: inline-flex;
  flex-shrink: 0;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--outline-variant);
  border-radius: 999px;
  background: var(--surface-variant);
}
.hub-audience-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  border-radius: 999px;
  padding: 4px 11px;
  background: transparent;
  color: var(--on-surface-variant);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.hub-audience-chip:hover { color: var(--on-surface); }
.hub-audience-chip.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.hub-audience-count { font-size: 11px; font-weight: 500; opacity: 0.75; }
@media (max-width: 640px) {
  .hub-search-row { flex-wrap: wrap; }
  .hub-audience-filter { width: 100%; justify-content: space-between; }
  .hub-audience-chip { flex: 1; justify-content: center; }
}
.hub-search-empty {
  text-align: center;
  color: var(--on-surface-variant);
  font-size: 13px;
  padding: 18px 0;
}
.hub-card-search-hidden { display: none !important; }
.hub-section-search-hidden { display: none !important; }
.hub-global-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: -8px;
}
.hub-self-shortcut-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  white-space: nowrap;
  word-break: keep-all;
}
.hub-self-shortcut-btn .material-icons-outlined { font-size: 17px; }
.hub-protected-backup-run {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: var(--radius-sm);
  color: #991b1b;
  background: #fff7f7;
}
.hub-protected-backup-run.is-success { border-color: #bbf7d0; border-left-color: #16a34a; color: #166534; background: #f4fff7; }
.hub-protected-backup-run.is-running { border-color: #bfdbfe; border-left-color: #2563eb; color: #1e40af; background: #eff6ff; }
.hub-protected-backup-run.is-stale { border-color: #fde68a; border-left-color: #d97706; color: #92400e; background: #fffbeb; }
.hub-protected-backup-run-icon { align-self: start; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #fee2e2; }
.hub-protected-backup-run.is-success .hub-protected-backup-run-icon { background: #dcfce7; }
.hub-protected-backup-run.is-running .hub-protected-backup-run-icon { background: #dbeafe; }
.hub-protected-backup-run.is-stale .hub-protected-backup-run-icon { background: #fef3c7; }
.hub-protected-backup-run-main { min-width: 0; overflow: hidden; }
.hub-protected-backup-run-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.hub-protected-backup-run-title h3 { min-width: 0; margin: 0; color: inherit; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.hub-protected-backup-run-title > span { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; color: inherit; background: color-mix(in srgb, currentColor 10%, transparent); font-size: 11px; font-weight: 800; white-space: nowrap; }
.hub-protected-backup-run p { margin: 3px 0 6px; color: inherit; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.hub-protected-backup-run-meta { display: flex; flex-wrap: wrap; min-width: 0; gap: 4px 10px; color: inherit; font-size: 11px; }
.hub-protected-backup-run-meta code,
.hub-protected-backup-run-meta span { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.hub-protected-backup-run-meta code { padding: 1px 5px; border-radius: 5px; color: inherit; background: color-mix(in srgb, currentColor 9%, transparent); font-family: var(--font-mono, monospace); font-size: 10px; }
.hub-backup-summary {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: var(--radius-sm);
  background: #fff7f7;
}
.hub-backup-summary.is-success { border-color: #bbf7d0; border-left-color: #16a34a; background: #f4fff7; }
.hub-backup-summary.is-degraded,
.hub-backup-summary.is-running,
.hub-backup-summary.is-stale { border-color: #fde68a; border-left-color: #d97706; background: #fffbeb; }
.hub-backup-summary-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #b91c1c;
  background: #fee2e2;
}
.hub-backup-summary.is-success .hub-backup-summary-icon { color: #15803d; background: #dcfce7; }
.hub-backup-summary.is-degraded .hub-backup-summary-icon,
.hub-backup-summary.is-running .hub-backup-summary-icon,
.hub-backup-summary.is-stale .hub-backup-summary-icon { color: #b45309; background: #fef3c7; }
.hub-backup-summary-main { min-width: 0; overflow: hidden; }
.hub-backup-summary-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hub-backup-summary-title-row h3 { min-width: 0; margin: 0; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; color: var(--on-surface); }
.hub-backup-summary-count { flex: 0 0 auto; white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--on-surface-variant); }
.hub-backup-summary p { margin: 4px 0 10px; overflow-wrap: anywhere; color: var(--on-surface-variant); font-size: 13px; }
.hub-backup-recovery-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 7px; }
.hub-backup-recovery-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.hub-backup-recovery-metric strong { font-size: 13px; }
.hub-backup-recovery-metric.is-verified { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.hub-backup-recovery-metric.is-failed { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
.hub-backup-recovery-metric.is-unverified { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.hub-backup-recovery-metric.is-running { color: #1e40af; border-color: #bfdbfe; background: #eff6ff; }
.hub-backup-summary p.hub-backup-recovery-explainer { margin: 0 0 7px; font-size: 11px; line-height: 1.45; }
.hub-backup-latest-attempt {
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--on-surface-variant);
  background: color-mix(in srgb, var(--surface-variant) 72%, transparent);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.hub-backup-components-label { margin: 0 0 5px; color: var(--on-surface-variant); font-size: 11px; font-weight: 700; }
.hub-backup-components { display: flex; flex-wrap: wrap; gap: 6px; }
.hub-backup-component {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #991b1b;
  background: #fee2e2;
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.hub-backup-component.success { color: #166534; background: #dcfce7; }
.hub-backup-component.partial { color: #92400e; background: #fef3c7; }
.hub-backup-component.running { color: #1e40af; background: #dbeafe; }
.hub-backup-component .material-icons-outlined { font-size: 14px; }
.hub-backup-summary-time { margin-top: 8px; overflow-wrap: anywhere; color: var(--on-surface-variant); font-size: 11px; }
.hub-section { display: flex; flex-direction: column; gap: 10px; }
.hub-section-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 28px;
  cursor: pointer;
  user-select: none;
  border: none;
  background: transparent;
  padding: 0;
  width: 100%;
  text-align: left;
}
.hub-section-head h3 {
  margin: 0;
  color: var(--on-surface);
  font-size: 16px;
  font-weight: 500;
}
.hub-section-count {
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-variant);
  border-radius: 999px;
  padding: 1px 8px;
}
.hub-section-chevron {
  margin-left: auto;
  color: var(--on-surface-variant);
  font-size: 20px;
  transition: transform 0.15s ease;
}
.hub-section.collapsed .hub-section-chevron { transform: rotate(-90deg); }
.hub-section.collapsed .hub-grid { display: none; }
.hub-section.collapsed .hub-api-launch-toolbar { display: none; }
.hub-content.hub-searching .hub-section.collapsed .hub-grid { display: grid; }
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.hub-card {
  min-width: 0;
  min-height: 148px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(60,64,67,0.08);
}
.hub-card.hub-card-service-failure {
  border-color: var(--danger);
  border-left-width: 5px;
  background: linear-gradient(135deg, var(--danger-light), var(--surface) 72%);
  box-shadow: 0 0 0 1px rgba(217, 48, 37, 0.08), 0 5px 16px rgba(217, 48, 37, 0.12);
}
.hub-card.hub-card-service-failure .hub-card-icon {
  background: var(--danger-light);
  color: var(--danger);
}
.hub-card.hub-card-critical-asset-warning:not(.hub-card-service-failure) {
  border-color: #e5a000;
  border-left-width: 5px;
  background: linear-gradient(135deg, var(--warning-light), var(--surface) 72%);
}
.hub-card.hub-card-critical-asset-critical:not(.hub-card-service-failure) {
  border-color: var(--danger);
  background: linear-gradient(135deg, var(--danger-light), var(--surface) 72%);
}

/* ===== 허브 즐겨찾기: 카드 아이콘 밑 별 토글 + 맨 위 즐겨찾기 구역 =====
   별을 켜면 같은 카드가 맨 위 구역에 하나 더 쌓이고, 원래 그룹의 카드는 그대로 남는다. */
.hub-card-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.hub-card-fav-btn {
  width: 100%;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.hub-card-fav-btn .material-icons-outlined { font-size: 19px; }
.hub-card-fav-btn:hover { opacity: 1; background: var(--surface-variant); }
.hub-card-fav-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; opacity: 1; }
.hub-card-fav-btn[disabled] { cursor: default; opacity: 0.35; }
.hub-card-fav-btn.on { opacity: 1; color: #f0a500; }
.hub-card-fav-btn.on:hover { color: #d18b00; }
/* 즐겨찾기로 지정한 카드는 원래 그룹에서도 왼쪽 금색 띄로 구분된다(장애·자산경고 띄가 우선). */
.hub-card.hub-card-favorited:not(.hub-card-service-failure):not(.hub-card-critical-asset-warning):not(.hub-card-critical-asset-critical) {
  border-left: 3px solid #f0a500;
}
.hub-section-favorites .hub-section-head h3 { display: inline-flex; align-items: center; gap: 6px; }
.hub-section-star { font-size: 18px; color: #f0a500; }
.hub-favorites-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px dashed var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--on-surface-variant);
  font-size: 12px;
  line-height: 1.5;
}
.hub-favorites-empty .material-icons-outlined { font-size: 18px; color: #f0a500; flex: 0 0 auto; }
.hub-favorites-empty b { color: #f0a500; }
.hub-section.collapsed .hub-favorites-empty { display: none; }
[data-theme="dark"] .hub-card-fav-btn.on,
[data-theme="dark"] .hub-section-star,
[data-theme="dark"] .hub-favorites-empty .material-icons-outlined,
[data-theme="dark"] .hub-favorites-empty b { color: #fdd663; }
[data-theme="dark"] .hub-card.hub-card-favorited:not(.hub-card-service-failure):not(.hub-card-critical-asset-warning):not(.hub-card-critical-asset-critical) {
  border-left-color: #fdd663;
}
.hub-critical-asset-summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.hub-critical-asset-summary.is-success { border-color: #81c995; background: color-mix(in srgb, var(--surface) 88%, #e6f4ea); }
.hub-critical-asset-summary.is-warning { border-color: #f6bf26; background: color-mix(in srgb, var(--surface) 85%, #fef7e0); }
.hub-critical-asset-summary.is-critical { border-color: var(--danger); background: color-mix(in srgb, var(--surface) 85%, var(--danger-light)); }
.hub-critical-asset-summary > .material-icons-outlined { color: var(--success); font-size: 25px; }
.hub-critical-asset-summary.is-warning > .material-icons-outlined { color: var(--orange); }
.hub-critical-asset-summary.is-critical > .material-icons-outlined { color: var(--danger); }
.hub-critical-asset-summary-main { display: grid; gap: 5px; min-width: 0; flex: 1; }
.hub-critical-asset-summary-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hub-critical-asset-summary-title strong { font-size: 15px; color: var(--on-surface); }
.hub-critical-asset-summary-title span,
.hub-critical-asset-summary p { margin: 0; color: var(--on-surface-variant); font-size: 12px; }
.hub-critical-asset-overall {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  white-space: nowrap;
}
.hub-critical-asset-summary-title .hub-critical-asset-overall.ok { background: var(--success-light); color: var(--success); }
.hub-critical-asset-summary-title .hub-critical-asset-overall.warning { background: var(--warning-light); color: var(--orange); }
.hub-critical-asset-summary-title .hub-critical-asset-overall.critical { background: var(--danger-light); color: var(--danger); }
.hub-critical-asset-summary-axes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 3px;
}
.hub-critical-asset-axis {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid var(--outline-variant);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}
.hub-critical-asset-axis-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--on-surface);
  font-size: 12px;
}
.hub-critical-asset-axis-title span { color: var(--on-surface-variant); font-size: 11px; font-weight: 800; }
.hub-critical-asset-summary-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.hub-critical-asset-summary-counts span,
.hub-critical-asset-badge,
.hub-dependency-audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.hub-critical-asset-badges {
  min-width: 0;
  max-width: 210px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.hub-critical-asset-badge .material-icons-outlined,
.hub-dependency-audit-badge .material-icons-outlined { flex: 0 0 auto; font-size: 14px; }
.hub-critical-asset-summary-counts .applied,
.hub-critical-asset-badge.applied { background: var(--success-light); color: var(--success); }
.hub-critical-asset-summary-counts .partial,
.hub-critical-asset-summary-counts .not-applied,
.hub-critical-asset-badge.partial,
.hub-critical-asset-badge.not-applied { background: var(--warning-light); color: var(--orange); }
.hub-critical-asset-summary-counts .at-risk,
.hub-critical-asset-badge.at-risk { background: var(--danger-light); color: var(--danger); }
.hub-critical-asset-summary-counts .not-applicable,
.hub-critical-asset-badge.not-applicable,
.hub-dependency-audit-badge.not-applicable { background: var(--surface-variant); color: var(--on-surface-variant); }
.hub-critical-asset-summary-counts .audit-complete,
.hub-dependency-audit-badge.complete { background: var(--success-light); color: var(--success); }
.hub-critical-asset-summary-counts .audit-incomplete,
.hub-critical-asset-summary-counts .audit-unknown,
.hub-dependency-audit-badge.incomplete,
.hub-dependency-audit-badge.unknown { background: var(--warning-light); color: var(--orange); }
/* 2026-09-27: 의존성 감사는 참고 정보(advisory) — 경고색 대신 중립색 */
.hub-critical-asset-summary-counts.advisory .audit-incomplete,
.hub-critical-asset-summary-counts.advisory .audit-unknown,
.hub-dependency-audit-badge.advisory { background: var(--surface-variant); color: var(--on-surface-variant); }
.hub-section-failure-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--danger-light);
  color: var(--danger);
  font-size: 11px;
  font-weight: 800;
}
.hub-section-failure-count .material-icons-outlined { font-size: 14px; }
.hub-view-as-card.verified {
  border-color: #86b7fe;
  box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.08), 0 4px 14px rgba(26, 115, 232, 0.08);
}
.hub-view-as-card.neutral {
  border-color: #81c995;
  box-shadow: 0 0 0 1px rgba(19, 115, 51, 0.07);
}
.hub-view-as-card.blocked {
  border-color: var(--outline-variant);
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-variant));
}
.hub-view-as-card.permission-denied,
.hub-view-as-card.unsupported,
.hub-view-as-card.pending,
.hub-view-as-card.invalid {
  border-color: var(--outline-variant);
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-variant));
}
.hub-view-as-card.permission-denied .hub-card-icon,
.hub-view-as-card.permission-denied .hub-card-main > :not(.hub-view-as-row),
.hub-view-as-card.unsupported .hub-card-icon,
.hub-view-as-card.unsupported .hub-card-main > :not(.hub-view-as-row),
.hub-view-as-card.pending .hub-card-icon,
.hub-view-as-card.pending .hub-card-main > :not(.hub-view-as-row),
.hub-view-as-card.invalid .hub-card-icon,
.hub-view-as-card.invalid .hub-card-main > :not(.hub-view-as-row) {
  opacity: 0.68;
}
.hub-view-as-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #b6ccf5;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 88%, #dbe8ff);
  color: var(--on-surface);
}
.hub-view-as-summary > .material-icons-outlined { color: #174ea6; font-size: 21px; }
.hub-view-as-summary div { display: grid; gap: 2px; min-width: 0; }
.hub-view-as-summary strong { font-size: 13px; }
.hub-view-as-summary span,
.hub-view-as-summary small { color: var(--on-surface-variant); line-height: 1.4; }
.hub-view-as-summary span { font-size: 12px; font-weight: 650; }
.hub-view-as-summary small { font-size: 11px; }
.hub-view-as-card.blocked .hub-card-icon,
.hub-view-as-card.blocked .hub-card-main > :not(.hub-view-as-row) {
  opacity: 0.68;
}
.hub-view-as-row { display: flex; align-items: center; margin: 1px 0 3px; }
.hub-view-as-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
  white-space: normal;
}
.hub-view-as-badge .material-icons-outlined { font-size: 14px; }
.hub-view-as-badge.verified { background: #e8f0fe; color: #174ea6; }
.hub-view-as-badge.neutral { background: #e6f4ea; color: #137333; }
.hub-view-as-badge.blocked { background: #f1f3f4; color: #5f6368; }
.hub-view-as-badge.permission-denied { background: #fde7e9; color: #a50e0e; }
.hub-view-as-badge.unsupported { background: #fce8e6; color: #c5221f; }
.hub-view-as-badge.pending { background: #fef7e0; color: #8d5d00; }
.hub-view-as-badge.invalid { background: #f3e8fd; color: #681da8; }
.hub-card-main p.hub-view-as-note {
  padding: 7px 9px;
  border-radius: 7px;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  line-height: 1.45;
}
.hub-view-as-card .hub-open-btn:disabled {
  cursor: not-allowed;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  border-color: var(--outline-variant);
  box-shadow: none;
  opacity: 0.8;
}
[data-theme="dark"] .hub-view-as-badge.verified { background: rgba(138, 180, 248, 0.2); color: #aecbfa; }
[data-theme="dark"] .hub-view-as-badge.neutral { background: rgba(129, 201, 149, 0.2); color: #a8dab5; }
[data-theme="dark"] .hub-view-as-badge.blocked { background: rgba(154, 160, 166, 0.18); color: #bdc1c6; }
[data-theme="dark"] .hub-view-as-badge.permission-denied,
[data-theme="dark"] .hub-view-as-badge.unsupported { background: rgba(242, 139, 130, 0.2); color: #f28b82; }
[data-theme="dark"] .hub-view-as-badge.pending { background: rgba(253, 214, 99, 0.18); color: #fdd663; }
[data-theme="dark"] .hub-view-as-badge.invalid { background: rgba(215, 174, 251, 0.18); color: #d7aefb; }
.hub-card-icon {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-variant);
  color: var(--primary);
  cursor: help;
}
.hub-card-icon:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.hub-card-icon .material-icons-outlined { font-size: 22px; }
.hub-icon-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 260px;
  max-width: calc(100vw - 32px);
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--on-surface);
  color: var(--surface);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
  text-align: left;
  white-space: normal;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}
.hub-card-icon:hover .hub-icon-tooltip,
.hub-card-icon:focus-visible .hub-icon-tooltip {
  opacity: 1;
  visibility: visible;
}
.hub-card-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hub-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.hub-card-title-row h4 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--on-surface);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.hub-card-main p {
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.hub-card-status-only .hub-card-main {
  gap: 8px;
}
.hub-card-status-only {
  min-height: 0;
}
.hub-card-status-only .hub-card-main > p {
  color: var(--on-surface);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: break-word;
}
.hub-url {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-variant);
  color: var(--grey-700);
  font-family: "Roboto Mono", Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-theme="dark"] .hub-url { color: var(--grey-500); }
.hub-api-identity {
  min-width: 0;
  color: var(--on-surface-variant);
  font-family: "Roboto Mono", Consolas, monospace;
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.hub-api-meta,
.hub-api-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}
.hub-api-meta span,
.hub-api-routes code {
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-pill);
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.hub-api-routes code {
  border-radius: 6px;
  font-family: "Roboto Mono", Consolas, monospace;
}
.hub-address-audit-row {
  display: flex;
  min-width: 0;
}
.hub-address-audit {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 23px;
  padding: 2px 8px;
  border: 1px solid #f3bf73;
  border-radius: var(--radius-pill);
  background: #fff4e5;
  color: #8a4b00;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.hub-address-audit:hover {
  border-color: #e19a35;
  background: #ffe7bd;
  box-shadow: 0 1px 4px rgba(138, 75, 0, 0.16);
}
.hub-address-audit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(243, 191, 115, 0.42);
}
.hub-address-audit .material-icons-outlined {
  flex: 0 0 auto;
  font-size: 14px;
}
.hub-address-audit span:not(.material-icons-outlined) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hub-address-audit small {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.78;
}
.hub-address-audit.permission {
  width: fit-content;
  margin-top: 2px;
}
[data-theme="dark"] .hub-address-audit {
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(251, 191, 36, 0.14);
  color: #facc15;
}
[data-theme="dark"] .hub-address-audit:hover {
  border-color: rgba(251, 191, 36, 0.72);
  background: rgba(251, 191, 36, 0.22);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.24);
}
.hub-address-audit-details {
  z-index: calc(var(--z-modal) + 2);
  box-sizing: border-box;
  padding: 24px;
}
.hub-address-audit-modal-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(92vw, 620px);
  max-height: min(82vh, 720px);
  padding: 24px;
}
.hub-address-audit-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.hub-address-audit-modal-head > .material-icons-outlined {
  color: #d97706;
  flex: 0 0 auto;
  font-size: 24px;
}
.hub-address-audit-modal-head h2 {
  margin: 0;
  color: var(--on-surface);
  font-size: 20px;
  line-height: 1.3;
}
.hub-address-audit-modal-head p {
  margin: 4px 0 0;
  color: var(--on-surface-variant);
  font-size: 13px;
  line-height: 1.4;
}
.hub-address-audit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}
.hub-address-audit-section-title {
  margin: 4px 0 -2px;
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.hub-address-audit-section-title:first-child {
  margin-top: 0;
}
.hub-address-audit-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface-variant);
}
.hub-address-audit-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.hub-address-audit-item-head strong {
  min-width: 0;
  color: var(--on-surface);
  font-size: 13px;
  line-height: 1.35;
}
.hub-address-audit-flags {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}
.hub-address-audit-flag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: #fff4e5;
  color: #8a4b00;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.hub-address-audit-value {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--on-surface);
  font-family: "Roboto Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}
.hub-address-audit-value.muted {
  color: var(--on-surface-variant);
  opacity: 0.82;
}
.hub-address-audit-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.hub-address-audit-arrow {
  color: var(--on-surface-variant);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}
.hub-address-audit-host {
  color: var(--on-surface-variant);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.hub-address-audit-actions {
  margin-top: 2px;
}
[data-theme="dark"] .hub-address-audit-flag {
  background: rgba(251, 191, 36, 0.14);
  color: #facc15;
}
.hub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--on-surface-variant);
  font-size: 11px;
}
.hub-meta span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-variant);
  color: var(--grey-700);
}
.hub-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.hub-status.ok { background: var(--success-light); color: var(--success); }
.hub-status.warning { background: var(--warning-light); color: var(--orange); }
.hub-status.error { background: var(--danger-light); color: var(--danger); }
.hub-status.desktop { background: var(--primary-light); color: var(--primary); }
.hub-status.disabled { background: var(--warning-light); color: var(--orange); }
.hub-status.unknown,
.hub-status.service-unknown,
.hub-status.ai-disconnected { background: var(--surface-variant); color: var(--grey-700); }
.hub-status.service-normal,
.hub-status.ai-write { background: var(--success-light); color: var(--success); }
.hub-status.service-failure { background: var(--danger-light); color: var(--danger); }
.hub-status.ai-read { background: var(--primary-light); color: var(--primary); }
.hub-status-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.hub-readiness-stack {
  max-width: 100%;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.hub-card-status-only .hub-card-title-row { flex-wrap: wrap; }
.hub-card-status-only .hub-card-title-row h4 { flex-basis: 100%; }
.hub-card-status-only .hub-readiness-stack {
  width: 100%;
  justify-content: flex-start;
}
.hub-readiness-badge { white-space: nowrap; }
/* 2026-10-21 정찬 지시: PC 폭에서 카드 제목이 오른쪽 상태 배지 묶음(약 120px)에 밀려 80~100px 칸에서
   두 줄로 잘리던 문제(1920 폭 144장 중 34장, 예: 「📱 TASK MANAGER 앱 설치 (공용 QR)」).
   휴대폰 폭(768px 이하)처럼 제목을 한 줄 전체 폭으로 쓰고 배지는 제목 아래로 내린다. 제목은 줄 수 제한 없이 다 보인다. */
@media (min-width: 769px) {
  .hub-card-title-row-critical-assets { flex-wrap: wrap; }
  .hub-card-title-row-critical-assets h4 {
    flex: 1 1 100%;
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    overflow-wrap: anywhere;
  }
  .hub-card-title-row-critical-assets .hub-status-stack {
    width: 100%;
    flex: 1 1 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
  }
  /* 등록 자산·의존성 감사 배지를 「정상」 옆에 이어 붙여 카드가 길어지는 것을 한 줄 정도로 줄인다. */
  .hub-card-title-row-critical-assets .hub-critical-asset-badges { display: contents; }
}
.hub-api-launch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--outline-variant));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary-light) 58%, var(--surface));
}
.hub-api-launch-copy,
.hub-api-launch-controls,
.hub-codex-select {
  display: flex;
  align-items: center;
}
.hub-api-launch-copy { min-width: 0; gap: 9px; }
.hub-api-launch-copy > .material-icons-outlined { flex: 0 0 auto; color: var(--primary); font-size: 21px; }
.hub-api-launch-copy div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hub-api-launch-copy strong { color: var(--on-surface); font-size: 13px; line-height: 1.35; }
.hub-api-launch-copy small { color: var(--on-surface-variant); font-size: 11px; line-height: 1.35; }
.hub-api-launch-controls { flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.hub-api-selection-count { color: var(--on-surface-variant); font-size: 11px; font-weight: 700; white-space: nowrap; }
.hub-api-launch-controls button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.hub-api-launch-controls .material-icons-outlined { font-size: 16px; }
.hub-codex-card-actions { justify-content: space-between; }
.hub-codex-select {
  gap: 6px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.hub-codex-select input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.hub-codex-select.disabled { cursor: not-allowed; opacity: 0.55; }
.hub-codex-open-btn { margin-left: auto; }
.hub-codex-open-btn:disabled,
.hub-api-launch-controls button:disabled { cursor: not-allowed; opacity: 0.58; }
.hub-card-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.hub-open-btn {
  flex: 0 0 auto;
  min-height: 34px;
  min-width: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  white-space: nowrap;
  word-break: keep-all;
}
.hub-open-btn .material-icons-outlined { flex: 0 0 auto; font-size: 16px; }
.hub-silent-print-btn {
  min-width: 132px;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--outline));
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary);
}
.hub-card-actions .btn-icon { flex: 0 0 34px; width: 34px; height: 34px; }
.hub-copy-btn { width: 34px; height: 34px; }

/* 허브 앱 진행 상태 토글 (좌측 하단) */
.hub-dev-status {
  margin-right: auto; /* 카드 좌측으로 밀어 좌하단 배치 */
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  word-break: keep-all;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.hub-dev-status .material-icons-outlined { font-size: 15px; }
.hub-dev-status.in_progress {
  background: rgba(255, 167, 38, 0.14);
  border-color: rgba(255, 167, 38, 0.45);
  color: #b26a00;
}
.hub-dev-status.in_progress:hover { background: rgba(255, 167, 38, 0.24); }
.hub-dev-status.on_hold {
  background: rgba(142, 68, 173, 0.15);
  border-color: rgba(142, 68, 173, 0.48);
  color: #7b1fa2;
}
.hub-dev-status.on_hold:hover { background: rgba(142, 68, 173, 0.25); }
.hub-dev-status.completed {
  background: rgba(46, 160, 67, 0.16);
  border-color: rgba(46, 160, 67, 0.5);
  color: #1a7f37;
}
.hub-dev-status.completed:hover { background: rgba(46, 160, 67, 0.26); }
.hub-dev-status.discarded {
  background: rgba(95, 99, 104, 0.14);
  border-color: rgba(95, 99, 104, 0.45);
  color: #5f6368;
}
.hub-dev-status.discarded:hover { background: rgba(95, 99, 104, 0.24); }

/* 허브 카드 수정사항 체크리스트 (소유자 전용) */
.hub-checklist {
  grid-column: 1 / -1;
  margin-top: 10px;
  border-top: 1px dashed var(--outline, #d0d0d0);
  padding-top: 8px;
}
.hub-checklist-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  color: var(--on-surface-variant, #555);
  font-size: 12.5px;
  font-weight: 600;
}
.hub-checklist-head:hover { color: var(--on-surface, #222); }
.hub-checklist-head .material-icons-outlined { font-size: 16px; }
.hub-checklist-title { flex: 0 0 auto; }
.hub-checklist-count {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  color: #5b6470;
  background: rgba(120, 130, 145, 0.14);
  border-radius: 999px;
  padding: 1px 8px;
}
.hub-checklist-chevron {
  margin-left: auto;
  transition: transform 0.18s ease;
}
.hub-checklist.open .hub-checklist-chevron { transform: rotate(180deg); }
.hub-checklist-body { display: none; padding: 4px 0 2px; }
.hub-checklist.open .hub-checklist-body { display: block; }
.hub-checklist-items { list-style: none; margin: 0; padding: 0; }
.hub-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 0;
}
.hub-checklist-check,
.hub-checklist-del {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1px;
  color: var(--on-surface-variant, #666);
  line-height: 1;
}
.hub-checklist-check .material-icons-outlined { font-size: 18px; }
.hub-checklist-del .material-icons-outlined { font-size: 15px; }
.hub-checklist-check:hover { color: #1a7f37; }
.hub-checklist-del { opacity: 0; transition: opacity 0.15s; }
.hub-checklist-del:hover { color: #c62828; }
.hub-checklist-item:hover .hub-checklist-del { opacity: 1; }
.hub-checklist-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  color: var(--on-surface, #222);
  font-family: inherit;
  border: none;
  background: none;
  outline: none;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: text;
  line-height: 1.4;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
  box-sizing: border-box;
  display: block;
}
.hub-checklist-text:hover { background: var(--grey-50, #f8f9fa); }
.hub-checklist-text:focus { background: var(--grey-100, #f3f4f6); box-shadow: inset 0 0 0 1px var(--primary, #1a73e8); }
.hub-checklist-item.done .hub-checklist-text,
.hub-checklist-text.checked {
  text-decoration: line-through;
  color: var(--on-surface-variant, #999);
}
.hub-checklist-item.done .hub-checklist-check { color: #1a7f37; }
.hub-checklist-empty {
  list-style: none;
  font-size: 12px;
  color: var(--on-surface-variant, #999);
  padding: 4px 0;
}
.hub-checklist-add { display: flex; gap: 6px; margin-top: 6px; }
.hub-checklist-input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  padding: 6px 9px;
  border: 1px solid var(--outline, #ccc);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--on-surface, #222);
}
.hub-checklist-input:focus { outline: none; border-color: #1a73e8; }
.hub-checklist-add-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  border: 1px solid var(--outline, #ccc);
  border-radius: 8px;
  background: var(--surface, #fff);
  cursor: pointer;
  color: #1a73e8;
}
.hub-checklist-add-btn:hover { background: rgba(26, 115, 232, 0.08); }
.hub-checklist-add-btn .material-icons-outlined { font-size: 18px; }

/* ============================================================
   COMMERCIAL DASHBOARD / WORKLOAD VIEW
   ============================================================ */
.commercial-dashboard-view, .workload-view, .report-view { display: none; padding: 24px 32px; }
.commercial-dashboard-view.active, .workload-view.active, .report-view.active { display: block; }

.commercial-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.commercial-page-head h2 {
  font-size: 20px;
  font-weight: 500;
  color: var(--on-surface);
  margin: 0 0 3px;
}
.commercial-page-head p {
  color: var(--on-surface-variant);
  font-size: 13px;
  margin: 0;
}
.commercial-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.commercial-stat {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  padding: 14px;
}
.commercial-stat strong {
  display: block;
  color: var(--primary);
  font-size: 26px;
  line-height: 1.1;
}
.commercial-stat span {
  display: block;
  color: var(--on-surface-variant);
  font-size: 12px;
  margin-top: 4px;
}
.commercial-stat.warn strong { color: var(--orange); }
.commercial-stat.danger strong { color: var(--danger); }
.commercial-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.commercial-panel {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  padding: 16px;
}
.commercial-panel h3,
.commercial-admin-grid h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface);
  margin: 0 0 12px;
}
.commercial-table-wrap {
  overflow-x: auto;
}
.commercial-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.8fr);
  gap: 16px;
}
.commercial-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.commercial-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  background: var(--surface);
}
.commercial-admin-row strong {
  display: block;
  font-size: 13px;
  color: var(--on-surface);
}
.commercial-admin-row span {
  display: block;
  color: var(--on-surface-variant);
  font-size: 12px;
  margin-top: 2px;
}
.commercial-admin-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-variant);
}
.commercial-admin-form textarea {
  min-height: 88px;
  resize: vertical;
  font-family: 'Roboto Mono', monospace;
}

.wl-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wl-name { width: 120px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; color: var(--on-surface); }
.wl-bar-wrap {
  flex: 1;
  min-height: 34px;
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}
.wl-seg {
  height: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  min-width: 0;
  border-right: 1px solid rgba(255,255,255,0.45);
}
.wl-seg:last-child { border-right: 0; }
.wl-seg span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wl-seg strong {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.wl-seg.overdue { background: var(--danger); }
.wl-seg.progress { background: var(--primary); }
.wl-seg.pending { background: var(--grey-400); }
.wl-seg.done { background: var(--success); }
.wl-seg.empty {
  background: var(--surface-variant);
  color: var(--grey-500);
  border-right-color: var(--outline-variant);
}
.wl-stats { width: 140px; font-size: 12px; text-align: right; color: var(--on-surface-variant); }
.wl-overdue-badge { background: var(--danger-light); color: var(--danger); padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; margin-left: 4px; }
.wl-legend { display: flex; gap: 16px; margin-bottom: 20px; font-size: 12px; color: var(--on-surface-variant); }
.wl-legend-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; vertical-align: middle; margin-right: 4px; }

/* ============================================================
   REPORT VIEW
   ============================================================ */
.report-card {
  background: var(--surface); border: 1px solid var(--outline-variant);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.report-card h3 { font-size: 16px; font-weight: 500; margin-bottom: 12px; color: var(--on-surface); }
.report-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.report-stat {
  flex: 1; min-width: 100px; text-align: center; padding: 16px;
  background: var(--surface-variant); border-radius: var(--radius-sm);
}
.report-stat-num { font-size: 32px; font-weight: 600; color: var(--primary); }
.report-stat-num.red { color: var(--danger); }
.report-stat-num.green { color: var(--success); }
.report-stat-label { font-size: 12px; color: var(--on-surface-variant); margin-top: 4px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { text-align: left; padding: 8px; background: var(--surface-variant); color: var(--on-surface-variant); border-bottom: 1px solid var(--outline-variant); }
.report-table td { padding: 8px; border-bottom: 1px solid var(--outline-variant); color: var(--on-surface); }

/* ============================================================
   DEPARTMENT MANAGEMENT CARDS
   ============================================================ */
.dept-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.dept-card {
  background: var(--surface); border: 1px solid var(--outline-variant);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow var(--transition);
}
.dept-card:hover { box-shadow: var(--shadow-1); }
.dept-card-bar { height: 4px; }
.dept-card-header {
  display: flex; align-items: center; padding: 16px; gap: 12px; cursor: pointer;
}
.dept-card-header:hover { background: var(--grey-50); }
.dept-card-title { flex: 1; font-size: 15px; font-weight: 600; color: var(--on-surface); }
.dept-card-badge {
  padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
}
.dept-delete-action {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--danger) 42%, var(--outline-variant));
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--danger);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.dept-delete-action:hover:not(:disabled) { background: var(--danger-light); }
.dept-delete-action:disabled {
  border-color: var(--outline-variant);
  color: var(--grey-400);
  background: var(--surface-variant);
  cursor: not-allowed;
  opacity: .72;
}
.dept-delete-action .material-icons-outlined { font-size: 16px; }
.dept-delete-action.overview { margin-left: auto; }
.dept-delete-action.detail { min-height: 32px; }
.dept-card-body { padding: 0 16px 16px; }

/* Stacked avatars */
.avatar-stack { display: flex; padding: 8px 0; }
.avatar-stack .stacked {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface);
  margin-left: -8px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff;
  transition: transform var(--transition);
}
.avatar-stack .stacked:first-child { margin-left: 0; }
.avatar-stack .stacked:hover { transform: translateY(-3px); z-index: 1; }
.avatar-stack .stacked-more {
  background: var(--grey-200); color: var(--on-surface-variant);
  font-size: 10px; margin-left: -8px;
}

/* Member rows */
.dept-card-members { display: none; }
.dept-card.expanded .dept-card-members { display: block; }
.dept-card.expanded .avatar-stack { display: none; }

.dept-member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--grey-50);
}
.dept-member-row:last-child { border-bottom: none; }
.dept-member-info { flex: 1; }
.dept-member-name { font-size: 14px; font-weight: 500; color: var(--on-surface); }
.dept-member-role { font-size: 12px; color: var(--grey-500); }
.dept-member-remove {
  opacity: 0; cursor: pointer; color: var(--grey-300);
  font-size: 18px; transition: all var(--transition);
}
.dept-member-row:hover .dept-member-remove { opacity: 1; }
.dept-member-remove:hover { color: var(--danger); }

/* Add member button */
.dept-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px; border: none; border-top: 1px solid var(--outline-variant);
  background: transparent; color: var(--grey-500); font-size: 13px;
  font-weight: 500; cursor: pointer; font-family: inherit;
  transition: all var(--transition);
}
.dept-add-btn:hover { background: var(--grey-50); color: var(--primary); }

/* Add member popover */
.member-popover {
  position: fixed; z-index: var(--z-popover);
  width: 300px; background: var(--surface);
  border: 1px solid var(--outline-variant); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(60,64,67,0.15); overflow: hidden;
  animation: fadeIn 120ms ease-out;
}
.member-popover-header { padding: 12px; border-bottom: 1px solid var(--outline-variant); }
.member-popover-header input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 14px;
  background: var(--surface-variant); color: var(--on-surface); outline: none;
}
.member-popover-header input:focus { border-color: var(--primary); background: var(--surface); }
.member-popover-list { max-height: 260px; overflow-y: auto; padding: 4px; }
.member-popover-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.1s;
}
.member-popover-item:hover { background: var(--grey-50); }
.member-popover-item.already { opacity: 0.4; cursor: default; pointer-events: none; }
.member-popover-item .mp-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.member-popover-item .mp-name { font-size: 14px; font-weight: 500; color: var(--on-surface); flex: 1; }
.member-popover-item .mp-dept { font-size: 11px; color: var(--grey-500); }
.member-popover-item .mp-already { font-size: 11px; color: var(--grey-500); font-style: italic; }

.hub-permission-help {
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  font-size: 13px;
}
.hub-permission-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hub-permission-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.hub-permission-row.editing {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--outline-variant));
  box-shadow: 0 0 0 2px var(--primary-light);
}
.hub-permission-row-head {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.hub-permission-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.hub-permission-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}
.hub-permission-icon .material-icons-outlined { font-size: 19px; }
.hub-permission-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hub-permission-copy strong {
  color: var(--on-surface);
  font-size: 13.5px;
  font-weight: 600;
}
.hub-permission-copy span,
.hub-permission-copy em {
  color: var(--on-surface-variant);
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}
.hub-permission-summary {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.hub-permission-summary strong {
  color: var(--on-surface);
  font-size: 12.5px;
  font-weight: 600;
}
.hub-permission-chips,
.hub-permission-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hub-permission-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--grey-100);
  color: var(--on-surface-variant);
  font-size: 11px;
  white-space: nowrap;
}
.hub-permission-chip.company { background: var(--grey-100); color: var(--on-surface-variant); }
.hub-permission-chip.team { background: var(--primary-light); color: var(--primary); }
.hub-permission-chip.user { background: var(--grey-100); color: var(--on-surface-variant); }
.hub-permission-chip.company.leidex,
.hub-permission-chip.team.leidex,
.hub-permission-chip.user.leidex {
  background: var(--primary-light);
  color: var(--primary);
}
.hub-permission-chip.company.cosnpeople,
.hub-permission-chip.team.cosnpeople,
.hub-permission-chip.user.cosnpeople {
  background: var(--success-light);
  color: var(--success);
}
.hub-permission-chip.public { background: var(--warning-light); color: var(--warning); }
.hub-permission-chip.readonly {
  max-width: min(360px, 100%);
  white-space: normal;
  overflow-wrap: anywhere;
}
.hub-permission-chip.more {
  border: 0;
  background: var(--surface-variant);
  cursor: pointer;
  font-family: inherit;
}
.hub-permission-edit-btn {
  min-height: 34px;
  padding: 0 12px;
  justify-content: center;
  white-space: nowrap;
}
.hub-permission-editor {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface-variant);
}
.hub-permission-note {
  display: block;
  margin-top: 3px;
  color: var(--grey-600);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
/* 위임자 모달: 회사/부서는 보기 전용(disabled) — 흐리게 + 클릭 불가 표시 */
.hub-permission-editor.scope-readonly .hub-permission-scope-stack {
  opacity: 0.72;
}
.hub-permission-editor.scope-readonly .hub-permission-company-option,
.hub-permission-editor.scope-readonly .hub-permission-dept-option {
  cursor: not-allowed;
}
.hub-permission-editor.scope-readonly .hub-permission-scope-stack input[disabled] {
  cursor: not-allowed;
}
.hub-permission-editor-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 14px;
}
.hub-permission-scope-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.hub-permission-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hub-permission-group-title {
  color: var(--on-surface);
  font-size: 12px;
  font-weight: 600;
}
.hub-permission-user-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hub-permission-user-head span {
  color: var(--on-surface-variant);
  font-size: 12px;
}
.hub-permission-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--on-surface-variant);
  font-size: 12px;
}
.hub-permission-options label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.hub-permission-options label.leidex:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.hub-permission-options label.cosnpeople:has(input:checked) {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success);
}
.hub-permission-options label.hub-permission-company-option {
  width: 100%;
  align-items: flex-start;
  gap: 7px;
}
.hub-permission-company-option span {
  font-weight: 700;
}
.hub-permission-company-option em {
  color: inherit;
  opacity: 0.8;
}
.hub-permission-company-options {
  width: 100%;
}
.hub-permission-dept-option span {
  font-weight: 600;
}
.hub-permission-dept-option em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hub-permission-company-badge {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--grey-100);
  color: var(--on-surface-variant);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
}
.hub-permission-company-badge.leidex {
  background: var(--primary-light);
  color: var(--primary);
}
.hub-permission-company-badge.cosnpeople {
  background: var(--success-light);
  color: var(--success);
}
.hub-permission-dept-options {
  max-height: 206px;
  overflow-y: auto;
}
.hub-permission-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.hub-permission-search .material-icons-outlined {
  color: var(--grey-500);
  font-size: 18px;
}
.hub-permission-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  font-size: 13px;
}
.hub-install-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--on-surface-variant);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.hub-install-hint .material-icons-outlined {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 17px;
}
.hub-permission-user-options {
  max-height: 230px;
  overflow-y: auto;
  align-content: flex-start;
}
.hub-permission-user-option {
  min-width: 170px;
}
.hub-permission-options input { margin: 0; }
.hub-permission-options em {
  color: var(--grey-500);
  font-size: 11px;
  font-style: normal;
}
.hub-permission-options label:has(input:checked) em {
  color: inherit;
}
.hub-permission-empty {
  color: var(--grey-500);
  font-size: 12px;
}
.hub-permission-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--outline-variant);
}
.hub-permission-editor-action-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hub-permission-editor-actions .btn,
.hub-permission-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--on-surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, border-color 0.12s;
}
.hub-permission-editor-actions .btn {
  min-height: 36px;
  padding: 0 12px;
}
.hub-permission-editor-actions .btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}
.hub-permission-editor-actions .btn:hover,
.hub-permission-edit-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.hub-permission-editor-actions .btn.primary:hover {
  background: var(--primary-hover);
  color: white;
}
.hub-permission-editor-actions .material-icons-outlined,
.hub-permission-edit-btn .material-icons-outlined {
  font-size: 17px;
}

/* ============================================================
   DEPARTMENT OVERVIEW CARDS (Bento Grid)
   ============================================================ */
.dept-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.dept-summary-card {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.dept-summary-card:hover {
  box-shadow: var(--shadow-3);
  transform: translateY(-3px);
  border-color: var(--outline);
}

.dept-summary-card .card-accent { height: 4px; }

.dept-summary-card .card-content { padding: 20px 24px; }

.dept-summary-card .card-top {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
}

.dept-card-add-member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  margin: -6px 0 14px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--on-surface-variant);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.dept-card-add-member:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-container);
}
.dept-card-add-member .material-icons-outlined { font-size: 16px; }

.dept-member-add-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px dashed var(--outline);
  border-radius: 20px;
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.dept-member-add-chip:hover {
  background: var(--primary-container);
  border-style: solid;
}
.dept-member-add-chip .material-icons-outlined { font-size: 14px; }

.dept-summary-card .dept-icon-lg {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; flex-shrink: 0;
}

.dept-summary-card .card-name {
  font-size: 18px; font-weight: 600; color: var(--on-surface);
}

.dept-summary-card .card-member-count {
  font-size: 13px; color: var(--on-surface-variant); margin-top: 2px;
}


/* Stats row */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 20px;
}

.stat-box {
  text-align: center; padding: 10px 6px;
  border-radius: var(--radius-sm); background: var(--surface-variant);
}

.stat-box .stat-num {
  font-size: 22px; font-weight: 700; line-height: 1.2;
}
.stat-box .stat-label {
  font-size: 11px; color: var(--on-surface-variant);
  margin-top: 2px; letter-spacing: 0.2px;
}

.stat-box.s-active .stat-num { color: var(--primary); }
.stat-box.s-done .stat-num { color: var(--success); }
.stat-box.s-overdue .stat-num { color: var(--danger); }
.stat-box.s-total .stat-num { color: var(--on-surface); }

/* Department progress bar */
.dept-progress { margin-bottom: 16px; }

.dept-progress-bar {
  height: 8px; background: var(--grey-100); border-radius: 4px;
  overflow: hidden; display: flex;
}

.dept-progress-seg { height: 100%; transition: width 0.5s ease; }
.dept-progress-seg.done { background: var(--success); border-radius: 4px 0 0 4px; }
.dept-progress-seg.progress { background: var(--primary); }
.dept-progress-seg.overdue { background: var(--danger); border-radius: 0 4px 4px 0; }

.dept-progress-labels {
  display: flex; justify-content: space-between;
  margin-top: 6px; font-size: 11px; color: var(--on-surface-variant);
}

/* Avatar group */
.avatar-group { display: flex; align-items: center; }

.avatar-group .ag-item {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2.5px solid var(--surface); margin-left: -10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
  transition: transform var(--transition); position: relative; z-index: 1;
}
.avatar-group .ag-item:first-child { margin-left: 0; }
.avatar-group .ag-item:hover { transform: translateY(-3px) scale(1.1); z-index: 5; }

.avatar-group .ag-more {
  background: var(--grey-200); color: var(--on-surface-variant);
  font-size: 11px; font-weight: 500;
}

/* ============================================================
   MEMBER PROFILE CARDS
   ============================================================ */
.members-summary-bar {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
}

.members-summary-bar .bar-label {
  font-size: 13px; font-weight: 500;
  color: var(--on-surface-variant); white-space: nowrap;
}

.members-summary-bar .bar-track {
  flex: 1; height: 24px; background: var(--grey-100);
  border-radius: 12px; display: flex; overflow: hidden;
}

.members-summary-bar .bar-seg {
  height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #fff;
  min-width: 0; overflow: hidden; white-space: nowrap;
  transition: width 0.5s ease;
}

.member-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.member-profile-card {
  background: var(--surface); border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg); padding: 24px;
  cursor: pointer; display: flex; flex-direction: column; gap: 16px;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.member-profile-card:hover {
  box-shadow: var(--shadow-3); transform: translateY(-3px); border-color: var(--outline);
}

.member-profile-card .profile-top {
  display: flex; align-items: center; gap: 14px;
}

.member-profile-card .profile-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff; flex-shrink: 0;
}

.member-profile-card .profile-name {
  font-size: 16px; font-weight: 600; color: var(--on-surface);
}

.member-profile-card .profile-dept {
  font-size: 12px; color: var(--on-surface-variant); margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
}

.member-profile-card .profile-dept .dept-badge {
  display: inline-flex; padding: 1px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 500;
}


/* Profile stat boxes */
.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}

.profile-stat-box {
  text-align: center; padding: 10px 6px;
  border-radius: var(--radius-sm); background: var(--surface-variant);
}

.profile-stat-box .ps-num {
  font-size: 20px; font-weight: 700; line-height: 1.2;
}
.profile-stat-box .ps-label {
  font-size: 11px; color: var(--on-surface-variant); margin-top: 2px;
}

.profile-stat-box.ps-active .ps-num { color: var(--primary); }
.profile-stat-box.ps-done .ps-num { color: var(--success); }
.profile-stat-box.ps-overdue .ps-num { color: var(--danger); }

/* Capacity bar */
.capacity-bar-wrap { margin-top: -4px; }

.cap-bar {
  width: 100%; height: 6px; background: var(--grey-100);
  border-radius: 3px; overflow: hidden;
}

.cap-bar-fill {
  height: 100%; border-radius: 3px; transition: width 0.5s ease;
}

.cap-bar-fill.cap-under { background: var(--success); }
.cap-bar-fill.cap-normal { background: var(--primary); }
.cap-bar-fill.cap-warning { background: var(--warning); }
.cap-bar-fill.cap-danger { background: var(--danger); }

.cap-labels {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px; font-size: 11px; color: var(--on-surface-variant);
}

/* ============================================================
   SEARCH DIALOG (Ctrl+K)
   ============================================================ */
.search-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: var(--z-search);
  justify-content: center; align-items: flex-start;
  padding-top: 15vh;
  animation: fadeIn 100ms ease;
}
[data-theme="dark"] .search-overlay { background: rgba(0,0,0,0.65); }
.search-overlay.active { display: flex; }

.search-dialog {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 90%; max-width: 580px; box-shadow: var(--shadow-4);
  animation: slideUp 150ms ease; overflow: hidden;
}
.search-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--outline-variant);
}
.search-input-wrap .material-icons-outlined { font-size: 24px; color: var(--grey-500); }
.search-input {
  flex: 1; border: none; background: none; font-size: 16px;
  font-family: inherit; color: var(--on-surface); outline: none;
}
.search-input::placeholder { color: var(--grey-400); }
.search-kbd {
  padding: 2px 8px; background: var(--grey-100); border-radius: 4px;
  font-size: 11px; color: var(--grey-500); font-family: 'Roboto Mono', monospace;
}
.search-results { max-height: 400px; overflow-y: auto; padding: 8px 0; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; cursor: pointer;
  transition: background 0.1s;
}
.search-result-item:hover, .search-result-item.selected { background: var(--grey-50); }
.search-result-item .sr-icon { font-size: 20px; color: var(--grey-500); }
.search-result-item .sr-title { font-size: 14px; font-weight: 500; color: var(--on-surface); }
.search-result-item .sr-main {
  min-width: 0; flex: 1;
  display: flex; flex-direction: column; gap: 3px;
}
.search-result-item .sr-sub {
  font-size: 12px; color: var(--on-surface-variant);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-item .sr-status { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-pill); }
.search-result-item .sr-status.pending { background: var(--grey-100); color: var(--grey-600); }
.search-result-item .sr-status.in_progress { background: var(--primary-light); color: var(--primary); }
.search-result-item .sr-status.completed { background: var(--success-light); color: var(--success); }
.search-result-item .sr-status-tag {
  flex-shrink: 0;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-pill);
}
.search-section + .search-section {
  border-top: 1px solid var(--outline-variant);
}
.search-section-title {
  padding: 10px 20px 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--grey-500); text-transform: uppercase;
}
.search-recent-btn,
.search-suggestion-chip {
  width: calc(100% - 24px);
  margin: 0 12px 8px;
  padding: 10px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--on-surface);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.search-recent-btn:hover,
.search-suggestion-chip:hover {
  background: var(--grey-50);
  border-color: var(--outline);
}
.search-suggestion-list {
  display: grid;
  grid-template-columns: 1fr;
}
.search-suggestion-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.search-suggestion-chip span {
  font-size: 11px;
  color: var(--on-surface-variant);
}
.search-result-item mark {
  background: color-mix(in srgb, var(--warning) 28%, transparent);
  color: inherit;
  padding: 0 2px;
  border-radius: 4px;
}
.search-empty { padding: 32px; text-align: center; color: var(--grey-500); font-size: 14px; }
.search-hint { padding: 10px 20px; border-top: 1px solid var(--outline-variant); font-size: 12px; color: var(--grey-500); display: flex; gap: 16px; }

/* ============================================================
   RESPONSIVE (MOBILE)
   ============================================================ */
@media (max-width: 1400px) {
  header { padding: 0 16px; }
  .summary-chips { display: none; }
  .header-search-wrap {
    min-width: 180px;
    width: 220px;
    max-width: 240px;
    flex-basis: 220px;
  }
  .btn-fab {
    width: 40px; height: 40px; padding: 0;
    justify-content: center; flex: 0 0 40px;
    border-radius: 50%;
  }
  .btn-fab span.fab-text { display: none; }
  .btn-fab.btn-quick {
    width: auto;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    flex: 0 0 auto;
  }
  .btn-fab.btn-quick span.fab-text { display: inline; }
  .user-name { max-width: 76px; }
}

@media (max-width: 768px) {
  header { padding: 0 12px; flex-wrap: wrap; height: auto; min-height: 56px; }
  header h1 { font-size: 16px; }
  .summary-chips { display: none; }
  .my-task-toolbar { margin: 0 10px 10px; align-items: stretch; }
  .my-task-scope-filters { width: 100%; }
  .my-task-filter { flex: 1; justify-content: center; padding: 0 8px; }
  .my-task-department-filter { flex: 1 1 100%; }
  .my-task-department-filter select { flex: 1; max-width: none; }
  .my-task-toolbar-help { width: 100%; margin-left: 0; }
  .header-right { flex-wrap: wrap; }
  .user-name { max-width: 84px; }
  .header-search-wrap {
    order: 9;
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .nav-tabs {
    order: 10; width: 100%; padding: 4px 0 8px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .nav-tab { font-size: 12px; padding: 5px 10px; white-space: nowrap; }
  .section-subnav { padding: 8px 16px; min-height: 44px; }
  .section-subnav-btn { font-size: 12px; min-height: 30px; padding: 5px 10px; }
  .board-headers {
    width: 100%; box-sizing: border-box; padding: 0 16px; gap: 8px;
    overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  }
  .board { flex-direction: column; padding: 8px 16px 24px; gap: 16px; }
  .column { max-width: 100%; min-width: unset; }
  .column-header { max-width: 100%; min-width: unset; }
  .card-list { max-height: none; }
  .btn-fab span.fab-text { display: none; }
  .btn-fab { padding: 10px; border-radius: 50%; }
  .drawer { width: 100vw; }
  :root { --drawer-width: 100vw; }
  .board-wrapper.drawer-open { margin-right: 0; }
  .board-wrapper { height: auto; overflow: visible; }
  .filter-bar { padding: 8px 16px; }
  .filter-bar select { font-size: 12px; padding: 4px 8px; }
  .notif-panel {
    top: 64px;
    right: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 76px);
  }
  .notif-list { max-height: min(504px, calc(100vh - 126px)); }
  .user-dropdown {
    top: 64px;
    right: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 76px);
  }
  .daily-view { padding: 16px; }
  .daily-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .daily-date-controls { width: 100%; justify-content: flex-start; }
  .daily-user-select { width: 100%; }
  .daily-summary-card { grid-template-columns: 1fr; gap: 12px; padding: 14px 16px; }
  .daily-summary-progress { width: 100%; }
  .daily-required { text-align: left; }
  .daily-layout { grid-template-columns: 1fr; }
  .daily-card { padding: 16px; }
  .daily-template-panel { padding: 16px; }
  .daily-item { grid-template-columns: 30px minmax(0, 1fr); padding: 10px 12px; }
  .daily-item-status { grid-column: 2; text-align: left; padding-top: 0; }
  .daily-template-form { grid-template-columns: 1fr; }
  .daily-template-form .btn-submit { width: 100%; }
  .daily-template-required { justify-content: flex-start; }
  .daily-history-row { grid-template-columns: 76px minmax(0, 1fr) 44px; }
  .hub-view { padding: 16px; }
  .hub-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .hub-refresh-btn { width: 100%; justify-content: center; }
  .hub-service-alert { grid-template-columns: 34px minmax(0, 1fr); padding: 12px; }
  .hub-service-alert-icon { width: 34px; height: 34px; border-radius: 10px; }
  .hub-service-alert-actions { grid-column: 1 / -1; width: 100%; }
  .hub-service-alert-actions button { flex: 1 1 140px; }
  .hub-global-actions { justify-content: stretch; }
  .hub-self-shortcut-btn { width: 100%; justify-content: center; }
  .hub-protected-backup-run { grid-template-columns: minmax(0, 1fr); padding: 11px; }
  .hub-protected-backup-run-icon { display: none; }
  .hub-protected-backup-run-title { align-items: flex-start; flex-direction: column; gap: 3px; }
  .hub-protected-backup-run-title > span { white-space: normal; overflow-wrap: anywhere; }
  .hub-backup-summary { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .hub-backup-summary-icon { display: none; }
  .hub-backup-summary-title-row { align-items: flex-start; flex-direction: column; gap: 3px; }
  .hub-backup-summary-count { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .hub-backup-recovery-metric { min-width: 0; flex: 1 1 120px; justify-content: space-between; }
  .hub-backup-components { gap: 5px; }
  .hub-grid { grid-template-columns: 1fr; }
  .hub-card { grid-template-columns: 38px minmax(0, 1fr); min-height: 0; padding: 12px; }
  .hub-card-icon { width: 38px; height: 38px; }
  .hub-card-fav-btn { height: 24px; }
  .hub-critical-asset-summary { gap: 8px; padding: 12px; }
  .hub-critical-asset-summary > .material-icons-outlined { display: none; }
  .hub-critical-asset-summary-title { align-items: flex-start; justify-content: flex-start; gap: 7px; }
  .hub-critical-asset-summary-title > strong { flex: 1 1 100%; }
  .hub-critical-asset-summary-axes { grid-template-columns: minmax(0, 1fr); }
  .hub-card-title-row-critical-assets { flex-wrap: wrap; }
  .hub-card-title-row-critical-assets .hub-status-stack { width: 100%; flex: 1 1 100%; align-items: flex-start; }
  .hub-critical-asset-badges { width: 100%; max-width: none; flex-direction: row; align-items: stretch; justify-content: flex-start; flex-wrap: wrap; }
  .hub-critical-asset-badge,
  .hub-dependency-audit-badge {
    min-width: 0;
    flex: 1 1 140px;
    justify-content: flex-start;
    white-space: normal;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .hub-card-actions { justify-content: stretch; }
  .hub-open-btn { flex: 1; justify-content: center; }
  .hub-api-launch-toolbar { align-items: stretch; flex-direction: column; }
  .hub-api-launch-controls { width: 100%; justify-content: stretch; }
  .hub-api-selection-count { width: 100%; }
  .hub-api-launch-controls button { flex: 1 1 150px; }
  .hub-codex-card-actions { align-items: stretch; }
  .hub-codex-select { flex: 0 0 auto; justify-content: center; }
  .hub-codex-open-btn { flex: 1 1 auto; margin-left: 0; }
  .shortcut-installer-guide { align-items: center; padding: 12px; }
  .shortcut-installer-guide-card {
    width: 100%;
    max-height: calc(100vh - 24px);
    overflow: auto;
  }
  .shortcut-installer-guide-actions { flex-direction: column-reverse; }
  .shortcut-installer-guide-actions .btn-submit,
  .shortcut-installer-guide-actions .btn-cancel {
    width: 100%; justify-content: center;
  }
  .commercial-dashboard-view, .workload-view, .report-view { padding: 16px; }
  .commercial-dashboard-grid,
  .commercial-admin-grid,
  .commercial-meta-grid { grid-template-columns: 1fr; }
  .commercial-page-head { align-items: stretch; flex-direction: column; }
  .commercial-inline-form { grid-template-columns: 1fr; }
  .search-dialog { width: 95%; }
  .my-view .board, .dept-view .board, .members-view .board { flex-direction: column; overflow: visible; }
  .my-view .column, .dept-view .column, .members-view .column { max-width: 100%; min-width: unset; }
  .my-view, .dept-view, .members-view { height: auto; overflow: visible; }
  .my-view > div, .dept-view > div, .members-view > div { overflow: visible; }
  .my-view .card-list, .dept-view .card-list, .members-view .card-list { max-height: none; overflow-y: visible; flex: none; }
  .dept-overview-grid { grid-template-columns: 1fr; }
  .member-cards-grid { grid-template-columns: 1fr; }
  .members-summary-bar { flex-direction: column; gap: 8px; }
  .members-summary-bar .bar-track { width: 100%; }
  .hub-permission-row-head { grid-template-columns: 1fr; align-items: stretch; }
  .hub-permission-summary { min-width: 0; }
  .hub-permission-edit-btn { width: 100%; }
  .hub-permission-editor-grid { grid-template-columns: 1fr; }
  .hub-permission-editor-actions { align-items: stretch; flex-direction: column; }
  .hub-permission-editor-action-main { justify-content: stretch; }
  .hub-permission-editor-action-main .btn { flex: 1; justify-content: center; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  header, .btn-fab, .filter-bar, .drawer-overlay, .drawer, .modal-overlay,
  .search-overlay, .login-overlay, .toast, .notif-wrapper, .nav-tabs,
  .user-menu-wrapper, .card-footer { display: none !important; }

  body { background: #fff; color: #000; }
  .board-wrapper { margin-right: 0 !important; }
  .board { flex-direction: column; gap: 16px; }
  .column { max-width: 100%; page-break-inside: avoid; }
  .card { border: 1px solid #ccc; break-inside: avoid; box-shadow: none !important; transform: none !important; }
  .card-list { max-height: none; overflow: visible; }

  .report-card { break-inside: avoid; border: 1px solid #ccc; }
  .report-stat { border: 1px solid #eee; }
  .report-table th, .report-table td { border: 1px solid #ccc; }
}

/* ============================================================
   FOCUS VIEW (실시간 진행중 포커스)
   ============================================================ */
.focus-view {
  display: none;
  flex-direction: column;
  padding: 16px 20px 24px;
  width: 100%;
  height: calc(100vh - 64px);
  box-sizing: border-box;
  overflow: hidden;
}
.focus-view.active { display: flex; }

.focus-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 12px;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.focus-toolbar-left { display:flex; align-items:center; gap:8px; min-width:0; }
.focus-toolbar-mid  { display:flex; align-items:center; gap:8px; }
.focus-toolbar-right{ display:flex; align-items:center; gap:8px; }

.focus-title { font-size:16px; font-weight:600; color: var(--on-surface); }
.focus-count {
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}
.focus-arrow {
  width: 36px; height: 36px;
  display: inline-flex; align-items:center; justify-content:center;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 8px;
  cursor: pointer;
  color: var(--on-surface);
  transition: all .15s;
}
.focus-arrow:hover:not(:disabled) {
  background: var(--surface-variant);
  border-color: var(--primary);
}
.focus-arrow:disabled { opacity:0.35; cursor:not-allowed; }
.focus-page-indicator {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--on-surface-variant);
  min-width: 60px;
  text-align: center;
}
.focus-hidden-info {
  font-size: 12px;
  color: var(--on-surface-variant);
}
.focus-restore-btn {
  display: inline-flex; align-items:center; gap:4px;
  padding: 6px 12px;
  font-size: 13px;
  background: var(--surface-variant);
  color: var(--on-surface);
  border: 1px solid var(--outline);
  border-radius: 8px;
  cursor: pointer;
}
.focus-restore-btn:hover { background: var(--primary); color:#fff; border-color: var(--primary); }

.focus-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

.focus-card {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-top: 4px solid var(--primary);
  border-radius: 12px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  transition: all .2s;
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.focus-card.priority-high   { border-top-color: var(--danger,  #d93025); }
.focus-card.priority-medium { border-top-color: var(--warning, #f9a825); }
.focus-card.priority-low    { border-top-color: var(--success, #1e8e3e); }
.focus-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.focus-card.checkpointing { opacity: 0; transform: translateX(-12px); transition: opacity .25s, transform .25s; }

.focus-card-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}
.focus-card-header-top {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.focus-card-position {
  flex-shrink:0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.focus-card-title-wrap { flex:1; min-width: 0; }
.focus-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface);
  line-height: 1.35;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.focus-card-meta {
  display: flex; flex-wrap: wrap; gap: 4px;
  font-size: 11px;
  color: var(--on-surface-variant);
}
.focus-card-meta .tag { font-size: 10px; padding: 1px 6px; }

.focus-card-actions {
  display: flex; gap: 2px; flex-shrink: 0; align-items: center;
  margin-left: auto;
}
.focus-reorder-btn,
.focus-open-btn {
  width: 24px; height: 24px;
  display: inline-flex; align-items:center; justify-content:center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: all .15s;
}
.focus-reorder-btn:hover,
.focus-open-btn:hover {
  background: var(--surface-variant);
  border-color: var(--outline-variant);
  color: var(--on-surface);
}
.focus-reorder-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.focus-reorder-btn .material-icons-outlined,
.focus-open-btn .material-icons-outlined { font-size: 16px; }

.focus-card-body {
  display: flex; flex-direction: column; gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.focus-card-desc {
  font-size: 14px;
  color: var(--on-surface);
  line-height: 1.55;
  word-break: break-all;
}
.focus-card-desc p { margin: 0 0 8px; }
.focus-card-desc p:last-child { margin-bottom: 0; }
.focus-card-desc ul, .focus-card-desc ol { margin: 0 0 8px; padding-left: 22px; }
.focus-card-desc code {
  background: var(--surface-variant);
  padding: 1px 5px; border-radius: 4px;
  font-size: 12.5px;
}
.focus-card-desc pre {
  background: var(--surface-variant);
  padding: 8px 10px; border-radius: 6px;
  overflow-x: auto;
  font-size: 12.5px;
}
.focus-card-desc h1,
.focus-card-desc h2,
.focus-card-desc h3,
.focus-card-desc h4 {
  margin: 8px 0 4px; font-size: 15px;
}

.focus-card-checklist {
  border-top: 1px dashed var(--outline-variant);
  padding-top: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.focus-card-checklist-progress {
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.focus-card-checklist-bar {
  flex:1;
  height: 4px;
  background: var(--surface-variant);
  border-radius: 2px;
  overflow: hidden;
}
.focus-card-checklist-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width .25s;
}
.focus-cl-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--on-surface);
  padding: 3px 0;
}
.focus-cl-item.done .focus-cl-text,
.focus-cl-text.checked {
  text-decoration: line-through;
  color: var(--on-surface-variant);
}
.focus-cl-checkbox,
.focus-cl-item input[type="checkbox"] {
  width: 16px; height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.focus-cl-text {
  flex: 1; min-width: 0;
  font-size: 13px;
  color: var(--on-surface);
  font-family: inherit;
  border: none;
  background: none;
  outline: none;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: text;
  line-height: 1.4;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
  box-sizing: border-box;
  display: block;
}
.focus-cl-text:hover { background: var(--grey-50, #f8f9fa); }
.focus-cl-text:focus { background: var(--grey-100, #f3f4f6); box-shadow: inset 0 0 0 1px var(--primary, #6366f1); }
.focus-cl-item { align-items: flex-start; }
.focus-cl-actions {
  display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.focus-cl-move-btn {
  width: 24px; height: 24px; border: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--on-surface-variant); cursor: pointer;
  transition: background .15s, color .15s, opacity .15s;
}
.focus-cl-move-btn:hover:not(:disabled) {
  background: var(--surface-variant); color: var(--primary);
}
.focus-cl-move-btn:disabled {
  opacity: 0.25; cursor: not-allowed;
}
.focus-cl-move-btn .material-icons-outlined { font-size: 18px; }
.focus-cl-add-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 2px;
}
.focus-cl-add-input {
  flex: 1; min-width: 0;
  height: 28px;
  border: 1px solid var(--outline-variant);
  border-radius: 6px;
  background: var(--surface);
  color: var(--on-surface);
  padding: 0 8px;
  font-size: 12.5px;
}
.focus-cl-add-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.focus-cl-add-btn {
  width: 28px; height: 28px; border: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; cursor: pointer;
  flex-shrink: 0;
  transition: filter .15s, transform .15s;
}
.focus-cl-add-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.focus-cl-add-btn:active { transform: translateY(0); }
.focus-cl-add-btn .material-icons-outlined { font-size: 18px; }

.focus-card-footer {
  display: flex; justify-content: stretch; align-items: center; gap: 8px;
  border-top: 1px solid var(--outline-variant);
  padding-top: 10px;
  flex-shrink: 0;
}
.focus-checkpoint-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  background: var(--success, #1e8e3e);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
}
.focus-checkpoint-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.focus-checkpoint-btn:active { transform: translateY(0); }
.focus-checkpoint-btn .material-icons-outlined { font-size: 16px; }

.focus-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--on-surface-variant);
}
.focus-empty .material-icons-outlined {
  font-size: 64px;
  color: var(--grey-300, #c0c0c0);
  margin-bottom: 12px;
  display: block;
}
.focus-empty-title {
  font-size: 16px; color: var(--on-surface);
  margin: 0 0 6px;
}
.focus-empty-sub {
  font-size: 13px; margin: 0;
  color: var(--on-surface-variant);
}

@media (max-width: 1100px) {
  /* 좁은 화면(태블릿/모바일)에서는 가로 스택 → 세로 스택으로 폴백 (카드 너무 좁아짐 방지) */
  .focus-view { height: auto; overflow: visible; }
  .focus-cards { display: flex; flex-direction: column; }
  .focus-card { height: auto; max-height: none; }
  .focus-card-body { max-height: 38vh; }
}

/* ============================================================
   WORKFLOW VIEW (PDM dependency graph)
   ============================================================ */
.workflow-view {
  display: none;
  flex-direction: column;
  height: calc(100vh - 64px);
  padding: 16px 20px 20px;
  gap: 12px;
  box-sizing: border-box;
}
.workflow-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--grey-50, #f8f9fa);
  border: 1px solid var(--grey-200, #e5e7eb);
  border-radius: 10px;
}
.workflow-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.workflow-title { font-size: 15px; }
.workflow-count {
  font-size: 12px;
  color: var(--grey-500, #6b7280);
  background: #fff;
  border: 1px solid var(--grey-200, #e5e7eb);
  border-radius: 999px;
  padding: 2px 10px;
}
.workflow-progress-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  color: #047857;
  border-color: #a7f3d0;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  font-weight: 700;
}
.workflow-blocked-count {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}
.workflow-toolbar-mid {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  position: relative;
}
.workflow-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.workflow-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--grey-700, #374151);
}
.workflow-filter > select {
  padding: 4px 8px;
  border: 1px solid var(--grey-300, #d1d5db);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}
.workflow-filter-toggle {
  background: #fff;
  border: 1px solid var(--grey-300, #d1d5db);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}
.workflow-filter-toggle input { margin: 0; }
.workflow-segmented {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--grey-300, #d1d5db);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.workflow-segmented button {
  border: 0;
  border-right: 1px solid var(--grey-300, #d1d5db);
  padding: 5px 10px;
  background: transparent;
  color: var(--grey-700, #374151);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.workflow-segmented button:last-child { border-right: 0; }
.workflow-segmented button.active {
  background: var(--primary, #6366f1);
  color: #fff;
}
.workflow-history-select {
  max-width: 170px;
  padding: 4px 8px;
  border: 1px solid var(--grey-300, #d1d5db);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}
.wf-btn-connect {
  border: 1px solid #f97316;
  color: #f97316;
  background: transparent;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.wf-btn-connect:hover {
  background: rgba(249, 115, 22, 0.08);
}
.wf-btn-connect.active {
  background: #f97316;
  color: #fff;
}
.wf-connect-guide {
  position: absolute;
  z-index: 40;
  width: min(310px, 78vw);
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.45;
}
.wf-connect-guide::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 18px;
  width: 10px;
  height: 10px;
  background: #fff7ed;
  border-left: 1px solid #fdba74;
  border-top: 1px solid #fdba74;
  transform: rotate(45deg);
}
.wf-connect-guide-text { margin-right: 64px; }
.wf-connect-guide button {
  position: absolute;
  top: 7px;
  right: 8px;
  border: 0;
  border-radius: 6px;
  padding: 3px 7px;
  background: #f97316;
  color: #fff;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.workflow-hint {
  font-size: 12px;
  color: var(--grey-600, #4b5563);
  padding: 6px 12px;
  background: #fffaf0;
  border: 1px dashed #f6c177;
  border-radius: 6px;
}
.workflow-hint strong { color: #b25b00; }
.workflow-canvas {
  flex: 1 1 auto;
  min-height: 400px;
  background: #fff;
  border: 1px solid var(--grey-200, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.workflow-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-500, #6b7280);
  font-size: 14px;
  padding: 24px;
  pointer-events: none;
  text-align: center;
}
.workflow-empty-card {
  width: min(420px, 100%);
  padding: 30px 28px;
  border: 2px dashed rgba(249, 115, 22, 0.55);
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.72);
  background: color-mix(in srgb, var(--surface, #fff) 84%, #fff7ed);
  box-shadow: 0 12px 30px rgba(249, 115, 22, 0.08);
  animation: workflowEmptyPulse 2s ease-in-out infinite;
}
.workflow-empty-icon {
  display: block;
  margin-bottom: 12px;
  color: #f97316;
  font-size: 56px;
  line-height: 1;
}
.workflow-empty-card p {
  margin: 4px 0;
  color: var(--grey-700, #374151);
  font-weight: 500;
}
@keyframes workflowEmptyPulse {
  0%, 100% {
    opacity: 0.82;
    border-color: rgba(249, 115, 22, 0.42);
    box-shadow: 0 12px 30px rgba(249, 115, 22, 0.08);
  }
  50% {
    opacity: 1;
    border-color: rgba(249, 115, 22, 0.95);
    box-shadow: 0 16px 36px rgba(249, 115, 22, 0.18);
  }
}
.workflow-toolbar-left > select {
  padding: 4px 8px;
  border: 1px solid var(--grey-300, #d1d5db);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  min-width: 180px;
}
.workflow-body {
  flex: 1 1 auto;
  display: flex;
  gap: 12px;
  min-height: 0;
}
.workflow-sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--grey-50, #f8f9fa);
  border: 1px solid var(--grey-200, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
}
.workflow-sidebar-header {
  padding: 8px;
  border-bottom: 1px solid var(--grey-200, #e5e7eb);
  background: #fff;
}
.workflow-sidebar-header input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--grey-300, #d1d5db);
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
}
.workflow-sidebar-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 8px;
}
.workflow-sidebar-controls select {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--grey-300, #d1d5db);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  box-sizing: border-box;
}
.workflow-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.workflow-quick-filters label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--grey-300, #d1d5db);
  border-radius: 6px;
  background: var(--grey-50, #f8f9fa);
  font-size: 11px;
  color: var(--grey-700, #374151);
  cursor: pointer;
}
.workflow-quick-filters input {
  margin: 0;
}
.workflow-sidebar-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px;
}
.workflow-sidebar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin-bottom: 4px;
  background: #fff;
  border: 1px solid var(--grey-200, #e5e7eb);
  border-radius: 6px;
  font-size: 12px;
  cursor: grab;
  user-select: none;
}
.workflow-sidebar-item:hover { border-color: var(--primary, #6366f1); }
.workflow-sidebar-item[data-added="1"] {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--grey-50, #f8f9fa);
  border-left: 4px solid #f97316;
}
.workflow-sidebar-item .wsi-id {
  font-size: 11px;
  color: var(--grey-500, #6b7280);
  flex-shrink: 0;
}
.workflow-sidebar-item .wsi-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-sidebar-item .wsi-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.wf-added-icon {
  color: #22c55e;
  font-weight: bold;
  margin-right: 4px;
}
.workflow-sidebar-empty {
  padding: 14px;
  text-align: center;
  color: var(--grey-500, #6b7280);
  font-size: 12px;
}
.workflow-canvas-wrap {
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
}
.workflow-canvas-wrap .workflow-canvas {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}
.workflow-gantt-axis,
.workflow-lane-bands {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.workflow-gantt-axis {
  height: 30px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 11px;
  color: var(--grey-600, #4b5563);
}
.workflow-gantt-axis span {
  position: absolute;
  top: 7px;
  transform: translateX(-50%);
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.25);
  white-space: nowrap;
}
.workflow-lane-band {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(59, 130, 246, 0.05);
}
.workflow-lane-band span {
  position: absolute;
  left: 8px;
  top: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--grey-600, #4b5563);
  font-size: 11px;
}
.workflow-canvas-wrap.drag-over .workflow-canvas {
  outline: 2px dashed var(--primary, #6366f1);
  outline-offset: -4px;
}
.workflow-node-edit-popover {
  position: absolute;
  z-index: 45;
  width: 230px;
  padding: 10px;
  border: 1px solid var(--grey-200, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  color: var(--grey-900, #111827);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
  display: grid;
  gap: 8px;
}
.workflow-node-edit-popover label {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.workflow-node-edit-popover select {
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--grey-300, #d1d5db);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}
.workflow-node-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.workflow-export-wrap {
  position: relative;
}
.workflow-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: 128px;
  padding: 5px;
  border: 1px solid var(--grey-200, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}
.workflow-export-menu button {
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--grey-900, #111827);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.workflow-export-menu button:hover {
  background: var(--grey-100, #f3f4f6);
}
.workflow-edge-popover {
  position: fixed;
  z-index: 1100;
  min-width: 132px;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--grey-200, #e5e7eb);
  border-radius: 6px;
  background: #fff;
  color: var(--grey-900, #111827);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
}
.workflow-edge-popover strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  color: var(--grey-500, #6b7280);
  text-transform: uppercase;
}
.workflow-context-menu {
  position: absolute;
  z-index: 35;
  min-width: 180px;
  padding: 5px;
  border: 1px solid var(--grey-200, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  color: var(--grey-900, #111827);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}
.workflow-context-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.workflow-context-menu button:hover {
  background: var(--grey-100, #f3f4f6);
}
.workflow-context-menu .material-icons-outlined {
  color: #f97316;
  font-size: 17px;
}
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-backdrop > .modal {
  background: #fff; border-radius: 10px; min-width: 360px; max-width: 480px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
  display: flex; flex-direction: column;
}
.modal-backdrop .modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--grey-200, #e5e7eb);
}
.modal-backdrop .modal-header h3 { margin: 0; font-size: 16px; }
.modal-backdrop .modal-close {
  background: none; border: none; cursor: pointer; padding: 4px;
}
.modal-backdrop .modal-body {
  padding: 12px 16px; display: flex; flex-direction: column; gap: 10px;
}
.modal-backdrop .modal-field {
  display: flex; flex-direction: column; gap: 4px; font-size: 13px;
}
.modal-backdrop .modal-field > input,
.modal-backdrop .modal-field > select,
.modal-backdrop .modal-field > textarea {
  padding: 6px 10px; border: 1px solid var(--grey-300, #d1d5db);
  border-radius: 6px; font-size: 13px; font-family: inherit;
}
.modal-backdrop .modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--grey-200, #e5e7eb);
}
.btn-primary {
  background: var(--primary, #6366f1); color: #fff;
  border: none; border-radius: 6px; padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.btn-primary:hover { filter: brightness(0.95); }


/* ============================================================
   WORKFLOW & MODAL — DARK MODE OVERRIDES
   ============================================================ */
html[data-theme='dark'] .wf-btn-connect {
  border-color: #fb923c;
  color: #fb923c;
  background: transparent;
}
html[data-theme='dark'] .wf-btn-connect.active {
  background: #f97316;
  border-color: #f97316;
  color: #111827;
}
html[data-theme='dark'] .wf-connect-guide {
  background: #3a2412;
  color: #fed7aa;
  border-color: #9a3412;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
}
html[data-theme='dark'] .wf-connect-guide::before {
  background: #3a2412;
  border-color: #9a3412;
}
html[data-theme='dark'] .wf-connect-guide button {
  color: #111827;
}
html[data-theme='dark'] .wf-added-icon {
  color: #4ade80;
}
[data-theme="dark"] .workflow-sidebar-header {
  background: var(--grey-50, #292a2d);
  border-bottom-color: var(--grey-200, #3c4043);
}
[data-theme="dark"] .workflow-sidebar-header input,
[data-theme="dark"] #workflow-task-search {
  background: var(--surface-variant, #292a2d);
  color: var(--grey-800, #e8eaed);
  border-color: var(--grey-300, #5f6368);
}
[data-theme="dark"] .workflow-sidebar-controls select,
[data-theme="dark"] .workflow-filter > select,
[data-theme="dark"] .workflow-history-select,
[data-theme="dark"] #workflow-layout-dropdown,
[data-theme="dark"] #workflow-grouping-dropdown {
  background: var(--surface-variant, #292a2d);
  color: var(--grey-800, #e8eaed);
  border-color: var(--grey-300, #5f6368);
}
[data-theme="dark"] .workflow-segmented {
  background: var(--surface-variant, #292a2d);
  border-color: var(--grey-300, #5f6368);
}
[data-theme="dark"] .workflow-segmented button {
  color: var(--grey-800, #e8eaed);
  border-color: var(--grey-300, #5f6368);
}
[data-theme="dark"] .workflow-progress-badge {
  background: #052e1c;
  color: #a7f3d0;
  border-color: #047857;
}
[data-theme="dark"] .workflow-blocked-count {
  background: #3f1111;
  color: #fecaca;
  border-color: #991b1b;
}
[data-theme="dark"] .workflow-quick-filters label {
  background: var(--surface-variant, #292a2d);
  color: var(--grey-800, #e8eaed);
  border-color: var(--grey-300, #5f6368);
}
[data-theme="dark"] #workflow-task-search:focus {
  border-color: var(--primary, #8ab4f8);
  outline: none;
}
[data-theme="dark"] #workflow-selector {
  background: var(--surface-variant, #292a2d);
  color: var(--grey-800, #e8eaed);
  border-color: var(--grey-300, #5f6368);
}
[data-theme="dark"] #workflow-selector:focus {
  border-color: var(--primary, #8ab4f8);
  outline: none;
}
html[data-theme='dark'] .workflow-canvas {
  background: #1a1a1d;
}
html[data-theme='dark'] .workflow-empty-card {
  background: rgba(58, 36, 18, 0.48);
  border-color: rgba(251, 146, 60, 0.62);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}
html[data-theme='dark'] .workflow-empty-card p {
  color: var(--on-surface, #e8eaed);
}
html[data-theme='dark'] .workflow-empty-icon {
  color: #fb923c;
}
html[data-theme='dark'] .workflow-context-menu {
  background: var(--surface, #1e1f21);
  color: var(--on-surface, #e8eaed);
  border-color: var(--grey-200, #3c4043);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
}
html[data-theme='dark'] .workflow-context-menu button:hover {
  background: var(--surface-variant, #292a2d);
}
html[data-theme='dark'] .workflow-edge-popover {
  background: var(--surface, #1e1f21);
  color: var(--on-surface, #e8eaed);
  border-color: var(--grey-200, #3c4043);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
html[data-theme='dark'] .workflow-edge-popover strong {
  color: var(--grey-500, #9aa0a6);
}
html[data-theme='dark'] .workflow-node-edit-popover,
html[data-theme='dark'] .workflow-export-menu {
  background: var(--surface, #1e1f21);
  color: var(--on-surface, #e8eaed);
  border-color: var(--grey-200, #3c4043);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
}
html[data-theme='dark'] .workflow-node-edit-popover select {
  background: var(--surface-variant, #292a2d);
  color: var(--on-surface, #e8eaed);
  border-color: var(--grey-300, #5f6368);
}
html[data-theme='dark'] .workflow-export-menu button {
  color: var(--on-surface, #e8eaed);
}
html[data-theme='dark'] .workflow-export-menu button:hover {
  background: var(--surface-variant, #292a2d);
}
html[data-theme='dark'] .workflow-gantt-axis span,
html[data-theme='dark'] .workflow-lane-band span {
  background: rgba(30, 31, 33, 0.86);
  color: var(--on-surface, #e8eaed);
}
[data-theme="dark"] .workflow-hint {
  background: #3a2e1a;
  color: #fde68a;
  border-color: #78350f;
}
[data-theme="dark"] .workflow-hint strong {
  color: #f59e0b;
}
[data-theme="dark"] .workflow-sidebar-item {
  background: var(--surface-variant, #292a2d);
  border-color: var(--grey-200, #3c4043);
  color: var(--grey-800, #e8eaed);
}
[data-theme="dark"] .workflow-sidebar-item:hover {
  border-color: var(--primary, #8ab4f8);
}
[data-theme="dark"] .workflow-sidebar-item[data-added="1"] {
  background: var(--grey-50, #292a2d);
  color: var(--grey-500, #9aa0a6);
  border-left-color: #f97316;
}
[data-theme="dark"] .workflow-sidebar-item .wsi-id {
  color: var(--grey-500, #9aa0a6);
}
[data-theme="dark"] .modal-backdrop > .modal {
  background: var(--surface, #1e1f21);
  color: var(--on-surface, #e8eaed);
  box-shadow: var(--shadow-4, 0 8px 16px rgba(0,0,0,0.5));
}
[data-theme="dark"] .modal-backdrop .modal-header {
  border-bottom-color: var(--grey-200, #3c4043);
}
[data-theme="dark"] .modal-backdrop .modal-close {
  color: var(--grey-500, #9aa0a6);
}
[data-theme="dark"] .modal-backdrop .modal-field > input,
[data-theme="dark"] .modal-backdrop .modal-field > select,
[data-theme="dark"] .modal-backdrop .modal-field > textarea {
  background: var(--surface-variant, #292a2d);
  color: var(--grey-800, #e8eaed);
  border-color: var(--grey-300, #5f6368);
}
[data-theme="dark"] .modal-backdrop .modal-field > input:focus,
[data-theme="dark"] .modal-backdrop .modal-field > select:focus,
[data-theme="dark"] .modal-backdrop .modal-field > textarea:focus {
  border-color: var(--primary, #8ab4f8);
  outline: none;
}
[data-theme="dark"] .modal-backdrop .modal-actions {
  border-top-color: var(--grey-200, #3c4043);
}

/* ============================================================
   관리자 보기 모드 (impersonation) 배너 / 멤버 카드 버튼
   ============================================================ */
.impersonation-banner {
  position: sticky;
  top: var(--header-offset, 64px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #fef7e0;
  color: #b06000;
  border-bottom: 1px solid #fbbc04;
  font-size: 13px;
  font-weight: 500;
}
.impersonation-banner.flash { animation: impersonation-flash 0.6s ease-in-out 2; }
@keyframes impersonation-flash {
  0%, 100% { background: #fef7e0; }
  50% { background: #fcd9a3; }
}
.impersonation-banner-main {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.impersonation-banner-hint { font-size: 12px; font-weight: 500; opacity: 0.9; }
.impersonation-banner .material-icons-outlined { font-size: 18px; color: #b06000; }
.btn-impersonation-exit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid #b06000;
  border-radius: 999px;
  background: transparent;
  color: #b06000;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-impersonation-exit:hover { background: rgba(176, 96, 0, 0.08); }
[data-theme="dark"] .impersonation-banner { background: rgba(251, 188, 4, 0.18); color: #fdd663; border-bottom-color: rgba(251, 188, 4, 0.4); }
[data-theme="dark"] .impersonation-banner .material-icons-outlined { color: #fdd663; }
[data-theme="dark"] .btn-impersonation-exit { color: #fdd663; border-color: #fdd663; }
[data-theme="dark"] .btn-impersonation-exit:hover { background: rgba(253, 214, 99, 0.12); }

@media (max-width: 640px) {
  .impersonation-banner { align-items: stretch; flex-direction: column; padding: 10px 12px; }
  .impersonation-banner-main { align-items: flex-start; }
  .btn-impersonation-exit { align-self: stretch; justify-content: center; }
}

.btn-view-as {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  margin-top: 8px;
  border: 1px solid var(--outline-variant);
  border-radius: 999px;
  background: var(--surface);
  color: var(--on-surface);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.btn-view-as:hover { border-color: var(--primary); color: var(--primary); }
.btn-view-as .material-icons-outlined { font-size: 14px; }
.member-profile-card.has-view-as { position: relative; }
.cap-admin-hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--on-surface-variant);
  font-style: italic;
}
.members-summary-bar.admin-aggregate .bar-label:first-child {
  color: #b06000;
  font-weight: 600;
}
[data-theme="dark"] .members-summary-bar.admin-aggregate .bar-label:first-child { color: #fdd663; }

/* ── 허브 구성원 관리 모달: 앱 내부 역할(3층) 섹션 ─────────────────────
   2026-08-08. 입장 권한은 위쪽 편집기, 역할은 여기. 저장 API 가 달라 폼 밖에 둔다. */
.hub-role-section { margin-top: 18px; border-top: 1px solid var(--outline-variant, #e3e6ea); padding-top: 14px; }
.hub-role-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.hub-role-head strong { font-size: 14px; }
.hub-role-head span { font-size: 12px; color: var(--on-surface-variant, #6b7280); }
.hub-role-loading, .hub-role-empty { font-size: 13px; color: var(--on-surface-variant, #6b7280); padding: 6px 0; }
.hub-role-empty small { display: block; margin-top: 4px; opacity: .85; }
.hub-role-item { border: 1px solid var(--outline-variant, #e3e6ea); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.hub-role-item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hub-role-item-head code { font-size: 11px; background: var(--surface-variant, #eef1f6); padding: 1px 5px; border-radius: 4px; margin-left: 6px; }
.hub-role-count { font-size: 12px; color: var(--on-surface-variant, #6b7280); }
.hub-role-note { font-size: 11.5px; color: var(--on-surface-variant, #6b7280); margin-top: 3px; }
.hub-role-add { display: flex; gap: 6px; margin: 8px 0 6px; }
.hub-role-add input { flex: 1; min-width: 140px; padding: 6px 9px; font-size: 13px;
  border: 1px solid var(--outline-variant, #e3e6ea); border-radius: 6px; }
.hub-role-add button { padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 0; border-radius: 6px; background: var(--primary, #1f4fd8); color: #fff; }
.hub-role-members { display: flex; flex-wrap: wrap; gap: 6px; }
.hub-role-none { font-size: 12px; color: var(--on-surface-variant, #6b7280); }
.hub-role-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  background: var(--surface-variant, #eef1f6); border-radius: 999px; padding: 3px 6px 3px 10px; }
.hub-role-chip button { border: 0; background: transparent; cursor: pointer; font-size: 14px; line-height: 1;
  color: var(--error, #a11d1d); padding: 0 4px; }
.hub-role-chip.readonly { padding: 3px 10px; opacity: .8; }
.hub-role-owned { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hub-role-owned > span:first-child { font-size: 11.5px; color: var(--on-surface-variant, #6b7280); }
.hub-role-grants { font-size: 12px; color: var(--on-surface, #1f2328); margin-top: 5px;
  background: var(--surface-variant, #f5f6f8); border-radius: 6px; padding: 6px 9px; line-height: 1.5; }
.hub-role-grants b { font-size: 11px; color: var(--on-surface-variant, #6b7280); margin-right: 5px; }
.hub-role-grants.missing { color: var(--on-surface-variant, #6b7280); font-style: italic; background: transparent; padding: 4px 0; }
.hub-role-impact { font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: 1px; }
.hub-role-impact.external { background: #fbeaea; color: #a11d1d; }
.hub-role-impact.write { background: #fdf3dd; color: #8a5a00; }
.hub-role-impact.read { background: #eef1f6; color: #6b7280; }
.hub-role-default { border: 1px dashed var(--outline-variant, #d6e0fb); background: #f0f4ff;
  border-radius: 8px; padding: 9px 12px; margin-bottom: 10px; font-size: 12.5px; color: #243a7a; }
.hub-role-default b { font-size: 11px; color: #4a5a8a; margin-right: 4px; }
.hub-role-default-name { font-weight: 700; margin-left: 4px; }
.hub-role-default-grants { margin-top: 4px; color: #33406b; line-height: 1.5; }
.hub-role-default.missing { border-color: #f0d9a8; background: #fdf3dd; color: #8a5a00; font-style: italic; }

/* ============================================================
   AUTOMATION MAP VIEW (업무 자동화 지도)
   ============================================================ */
.automap-view {
  padding: 20px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: calc(100vh - var(--header-offset) - var(--runtime-banner-height));
  box-sizing: border-box;
}
.automap-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.automap-title-wrap h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--on-surface);
}
.automap-title-wrap p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--on-surface-variant);
}
.automap-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.automap-controls select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--on-surface);
  font-size: 13px;
}
.automap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--on-surface-variant);
  cursor: pointer;
  user-select: none;
}
.automap-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.automap-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--on-surface-variant);
}
.automap-legend-sep {
  width: 1px;
  height: 16px;
  background: var(--outline-variant);
}
.automap-updated { margin-left: auto; font-size: 12px; color: var(--on-surface-variant); }
.automap-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--outline-variant);
  background: var(--surface-variant);
  font-size: 12px;
  color: var(--on-surface);
}
.automap-chip i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.automap-chip b { font-weight: 700; }
.automap-chip-done i { background: #16a34a; }
.automap-chip-partial i { background: #d97706; }
.automap-chip-none i { background: #dc2626; }
.automap-chip-unknown i { background: #6b7280; }
.automap-chip-break i { background: #dc2626; border: 2px dashed #dc2626; background: transparent; }

.automap-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  padding-bottom: 20px;
}
.automap-canvas-wrap {
  position: relative;
  min-height: 0;
  border: 1px solid var(--outline-variant);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.automap-canvas { position: absolute; inset: 0; }
.automap-empty,
.automap-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--on-surface-variant);
  font-size: 14px;
  text-align: center;
  padding: 24px;
}

.automap-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--outline-variant);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.automap-side-tabs {
  display: flex;
  border-bottom: 1px solid var(--outline-variant);
  flex: 0 0 auto;
}
.automap-side-tab {
  flex: 1;
  padding: 11px 8px;
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.automap-side-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.automap-side-tab b {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-variant);
  font-size: 11px;
}
.automap-side-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}
.automap-side-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--on-surface-variant);
  font-size: 13px;
}

.automap-gap {
  padding: 10px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.automap-gap:hover {
  border-color: var(--primary);
  background: var(--surface-variant);
}
.automap-gap-head { display: flex; gap: 8px; align-items: flex-start; }
.automap-gap-index {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.automap-gap-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
  line-height: 1.4;
}
.automap-gap-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0 28px;
  font-size: 11px;
  color: var(--on-surface-variant);
}
.automap-gap-lane {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-variant);
}
.automap-gap-impact {
  margin: 6px 0 0 28px;
  font-size: 12px;
  color: var(--on-surface-variant);
  line-height: 1.5;
}
.automap-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.automap-dot-done { background: #16a34a; }
.automap-dot-partial { background: #d97706; }
.automap-dot-none { background: #dc2626; }
.automap-dot-unknown { background: #6b7280; }

.automap-detail { padding: 4px 4px 12px; }
.automap-detail-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.4;
  margin-bottom: 8px;
}
.automap-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.automap-badge {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--outline-variant);
  background: var(--surface-variant);
  font-size: 11px;
  color: var(--on-surface-variant);
}
.automap-badge-warn {
  border-color: #d97706;
  color: #b45309;
}
.automap-detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 0;
  border-top: 1px solid var(--outline-variant);
}
.automap-detail-key {
  font-size: 11px;
  font-weight: 700;
  color: var(--on-surface-variant);
  letter-spacing: 0.02em;
}
.automap-detail-value {
  font-size: 13px;
  color: var(--on-surface);
  line-height: 1.6;
  word-break: break-word;
}
.automap-live {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  margin: 2px 4px 2px 0;
  border: 1px solid var(--outline-variant);
}
.automap-live-ok { border-color: #16a34a; color: #15803d; }
.automap-live-error { border-color: #dc2626; color: #b91c1c; font-weight: 700; }
.automap-live-unknown,
.automap-live-disabled,
.automap-live-desktop { color: var(--on-surface-variant); }

@media (max-width: 1200px) {
  .automap-body { grid-template-columns: minmax(0, 1fr); }
  .automap-side { max-height: 320px; }
}

/* ============================================================
   첫 실행 화면 안내(온보딩 투어) — onboarding-tour.js, 2026-09-27
   ============================================================ */
#tm-tour { position: fixed; inset: 0; z-index: 2147483000; font-family: inherit; }
#tm-tour .tm-tour-shade { position: absolute; inset: 0; background: transparent; }
#tm-tour.is-center .tm-tour-shade { background: rgba(15, 23, 42, 0.55); }
#tm-tour .tm-tour-spot {
  position: fixed; display: none; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55), 0 0 0 3px var(--primary);
  transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease;
}
#tm-tour .tm-tour-card {
  position: fixed; width: min(360px, calc(100vw - 24px)); box-sizing: border-box;
  background: var(--surface); color: var(--on-surface); border-radius: 14px; padding: 18px 18px 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); border: 1px solid var(--outline-variant);
}
#tm-tour.is-center .tm-tour-card { left: 50% !important; top: 50% !important; bottom: auto !important; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 24px)); text-align: center; padding: 26px 24px 18px; }
#tm-tour.is-narrow:not(.is-center) .tm-tour-card { left: 12px !important; right: 12px; width: auto; }
#tm-tour .tm-tour-icon { font-size: 40px; line-height: 1; margin-bottom: 10px; }
#tm-tour .tm-tour-title { font-size: 17px; font-weight: 800; margin-bottom: 8px; color: var(--on-surface); }
#tm-tour .tm-tour-body { font-size: 14px; line-height: 1.6; color: var(--on-surface-variant); word-break: keep-all; }
#tm-tour .tm-tour-body b { color: var(--on-surface); }
#tm-tour .tm-tour-dots { display: flex; justify-content: center; gap: 5px; margin: 14px 0 12px; }
#tm-tour .tm-tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--outline-variant); }
#tm-tour .tm-tour-dot.on { width: 18px; border-radius: 3px; background: var(--primary); }
#tm-tour .tm-tour-actions { display: flex; align-items: center; gap: 8px; }
#tm-tour .tm-tour-spacer { flex: 1; }
#tm-tour .tm-tour-btn {
  border: 1px solid var(--outline-variant); background: var(--surface); color: var(--on-surface);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
#tm-tour .tm-tour-btn.ghost { border-color: transparent; color: var(--on-surface-variant); padding-left: 4px; padding-right: 4px; }
#tm-tour .tm-tour-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] #tm-tour .tm-tour-btn.primary { color: #0b1220; }
#tm-tour .tm-tour-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { #tm-tour .tm-tour-spot { transition: none; } }
