:root {
  color-scheme: only light;
  --background: #ffffff;
  --foreground: #191919;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-strong: #f1f5f9;
  --control: #f9fafb;
  --control-hover: #f3f4f6;
  --line: #e5e7eb;
  --line-strong: #cbd5e1;
  --muted: #62666d;
  --subtle: #9b9a97;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --red: #a23a31;
  --red-soft: #fbefed;
  --green: #2d7554;
  --green-soft: #eef7f2;
  --amber: #8b5a16;
  --amber-soft: #fbf3e7;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: var(--font-regular);
  letter-spacing: 0;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.48; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(23, 23, 23, 0.18);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  min-width: 0;
  background: var(--background);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: var(--background);
  padding: 24px;
}
.login-screen[hidden] { display: none; }
.login-panel {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 22px;
}
.login-panel h1 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.2;
}
.login-panel p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.rail {
  position: sticky;
  top: 0;
  display: flex;
  width: 252px;
  height: 100vh;
  flex: 0 0 252px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fbfbfa;
  padding: 12px;
}

.brand {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  min-height: 58px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--foreground);
  padding: 4px 8px 14px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
  font-weight: var(--font-semibold);
}
.brand-product {
  display: grid;
  min-width: 0;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-medium);
}
.brand-product strong {
  overflow: hidden;
  color: var(--foreground);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: var(--font-semibold);
}

.rail-nav {
  display: grid;
  align-content: start;
  gap: 2px;
  margin-top: 14px;
}
.rail-nav a {
  display: flex;
  height: 36px;
  align-items: center;
  border-radius: 6px;
  color: var(--muted);
  padding: 0 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: var(--font-medium);
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.rail-nav a::before {
  content: attr(data-nav-icon);
  width: 24px;
  color: var(--subtle);
  font-size: 12px;
}
.rail-nav a.active,
.rail-nav a:hover {
  background: var(--surface-strong);
  color: var(--foreground);
}
.rail-nav a:active { opacity: 0.76; }

.rail-menu { flex: 1; min-height: 0; overflow-y: auto; }
.rail-menu > .rail-logout { margin-top: 12px; }
.rail-admin-nav {
  display: grid;
  align-content: start;
  gap: 2px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.rail-admin-nav[hidden] { display: none; }
.rail-section-label {
  color: var(--subtle);
  padding: 0 10px 4px;
  font-size: 11px;
  font-weight: var(--font-semibold);
}
.rail-admin-nav a {
  display: flex;
  height: 36px;
  align-items: center;
  border-radius: 6px;
  color: var(--muted);
  padding: 0 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: var(--font-medium);
}
.rail-admin-nav a::before {
  content: attr(data-nav-icon);
  width: 24px;
  color: var(--subtle);
  font-size: 12px;
}
.rail-admin-nav a.active,
.rail-admin-nav a:hover {
  background: var(--surface-strong);
  color: var(--foreground);
}

.rail-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 8px;
}
.presence-bubble-slot { min-height: 82px; display: flex; align-items: flex-end; padding: 4px 2px 16px; }
.presence-bubble { position: relative; width: 100%; padding: 10px 12px; border: 1px solid #bcded2; border-radius: 8px; background: #edf8f2; color: #245441; font-size: 12px; line-height: 1.6; text-align: center; overflow-wrap: anywhere; }
.presence-bubble::after { content: ''; position: absolute; bottom: -6px; left: 20px; width: 10px; height: 10px; border-right: 1px solid #bcded2; border-bottom: 1px solid #bcded2; background: #edf8f2; transform: rotate(45deg); }
.rail-footer .team-presence { border-top: 1px solid var(--line); }
.cheer-heart-layer { position: fixed; inset: 0; z-index: 10000; pointer-events: none; overflow: hidden; }
.cheer-floating-heart { position: absolute; bottom: -60px; left: var(--heart-left); font-size: var(--heart-size); line-height: 1.2; opacity: 0; animation: cheer-heart-rise 3.4s ease-out var(--heart-delay) both; }
@keyframes cheer-heart-rise {
  0% { opacity: 0; transform: translate(0,0) scale(.7); }
  12% { opacity: 1; }
  72% { opacity: .85; }
  100% { opacity: 0; transform: translate(var(--heart-drift),-75vh) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) { .cheer-heart-layer { display: none; } }
.rail-logout {
  display: flex;
  width: 100%;
  height: 36px;
  align-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: var(--font-medium);
  text-align: left;
}
.rail-logout::before {
  content: attr(data-nav-icon);
  width: 24px;
  color: var(--subtle);
  font-size: 14px;
}
.rail-logout:hover {
  background: var(--surface-strong);
  color: var(--foreground);
}

.main-shell {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--background) 96%, transparent);
  backdrop-filter: blur(14px);
}
.topbar-inner {
  display: flex;
  width: 100%;
  max-width: 1360px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 16px 28px;
}
.topbar h1 {
  margin: 3px 0 0;
  font-size: 28px;
  font-weight: var(--font-semibold);
  line-height: 1.15;
}
.topbar p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.small-label,
.block-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-semibold);
  line-height: 1.35;
}
.workspace {
  display: grid;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 28px 36px;
}
.view-page { display: none; min-width: 0; }
.view-page[hidden] { display: none !important; }
.view-page.active {
  display: grid;
  gap: 14px;
  animation: pageIn 0.14s ease-out;
}
.calendar-home {
  min-width: 0;
  background: var(--surface);
  overflow-x: auto;
  overflow-y: hidden;
}
#calendarAssignee { width: 180px; max-width: 100%; height: 40px; }
.calendar-actions { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.calendar-toolbar {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 0;
  padding: 8px 0 16px;
}
.calendar-kicker {
  margin: 0 0 3px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: var(--font-semibold);
}
.calendar-toolbar h2 {
  margin: 0;
  font-size: 20px;
  font-weight: var(--font-semibold);
  line-height: 1.2;
}
.calendar-actions,
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.calendar-weekdays,
.month-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 760px;
}
.calendar-weekdays {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.calendar-weekdays span {
  padding: 8px 10px 12px;
  color: var(--subtle);
  text-align: center;
  font-size: 12px;
  font-weight: var(--font-semibold);
}
.calendar-weekdays span:first-child { color: var(--red); }
.calendar-weekdays span:last-child { color: var(--blue); }
.month-calendar { display: block; overflow: hidden; }
.calendar-week { position: relative; isolation:isolate; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-week:not(:last-child) { border-bottom: 1px solid var(--line); }
.calendar-week .calendar-events { margin-top: var(--period-space, 0px); }
.calendar-periods { position: absolute; inset: 40px 0 auto; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: 30px; row-gap: 4px; pointer-events: none; }
.calendar-week .calendar-periods { top:calc(var(--upload-header,24px) + 16px); z-index:2; }
.calendar-week .calendar-events, .calendar-week .calendar-date { position:relative; z-index:1; }
.footage-folder-link { display:inline-flex; margin-top:8px; width:fit-content; text-decoration:none; }
.nas-link-add { grid-column:1 / -1; justify-self:start; }
.nas-link-add[hidden] { display:none !important; }
.calendar-week .calendar-date { display:flex; justify-content:space-between; align-items:flex-start; min-height:var(--upload-header,24px); gap:4px; }
.calendar-date time { flex-shrink:0; }
.upload-day-channels { flex:1; min-width:0; display:grid; }
.upload-day-channels button { display:block; width:100%; height:24px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:0; border:0; background:transparent; color:#243a42; font:inherit; font-size:11px; font-weight:600; text-align:left; cursor:pointer; }
.upload-day-channels button:hover { text-decoration:underline; }
#addUploadSchedule[hidden] { display:none !important; }
.campaign-insight-editor { border-top:1px solid var(--line); padding-top:16px; }
.campaign-insight-editor [hidden] { display:none !important; }
.manual-metrics [hidden] { display:none !important; }
.campaign-insight-editor #insightCapturePanel { margin-top:12px; }
.insight-paste-area { padding:16px; margin:12px 0; border:1px dashed var(--line-strong); border-radius:6px; overflow-wrap:anywhere; }
.insight-paste-area:focus { outline:2px solid var(--green); }
.insight-warning { color:#975312; }
#insightCapturePreview .btn { margin-top:12px; }
#insightCaptureHistory { font-size:12px; overflow-wrap:anywhere; }
#insightCaptureHistory > div { padding:8px 0; border-bottom:1px solid var(--line); }
#campaignHighlights { display:block; }
.nas-links-editor h4 { margin:0 0 10px; font-size:14px; }
.nas-link-rows { display:grid; gap:8px; margin-bottom:10px; }
.nas-link-row { display:grid; grid-template-columns:minmax(0,1fr) 36px; gap:8px; align-items:center; }
.footage-folder-link { margin:8px 8px 0 0; }
#aiChat { background:var(--surface); border:1px solid var(--line); }
.ai-chat-layout { display:grid; grid-template-columns:220px minmax(0,1fr); min-height:620px; }
.chat-history { border-right:1px solid var(--line); padding:18px 12px; background:#f7f9fb; }
.chat-history h3 { font-size:13px; margin:24px 0 12px; }
#chatHistoryList { max-height:65vh; overflow:auto; }
#chatHistoryList button { width:100%; text-align:left; border:0; border-bottom:1px solid var(--line); padding:12px 8px; background:none; color:inherit; cursor:pointer; }
#chatHistoryList button[aria-pressed=true] { background:#e8f5f1; }
#chatHistoryList strong { display:block; font-size:13px; overflow-wrap:anywhere; }
#chatHistoryList small { color:var(--muted); font-size:11px; }
.chat-main { min-width:0; display:flex; flex-direction:column; }
.chat-context { display:grid; grid-template-columns:1fr 1fr 2fr 150px; gap:12px; padding:18px; border-bottom:1px solid var(--line); }
.chat-context label { min-width:0; font-size:12px; color:var(--muted); display:grid; gap:6px; }
.chat-context select,.chat-context input { width:100%; min-width:0; }
.chat-messages { flex:1; min-height:300px; max-height:65vh; overflow:auto; padding:24px; }
.chat-empty { display:grid; place-items:center; min-height:260px; color:var(--muted); }
.chat-turn { border-bottom:1px solid var(--line); margin-bottom:24px; padding-bottom:24px; }
.chat-turn h3 { margin:0 0 10px; font-size:14px; }
.chat-turn h3 small { font-weight:400; color:var(--muted); font-size:11px; }
.chat-user { border-left:3px solid #74b6ab; padding:8px 16px; margin-bottom:24px; background:#f1f8f5; }
.chat-user p,.chat-answer { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.8; font-size:14px; margin:0; }
.chat-assistant { padding:0 16px; }
.chat-copy { margin-top:12px; }
.chat-sources { margin-top:16px; color:var(--muted); font-size:12px; }
.chat-source { display:block; border:0; background:none; color:var(--blue); text-align:left; padding:6px 0; cursor:pointer; overflow-wrap:anywhere; }
.chat-status { margin:0; padding:0 20px 12px; color:var(--muted); font-size:13px; }
.chat-status:empty { display:none; }
.chat-composer { border-top:1px solid var(--line); display:grid; grid-template-columns:minmax(0,1fr) 80px; gap:12px; padding:18px; align-items:end; }
.chat-composer textarea { min-height:76px; max-height:180px; resize:vertical; }
.chat-composer button { height:40px; }
@media(max-width:1100px) { .chat-context { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:760px) { .ai-chat-layout { grid-template-columns:1fr; } .chat-history { border-right:0; border-bottom:1px solid var(--line); } #chatHistoryList { max-height:140px; } .chat-history h3 { margin:12px 0; } .chat-messages { padding:16px; } .chat-composer { padding:12px; } }
#campaignHighlights .campaign-ranking-note { display:inline-block; margin-left:8px; font-size:12px; font-weight:400; color:var(--muted); }
.campaign-title-link { border:0; padding:0; background:none; color:inherit; font:inherit; font-weight:600; text-align:left; cursor:pointer; overflow-wrap:anywhere; }
.campaign-title-link:hover { text-decoration:underline; }
.campaign-title-link:focus-visible { outline:2px solid var(--blue); outline-offset:3px; }
#campaignHighlights .campaign-cumulative { margin-top:32px; border-top:5px solid var(--line); padding:24px 0 8px; }
#campaignHighlights .campaign-cumulative-heading { margin:0 0 20px; font-size:17px; }
#campaignHighlights .campaign-cumulative-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; background:#f7f9fb; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
#campaignHighlights .campaign-compact { min-width:0; }
.campaign-compact ol { padding-left:24px; margin:0; }
.campaign-compact li { padding:10px 0; overflow-wrap:anywhere; border-bottom:1px solid var(--line); font-size:14px; }
.campaign-recent-rest { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:16px; padding-left:0; list-style-position:inside; margin:16px 0 0; }
.campaign-recent-rest:empty { display:none; }
.campaign-recent-rest li { padding:16px 12px; min-width:0; background:#f7f9fb; border-top:2px solid #dce7ee; line-height:1.7; }
.campaign-recent-rest h4 { display:inline; font-size:14px; font-weight:500; overflow-wrap:anywhere; margin:0; }
.campaign-recent-rest strong, .campaign-compact li strong { display:inline; margin-left:8px; white-space:nowrap; }
#campaigns > .workbench { display:block; }
#campaigns > .workbench > .panel + .panel { margin-top:24px; }
.campaign-month { border-top:1px solid var(--line); }
.campaign-month summary { padding:18px 20px; cursor:pointer; background:var(--surface); }
.campaign-month summary span { display:inline-block; margin-left:16px; color:var(--muted); font-size:13px; }
.campaign-month-empty { padding:16px 20px; }
#campaignsTable .data-table { table-layout:fixed; width:100%; min-width:1050px; }
#campaignsTable .data-table th:nth-child(2) { width:18%; }
#campaignsTable .data-table th:nth-child(3) { width:9%; }
#campaignsTable .data-table th:nth-child(4) { width:112px; }
#campaignsTable .data-table th:nth-child(5) { width:90px; text-align:right; }
#campaignsTable .data-table th:nth-child(6) { width:110px; }
#campaignsTable .data-table th:nth-child(7) { width:190px; }
#campaignsTable .data-table td { overflow-wrap:anywhere; }
#campaignsTable .campaign-actions .row-actions { flex-wrap:nowrap; }
@media (max-width:760px) { #campaignHighlights .campaign-cumulative-grid { grid-template-columns:1fr; gap:0; } }
#campaignHighlights .campaign-ranking { border:0; border-bottom:1px solid var(--line); border-radius:0; padding:16px 0; }
#campaignHighlights .campaign-ranking.campaign-recent { border-bottom:0; }
#campaignHighlights .campaign-recent > h3 { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 12px; margin:0 0 20px; font-size:17px; }
#campaignHighlights .campaign-ranking-note { margin-left:0; }
#campaignHighlights .campaign-compact { padding:20px 16px; border:0; }
#campaignHighlights .campaign-compact + .campaign-compact { border-left:1px solid var(--line); }
#campaignHighlights .campaign-compact h3 { padding-bottom:12px; margin-bottom:4px; border-bottom:2px solid #71b6ad; font-size:14px; }
#campaignHighlights .campaign-compact li { line-height:1.65; padding:12px 0; }
#campaignHighlights .campaign-compact li:last-child { border-bottom:0; }
@media (max-width:760px) { #campaignHighlights .campaign-compact + .campaign-compact { border-left:0; border-top:1px solid var(--line); } }
.campaign-ranking .campaign-top-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); align-items:start; gap:16px; padding:0; border:0; }
.campaign-top-item { min-width:0; border:1px solid var(--line); border-radius:6px; overflow:hidden; background:var(--surface); }
.campaign-top-item header { display:grid; grid-template-columns:20px minmax(0,1fr) auto; gap:8px; align-items:start; padding:12px; height:72px; box-sizing:border-box; }
.campaign-top-item h4 { margin:0; font-size:13px; line-height:20px; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.campaign-embed, .campaign-embed.youtube { display:block; width:100%; height:360px; aspect-ratio:auto; border:0; background:#fafafa; }
.campaign-original-link { display:block; padding:12px; font-size:13px; background:#f7f9fb; border-top:1px solid var(--line); }
.upload-month-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:16px 0; }
.upload-month-summary button { display:flex; flex-direction:column; align-items:flex-start; gap:5px; padding:12px; min-width:0; border:1px solid var(--line); border-radius:6px; background:var(--surface); color:var(--foreground); font:inherit; cursor:pointer; text-align:left; }
.upload-month-summary button[aria-pressed="true"] { outline:2px solid #369d8d; outline-offset:-2px; }
.upload-month-summary span, .upload-month-summary small { color:var(--muted); font-size:12px; }
.upload-month-status { margin:16px 0; font-size:14px; }
.upload-date-picker { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; margin-bottom:20px; }
.upload-date-picker > span { text-align:center; font-size:12px; }
.upload-date-picker button { height:52px; min-width:0; padding:3px; border:1px solid var(--line); border-radius:4px; background:var(--surface); color:var(--foreground); font:inherit; cursor:pointer; }
.upload-date-picker button small { display:block; font-size:10px; }
.upload-date-picker button[aria-pressed="true"] { background:#dff3e9; border-color:#369d8d; }
.upload-date-picker button.registered { background:#f0f2f2; opacity:1; color:#65706b; }
.upload-date-picker button:disabled { cursor:default; }
.upload-month-list > div { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:10px 0; border-bottom:1px solid var(--line); }
.upload-month-list strong { margin-right:auto; }
.upload-visibility-switch { display:inline-flex; align-items:center; justify-content:center; gap:8px; height:36px; padding:0 8px; border:0; background:transparent; color:var(--text,#222); font:inherit; font-size:13px; cursor:pointer; white-space:nowrap; }
.upload-switch-track { position:relative; display:block; width:34px; height:20px; flex:none; border-radius:10px; background:#b9bfc3; transition:background .15s; }
.upload-switch-track::after { content:''; position:absolute; top:3px; left:3px; width:14px; height:14px; border-radius:50%; background:#fff; transition:transform .15s; }
.upload-visibility-switch[aria-checked="true"] .upload-switch-track { background:#369d8d; }
.upload-visibility-switch[aria-checked="true"] .upload-switch-track::after { transform:translateX(14px); }
.upload-switch-state { width:25px; font-size:11px; }
.upload-visibility-switch:focus-visible { outline:2px solid #369d8d; outline-offset:2px; }
.calendar-period { pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 0; height: 30px; margin: 0 4px; padding: 0 9px; border: 1px solid #b4d7cf; border-radius: 5px; background: #e5f1ed; color: var(--foreground); text-align: left; cursor: pointer; font: inherit; font-size: 12px; }
.calendar-period strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-period span { flex: 0 1 40%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.calendar-period:hover { background: #d8eae4; }
.calendar-period.calendar-shared-event { align-self: center; height: 24px; justify-content: center; text-align: center; background: #fff0e8; border: 0; color: #8d4731; }
.calendar-period.calendar-shared-event:hover { background: #fbe4d7; }
.calendar-period.is-complete { background: #eeeeee; border-color: var(--line); }
.calendar-period.continues-before { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.calendar-period.continues-after { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.calendar-day {
  display: grid;
  min-width: 0;
  min-height: 164px;
  align-content: start;
  gap: 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px;
}
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:nth-last-child(-n + 7) { border-bottom: 0; }
.calendar-week > .calendar-day { border-right: 1px solid var(--line); border-bottom: 0; }
.calendar-week > .calendar-day:last-child { border-right: 0; }
.calendar-day.outside-month { background: var(--surface-muted); }
.calendar-day.outside-month .calendar-date { color: var(--subtle); }
.calendar-date {
  display: flex;
  min-height: 24px;
  justify-content: flex-end;
  color: var(--foreground);
  font-size: 13px;
  font-weight: var(--font-semibold);
}
.calendar-date time {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
}
.calendar-day.is-today .calendar-date time {
  border-radius: 50%;
  background: var(--red);
  color: #fff;
}
.calendar-events { display: grid; align-content: start; gap: 5px; min-width: 0; }
.calendar-event {
  display: grid;
  min-width: 0;
  gap: 5px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(22, 22, 22, 0.06);
  border-radius: 6px;
  background: var(--surface);
  color: var(--foreground);
  padding: 8px;
  text-align: left;
}
.calendar-event:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.calendar-event.urgent { box-shadow: inset 0 0 0 1px #e89540, 0 1px 2px rgba(22, 22, 22, 0.06); }
.calendar-event.overdue { border-color: var(--red); background: var(--red-soft); }
.calendar-event.is-complete { opacity: 0.64; }
.calendar-event strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: var(--font-semibold);
}
.calendar-event-tag {
  width: max-content;
  border-radius: 4px;
  background: #f9dfdc;
  color: #9a4d47;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: var(--font-semibold);
}
.calendar-event-tag.editing { background: #dce9f7; color: #3c6590; }
.calendar-event-tag.complete { background: #e7e9e8; color: #65706b; }
.calendar-event-assignee {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.calendar-event-assignee::before { content: "● "; color: var(--blue); font-size: 9px; }
.team-directory {
  grid-template-columns: minmax(0, 1fr);
}
.team-directory .panel {
  max-width: 980px;
}
.team-directory .data-table th,
.team-directory .data-table td {
  padding-top: 15px;
  padding-bottom: 15px;
}
.calendar-more {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 3px 0;
  text-align: left;
  font-size: 11px;
  font-weight: var(--font-semibold);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.command-band,
.panel,
.result-card,
.metric-card,
.detail-pane {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.command-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
}
.command-band h2,
.section-head h2,
.drawer-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: var(--font-semibold);
  line-height: 1.25;
}
.section-help,
.command-band p {
  max-width: 920px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.command-actions,
.form-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
#analysisCopyActions[hidden] { display: none; }
.user-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  padding: 0 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: var(--font-semibold);
}
.btn,
.icon-btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--foreground);
  padding: 0 11px;
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
  font-weight: var(--font-semibold);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.icon-btn { width: 34px; padding: 0; font-size: 18px; }
.btn:hover,
.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}
.btn:active,
.icon-btn:active { opacity: 0.76; }
.btn.primary {
  border-color: var(--foreground);
  background: var(--foreground);
  color: #fff;
}
.btn.primary:hover { background: var(--foreground); opacity: 0.88; }
.btn.subtle { color: var(--muted); }
.btn.danger { color: var(--red); }
.row-actions .btn[data-select] {
  border-color: #cdddf6;
  background: var(--blue-soft);
  color: #2372bb;
}
.row-actions .btn[data-select]:hover {
  border-color: var(--blue);
  background: #e4f0fd;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.metric-card {
  display: grid;
  min-height: 88px;
  align-content: center;
  gap: 8px;
  padding: 14px;
  border-top: 3px solid var(--blue);
}
.metric-card:nth-child(2),
.metric-card:nth-child(5) { border-top-color: var(--green); }
.metric-card:nth-child(3) { border-top-color: var(--amber); }
.metric-card:nth-child(4) { border-top-color: #3f9f93; }
.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-semibold);
}
.metric-card strong {
  font-size: 23px;
  font-weight: var(--font-semibold);
  line-height: 1;
}
.metric-card small {
  color: var(--muted);
  font-size: 12px;
}

.ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
  gap: 14px;
  align-items: start;
}
.database-layout { display: block; width: 100%; min-width: 0; }
#database .section-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
#accessHistoryPanel { margin-top: 24px; border-top: 1px solid var(--line); }
#accessHistoryStatus { padding: 0 16px; color: var(--muted); }
#moreAccessHistory[hidden] { display: none; }
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.side-stack { display: grid; gap: 10px; }
.analysis-drawer-panel .analysis-output { min-width: 0; width: 100%; overflow-wrap: anywhere; }
.review-feedback-editor { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 24px; min-width: 0; }
.review-feedback-editor label { display: grid; gap: 10px; }
.review-feedback-editor textarea { width: 100%; min-height: 180px; box-sizing: border-box; }
.review-feedback-editor .form-actions { align-items: center; flex-wrap: wrap; }
.review-feedback-editor button { height: 42px; flex: 0 0 auto; }
.panel { min-width: 0; overflow: hidden; }
.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}
.section-head.compact { padding: 12px 14px; }
#entityDetailContent > .section-head {
  border-left: 3px solid var(--blue);
  padding-left: 13px;
}
#entityDetailContent .kv-row span {
  color: #2372bb;
  font-weight: var(--font-semibold);
}
.panel-body { display: grid; gap: 14px; padding: 16px; }

.action-lanes { display: grid; padding: 0 16px 14px; }
.action-lane {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--foreground);
  padding: 15px 0;
  text-align: left;
}
.action-lane:first-child { border-top: 0; }
.lane-index {
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  font-weight: var(--font-semibold);
}
.lane-body { display: grid; min-width: 0; gap: 4px; }
.lane-body strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: var(--font-semibold);
}
.lane-body span:last-child { color: var(--muted); font-size: 13px; line-height: 1.45; }
.lane-action {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  padding: 0 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: var(--font-semibold);
}

.filter-row,
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.form-grid { padding: 0; border-bottom: 0; }
#recordForm label[hidden] { display: none !important; }
.todo-date-editor, .todo-assignees { grid-column: 1 / -1; min-width: 0; }
.todo-date-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
#recordForm .todo-period-toggle, #recordForm .todo-assignees label { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
#recordForm .todo-period-toggle input, #recordForm .todo-assignees input { width: 16px; height: 16px; min-height: 0; padding: 0; flex: 0 0 16px; }
.todo-date-fields { display: grid; gap: 12px; }
.todo-date-fields.is-period { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.team-presence { padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; font-size: 12px; }
.team-presence strong { display: block; margin-bottom: 8px; }
#teamPresence { display: flex; flex-wrap: wrap; gap: 6px 10px; max-height: 120px; overflow: auto; }
.presence-person { display: inline-flex; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.presence-person i { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: #278760; }
.presence-person { width: 100%; min-width: 0; }
.presence-person > span { flex: 1; min-width: 0; }
.presence-person small { display: block; color: var(--muted); font-size: 11px; }
.presence-person[data-status="집중 중"] i { background: #bb780c; }
.presence-person[data-status="잠깐 자리 비움"] i { background: #90979b; }
.presence-cheer { width: 28px; height: 28px; min-height: 28px; flex: 0 0 28px; color: #b44063; }
.presence-status-controls { display: grid; gap: 6px; margin-top: 12px; }
.presence-status-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.team-presence .presence-status-heading label { margin: 0; }
.presence-status-controls select { width: 100%; font-size: 12px; }
#teamCheerMessage { color: #316d58; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.team-presence label { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.team-presence input { width: 14px; height: 14px; min-height: 0; }
.todo-assignees { border: 0; padding: 0; margin: 0; }
.todo-assignees legend { margin-bottom: 6px; padding: 0; color: var(--muted); font-size: 12px; font-weight: var(--font-semibold); }
.todo-assignees > div { display: flex; flex-wrap: wrap; gap: 12px 20px; }
@media (max-width: 480px) { .todo-date-fields.is-period { grid-template-columns: minmax(0, 1fr); } }
.full { grid-column: 1 / -1; }
label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-semibold);
}
input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--control);
  color: var(--foreground);
  padding: 9px 10px;
  font-size: 14px;
  line-height: 1.4;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
  background-color: var(--surface);
}
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
select:disabled {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--subtle) 50%),
    linear-gradient(135deg, var(--subtle) 50%, transparent 50%);
}
.form-grid label > .btn,
.filter-row label > .btn {
  width: 100%;
  min-height: 38px;
}
textarea { min-height: 136px; resize: vertical; }

.table-wrap {
  width: 100%;
  overflow: auto;
}
#todosTable { display: grid; gap: 24px; padding: 16px; overflow: visible; box-sizing: border-box; }
.assignee-workspace { min-width: 0; border: 1px solid var(--line); border-top: 3px solid #77d8c7; border-radius: 8px; overflow: hidden; background: var(--surface); }
.assignee-workspace-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); }
.assignee-workspace-head h3 { margin: 0; font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.assignee-workspace-head p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.assignee-workspace-head .btn { flex: 0 0 auto; }
.assignee-table-scroll { overflow-x: auto; }
.assignee-workspace .data-table { table-layout: fixed; min-width: 660px; }
.assignee-workspace th:first-child { width: 38%; }
.assignee-workspace th:nth-child(2) { width: 21%; }
.assignee-workspace th:last-child { width: 130px; }
.assignee-workspace td { overflow-wrap: anywhere; }
.assignee-workspace tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 600px) { #todosTable { padding: 10px; gap: 18px; } .assignee-workspace-head { padding: 14px; } }
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.45;
}
.data-table th {
  background: #fbfbfa;
  color: var(--muted);
  font-weight: var(--font-semibold);
  white-space: nowrap;
}
.data-table tr:hover td { background: #fcfcfb; }
.todo-row td { padding-top: 7px; padding-bottom: 7px; }
.todo-row.urgent td { background: #fff3f1; }
.todo-row.overdue td { background: #fff4f2; }
.todo-meta { color: var(--blue); display: block; font-size: 11px; font-weight: var(--font-semibold); margin-top: 3px; }
.todo-note { color: var(--muted); display: block; font-size: 12px; margin-top: 3px; }
.todo-tags { color: var(--muted); display: inline-block; font-size: 11px; margin-top: 4px; }
.todo-due-label { display: block; font-size: 11px; font-weight: var(--font-semibold); margin-top: 3px; }
.todo-due-label.urgent { color: #c2413b; }
.todo-due-label.overdue { color: #c2413b; }
.todo-group-row td {
  background: #77D8C7;
  color: #17483f;
  font-size: 18px;
  font-weight: var(--font-semibold);
  letter-spacing: 0;
  line-height: 1.25;
  padding: 16px;
  border-top: 2px solid #50bda9;
}
.data-table .todo-group-gap td, .data-table .todo-group-gap:hover td { height: 24px; padding: 0; border: 0; background: var(--surface); }
.todo-group-button small { font-size: 12px; font-weight: normal; color: #28574e; }
.todo-group-button {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  font: inherit;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}
.data-table .todo-group-row:hover td {
  background: #89dfd0;
  color: #17483f;
}
.todo-summary { cursor: pointer; }
.todo-summary:hover strong { color: var(--blue); }
.todo-clickable { cursor: pointer; }
.todo-clickable:hover { background: var(--surface-muted); }
.assignee-todo-list,
.comment-list {
  display: grid;
  gap: 8px;
}
.assignee-todo-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--foreground);
  padding: 11px;
  text-align: left;
}
.assignee-todo-item:hover { background: var(--surface-muted); }
.assignee-todo-item span,
.assignee-todo-item small { color: var(--muted); font-size: 12px; }
.todo-comments { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.todo-comments h3 { margin: 0; font-size: 15px; }
.todo-comment { border-left: 3px solid #77D8C7; padding: 8px 10px; }
.todo-comment.reply { margin-left: 18px; border-left-color: var(--blue); }
.todo-comment header { display: flex; align-items: baseline; gap: 7px; }
.todo-comment header span { color: var(--muted); font-size: 11px; }
.todo-comment p { margin: 6px 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.text-button { border: 0; background: transparent; color: var(--blue); padding: 0; font-size: 12px; }
.comment-form { display: grid; gap: 8px; margin-top: 12px; }
.comment-form textarea { min-height: 76px; }
.comment-form .btn { justify-self: end; }
.reply-target { color: var(--muted); font-size: 12px; }
.reply-target button { border: 0; background: transparent; color: var(--blue); padding: 0 0 0 6px; }
.numeric { text-align: right !important; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 3px 8px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: var(--font-semibold);
}
.badge.green { border-color: #d9eadf; background: var(--green-soft); color: var(--green); }
.badge.red { border-color: #f2d7d2; background: var(--red-soft); color: var(--red); }
.badge.amber { border-color: #f2dfbf; background: var(--amber-soft); color: var(--amber); }
.badge.blue { border-color: #dce5fb; background: var(--blue-soft); color: var(--blue); }

.detail-pane {
  display: grid;
  align-content: start;
  min-height: 220px;
  overflow: hidden;
}
.detail-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}
.detail-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.kv-list { display: grid; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.kv-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.kv-row:first-child { border-top: 0; }
.kv-row span,
.kv-row strong {
  padding: 9px 10px;
  line-height: 1.45;
}
.kv-row span { background: #fbfbfa; color: var(--muted); font-weight: var(--font-semibold); }
.kv-row strong { font-weight: var(--font-medium); overflow-wrap: anywhere; }
.todo-status-property strong { overflow: visible; }
.todo-status-chip,
.todo-status-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 5px;
  font: inherit;
  font-weight: var(--font-semibold);
}
.todo-status-chip { padding: 5px 9px; }
.todo-status-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.todo-status-action { min-height: 30px; padding: 5px 9px; cursor: pointer; background: #f2f2f0; color: #8a8a86; }
.todo-status-chip i,
.todo-status-action i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .72; }
.todo-status-chip.planning,
.todo-status-action.planning.active { background: #dcecf9; color: #2372bb; }
.todo-status-chip.editing,
.todo-status-action.editing.active { background: #dcecf9; color: #2372bb; }
.todo-status-chip.complete,
.todo-status-action.complete.active { background: #dceee2; color: #28784b; }
.todo-status-action:hover { box-shadow: inset 0 0 0 1px rgba(24, 24, 23, .16); }
.todo-feedback-property strong { overflow: visible; }
.todo-feedback-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.todo-feedback-action {
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #48627c;
  padding: 5px 9px;
  font: inherit;
  font-weight: var(--font-semibold);
  cursor: pointer;
}
.todo-feedback-action:hover { border-color: #4a90d9; background: #eef6ff; color: #1c6cb5; }
.completion-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 24, 27, .36);
}
.completion-dialog[hidden] { display: none; }
.completion-dialog-panel {
  width: min(100%, 360px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .22);
  padding: 28px;
  text-align: center;
}
.completion-dialog-panel h2 { margin: 0; font-size: 20px; }
.completion-dialog-panel p { margin: 10px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.completion-dialog-actions { display: flex; justify-content: center; gap: 8px; }

.view-tabs {
  display: inline-flex;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 3px;
}
.tab {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: var(--font-semibold);
}
.tab.active { background: var(--foreground); color: #fff; }

.ai-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-briefing { margin-bottom: 16px; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); }
.home-briefing-head h2 { margin: 3px 0 0; font-size: 19px; }
#overview button.internal-task { background: #fffae6; }
#overview button.internal-task:hover { background: #fff7d6; }
.briefing-section { margin-top: 18px; min-width: 0; }
.briefing-section + .briefing-section { padding-top: 16px; border-top: 1px solid var(--line); }
.briefing-message { margin: 0; color: var(--foreground); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.briefing-bubbles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; margin-top: 14px; min-width: 0; }
.briefing-bubble { min-width: 0; width: 100%; display: grid; align-content: start; gap: 3px; padding: 12px 14px; text-align: left; white-space: normal; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); cursor: pointer; }
.briefing-empty { grid-column: 1 / -1; }
.home-briefing, .home-briefing-head { min-width: 0; overflow-wrap: anywhere; }
.briefing-bubble span { color: var(--muted); font-size: 12px; }.briefing-bubble strong { font-size: 14px; }.briefing-bubble small { color: var(--muted); }.briefing-bubble.urgent, .briefing-bubble.overdue, .briefing-bubble.unread { border-color: #e5a5a0; background: #fff5f4; }.briefing-empty { color: var(--muted); padding: 8px 0; }
.todo-completed-row td { background: var(--surface-muted); }.todo-completed-toggle { width: 100%; padding: 8px 4px; color: var(--muted); border: 0; background: transparent; text-align: left; cursor: pointer; }
.campaign-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }.campaign-ranking { border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 8px; padding: 14px; }.campaign-ranking:last-child { border-left-color: var(--green); }.campaign-ranking h3 { margin: 0 0 9px; font-size: 15px; }.campaign-ranking div { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }.campaign-ranking b { color: #2372bb; }.campaign-ranking:last-child b { color: var(--green); }.campaign-ranking span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.campaign-ranking strong { color: var(--blue); font-size: 13px; }.campaign-ranking:last-child strong { color: var(--green); }
.manual-metrics { margin-top: 14px; }.manual-metrics > .btn { margin-bottom: 10px; }.plan-form h3 { margin: 18px 0 10px; }.plan-form h3:first-child { margin-top: 0; }.plan-form .plan-footage { grid-column: span 2; }.script-row { display: grid; grid-template-columns: 1fr 1.2fr 1.4fr 34px; gap: 8px; margin-bottom: 8px; }.script-row input { min-width: 0; }
.writing-mode-switch { display: inline-flex; width: max-content; gap: 3px; grid-column: 1 / -1; margin-top: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); padding: 3px; }.writing-mode { min-height: 36px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); padding: 0 13px; cursor: pointer; font: inherit; font-size: 13px; font-weight: var(--font-semibold); }.writing-mode.active { color: #fff; background: var(--foreground); }.writing-panel { grid-column: 1 / -1; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); }.writing-panel label { display: grid; gap: 7px; font-weight: var(--font-semibold); }.writing-panel textarea { min-height: 150px; }
.todo-plan-detail { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); }.todo-plan-detail h3, .todo-plan-detail h4 { margin: 0; font-size: 14px; }.plan-detail-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 12px; }.plan-detail-grid div { display: grid; gap: 4px; }.plan-detail-grid span { color: var(--muted); font-size: 12px; }.plan-detail-grid strong { font-size: 13px; line-height: 1.45; white-space: pre-wrap; }.plan-detail-grid .full { grid-column: 1 / -1; }.plan-detail-script { margin-top: 14px; }.plan-detail-script table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12px; }.plan-detail-script th, .plan-detail-script td { padding: 8px; text-align: left; vertical-align: top; border: 1px solid var(--line); }.plan-detail-script th { color: var(--muted); background: var(--surface); }
.ai-mode-card {
  display: grid;
  min-height: 78px;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--foreground);
  padding: 12px;
  text-align: left;
}
.ai-mode-card:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.ai-mode-card.active { border-color: var(--foreground); background: var(--foreground); color: #fff; }
.ai-mode-card strong { font-size: 14px; font-weight: var(--font-semibold); }
.ai-mode-card span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.ai-mode-card.active span { color: rgba(255, 255, 255, 0.76); }
.ai-request-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: var(--font-semibold);
}
.ai-template-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.ai-template-row .text-button {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  padding: 0 7px;
  font-size: 11px;
}
.ai-template-row .text-button:hover { border-color: var(--line-strong); color: var(--foreground); }
.ai-question {
  height: 40px;
  min-height: 40px;
}
.ai-divider { height: 1px; margin: 2px 0 6px; background: var(--line); }
.video-review-form {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  padding: 14px;
}
.video-file-field { display: grid; gap: 7px; color: var(--foreground); font-size: 13px; font-weight: var(--font-semibold); }
.video-file-field input { width: 100%; }
.video-review-criteria { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0; padding: 0; border: 0; }
.video-review-criteria legend { width: 100%; margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: var(--font-semibold); }
.video-review-criteria label { display: inline-flex; width: auto; align-items: center; gap: 6px; color: var(--foreground); font-size: 13px; line-height: 1.2; white-space: nowrap; }
.video-review-criteria input[type="checkbox"] { width: 16px; min-width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; accent-color: var(--foreground); }
.ai-run-actions { justify-content: space-between; flex-wrap: nowrap; gap: 12px; }
.ai-run-actions .btn { white-space: normal; min-width: 0; }
.video-review-form [hidden] { display: none !important; }
.image-review-file { display:flex; align-items:center; gap:8px; margin:8px 0; }
.image-review-file span { flex:1; min-width:0; overflow-wrap:anywhere; }
.image-review-file .btn { flex:0 0 36px; min-height:36px; padding:4px; }
.analysis-review-output { white-space: normal; font-family: inherit; line-height: 1.5; }
.review-verdict { display: grid; gap: 6px; padding: 16px; border: 1px solid #e7b2ae; border-radius: 6px; background: #fff7f6; }.review-verdict.approved { border-color: #a6d6bb; background: #f3fbf6; }.review-verdict div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }.review-verdict span { color: #b42b25; font-weight: var(--font-semibold); }.review-verdict.approved span { color: #287a4f; }.review-verdict strong { font-size: 15px; }.review-verdict p { margin: 0; color: var(--muted); }
.review-key-problems, .review-structure-notes, .review-checklist { margin-top: 18px; }.review-key-problems h3, .review-structure-notes h3, .review-checklist h3 { margin: 0 0 8px; font-size: 15px; }.review-key-problems ol, .review-checklist ul { margin: 0; padding-left: 20px; }.review-key-problems li, .review-checklist li { margin: 5px 0; }.review-table-wrap { overflow-x: auto; margin-top: 18px; border: 1px solid var(--line); border-radius: 6px; }.review-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 13px; }.review-table th, .review-table td { padding: 11px 12px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }.review-table th { color: var(--muted); background: var(--surface-muted); font-weight: var(--font-semibold); }.review-table tr:last-child td { border-bottom: 0; }.review-table tr.required td { background: #fff8f7; }.review-type { white-space: nowrap; font-size: 12px; }.review-structure-notes { padding: 14px; border-left: 3px solid var(--foreground); background: var(--surface-muted); }.review-structure-notes p { margin: 7px 0 0; }.review-checklist { padding: 14px; border: 1px solid var(--line); border-radius: 6px; }

.result-card {
  display: grid;
  grid-template-rows: auto auto minmax(220px, auto);
  overflow: hidden;
}
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}
.result-head strong { font-size: 13px; font-weight: var(--font-semibold); }
.analysis-loading {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px 12px;
  background: #fbfcfd;
}
.analysis-loading[hidden] { display: none; }
#analysisDrawer .drawer-body.analysis-is-pending { display:flex; align-items:center; justify-content:center; flex:1; min-height:300px; }
#analysisDrawer .analysis-loading { width:min(100%,440px); padding:32px 16px; border:0; background:none; text-align:center; justify-items:center; gap:20px; }
#analysisDrawer .analysis-loading h3 { margin:0; font-size:18px; }
#analysisDrawer .analysis-loading-row { flex-direction:column; justify-content:center; gap:8px; }
#analysisProgress { color:var(--foreground); font-size:15px; overflow-wrap:anywhere; }
.analysis-spinner { width:36px; height:36px; border:3px solid var(--line); border-top-color:#369d8d; border-radius:50%; animation:analysis-spin 1s linear infinite; }
@keyframes analysis-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .analysis-spinner { animation:none; } }
.analysis-loading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--font-semibold);
}
.analysis-loading-track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf2;
}
.analysis-loading-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f6feb, #24a148);
  transition: width 0.45s ease;
}
pre.output {
  margin: 0;
  min-height: 220px;
  max-height: 68vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
  padding: 14px;
  background: var(--surface);
  color: var(--foreground);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
}
pre.output.is-loading { color: var(--muted); }

.upload-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  padding: 12px;
}
.dropzone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 132px;
  align-content: center;
  align-items: center;
  gap: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 18px;
  text-align: left;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.dropzone.dragover { transform: translateY(-1px); }
.dropzone-mark {
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-muted);
}
.video-review-form[hidden] { display: none; }
.dropzone-mark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 13px;
  width: 10px;
  height: 10px;
  border-left: 2px solid var(--foreground);
  border-top: 2px solid var(--foreground);
  transform: translateX(-50%) rotate(45deg);
}
.dropzone-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 2px;
  height: 20px;
  background: var(--foreground);
  transform: translateX(-50%);
}
.dropzone-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.dropzone strong,
#uploadSummary { font-size: 15px; font-weight: var(--font-semibold); }
.dropzone span,
.dropzone small,
.upload-status,
.upload-file-size,
.file-name { color: var(--muted); font-size: 13px; line-height: 1.45; }
.upload-footer,
.upload-file {
  display: flex;
  align-items: center;
  gap: 8px;
}
.upload-footer { justify-content: space-between; }
.upload-meta,
.upload-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.upload-file-list {
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: auto;
  max-height: 172px;
}
.upload-file-list[hidden] { display: none; }
.upload-file {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 8px;
}
.file-chip {
  display: inline-flex;
  min-width: 42px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--foreground);
  color: #fff;
  padding: 0 7px;
  font-size: 11px;
  font-weight: var(--font-semibold);
}
.upload-file-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: var(--font-medium);
}
.upload-remove {
  width: 28px;
  min-height: 28px;
  font-size: 16px;
}
.upload-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.trend-board {
  display: grid;
  grid-template-columns: minmax(160px, 0.28fr) minmax(0, 1fr);
  gap: 10px;
}
#campaignTrend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trend-card {
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  padding: 12px;
}
.trend-card:nth-child(2) { border-left-color: var(--green); }
.trend-card:nth-child(3) { border-left-color: var(--amber); }
.trend-card span,
.trend-card small { color: var(--muted); font-size: 12px; font-weight: var(--font-semibold); }
.trend-card strong { color: #2372bb; font-size: 20px; font-weight: var(--font-semibold); }
.trend-card:nth-child(2) strong { color: var(--green); }
.trend-card:nth-child(3) strong { color: var(--amber); }
.review-history-list { display: grid; gap: 8px; }
.review-history-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  padding: 11px 12px;
}
.review-history-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--blue-soft);
  color: #2372bb;
  font-size: 12px;
  font-weight: var(--font-semibold);
}
.review-history-icon.plan { background: var(--green-soft); color: var(--green); }
.review-history-item:has(.review-history-icon.plan) { border-left-color: var(--green); }
.review-history-copy { display: grid; min-width: 0; gap: 3px; }
.review-history-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.review-history-copy span { color: var(--muted); font-size: 12px; }
.review-history-copy small { font-size: 12px; font-weight: var(--font-semibold); }
.review-history-copy small.revision { color: var(--red); }
.review-history-copy small.approved { color: var(--green); }
.campaign-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.campaign-actions .row-actions { flex-wrap: nowrap; gap: 6px; }
.bar-list {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.22fr) minmax(0, 1fr) minmax(100px, auto);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.bar-row div {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
}
.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--foreground);
}
.bar-row strong {
  color: var(--foreground);
  text-align: right;
  font-weight: var(--font-semibold);
}
.split-line {
  height: 1px;
  background: var(--line);
}
.setting-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}
.setting-card strong { font-size: 14px; font-weight: var(--font-semibold); }
.setting-card span { color: var(--muted); font-size: 13px; line-height: 1.45; }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  justify-content: end;
  background: rgba(25,25,25,0.24);
}
.drawer[hidden] { display: none; }
.drawer-panel {
  width: min(520px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--surface);
  animation: drawerIn 0.16s ease-out;
}
@keyframes drawerIn {
  from { transform: translateX(12px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.drawer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
  flex: 0 0 auto;
}
.drawer-body {
  display: grid;
  gap: 12px;
  padding: 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#recordForm { align-content: start; }
#recordForm > .form-actions {
  align-items: center;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
#recordForm > .form-actions .btn { min-height: 40px; }
.drawer-tools { display: flex; gap: 8px; }.analysis-drawer-panel { width: min(900px, 100vw); }.drawer.is-expanded .analysis-drawer-panel { width: 100vw; }.analysis-drawer-panel .drawer-body { padding: 20px; align-content: start; }.analysis-drawer-panel .analysis-output { min-height: 0; }.analysis-drawer-panel .form-actions { margin-top: 4px; }
.drawer.is-expanded > .drawer-panel { width: 100vw; }.todo-detail-drawer-panel { width: min(860px, 100vw); }.todo-detail-drawer-panel .drawer-body { align-content: start; }.todo-detail-drawer-panel .todo-plan-detail { margin-top: 0; }.view-page .detail-pane { display: none; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--foreground);
  color: #fff;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
}
.toast[hidden] { display: none; }
.todo-alert-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 91;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 40px));
}
.todo-alert {
  position: relative;
  display: flex;
  width: 100%;
  box-sizing: border-box;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #efb3ad;
  border-radius: 6px;
  background: #fff3f1;
  color: #942a24;
  padding: 14px 48px 14px 14px;
  box-shadow: 0 10px 28px rgba(98, 28, 24, 0.16);
}
.todo-alert strong { display: block; font-size: 14px; }
.todo-alert p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; }
.todo-alert-title { display: block; margin-top: 4px; font-weight: var(--font-semibold); }
.todo-alert .icon-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  border: 0;
  border-bottom: 1px solid #efb3ad;
  border-left: 1px solid #efb3ad;
  border-radius: 0 6px 0 6px;
  color: #942a24;
}
body[data-role]:not([data-role="관리자"]) [data-page-link="sales"],
body[data-role]:not([data-role="관리자"]) [data-page-jump="sales"],
body[data-role]:not([data-role="관리자"]) [data-ai-mode="sales"],
body[data-role]:not([data-role="관리자"]) [data-page-link="codes"],
body[data-role]:not([data-role="관리자"]) [data-page-link="database"],
body[data-role]:not([data-role="관리자"]) [data-page-link="settings"],
body[data-role]:not([data-role="관리자"]) #sales,
body[data-role]:not([data-role="관리자"]) #codes,
body[data-role]:not([data-role="관리자"]) #database,
body[data-role]:not([data-role="관리자"]) #settings,
body[data-role]:not([data-role="관리자"]) #employeeAddButton { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1080px) {
  .app-shell { display: block; }
  .rail {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .rail-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rail-menu { flex: none; overflow: visible; }
  .rail-admin-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
  .rail-section-label { grid-column: 1 / -1; }
  .rail-footer { margin-top: 12px; }
  .topbar-inner,
  .command-band,
  .ops-grid,
  .workbench,
  .filter-row,
  .form-grid,
  .export-grid,
  .settings-grid,
  .trend-board {
    grid-template-columns: 1fr;
  }
  #campaignTrend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .campaign-actions { justify-content: flex-start; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-mode-grid { grid-template-columns: 1fr; }
  .campaign-highlights { grid-template-columns: 1fr; }
  .script-row { grid-template-columns: 1fr; }.script-row .icon-btn { justify-self: end; }
  .plan-form .plan-footage { grid-column: auto; }
  .ai-request-head { align-items: flex-start; flex-direction: column; }
  .ai-template-row { justify-content: flex-start; }
  .command-actions { justify-content: flex-start; }
  .dropzone {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .upload-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .upload-meta,
  .upload-actions { justify-content: space-between; }
}

@media (max-width: 720px) {
  #campaignTrend { grid-template-columns: 1fr; }
  .campaign-actions { flex-wrap: wrap; }
  .campaign-actions .row-actions { flex-wrap: wrap; }
}
