/* ==================================================
   기본 설정 및 타이포그래피
================================================== */

* {
  box-sizing: border-box;
}

/* 화면 전반의 Bootstrap 아이콘 가독성 보강 */
.bi {
  font-size: calc(1em + 2px);
}

/* 메인 화면 밀도 및 라이선스 화면과의 시각적 연결 */
body {
  position: relative;
  background:
    radial-gradient(circle at 8% 12%, rgba(241, 124, 33, .08), transparent 24%),
    radial-gradient(circle at 92% 78%, rgba(62, 148, 48, .07), transparent 28%),
    #f3f6f4;
}

main {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 24px 30px 42px;
}

#tab-dashboard {
  position: relative;
  display: grid;
  gap: 18px;
}

#tab-dashboard.hidden {
  display: none;
}

.dashboard-hero {
  position: relative;
  display: block;
  height: 152px;
  min-height: 152px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #f0cda9;
  border-radius: 20px;
  color: #20354f;
  background: linear-gradient(120deg, #fff 0%, #f5fbf2 62%, #fff2e6 100%);
  box-shadow: 0 9px 24px rgba(125, 85, 47, .08);
}

.dashboard-hero-watermark {
  position: absolute;
  right: 5%;
  top: 50%;
  width: 150px;
  height: auto;
  opacity: .9;
  transform: translateY(-50%);
  filter: saturate(.92);
  pointer-events: none;
  user-select: none;
}

.dashboard-hero-copy {
  position: relative;
  z-index: 1;
}

.dashboard-hero h1 {
  margin: 0 0 7px;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -.7px;
}

.dashboard-hero p {
  margin: 0;
  color: #6f756f;
  font-size: 13px;
}

#tab-dashboard .kpi {
  gap: 14px;
  margin: 0;
}

#tab-dashboard .kpi > div {
  min-height: 112px;
  padding: 20px 22px;
  border: 1px solid #e2e9e5;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff 0%, #f9fbfa 100%);
  box-shadow: 0 8px 22px rgba(29, 60, 47, .07);
}

#tab-dashboard .kpi > .kpi-link {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

#tab-dashboard .kpi > .kpi-link::after {
  content: "›";
  position: absolute;
  top: 50%;
  right: 18px;
  color: #8c9991;
  font-size: 23px;
  font-weight: 500;
  transform: translateY(-50%);
}

/* 홈 KPI의 강조색은 연결되는 업무 메뉴의 대표색을 따릅니다. */
#tab-dashboard .kpi > .kpi-accent-journal::before { background: #e67a24; }
#tab-dashboard .kpi > .kpi-accent-subjects::before { background: #4c9c3d; }
#tab-dashboard .kpi > .kpi-accent-medicine::before { background: #344878; }
#tab-dashboard .kpi > .kpi-accent-emergency::before { background: #c95852; }

#tab-dashboard .kpi > .kpi-link:hover {
  border-color: #b9cdbd;
  box-shadow: 0 10px 26px rgba(29, 60, 47, .1);
  transform: translateY(-2px);
}

#tab-dashboard .kpi > .kpi-link:focus-visible {
  outline: 3px solid rgba(76, 159, 55, .25);
  outline-offset: 2px;
}

#tab-dashboard .kpi > div::before {
  width: 5px;
  border-radius: 5px;
  background: #ee812b;
}

#tab-dashboard .kpi > div:nth-child(even)::before {
  background: #3c8b43;
}

#tab-dashboard .kpi .num,
#tab-dashboard .kpi > div:nth-child(n) .num {
  color: #173f35;
  font-size: 30px;
}

#tab-dashboard .kpi .lbl {
  margin-top: 8px;
  color: #66766f;
  font-size: 12px;
  font-weight: 700;
}

#tab-dashboard .two-col {
  align-items: stretch;
  gap: 18px;
}

#tab-dashboard .dashboard-primary-row > .card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

#tab-dashboard .dashboard-primary-row > .card:not(.is-collapsed) {
  height: 420px;
}

#tab-dashboard .dashboard-primary-row > .card:not(.is-collapsed) .collapsible-card-content {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
}

#tab-dashboard .dashboard-primary-row > .card.is-collapsed {
  align-self: start;
}

#tab-dashboard .dashboard-schedule-card #schedule-list,
#tab-dashboard .action-target-card .action-target-list {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#tab-dashboard .card {
  margin: 0;
  border: 1px solid #e1e8e4;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 28px rgba(30, 61, 49, .07);
}

#tab-dashboard .card h2 {
  padding-bottom: 14px;
  border-bottom: 1px solid #edf1ef;
  color: #173f35;
}

nav {
  border-top: 0;
  border-bottom: 1px solid #dce5df;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 16px rgba(32, 64, 51, .06);
}

.nav-inner {
  gap: 5px;
  padding: 8px 12px;
}

.nav-inner button {
  min-height: 40px;
  border-radius: 10px;
}

.nav-inner button.active {
  color: #fff;
  background: linear-gradient(135deg, #2f7e3f, #47952e);
  box-shadow: 0 7px 16px rgba(48, 126, 63, .22);
}

@media (max-width: 760px) {
  main { padding: 16px 14px 30px; }
  .dashboard-hero { min-height: 128px; padding: 23px 22px; }
  .dashboard-hero h1 { font-size: 23px; }
  .dashboard-hero-watermark { right: 2%; width: 120px; opacity: .58; }
}

:root {
  --control-height: 40px;
  --mini-height: 30px;
  --brand-green: #4c8f46;
  --brand-green-dark: #36743a;
  --orange: var(--brand-orange);
  --brand-orange: #d96b16;
  --brand-orange-dark: #b7560f;
  --brand-orange-soft: #fff4e8;
  --leaf-green: #5c8f55;
  --navy: #203a5f;
  --navy-strong: #172c49;
  --text: #242b34;
  --shadow-xs: 0 1px 2px rgba(40, 44, 52, 0.04);
  --of-green: #359d26;
  --of-green-deep: #28781d;
  --of-green-soft: #edf8eb;
  --of-orange: #ed7d1d;
  --of-orange-soft: #fff4e9;
  --of-navy: #20354f;
  --of-text: #28313b;
  --border: #e2e7e1;
  --input-border: #ccd5cc;
  --focus-ring: 0 0 0 3px rgba(53, 157, 38, 0.13);
}

html,
body {
  width: 100%;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: #ffffff !important;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  font-family: Pretendard,
    "Noto Sans KR",
    "맑은 고딕",
    "Malgun Gothic",
    Arial,
    sans-serif;
  letter-spacing: -0.01em;
  color: var(--of-text);
}

/* ==================================================
   공통 레이아웃 및 유틸리티
================================================== */

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.row>div {
  min-width: 140px;
  flex: 1;
}

/* 입력 내용 길이에 맞춘 공통 폼 레이아웃 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: 12px 14px;
  width: 100%;
  max-width: 1120px;
  margin-bottom: 4px;
}

.form-grid-compact { max-width: 1040px; }
.field-short { grid-column: span 2; min-width: 150px; }
.field-medium { grid-column: span 3; min-width: 210px; }
.field-long { grid-column: span 6; min-width: 320px; }
.field-full { width: 100%; max-width: 1120px; }
.form-grid input, .form-grid select, .form-grid textarea,
.field-full input, .field-full select, .field-full textarea { margin-bottom: 0; }
.form-grid label, .field-full > label { margin-bottom: 6px; }
.field-full { margin-bottom: 12px; }

.toolbar-controls {
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
}

.muted {
  color: #999;
  font-size: 12px;
}

.empty {
  padding: 30px;
  color: #aaa;
  text-align: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.hidden {
  display: none;
}

/* 공통 알림 */
.app-notification-region {
  position: fixed;
  z-index: 12000;
  top: 22px;
  right: 22px;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}
.app-notification {
  --notification-color: #376a96;
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 28px;
  gap: 11px;
  align-items: start;
  overflow: hidden;
  padding: 16px 14px 17px 16px;
  border: 1px solid #d9e0e6;
  border-left: 4px solid var(--notification-color);
  border-radius: 13px;
  color: #26323c;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 14px 38px rgba(28, 39, 49, .17);
  /* 알림 카드가 아래의 입력창을 가려도 입력 자체는 계속 클릭할 수 있습니다. */
  pointer-events: none;
  animation: app-notification-in .2s ease-out both;
}
.app-notification-success { --notification-color: #3c8a45; }
.app-notification-warning { --notification-color: #b27a16; }
.app-notification-error { --notification-color: #c44747; }
.app-notification-icon {
  margin-top: 1px;
  color: var(--notification-color);
  font-size: 20px;
}
.app-notification-content { min-width: 0; }
.app-notification-content strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.35;
}
.app-notification-content p {
  margin: 0;
  color: #586570;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.app-notification-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: #77838d;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}
.app-notification-close:hover { color: #25313b; background: #f0f2f4; }
.app-notification-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--notification-color);
  transform-origin: left;
  animation: app-notification-progress var(--notification-duration, 4200ms) linear both;
}
.app-notification.is-leaving { animation: app-notification-out .18s ease-in both; }
@keyframes app-notification-in {
  from { opacity: 0; transform: translate3d(22px, -4px, 0) scale(.98); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes app-notification-out {
  to { opacity: 0; transform: translate3d(18px, 0, 0) scale(.98); }
}
@keyframes app-notification-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
html[data-theme="dark"] .app-notification {
  border-color: #49545e;
  color: #f1f4f6;
  background: rgba(38, 45, 51, .98);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .34);
}
html[data-theme="dark"] .app-notification-content p { color: #c4cdd4; }
html[data-theme="dark"] .app-notification-close { color: #b7c0c7; }
html[data-theme="dark"] .app-notification-close:hover { color: #fff; background: #46515a; }
@media (max-width: 640px) {
  .app-notification-region { top: 12px; right: 12px; width: calc(100vw - 24px); }
}

/* 약품 수량 입력창 */
.app-number-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: #25313b;
  background: transparent;
  box-shadow: 0 24px 70px rgba(20, 30, 40, .25);
}
.app-number-dialog::backdrop {
  background: rgba(26, 34, 42, .26);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.app-number-dialog-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 15px 13px;
  padding: 22px;
  border: 1px solid #dbe1e5;
  border-radius: 16px;
  background: #fff;
}
.app-number-dialog-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background: #344878;
  font-size: 20px;
}
.app-number-dialog-heading strong { display: block; margin: 1px 0 5px; font-size: 17px; }
.app-number-dialog-heading p { margin: 0; color: #697681; font-size: 13px; line-height: 1.5; }
.app-number-dialog-card > label { grid-column: 1 / -1; margin: 2px 0 0; }
.app-number-dialog-card > label > span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.app-number-input-wrap { position: relative; }
.app-number-input-wrap input {
  width: 100%;
  height: 46px;
  margin: 0;
  padding-right: 62px;
  font-size: 16px;
  font-weight: 700;
}
.app-number-input-wrap em {
  position: absolute;
  top: 50%;
  right: 14px;
  color: #68747f;
  font-size: 13px;
  font-style: normal;
  transform: translateY(-50%);
}
.app-number-dialog-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.app-number-dialog-actions .btn { min-width: 86px; }
html[data-theme="dark"] .app-number-dialog-card { border-color: #4a555e; color: #f2f4f5; background: #2a3238; }
html[data-theme="dark"] .app-number-dialog-heading p,
html[data-theme="dark"] .app-number-input-wrap em { color: #c1cad1; }

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 2000px;
  min-width: 0;
  margin: 0 auto;
  background: #ffffff;
  padding: 24px 24px 36px;
}

.dashboard-hero-slide {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 140px;
  padding: 25px 34px 31px;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity .5s ease, transform .55s cubic-bezier(.2, .75, .25, 1);
  pointer-events: none;
}

.dashboard-hero-slide.is-active {
  display: flex;
  z-index: 1;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  animation:dashboard-slide-reveal .38s ease-out both;
}

@keyframes dashboard-slide-reveal {
  from { opacity:0; transform:translateX(10px); }
  to { opacity:1; transform:translateX(0); }
}

.dashboard-hero-team {
  right: 3.5%;
  width: 250px;
  opacity: .88;
}

.dashboard-hero-ai {
  right: 7%;
  width: auto;
  height: calc(100% - 14px);
  max-height: 160px;
  opacity: .96;
  filter: saturate(.96);
}

/* 배너별 정보 성격은 다르게, 색상과 전환 방식은 오렌지톡 체계로 통일한다. */
.dashboard-hero-overview { justify-content:flex-start; gap:22px; background:linear-gradient(105deg,#fff 0%,#fffaf4 57%,#f2f8ef 100%); }
.dashboard-hero-overview::after { content:""; position:absolute; right:17%; bottom:-74px; width:220px; height:148px; border:1px solid rgba(224,118,32,.1); border-radius:50%; }
.dashboard-overview-clock { position:relative; display:flex; width:330px; min-width:330px; flex:0 0 330px; align-items:center; gap:18px; padding-right:24px; border-right:1px solid rgba(214,190,168,.72); }
.dashboard-analog-clock { --clock-hour-angle:0deg; --clock-minute-angle:0deg; --clock-second-angle:0deg; position:relative; width:76px; height:76px; flex:0 0 76px; border:1px solid #d9d7d1; border-radius:50%; background:radial-gradient(circle at 38% 31%,#fff 0,#fdfcf9 58%,#f1eee7 100%); box-shadow:0 8px 18px rgba(57,67,61,.11),inset 0 0 0 4px rgba(255,255,255,.82); }
.dashboard-analog-clock::before { content:""; position:absolute; inset:7px; border-radius:50%; background:repeating-conic-gradient(from -1deg,#34443d 0 2deg,transparent 2deg 30deg); -webkit-mask:radial-gradient(circle,transparent 0 78%,#000 79% 96%,transparent 97%); mask:radial-gradient(circle,transparent 0 78%,#000 79% 96%,transparent 97%); opacity:.9; }
.dashboard-analog-clock::after { content:""; position:absolute; inset:12px; border-radius:50%; background:repeating-conic-gradient(from -.5deg,rgba(63,75,69,.46) 0 1deg,transparent 1deg 6deg); -webkit-mask:radial-gradient(circle,transparent 0 88%,#000 89% 97%,transparent 98%); mask:radial-gradient(circle,transparent 0 88%,#000 89% 97%,transparent 98%); }
.dashboard-clock-hand { position:absolute; z-index:2; left:50%; bottom:50%; width:2px; border-radius:999px; background:#263d36; transform-origin:50% 100%; }
.dashboard-clock-hour { height:20px; transform:translateX(-50%) rotate(var(--clock-hour-angle)); }
.dashboard-clock-minute { height:27px; width:1.5px; transform:translateX(-50%) rotate(var(--clock-minute-angle)); }
.dashboard-clock-second { z-index:3; height:29px; width:1px; background:#df7620; transform:translateX(-50%) rotate(var(--clock-second-angle)); }
.dashboard-clock-pin { position:absolute; z-index:4; left:50%; top:50%; width:7px; height:7px; border:2px solid #fff; border-radius:50%; background:#df7620; box-shadow:0 1px 3px rgba(74,58,44,.22); transform:translate(-50%,-50%); }
.dashboard-clock-meta { display:flex; min-width:0; flex:1 1 auto; flex-direction:column; align-items:flex-start; gap:8px; }
.dashboard-overview-clock .dashboard-live-date { margin:0; color:#66736d; font-size:19px; font-weight:500; line-height:1.2; letter-spacing:-.035em; white-space:nowrap; }
.dashboard-clock-meta > strong { color:#d96d1c; font-size:23px; font-weight:800; line-height:1; letter-spacing:.015em; white-space:nowrap; font-variant-numeric:tabular-nums; }
.dashboard-hero-overview .dashboard-hero-copy { max-width:55%; padding:0; }
.dashboard-hero-overview h1 { margin-bottom:4px; color:#263d52; font-size:27px; }

.dashboard-hero-tip { justify-content:flex-start; gap:18px; background:linear-gradient(108deg,#fbfef9 0%,#eef7eb 64%,#fffaf2 100%); }
.dashboard-hero-tip::after { content:""; position:absolute; right:18%; top:-55px; width:220px; height:220px; border-radius:50%; background:rgba(112,166,91,.055); }
.dashboard-tip-symbol { display:flex; width:68px; height:80px; flex:0 0 68px; flex-direction:column; align-items:center; justify-content:center; gap:7px; border-right:1px solid #cfe0ca; color:#4f8747; }
.dashboard-tip-symbol .bi { display:grid; width:34px; height:34px; place-items:center; border-radius:50%; color:#df7620; background:#fff7ed; box-shadow:inset 0 0 0 1px #efd2b4; font-size:16px; }
.dashboard-tip-symbol span { font-size:9px; font-weight:800; white-space:nowrap; }
.dashboard-hero-tip .dashboard-hero-copy { max-width:58%; padding:0; border:0; }
.dashboard-hero-tip .dashboard-tip-label { margin:0 0 6px; color:#4e8147; }
.dashboard-hero-tip h1 { margin-bottom:4px; color:#244636; font-size:25px; }
.dashboard-hero-tip p { color:#708078; }

.dashboard-hero-ai-slide { background:linear-gradient(108deg,#fff 0%,#fff5ea 61%,#f2f8ef 100%); }
.dashboard-hero-ai-slide::before { content:""; position:absolute; top:-76px; right:22%; width:220px; height:220px; border:1px solid rgba(218,112,28,.1); border-radius:50%; box-shadow:0 0 0 28px rgba(222,119,35,.025); }
.dashboard-hero-ai-slide .dashboard-hero-copy { max-width:55%; padding:0; border:0; background:transparent; box-shadow:none; }
.dashboard-hero-ai-slide .dashboard-tip-label { margin:0 0 8px; color:#b75e19; }
.dashboard-hero-ai-slide .dashboard-tip-label::after { content:""; width:54px; height:1px; margin-left:3px; background:#e9b486; }
.dashboard-hero-ai-slide .dashboard-tip-label .bi { display:grid; place-items:center; width:25px; height:25px; border-radius:8px; color:#d96f1b; background:#fff0e3; box-shadow:inset 0 0 0 1px #f2d2b7; }
.dashboard-hero-ai-slide h1 { color:#263e55; font-size:25px; }
.dashboard-ai-preview { position:absolute; z-index:2; top:23px; right:20%; display:flex; width:226px; flex-direction:column; gap:7px; padding:10px; border:1px solid rgba(230,189,151,.82); border-radius:16px; background:rgba(255,255,255,.72); box-shadow:0 10px 26px rgba(95,67,43,.08); backdrop-filter:blur(4px); }
.dashboard-ai-preview > div { display:flex; align-items:center; gap:8px; min-width:0; border-radius:10px; font-size:9px; font-weight:700; line-height:1.25; }
.dashboard-ai-preview i { display:grid; width:25px; height:25px; flex:0 0 25px; place-items:center; border-radius:8px; font-size:12px; }
.dashboard-ai-preview-question { align-self:flex-start; width:84%; padding:5px 8px; color:#68736d; background:#f6f4f1; }
.dashboard-ai-preview-question i { color:#8a8178; background:#fff; }
.dashboard-ai-preview-answer { align-self:flex-end; width:94%; padding:6px 8px; color:#48654f; background:linear-gradient(100deg,#fff5e9,#eef7eb); box-shadow:inset 0 0 0 1px rgba(214,226,207,.8); }
.dashboard-ai-preview-answer i { color:#d96f1b; background:#fff; box-shadow:0 3px 8px rgba(179,98,35,.08); }
.dashboard-ai-preview-answer b { color:#b85f1b; font-weight:850; }

.dashboard-weather-briefing {
  display: block;
  background:
    radial-gradient(circle at 78% 24%,rgba(255,190,101,.18) 0 34px,rgba(255,190,101,.07) 35px 66px,transparent 67px),
    linear-gradient(120deg,#fffdf9 0%,#f4faf1 49%,#fff3e5 100%);
}
.dashboard-weather-briefing::before { content:""; position:absolute; right:1.5%; bottom:-74px; width:48%; height:146px; border:1px solid rgba(91,139,83,.12); border-radius:50%; box-shadow:0 0 0 22px rgba(91,139,83,.025),0 0 0 46px rgba(223,118,32,.018); }
.dashboard-weather-briefing::after { content:""; position:absolute; left:0; top:0; width:6px; height:100%; background:linear-gradient(#86b579,#df7620); opacity:.9; }
.dashboard-weather-briefing.risk-level-1::after { background:linear-gradient(#efb262,#df7620); }
.dashboard-weather-briefing.risk-level-2::after { background:linear-gradient(#df7620,#c44d45); }
.dashboard-weather-briefing-copy { padding-left:0; border-left:0; }
.dashboard-hero-slide[hidden],
.dashboard-hero-dot[hidden] { display:none; }
.dashboard-weather-briefing-copy { width:40%; min-width:0; margin-left:4.5%; }
.dashboard-weather-label { display:flex; align-items:center; gap:9px; margin-bottom:8px; }
.dashboard-weather-label-icon { position:relative; display:grid; width:34px; height:34px; flex:0 0 34px; place-items:center; border:1px solid #cdded7; border-radius:11px; color:#3f756d; background:linear-gradient(145deg,#f8fcfa,#eaf4ef); box-shadow:0 4px 11px rgba(55,91,76,.08); }
.dashboard-weather-label-icon > i { font-size:16px; }
.dashboard-weather-label-icon > b { position:absolute; right:4px; bottom:4px; width:5px; height:5px; border:1.5px solid #fff; border-radius:50%; background:#df7620; box-shadow:0 0 0 2px rgba(223,118,32,.14); }
.dashboard-weather-label > span:last-child { display:flex; flex-direction:column; gap:1px; }
.dashboard-weather-label small { color:#7d8d86; font-size:8px; font-weight:750; letter-spacing:.06em; }
.dashboard-weather-label strong { color:#3f7564; font-size:11px; font-weight:850; }
.dashboard-weather-briefing h1 { display:flex; align-items:center; gap:9px; margin-bottom:7px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:22px; }
.weather-briefing-time { padding:4px 8px; border:1px solid #d2e1dc; border-radius:999px; color:#4b6d64; background:rgba(245,250,247,.9); font-size:11px; font-weight:850; line-height:1; }
.weather-briefing-status { overflow:hidden; color:#b45c1a; font-size:23px; font-weight:830; letter-spacing:-.025em; text-overflow:ellipsis; white-space:nowrap; }
.risk-level-0 .weather-briefing-status,
.weather-briefing-status.is-stable { color:#467b47; }
.risk-level-2 .weather-briefing-status { color:#b5413a; }
.dashboard-weather-briefing p { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-weather-briefing-advice { display:flex; align-items:center; gap:7px; margin:0; color:#667870; font-size:11px; font-weight:650; }
.dashboard-weather-briefing-advice > i { color:#d87529; font-size:13px; }
.dashboard-weather-briefing-advice > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-weather-timeline {
  position: absolute;
  z-index: 1;
  top: 16px;
  right: 3%;
  display: grid;
  grid-template-columns: repeat(6, minmax(54px, 1fr));
  align-items: start;
  gap: 4px;
  width: 42%;
  max-width: none;
  margin: 0;
  padding: 11px 12px 9px;
  border:1px solid #dfe9df;
  border-radius:15px;
  background:rgba(255,255,255,.68);
  box-shadow:0 7px 18px rgba(64,91,72,.07);
}
.dashboard-weather-timeline::before { content:""; position:absolute; z-index:-1; top:40px; left:8.33%; right:8.33%; height:2px; background:#dce5dd; }
.weather-risk-point { display:grid; grid-template-rows:16px 34px 17px 15px; justify-items:center; gap:2px; min-width:0; color:#617068; }
.weather-risk-time { font-size:10px; font-weight:750; white-space:nowrap; }
.weather-risk-marker { display:grid; place-items:center; width:31px; height:31px; border:3px solid #fff; border-radius:50%; color:#398232; background:#e8f4e5; box-shadow:0 2px 8px rgba(45,78,60,.13); }
.weather-risk-marker .bi { font-size:13px; line-height:1; }
.weather-risk-point strong { color:#47764a; font-size:10px; }
.weather-risk-point small { color:#79867f; font-size:10px; font-weight:700; }
.weather-risk-point.level-1 .weather-risk-marker { color:#b75f19; background:#fff0df; }
.weather-risk-point.level-1 strong { color:#b75f19; }
.weather-risk-point.level-2 .weather-risk-marker { color:#b54239; background:#fde9e7; }
.weather-risk-point.level-2 strong { color:#b54239; }

@media (max-width: 980px) {
  .dashboard-overview-clock { width:272px; min-width:272px; flex-basis:272px; gap:13px; padding-right:17px; }
  .dashboard-overview-clock .dashboard-live-date { font-size:15px; }
  .dashboard-clock-meta > strong { font-size:18px; }
  .dashboard-weather-briefing-copy { width:43%; margin-left:2.5%; }
  .dashboard-weather-timeline { right:2%; width:40%; }
  .dashboard-weather-briefing h1 { font-size:19px; }
  .weather-briefing-status { font-size:19px; }
  .dashboard-weather-briefing p { font-size:11px; }
}

@media (max-width: 760px) {
  .dashboard-hero-ai {
    right: 4%;
    width: auto;
    height: calc(100% - 18px);
    max-height: 132px;
    opacity: .54;
  }
  .dashboard-hero-overview, .dashboard-hero-tip { gap:10px; }
  .dashboard-overview-clock { width:160px; min-width:160px; flex-basis:160px; gap:8px; padding-right:9px; }
  .dashboard-analog-clock { width:54px; height:54px; flex-basis:54px; }
  .dashboard-clock-hour { height:14px; }
  .dashboard-clock-minute { height:19px; }
  .dashboard-clock-second { height:20px; }
  .dashboard-overview-clock .dashboard-live-date { font-size:10px; white-space:normal; }
  .dashboard-clock-meta > strong { font-size:12px; }
  .dashboard-hero-overview .dashboard-hero-copy { max-width:70%; padding:0; }
  .dashboard-hero-overview .dashboard-live-date { font-size:9px; }
  .dashboard-hero-overview h1 { font-size:20px; }
  .dashboard-tip-symbol { width:52px; height:66px; flex-basis:52px; }
  .dashboard-tip-symbol span { display:none; }
  .dashboard-hero-tip .dashboard-hero-copy { max-width:72%; padding:0; }
  .dashboard-hero-tip h1 { font-size:18px; }
  .dashboard-hero-ai-slide .dashboard-hero-copy { max-width:72%; padding:0; }
  .dashboard-hero-ai-slide h1 { font-size:18px; }
  .dashboard-ai-preview { display:none; }
  .dashboard-hero:has(.dashboard-weather-briefing.is-active) { height:190px; min-height:190px; }
  .dashboard-weather-briefing { padding-top:17px; padding-bottom:39px; }
  .dashboard-weather-briefing-copy { width:100%; margin:0 0 7px; }
  .dashboard-weather-briefing h1 { margin-bottom:3px; font-size:16px; }
  .dashboard-weather-label { margin-bottom:5px; }
  .dashboard-weather-label-icon { width:28px; height:28px; flex-basis:28px; }
  .weather-briefing-status { font-size:16px; }
  .weather-briefing-time { padding:3px 6px; font-size:9px; }
  .dashboard-weather-briefing p { font-size:10px; }
  .dashboard-weather-timeline { position:relative; top:auto; right:auto; grid-template-columns:repeat(6,minmax(40px,1fr)); width:100%; max-width:none; padding-top:2px; }
  .dashboard-weather-timeline::before { top:35px; }
  .weather-risk-point { grid-template-rows:14px 30px 14px; gap:1px; }
  .weather-risk-marker { width:27px; height:27px; }
  .weather-risk-point strong { font-size:9px; }
  .weather-risk-point small { display:none; }
}

.dashboard-tip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 1px 0 6px;
  color: #477b42;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-tip-label .bi {
  color: #e47a21;
}

.dashboard-hero-controls {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 120px;
  bottom: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transform: translateX(-50%);
}

.dashboard-hero-dot,
.dashboard-hero-arrow {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.dashboard-hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(91, 117, 91, .3);
  transition: width .2s ease, background-color .2s ease;
}

.dashboard-hero-dot.is-active {
  width: 21px;
  background: #df7620;
}

.dashboard-hero-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #607068;
}

.dashboard-hero-arrow:hover,
.dashboard-hero-arrow:focus-visible {
  background: rgba(255, 255, 255, .72);
  color: #d96600;
  outline: none;
}

.dashboard-hero-arrow .bi {
  font-size: 12px;
}

/* ==================================================
   헤더 및 상단 도구
================================================== */

.storage-settings {
  grid-area: storage;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  font-size: 10px;
}

.web-storage-settings {
  align-items: center;
  justify-self: end;
  width: min(440px, 100%);
  margin-right: 60px;
  gap: 8px;
}

.web-storage-settings .web-storage-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.header-main-brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 26px;
  padding-left: 80px;
}

.demo-notice-text {
  display: block;
  width: 100%;
  text-align: center;
}

.demo-notice .btn {
  margin-left: 8px;
}

.storage-button.danger {
  border-color: #d4a3a0;
  background: #fffafa;
  color: #a9322d;
}

.storage-button.danger:hover {
  border-color: #be7874;
  background: #fff1f0;
  color: #922823;
}

.demo-notice strong {
  color: var(--navy-strong);
}

.app-header {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(560px, 1.35fr);
  grid-template-areas: "brand storage";
  align-items: center;
  gap: 8px 24px;
  width: 100%;
  min-width: 0;
  position: relative;
  overflow: hidden;
  min-height: 78px;
  padding: 8px 28px;
  border-top: 3px solid #ed7d1d;
  border-bottom: 1px solid #eadfd3;
  background: #fffaf5;
  box-shadow: 0 5px 16px rgba(96, 69, 44, .06);
}

.app-header::before {
  display: none !important;
}

.app-header::after {
  display: none;
}

.header-main-brand,
.storage-settings {
  min-width: 0;
  position: relative;
  z-index: 2;
}

.header-main-logo {
  display: block;
  width: min(240px, 100%);
  height: 64px;
  object-fit: contain;
}

.header-home-button {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.header-home-button:focus-visible {
  outline: 2px solid rgba(237, 125, 29, 0.72);
  outline-offset: 4px;
}

.header-home-button > .header-main-logo {
  animation: header-full-logo-swap 12s ease-in-out infinite;
}

.header-home-button > .header-short-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation-name: header-short-logo-swap;
}

@keyframes header-full-logo-swap {
  0%, 45%, 100% { opacity: 1; }
  50%, 95% { opacity: 0; }
}

@keyframes header-short-logo-swap {
  0%, 45%, 100% { opacity: 0; }
  50%, 95% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .header-home-button > .header-main-logo { animation: none; }
}

.storage-button {
  flex: 0 0 auto;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  padding: 6px 10px;
  transition: background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
  border-color: #c7d5c5;
  border: 1px solid rgba(53, 157, 38, 0.26);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.70);
  color: var(--of-green-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.90);
}

.storage-button:hover {
  border-color: rgba(53, 157, 38, 0.48);
  background: #ffffff;
  color: #226919;
  box-shadow: 0 3px 9px rgba(53, 157, 38, 0.08);
  transform: none;
}

.demo-notice {
  max-width: 1440px;
  margin: 0 auto 16px;
  padding: 11px 16px;
  border: 1px solid #dce5da;
  border-left: 4px solid var(--of-orange);
  border-radius: 6px;
  background: #ffffff;
  color: #58635a;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: none;
}

.business-links-header {
  margin-bottom: 18px;
}

.business-links-header h2 {
  margin: 0;
}

/* ==================================================
   내비게이션 및 탭
================================================== */

nav {
  width: 100%;
  background: #ffffff !important;
  border-bottom: 0;
  box-shadow: none;
}

.nav-container {
  position: relative;
  width: 100%;
  max-width: 2000px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 24px;
  background: #ffffff;
}

.nav-container::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: 0;
  left: 24px;
  height: 2px;
  background: var(--of-green);
  pointer-events: none;
}

.nav-inner {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: stretch;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.nav-inner button {
  width: 100%;
  min-width: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  transition: background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid #edf0ed;
  border-radius: 0;
  background: #ffffff;
  color: #343d47;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.035em;
  box-shadow: none;
  transform: none;
}

.nav-inner button:first-child {
  border-left: 1px solid #edf0ed;
}

.nav-inner button.nav-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-home-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-inner button:hover {
  border-color: #edf0ed;
  background: #f4faf3;
  color: var(--of-green-deep);
  box-shadow: inset 0 -3px 0 rgba(53, 157, 38, 0.36);
}

.nav-inner button.active {
  border-color: #edf0ed;
  background: var(--of-green);
  color: #ffffff;
  font-weight: 750;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -3px 0 rgba(31, 112, 21, 0.30);
}

table {
  width: 100%;
  overflow: hidden;
  border: 1px solid #dfe5df;
  border-collapse: collapse;
  border-spacing: 0;
  border-radius: 6px;
  background: #ffffff;
  font-size: 13px;
}

/* ==================================================
   폼 및 입력 요소
================================================== */

input,
select {
  height: var(--control-height);
}

.memo-input-row,
.toolbar-controls {
  display: grid;
  align-items: end;
  gap: 8px;
}

.memo-input-row {
  grid-template-columns: max-content minmax(0, 1fr) auto;
  padding: 9px;
  border: 1px solid #e3e8e2;
  border-radius: 9px;
  background: #f8faf8;
}

.memo-input-row input,
.toolbar-controls input,
.toolbar-controls select {
  margin-bottom: 0;
}

.checkbox-group label {
  display: inline-flex;
  align-items: center;
  margin: 0 14px 6px 0;
  font-size: 13px;
}

.checkbox-group input {
  width: auto;
  height: auto;
  margin: 0 5px 0 0;
}

details.section {
  margin-bottom: 12px;
}

details.section summary {
  margin-bottom: 8px;
  color: var(--orange);
  cursor: pointer;
  font-size: 13px;
}

input::placeholder,
textarea::placeholder {
  color: #a2aab4;
}

select {
  cursor: pointer;
  height: 42px;
  padding-top: 0;
  padding-right: 36px;
  padding-bottom: 1px;
  padding-left: 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: normal;
  color: #28313b;
  vertical-align: middle;
}

textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.55;
}

.memo-day,
details.section {
  border: 1px solid #e9edf1;
  background: #fff;
  border-radius: 7px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #505a67;
  font-weight: 650;
}

details.section summary,
.memo-day .d {
  color: var(--brand-orange-dark);
}

input,
select,
textarea {
  width: 100%;
  margin: 0 0 12px;
  padding: 8px 11px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  box-shadow: none;
  transition: border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aebcab;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--of-green);
  outline: none;
  box-shadow: var(--focus-ring);
}

.memo-day .d,
details.section summary {
  color: var(--of-green-deep);
}

.site-add-panel summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 14px;
  color: #344253;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color 0.16s ease,
    color 0.16s ease;
}

.site-add-panel summary::-webkit-details-marker {
  display: none;
}

.site-add-panel summary::marker {
  display: none;
  content: "";
}

.site-add-panel summary:hover {
  background: #f6faf5;
  color: #28781d;
}

.site-add-panel[open] summary {
  border-bottom: 1px solid #e4eae4;
  background: #f8fbf7;
  color: #28781d;
}

.site-form-field {
  min-width: 0;
}

.site-form-field label {
  margin-bottom: 6px;
  color: #4d5864;
  font-size: 12px;
  font-weight: 700;
}

.site-add-form input,
.site-add-form select {
  width: 100%;
  height: 40px;
  margin: 0;
  border-radius: 6px;
}

.site-add-form select {
  height: 42px;
}

/* ==================================================
   버튼
================================================== */

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.btn.small {
  height: var(--control-height);
  min-width: 54px;
  padding: 0 13px;
  font-size: 12px;
}

button,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn.danger:active {
  background: #92241f;
}

.btn.mini {
  height: var(--mini-height);
  min-width: 42px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
}

.btn:active {
  box-shadow: none;
  transform: none;
  border-color: #934207;
  background: #a94d0a;
}

.btn.gray:hover {
  border-color: #b8c0c8;

  background: linear-gradient(180deg,
      #ffffff 0%,
      #fafbfc 52%,
      #f1f3f5 100%);

  color: #38424c;

  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);

  transform: translateY(-1px);
}

.btn.danger {
  border: 1px solid #a92e29;

  background: linear-gradient(180deg,
      #e8645e 0%,
      #c9433d 52%,
      #a92e29 100%);

  color: #ffffff;

  box-shadow:
    0 2px 5px rgba(169, 46, 41, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn.danger:hover {
  border-color: #ed6d66;

  background: linear-gradient(180deg,
      #f27b74 0%,
      #df554e 52%,
      #bd3933 100%);

  box-shadow:
    0 5px 12px rgba(169, 46, 41, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);

  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: max-content;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -0.015em;
  height: var(--control-height);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
  border: 1px solid #d96b11;
  border-radius: 6px;
  background: linear-gradient(180deg,
      #f3943f 0%,
      var(--of-orange) 52%,
      #df6b0e 100%);
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(223, 107, 14, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn.green {
  border: 1px solid #3c9631;
  background: linear-gradient(180deg,
      #6ac85d 0%,
      #4ab73d 52%,
      #38962c 100%);
  color: #ffffff;
  box-shadow:
    0 2px 5px rgba(56, 150, 44, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn:hover {
  border-color: #ff982e;

  background: linear-gradient(180deg,
      #ffad5a 0%,
      #ff9835 52%,
      #f58a21 100%);

  box-shadow:
    0 5px 12px rgba(255, 140, 40, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, .35);

  transform: translateY(-1px);
}

.btn:focus-visible {
  outline-offset: 2px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(237, 125, 29, 0.15),
    0 3px 8px rgba(223, 107, 14, 0.14);
}

.btn.outline {
  box-shadow: none;
  border-color: rgba(53, 157, 38, 0.40);
  background: #ffffff;
  color: var(--of-green-deep);
}

.btn.outline:hover {
  box-shadow: none;
  border-color: var(--of-green);
  background: var(--of-green-soft);
  color: #226919;
}

.btn.gray {
  border: 1px solid #cfd5db;
  border-radius: 6px;

  background: linear-gradient(180deg,
      #ffffff 0%,
      #f6f8f7 52%,
      #eceff2 100%);

  color: #55606c;

  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.btn.green:hover {
  border-color: #66d55a;

  background: linear-gradient(180deg,
      #7ddf70 0%,
      #5ecf50 52%,
      #47b83b 100%);

  box-shadow:
    0 5px 12px rgba(74, 183, 61, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);

  transform: translateY(-1px);
}

.link-item .btn.danger,
.link-item .btn.mini.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #9b6763;
  font-size: 15px;
  font-weight: 600;
  box-shadow: none;
  transform: none;
}

.link-item .btn.danger:hover,
.link-item .btn.mini.danger:hover {
  background: #fff0ef;
  color: #bb3e37;
  box-shadow: none;
  transform: none;
}

.site-submit-cell .btn {
  min-width: 72px;
  height: 40px;
}

/* ==================================================
   카드 및 대시보드
================================================== */

.kpi>div {
  min-width: 0;
  position: relative;
  overflow: visible;
  min-height: 104px;
  padding: 17px 16px;
  border: 1px solid #dfe6de;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  box-shadow: none;
  transition: border-color 0.15s ease;
}

.two-col>.card {
  min-width: 0;
  margin-bottom: 18px;
}

.kpi .num {
  z-index: 1;
  position: static;
  margin: 0 0 10px;
  color: var(--navy-strong);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
}

.kpi>div:nth-child(3n + 1)::before {
  background: var(--brand-orange);
}

.kpi>div:nth-child(3n + 2)::before {
  background: var(--brand-green);
}

.kpi>div:nth-child(3n)::before {
  background: var(--navy);
}

.kpi>div:nth-child(3n + 1) .num {
  color: var(--brand-orange-dark);
}

.kpi>div:nth-child(3n + 2) .num {
  color: var(--brand-green-dark);
}

.kpi>div:nth-child(3n) .num {
  color: var(--navy-strong);
}

.kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  gap: 12px;
}

.kpi>div .num,
.kpi>div:nth-child(n) .num {
  position: static;
  margin: 0 0 10px;
  color: var(--navy-strong);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
}

.kpi .lbl {
  margin-top: 4px;
  z-index: 1;
  line-height: 1.4;
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  color: #717b87;
  font-size: 16px;
  font-weight: 650;
}

.card {
  --card-padding: 20px;
  margin-bottom: 18px;
  padding: var(--card-padding);
  border: 1px solid #e1e6e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(35, 50, 35, 0.035),
    0 4px 12px rgba(35, 50, 35, 0.035);
  transition: border-color 0.15s ease;
}

.card:hover {
  box-shadow: 0 1px 2px rgba(35, 50, 35, 0.04),
    0 5px 14px rgba(35, 50, 35, 0.045);
}

.card h2 {
  position: relative;
  margin: 0 0 16px;
  padding: 0 0 11px;
  border-bottom: 1px solid #e8ece8;
  color: var(--of-navy);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 9px;

}

.card h2::before {
  content: "";
  position: static;
  flex: 0 0 3px;
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: #359d26;
}

.kpi>div::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--of-green);
}

.kpi>div::after {
  display: none !important;
  content: none !important;
}

.kpi>div:hover {
  border-color: #cddacb;
  box-shadow: none;
  transform: none;
}

.kpi .num,
.kpi>div:nth-child(n) .num {
  color: var(--of-navy);
}

.business-links-card {
  overflow: hidden;
}

/* ==================================================
   테이블 및 상태 표시
================================================== */

tr:hover td {
  background: #fffaf3;
}

.status {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background-color 0.14s ease;
}

th,
td {
  text-align: left;
  padding: 10px 11px;
  border-bottom: 1px solid #e5e9ed;
}

.tag,
.status {
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 650;
}

th {
  font-weight: 700;
  border-top: 2px solid var(--of-green);
  background: #f3f6f3;
  color: #465248;
}

tbody tr:hover td {
  background: #f5faf4;
}

.tag {
  display: inline-block;
  margin: 2px 2px 0 0;
  padding: 3px 9px;
  border-color: rgba(237, 125, 29, 0.28);
  border-radius: 4px;
  background: var(--of-orange-soft);
  color: #c45e0b;
  font-size: 11px;
  font-weight: 650;
}

.status.MANAGING {
  border-color: rgba(53, 157, 38, 0.25);
  background: var(--of-green-soft);
  color: var(--of-green-deep);
}

.status.RECHECK {
  border-color: rgba(237, 125, 29, 0.28);
  background: var(--of-orange-soft);
  color: #bd5708;
}

.exam-schedule {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.exam-schedule-date {
  color: #465248;
  font-size: 12px;
  font-weight: 650;
}

.exam-schedule-status {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.exam-schedule-status.scheduled {
  border-color: #cfe3cc;
  background: #f1f8f0;
  color: #34782a;
}

.exam-schedule-status.due-soon {
  border-color: #f5c28f;
  background: #fff4e8;
  color: #b9560b;
}

.exam-schedule-status.overdue {
  border-color: #edb1b1;
  background: #fff0f0;
  color: #bd3232;
}

.exam-schedule-status.missing {
  border-color: #d8dde1;
  background: #f4f6f7;
  color: #707a82;
}

.table-heading-with-help {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: #6b756d;
  cursor: help;
  outline: none;
}

.info-tooltip:hover,
.info-tooltip:focus-visible {
  color: #c45e0b;
}

.info-tooltip-content {
  position: absolute;
  z-index: 30;
  top: calc(100% + 9px);
  right: -12px;
  width: 255px;
  padding: 10px 12px;
  border: 1px solid #efc89f;
  border-radius: 8px;
  background: #fffdf9;
  box-shadow: 0 8px 24px rgba(74, 51, 31, 0.16);
  color: #3f4942;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  text-align: left;
  white-space: normal;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
}

.info-tooltip-content small {
  color: #7a827c;
  font-size: 10px;
}

.info-tooltip-content::before {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 100%;
  border: 6px solid transparent;
  border-bottom-color: #efc89f;
}

.info-tooltip:hover .info-tooltip-content,
.info-tooltip:focus .info-tooltip-content {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* 대상자 상세 정보 */
#detail-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.subject-profile-icon {
  color: #465d52;
  font-size: 24px;
}

#detail-info {
  margin-top: 16px;
}

.subject-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #e1e7e1;
  border-radius: 8px;
  background: #fff;
}

.subject-detail-item {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid #edf0ed;
  border-bottom: 1px solid #edf0ed;
  background: #fbfcfb;
}

.subject-detail-item:nth-child(4n) {
  border-right: 0;
}

.subject-detail-label,
.subject-detail-value {
  display: block;
}

.subject-detail-label {
  margin-bottom: 5px;
  color: #788178;
  font-size: 13.2px;
  font-weight: 650;
}

.subject-detail-value {
  overflow-wrap: anywhere;
  color: #26382f;
  font-size: 15.6px;
  font-weight: 700;
}

.subject-detail-note {
  grid-column: 1 / -1;
  border-right: 0;
  border-bottom: 0;
  background: #fffaf4;
}

@media (max-width: 1180px) {
  .subject-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subject-detail-item:nth-child(4n) {
    border-right: 1px solid #edf0ed;
  }

  .subject-detail-item:nth-child(2n) {
    border-right: 0;
  }
}

.subject-list-table-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin-top: 14px;
}

.subject-list-table-scroll:focus-visible {
  outline: 2px solid var(--of-green);
  outline-offset: 2px;
}

.subject-list-table-scroll > .subject-list-table {
  width: 100%;
  min-width: 1440px;
  margin: 0;
  table-layout: auto;
}

.subject-list-table th,
.subject-list-table .table-sort-button {
  white-space: nowrap;
}

.subject-list-table .info-tooltip-content {
  white-space: normal;
}

.subject-list-table th:nth-child(1) {
  min-width: 160px;
}

.subject-list-table th:nth-child(2) {
  min-width: 116px;
}

.subject-list-table th:nth-child(3),
.subject-list-table th:nth-child(4) {
  min-width: 148px;
}

.subject-list-table th:nth-child(5) {
  min-width: 136px;
}

.subject-list-table th:nth-child(6) {
  min-width: 108px;
}

.subject-list-table th:nth-child(7) {
  min-width: 96px;
}

.subject-list-table th:nth-child(8) {
  min-width: 172px;
}

.subject-list-table th:nth-child(9),
.subject-list-table td:nth-child(9) {
  min-width: 148px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.subject-list-table td:nth-child(9) .status {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.subject-list-table th:last-child,
.subject-list-table td:last-child:not([colspan]) {
  width: 198px;
  min-width: 198px;
  white-space: nowrap;
}

.subject-list-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  width: max-content;
}

.subject-list-actions > .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.status.CLOSED {
  border-color: #d6dcdf;
  background: #f3f5f6;
  color: #65717b;
}

.service-badge {
  display: flex;
  align-items: center;
  gap: 10px;

  background: #22335d;
  color: #fff;
  border-radius: 8px;

  padding: 6px 11px;

  position: relative;
  top: 5px;

  left: 0;

}

.settings-organization-field { grid-column:1 / -1; min-width:0; }
.settings-organization-options { display:grid; grid-template-columns:repeat(2, minmax(0, 160px)); gap:8px; }
.settings-organization-options button { min-height:43px; border:1px solid #d7dee5; border-radius:9px; background:#fff; color:#344054; font:inherit; font-weight:700; cursor:pointer; }
.settings-organization-options button i { margin-right:6px; }
.settings-organization-options button.is-active { border-color:#4c9b35; background:#eef8eb; color:#2f7d25; box-shadow:0 0 0 2px rgba(76,155,53,.12); }
html[data-theme="dark"] .settings-organization-options button { background:#243047; border-color:#465477; color:#dce4f0; }
html[data-theme="dark"] .settings-organization-options button.is-active { background:#28452f; border-color:#70b65d; color:#ccecc4; }

.app-search-field {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.app-search-field > i {
  flex:0 0 auto;
  color:var(--of-green-deep);
  font-size:17px;
  line-height:1;
}
.app-search-field > input {
  min-width:0;
  margin:0;
}
.app-search-field > input:focus {
  border-color:var(--of-green);
  box-shadow:0 0 0 2px rgba(53,157,38,.14);
}
.subject-list-search { width:min(430px,100%); }
.subject-list-search input { width:100%; }

.subject-list-toolbar { position:relative; flex-wrap:wrap; justify-content:flex-end; }
.subject-filter-panel { position:relative; margin:0; }
.subject-filter-panel > summary {
  display:flex; align-items:center; gap:7px; min-height:40px; padding:0 14px;
  border:1px solid #d5ddd7; border-radius:7px; background:#fff; color:#34493f;
  font-weight:700; cursor:pointer; list-style:none;
}
.subject-filter-panel > summary::-webkit-details-marker { display:none; }
.subject-filter-panel[open] > summary { border-color:#77aa6b; box-shadow:0 0 0 2px rgba(76,156,61,.12); }
.filter-reset-button {
  display:flex; align-items:center; gap:7px; min-height:40px; padding:0 14px;
  border:1px solid #d5ddd7; border-radius:7px; background:#fff; color:#34493f;
  font:inherit; font-weight:700; cursor:pointer;
}
.filter-reset-button:hover { border-color:#77aa6b; color:#397e2d; background:#f6fbf4; }
.filter-reset-button:focus-visible { outline:2px solid rgba(76,156,61,.28); outline-offset:2px; }
.filter-reset-button-compact { min-height:34px; padding:0 11px; font-size:12px; }
.filter-reset-button i { flex:0 0 auto; font-size:14px; line-height:1; }
.subject-filter-popover {
  position:absolute; z-index:180; top:calc(100% + 7px); right:0; width:520px;
  display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:16px;
  border:1px solid #cfdcd0; border-radius:12px; background:#fff;
  box-shadow:0 14px 32px rgba(37,57,47,.16);
}
.subject-filter-popover label { display:grid; gap:6px; margin:0; color:#405249; font-size:12px; font-weight:700; }
.subject-filter-popover select { width:100%; margin:0; }
.subject-filter-actions { grid-column:1 / -1; display:flex; justify-content:flex-end; gap:8px; }
.table-sort-button {
  display:inline-flex; align-items:center; gap:7px; padding:0; border:0; background:transparent;
  color:inherit; font:inherit; font-weight:inherit; cursor:pointer;
}
.table-sort-button:hover { color:var(--of-green); }
.table-sort-indicator {
  display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px;
  border:1px solid #d6ded8; border-radius:5px; background:#fff; color:#718078;
  font-size:11px; line-height:1;
}
.table-sort-indicator.active { border-color:#a9c9a3; background:#edf7eb; color:#397e2d; }
.table-sort-button:hover .table-sort-indicator { border-color:#91b88a; }
html[data-theme="dark"] .table-sort-indicator { border-color:#6c7d74; background:#405149; color:#d2ddd6; }
html[data-theme="dark"] .table-sort-indicator.active { border-color:#79a86f; background:#30492f; color:#bfe2b7; }

@media (max-width:900px) {
  .subject-filter-popover { position:fixed; left:16px; right:16px; top:auto; width:auto; grid-template-columns:1fr; }
  .subject-list-toolbar { justify-content:flex-start; }
}

html[data-theme="dark"] .subject-filter-panel > summary,
html[data-theme="dark"] .subject-filter-popover,
html[data-theme="dark"] .filter-reset-button { color:#edf4ef; border-color:#667a70; background:#35463f; }
html[data-theme="dark"] .filter-reset-button:hover { border-color:#83ad78; color:#d8efd3; background:#40554a; }
html[data-theme="dark"] .subject-filter-popover label { color:#dbe7df; }

.medicine-quote-summary { margin:10px 0 0; }
.medicine-bulk-card > .flex-between .btn:not(.gray) { background:#2d3f70; border-color:#2d3f70; color:#fff; }
.medicine-bulk-card > .flex-between .btn:not(.gray):hover { background:#22335d; }
.medicine-bulk-card > .flex-between #medicine-quote-cancel {
  border-color:#cfd6dc;
  background:#fff;
  color:#5f6d78;
}
.medicine-bulk-card > .flex-between #medicine-quote-cancel:hover { background:#f4f6f7; }
.medicine-bulk-card .workspace-eyebrow { color:#d9681b; }
.medicine-quote-guide {
  display:flex;
  align-items:center;
  gap:11px;
  max-width:none;
  padding:9px 12px;
  border-left:3px solid #e77722;
  border-radius:0 8px 8px 0;
  background:#fff8f1;
}
.medicine-quote-guide-copy { display:flex; flex-direction:column; gap:3px; line-height:1.45; }
.medicine-quote-guide-copy strong { color:#9a4a13; font-weight:700; }
.medicine-quote-company-link {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  padding:3px 7px;
  border:1px solid #f0c49f;
  border-radius:7px;
  background:#fff;
  transition:border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.medicine-quote-company-link:hover {
  border-color:#e77722;
  box-shadow:0 3px 10px rgba(216,104,27,.14);
  transform:translateY(-1px);
}
.medicine-quote-company-link img { display:block; width:auto; height:23px; }
html[data-theme="dark"] .medicine-quote-guide { background:#352b25; color:#d8d1cb; }
html[data-theme="dark"] .medicine-quote-guide-copy strong { color:#ffbd89; }
html[data-theme="dark"] .medicine-quote-company-link { border-color:#765039; background:#fff; }
.medicine-quote-counts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:14px; }
.medicine-quote-count { padding:12px 14px; border:1px solid #d9dfeb; border-radius:10px; background:#f7f8fc; color:inherit; font:inherit; text-align:left; cursor:pointer; transition:box-shadow .16s ease, transform .16s ease; }
.medicine-quote-count:hover { transform:translateY(-1px); box-shadow:0 5px 14px rgba(39,54,72,.08); }
.medicine-quote-count.is-active { box-shadow:0 0 0 2px rgba(45,63,112,.14); }
.medicine-quote-count:nth-child(2) { border-color:#bcdcb5; background:#f2faef; }
.medicine-quote-count:nth-child(3) { border-color:#f0c49f; background:#fff8f1; }
.medicine-quote-count span { display:block; color:#718078; font-size:12px; }
.medicine-quote-count strong { display:block; margin-top:2px; color:#263864; font-size:19px; }
.medicine-quote-count:nth-child(2) strong { color:var(--of-green-deep); }
.medicine-quote-count:nth-child(3) strong { color:#c85d17; }
.medicine-quote-count:nth-child(2).is-active { box-shadow:0 0 0 2px rgba(53,157,38,.18); }
.medicine-quote-count:nth-child(3).is-active { box-shadow:0 0 0 2px rgba(231,119,34,.18); }
.medicine-quote-search-wrap { display:flex; justify-content:flex-end; margin:12px 0 10px; }
.medicine-quote-search-wrap input { width:260px; margin:0; }
.medicine-quote-list { display:grid; gap:9px; }
.medicine-quote-item { border:1px solid #dfe6e0; border-radius:11px; background:#fff; overflow:hidden; }
.medicine-quote-item.needs-check { border-color:#c8d0e1; background:#fbfcff; }
.medicine-quote-item-head { display:grid; grid-template-columns:22px minmax(240px,1.35fr) minmax(210px,.85fr) minmax(155px,.65fr) minmax(215px,.85fr) 178px; gap:12px; align-items:center; padding:12px 14px; }
.medicine-quote-item-check input { width:16px; height:16px; margin:0; accent-color:#2d3f70; }
.medicine-quote-item-title strong { display:block; color:#21392f; }
.medicine-quote-item-result { display:flex; align-items:center; gap:7px; font-weight:750; color:#263864; white-space:nowrap; }
.medicine-quote-arrow { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:6px; background:#eef1f8; color:#2d3f70; font-size:14px; font-weight:900; }
.medicine-quote-edit-toggle { border:1px solid #d8e0da; border-radius:8px; padding:7px 10px; background:#fff; color:#52635a; font:inherit; font-size:12px; font-weight:700; cursor:pointer; }
.medicine-quote-row-actions { display:flex; align-items:center; justify-content:flex-end; gap:5px; white-space:nowrap; }
.medicine-quote-remove { border:1px solid #e4c4c1; border-radius:8px; padding:7px 10px; background:#fff; color:#a33d35; font:inherit; font-size:12px; font-weight:700; cursor:pointer; }
.medicine-quote-remove:hover { border-color:#c84a41; background:#fff6f5; }
.medicine-quote-editor { display:none; grid-template-columns:1.4fr 1fr 1fr 1fr 1fr; gap:10px; padding:12px 14px; border-top:1px solid #e5ebe6; background:#f8faf8; }
.medicine-quote-item.is-editing .medicine-quote-editor { display:grid; }
.medicine-quote-editor label { display:flex; flex-direction:column; gap:5px; color:#647168; font-size:11px; }
.medicine-quote-editor input,
.medicine-quote-editor select { min-width:0; padding:8px 9px; }
.medicine-unit-combobox { position:relative; display:block; width:100%; }
.medicine-unit-combobox > input {
  width:100%;
  height:42px;
  padding-right:42px !important;
  box-sizing:border-box;
}
.medicine-unit-toggle {
  position:absolute;
  z-index:2;
  top:0;
  right:0;
  bottom:0;
  width:42px;
  height:42px;
  min-height:42px;
  margin:0;
  padding:0;
  border:0;
  border-radius:0 7px 7px 0;
  background:transparent;
  color:#26352d;
  cursor:pointer;
}
.medicine-unit-toggle i { display:block; font-size:12px; line-height:1; }
.medicine-unit-toggle:hover { background:transparent; color:#2f7e31; }
.medicine-unit-toggle:focus-visible { outline:2px solid rgba(76,156,61,.35); outline-offset:-3px; }
.medicine-unit-menu { position:absolute; z-index:320; top:calc(100% + 4px); left:0; right:0; display:flex; flex-direction:column; max-height:190px; padding:4px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; border:1px solid #cfd8d1; border-radius:9px; background:#fff; box-shadow:0 10px 24px rgba(33,50,40,.16); }
.medicine-unit-menu.hidden { display:none; }
.medicine-unit-menu > button { flex:0 0 36px; width:100%; min-width:0; min-height:36px; padding:7px 10px; border:0; border-radius:6px; background:transparent; color:#304039; font:inherit; text-align:left; cursor:pointer; }
.medicine-unit-menu > button:hover { background:#eef7ec; color:#2f7e31; font-weight:700; }
html[data-theme="dark"] .medicine-unit-toggle { color:#e4ece6; }
html[data-theme="dark"] .medicine-unit-toggle:hover { background:transparent; color:#bfe4b8; }
html[data-theme="dark"] .medicine-unit-menu { border-color:#66736b; background:#34413a; }
html[data-theme="dark"] .medicine-unit-menu > button { color:#eef4ef; }
html[data-theme="dark"] .medicine-unit-menu > button:hover { background:#46594c; color:#c8efc0; }
.medicine-quote-item-meta { display:block; margin-top:3px; color:#7a8680; font-size:11px; }
.medicine-quote-badge { display:inline-flex; align-items:center; white-space:nowrap; border-radius:999px; padding:3px 8px; font-size:11px; font-weight:700; }
.medicine-quote-badge.auto { background:var(--of-green-soft); color:var(--of-green-deep); }
.medicine-quote-badge.suggest { background:#f5f0e5; color:#80651e; }
.medicine-quote-badge.review { background:#f8eceb; color:#98433d; }
.medicine-quote-badge.existing { background:#edf0f6; color:#344a7c; }
.medicine-quote-pagination { justify-content:center; margin-top:14px; }
.medicine-stock-table-wrap { margin-top:14px; overflow:auto; border:1px solid #dce5de; border-radius:10px; }
.medicine-stock-tools { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
.medicine-stock-search-field input { width:280px; margin:0; }
.status.medicine-stock-empty { border-color:#e6aaa5; background:#fff0ef; color:#b23b34; }
.status.medicine-stock-unset { border-color:#d5dbe2; background:#f3f5f7; color:#68737e; }
html[data-theme="dark"] .status.medicine-stock-empty { border-color:#b9655f; background:#603b39; color:#ffd4d0; }
html[data-theme="dark"] .status.medicine-stock-unset { border-color:#6d777f; background:#465057; color:#e0e6ea; }
.medicine-stock-table { min-width:1240px; margin:0; table-layout:auto; }
.medicine-stock-table th { white-space:nowrap; background:#f4f7f4; color:#43564b; font-size:12px; }
.medicine-stock-table td { padding:10px 11px; vertical-align:middle; }
.medicine-stock-table tbody tr:hover td { background:#f8fbf7; }
.medicine-stock-table .medicine-company { width:120px; color:#637169; font-size:12px; }
.medicine-stock-table .medicine-name { min-width:175px; }
.medicine-stock-table .medicine-spec { min-width:100px; }
.medicine-stock-table .medicine-number { text-align:left; white-space:nowrap; font-variant-numeric:tabular-nums; }
.medicine-stock-table .medicine-conversion { min-width:130px; color:#53645a; white-space:nowrap; }
.medicine-stock-table .medicine-dispense-mode { min-width:110px; white-space:nowrap; }
.medicine-stock-table .medicine-dispense-mode span { display:inline-flex; padding:4px 8px; border:1px solid #d8e3d7; border-radius:999px; color:#4b6650; background:#f5f9f3; font-size:11px; font-weight:750; }
html[data-theme="dark"] .medicine-stock-table .medicine-dispense-mode span { border-color:#6f8377; color:#e5eee8; background:#465a4e; }
.medicine-stock-table .medicine-current { color:#347b29; font-weight:800; white-space:nowrap; }
.medicine-stock-table .medicine-row-actions { display:flex; gap:5px; flex-wrap:nowrap; white-space:nowrap; }
.medicine-stock-table .medicine-row-actions .btn { padding:6px 9px; font-size:11px; }
@media (max-width:900px) {
  .medicine-stock-tools { width:100%; flex-wrap:wrap; }
  .medicine-stock-search-field { flex:1 1 240px; }
  .medicine-stock-search-field input { width:100%; }
  .medicine-quote-item-head { grid-template-columns:auto 1fr auto; }
  .medicine-quote-item-spec, .medicine-quote-item-result { grid-column:2 / -1; }
  .medicine-quote-editor { grid-template-columns:1fr 1fr; }
}

.service-badge i {
  font-size: 20px;

}

.badge-divider {
  width: 1px;
  height: 26px;

  background: rgba(255, 255, 255, .35);
}

.badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: center;
}

.badge-text>div:first-child {
  font-size: 13px;

  font-weight: 700;
  opacity: .8;
}

.badge-text>div:last-child {
  font-size: 15px;

  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;

  flex-shrink: 0;
  border-radius: 50%;
  background: #32c55f;

  animation: statusPulse 1.8s infinite;
}

/* ==================================================
   기능별 컴포넌트
================================================== */

.schedule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  box-sizing: border-box;
  margin-bottom: 6px;
  padding: 8px 10px;
  border: 1px solid #e2e8e4;
  border-left: 3px solid #d5ddd8;
  border-radius: 7px;
  color: #2f3740;
  background: #fff;
}

#schedule-list {
  max-height: 304px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 5px;
}

#schedule-list .schedule:last-child {
  margin-bottom: 0;
}

.schedule.overdue {
  border-left-color: #d9aaa7;
  background: #fff;
}

.schedule.today {
  border-left-color: #f0b477;
  background: #fff;
}

.schedule.upcoming {
  border-left-color: #9dcc94;
  background: #fff;
}

.schedule-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.schedule-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid #d6dfd8;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.schedule-summary > b { color:#2e3540; font-size:13px; letter-spacing:-.01em; }
.schedule-state.today { border-color:#f0d0ac; color:#a86625; background:#fff8f0; }
.schedule-state.overdue { border-color:#e8c9c6; color:#a05e5a; background:#fff7f6; }
.schedule-state.upcoming { border-color:#cbe3c6; color:#4c8a43; background:#f5fbf3; }
.schedule-person::before { content: "·"; margin-right: 7px; color: #a7aaa7; }
.schedule-person { color:#46505a; font-size:12px; font-weight:650; }
.schedule .tag { margin:0; padding:3px 7px; border-color:#e2e6e3; color:#667069; background:#f7f8f7; font-size:10px; }
.schedule-actions { display:flex; align-items:center; gap:5px; flex:0 0 auto; }
.schedule-actions > .btn { border-color:#d9dfdb; color:#4b5550; background:#fff; box-shadow:none; }
.schedule-actions > .btn:hover { border-color:#9fc795; color:#43823b; background:#f6fbf4; }
.schedule-actions .schedule-complete { color:#397632; border-color:#bdd8b8; background:#f6fbf4; }
.schedule-actions .schedule-reschedule { color:#8b642f; border-color:#e4d2b8; background:#fffaf3; }

.schedule-reschedule-dialog {
  width:min(430px,calc(100vw - 32px));
  padding:0;
  border:0;
  border-radius:14px;
  color:#25313b;
  background:transparent;
  box-shadow:0 24px 70px rgba(20,30,40,.25);
}
.schedule-reschedule-dialog::backdrop { background:rgba(26,34,42,.28); }
.schedule-reschedule-card { padding:22px; border:1px solid #dbe1e5; border-radius:14px; background:#fff; }
.schedule-reschedule-heading { display:flex; gap:12px; align-items:center; margin-bottom:18px; }
.schedule-reschedule-heading > i { display:grid; place-items:center; width:40px; height:40px; border-radius:10px; color:#fff; background:#4d9942; font-size:18px; }
.schedule-reschedule-heading strong { display:block; margin-bottom:3px; font-size:17px; }
.schedule-reschedule-heading p { margin:0; color:#697681; font-size:13px; }
.schedule-reschedule-card > label { display:block; font-size:13px; font-weight:750; }
.schedule-reschedule-card input { width:100%; height:44px; margin-top:7px; box-sizing:border-box; }
.schedule-reschedule-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }
html[data-theme="dark"] .schedule-reschedule-card { border-color:#61736a; color:#f2f6f3; background:#34453e; }
html[data-theme="dark"] .schedule-reschedule-heading p { color:#c1cdc6; }
html[data-theme="dark"] .schedule-reschedule-card input { border-color:#687b71; color:#f2f6f3; background:#293a33; }

@media (max-width:720px) {
  .schedule { align-items:flex-start; flex-direction:column; }
  .schedule-actions { width:100%; justify-content:flex-end; }
}

.memo-day {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.card h2>.bi {
  color: #4d7950;
  font-size: 18px;
  line-height: 1;
}

.memo-day+.memo-day {
  border-top: 1px solid #dde4dd;
}

.memo-day-header {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-left: 3px solid #dd7b29;
  background: #f5f7f5;
}

.memo-day-header time {
  color: #34443b;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.memo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 7px 11px 7px 14px;
  border-bottom: 1px solid #eef1ee;
  color: #34423a;
  font-size: 13px;
}

.memo-item:last-child {
  border-bottom: 0;
}

.memo-item-text {
  position: relative;
  min-width: 0;
  padding-left: 13px;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.memo-item-text::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9aa69b;
}

.memo-item .actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.memo-list {
  max-height: 400px;
  margin-top: 10px;
  border: 1px solid #dfe5df;
  border-radius: 9px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: #fff;
}

.memo-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 10px;
}

.memo-search-wrap {
  width: 230px;
}

.memo-search-wrap i {
  font-size: 14px;
}

.memo-search-wrap input {
  width: 100%;
  height: 31px;
  margin: 0;
  padding: 4px 9px;
  font-size: 11px;
}

.memo-list-toolbar label {
  margin: 0;
  color: #737d75;
  font-size: 11px;
}

.memo-list-toolbar select {
  width: 135px;
  height: 31px;
  margin: 0;
  padding: 4px 28px 4px 9px;
  font-size: 11px;
}

.memo-list-toolbar .btn {
  height: 31px;
  padding: 4px 9px;
}

.memo-day.is-today {
  background: #fffdf9;
}

.memo-day.is-today .memo-day-header {
  border-left-color: #e67b22;
  background: #fff7ee;
}

.memo-today-label {
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #459d35;
  color: #fff;
  font-size: 9px;
  font-weight: 750;
}

.memo-list::-webkit-scrollbar {
  width: 7px;
}

.memo-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd6c8;
}

.memo-list::-webkit-scrollbar-track {
  background: transparent;
}

/* 오늘의 조치 대상자 */
.action-target-guide {
  margin: -3px 0 10px;
  color: #7a837c;
  font-size: 11px;
}

.action-target-list {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  overflow-y: auto;
  border: 1px solid #dfe5df;
  border-radius: 9px;
  background: #fff;
  scrollbar-gutter: stable;
}

.action-target {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1.5fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 10px 9px 13px;
  border-left: 3px solid #d6ddd5;
  border-bottom: 1px solid #edf0ed;
}

.action-target:last-child {
  border-bottom: 0;
}

.action-target.overdue {
  border-left-color: #c8463b;
  background: #fffafa;
}

.action-target.today {
  border-left-color: #e57a22;
  background: #fffdf9;
}

.action-target.attention {
  border-left-color: #d79a35;
}

.action-target-person {
  min-width: 0;
}

.action-target-person strong,
.action-target-person span {
  display: block;
}

.action-target-person strong {
  overflow: hidden;
  color: #263a30;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-target-person span {
  margin-top: 2px;
  overflow: hidden;
  color: #7b857e;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-target-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.action-reason {
  padding: 3px 6px;
  border: 1px solid #dde3dd;
  border-radius: 4px;
  background: #f5f7f5;
  color: #667169;
  font-size: 10px;
  font-weight: 650;
}

.action-reason.severity-0 {
  border-color: #edc3bf;
  background: #fff0ef;
  color: #ae3b32;
}

.action-reason.severity-1 {
  border-color: #efca9f;
  background: #fff5e9;
  color: #a85a13;
}

.action-reason.severity-2 {
  border-color: #ead6aa;
  background: #fff9e9;
  color: #8d681b;
}

.action-target-empty {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #738078;
  text-align: center;
}

.action-target-empty i {
  margin-bottom: 8px;
  color: #5aa44f;
  font-size: 25px;
}

.action-target-empty strong {
  color: #43544a;
  font-size: 13px;
}

.action-target-empty span {
  margin-top: 3px;
  font-size: 10px;
}

@media (max-width: 760px) {
  .action-target {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .action-target-reasons {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  min-width: 0;
  margin-top: 18px;
}

.edit-banner {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #ffd7a8;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a4d00;
  font-size: 13px;
}

.medicine-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #ffe1bf;
  border-radius: 8px;
  background: #fff8f1;
  color: #8a5a00;
  font-size: 12px;
  line-height: 1.6;
}

.stock-main {
  color: #333;
  font-weight: 700;
}

.stock-sub {
  display: block;
  margin-top: 2px;
  color: #888;
  font-size: 11px;
}

.web-storage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.memo-selected-date {
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:var(--control-height);
  padding:0 11px;
  border:1px solid #efcfad;
  border-radius:7px;
  color:#98551f;
  background:#fff8ef;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
  cursor:pointer;
}
.memo-selected-date i { color:#df7420; font-size:14px; }
.memo-selected-date:hover { border-color:#e6a365; background:#fff1e1; }
.memo-selected-date:focus-visible { outline:2px solid rgba(223,116,32,.28); outline-offset:2px; }

.settings-launch-button {
  gap: 5px;
  color: #315e3b;
  background: linear-gradient(135deg, #fff, #f1f8ef);
}

.settings-launch-button .bi {
  font-size: 12px;
}

.settings-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(480px, calc(100vw - 28px));
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px 0 0 18px;
  color: #263b32;
  background: #fff;
  box-shadow: -18px 0 54px rgba(24, 45, 34, .2), -4px 0 16px rgba(24, 45, 34, .08);
}

#reset-license-button {
  width: auto;
  min-width: 104px;
  margin: 0;
}

.settings-dialog::backdrop {
  background: rgba(22, 34, 28, .18);
  animation: settings-backdrop-enter .24s ease-out both;
}

.settings-dialog[open] {
  animation: settings-panel-enter .26s cubic-bezier(.22, .75, .28, 1) both;
}

.settings-dialog[open].is-closing {
  animation: settings-panel-exit .2s ease-in both;
}

.settings-dialog[open].is-closing::backdrop {
  animation: settings-backdrop-exit .2s ease-in both;
}

.settings-dialog form {
  display: flex;
  height: 100%;
  max-height: 100dvh;
  flex-direction: column;
  overflow: hidden;
}

.settings-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid #e7ece8;
  background: linear-gradient(120deg, #fff 0%, #f5fbf2 62%, #fff2e6 100%);
}

.settings-dialog-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: #df7620;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
}

.settings-dialog-header h2 {
  margin: 0;
  color: #193b31;
  font-size: 22px;
  letter-spacing: -.04em;
}

.settings-dialog-header p {
  margin: 6px 0 0;
  color: #75827b;
  font-size: 12px;
}

.settings-product-status {
  display: flex;
  min-width: max-content;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  margin-left: auto;
}

.settings-version-badge,
.settings-license-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid #dfe6e1;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: #607068;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.settings-version-badge b {
  color: #d66c16;
}

.settings-license-badge.is-authenticated {
  border-color: #bcdcb6;
  color: #34792d;
  background: #eff8ec;
}

.settings-license-badge.is-required {
  border-color: #edc5bc;
  color: #ae483d;
  background: #fff3f0;
}

.settings-license-badge.is-preview {
  border-color: #cbd8e8;
  color: #4d6681;
  background: #f1f6fb;
}

.settings-dialog-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  padding: 0;
  border: 1px solid #dde5df;
  border-radius: 9px;
  color: #65736b;
  background: rgba(255, 255, 255, .78);
  cursor: pointer;
}

.settings-dialog-close:hover {
  color: #d96c16;
  border-color: #ecc8a9;
  background: #fff8f2;
}

.settings-dialog-body {
  display: grid;
  min-width: 0;
  gap: 14px;
  padding: 20px 26px;
  overflow-x: hidden;
  overflow-y: auto;
}

.settings-section {
  min-width: 0;
  padding: 17px;
  border: 1px solid #cfd9d2;
  border-radius: 12px;
  background: #fcfdfc;
  box-shadow: 0 2px 8px rgba(35, 61, 48, .055);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.settings-section:hover {
  border-color: #b7c6bc;
  background: #fff;
  box-shadow: 0 4px 12px rgba(35, 61, 48, .075);
}

.settings-collapsible-section[open] {
  border-color: #a9bcae;
  background: #fff;
  box-shadow: 0 6px 16px rgba(35, 61, 48, .09);
}

.settings-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 15px;
}

.settings-section-heading > .bi {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 8px;
  color: #398232;
  background: #edf7e9;
  font-size: 15px;
}

.settings-section-heading div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.settings-section-heading strong {
  color: #264338;
  font-size: 14px;
}

.settings-section-heading span {
  color: #7a8680;
  font-size: 11px;
}

.settings-section-summary {
  align-items: center;
  margin: 0;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.settings-section-summary::-webkit-details-marker { display: none; }
.settings-section-summary .settings-summary-chevron {
  width: auto;
  height: auto;
  margin-left: auto;
  color: #75827b;
  background: transparent;
  font-size: 12px;
  transition: transform .18s ease;
}
.settings-collapsible-section[open] > .settings-section-summary {
  margin-bottom: 15px;
  padding-bottom: 13px;
  border-bottom: 1px solid #dfe6e1;
}
.settings-collapsible-section[open] > .settings-section-summary .settings-summary-chevron { transform: rotate(180deg); }
.settings-section-summary:focus-visible { outline: 2px solid #4b9b3d; outline-offset: 5px; border-radius: 6px; }
.settings-section-content { min-width: 0; }
.settings-organization-section[open] > .settings-section-summary { margin-bottom: 11px; }
.settings-organization-section .settings-section-content { padding-bottom: 1px; }
.settings-organization-section .settings-organization-field { gap: 6px; }
.settings-field-help {
  display: block;
  margin-top: 1px;
  color: #7d8983;
  font-size: 10px;
  line-height: 1.5;
}
.settings-option-heading { display:flex; flex-direction:column; gap:3px; margin-bottom:9px; }
.settings-option-heading strong { color:#33423b; font-size:12px; }
.settings-option-heading span { color:#87918c; font-size:10px; }
html[data-theme="dark"] .settings-option-heading strong { color:#e6efea; }
html[data-theme="dark"] .settings-option-heading span { color:#c3cec8; }

.settings-field-grid {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr);
  gap: 12px;
}

.settings-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.settings-field > span {
  color: #52635a;
  font-size: 11px;
  font-weight: 750;
}

.settings-field input,
.settings-field select {
  width: 100%;
  height: 40px;
  margin: 0;
  border-color: #d7e0d8;
  background: #fff;
  font-size: 12px;
}

.settings-key-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
}

.settings-key-input input {
  border-radius: 8px 0 0 8px;
}

.settings-key-input button {
  display: grid;
  place-items: center;
  border: 1px solid #d7e0d8;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  color: #557064;
  background: #f6f9f6;
  cursor: pointer;
}

.settings-security-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 10px;
  color: #7b867f;
  font-size: 10px;
  line-height: 1.5;
}

.settings-security-note .bi {
  color: #4c9744;
  font-size: 12px;
}

.settings-data-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.settings-data-actions .btn {
  width: 100%;
  padding: 0 11px;
  gap: 7px;
  font-size: 11px;
}

.settings-data-actions .btn .bi,
.settings-dialog-footer .btn .bi {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}

.settings-data-actions .btn.danger {
  border-color: #d9958f;
  color: #fff;
  background: linear-gradient(180deg, #d95248, #b93630);
}

.settings-data-actions .btn.danger:hover {
  border-color: #b93630;
  background: linear-gradient(180deg, #c94840, #a92e29);
}

.settings-data-warning {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 10px;
  color: #9a5a52;
  font-size: 10px;
  line-height: 1.5;
}

.settings-license-management {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
}
.settings-license-current {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
  padding:11px 12px;
  border:1px solid #dce8df;
  border-radius:9px;
  background:#f6faf6;
}
.settings-license-current-copy { display:flex; min-width:0; flex-direction:column; gap:4px; }
.settings-license-current-copy span { color:#738078; font-size:10px; }
.settings-license-current-copy strong {
  color:#30463b;
  font-size:13px;
  letter-spacing:.08em;
  font-variant-numeric:tabular-nums;
}
.settings-license-key-toggle {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-width:82px;
  height:32px;
  padding:0 10px;
  border:1px solid #cbd9cf;
  border-radius:7px;
  background:#fff;
  color:#52635a;
  font-size:10px;
  font-weight:700;
  cursor:pointer;
}
.settings-license-key-toggle:hover { border-color:#78ad68; color:#39742f; background:#f7fbf5; }
.settings-license-key-toggle[hidden] { display:none; }
.settings-license-copy { display:flex; min-width:0; flex-direction:column; gap:4px; }
.settings-license-copy strong { color:#354a40; font-size:12px; }
.settings-license-copy span { color:#7a8680; font-size:10px; line-height:1.5; }
.settings-license-management #reset-license-button {
  width:auto;
  min-width:128px;
  height:38px;
  min-height:38px;
  margin:0;
  padding:0 13px;
  gap:7px;
  white-space:nowrap;
  font-size:11px;
}
.settings-license-warning {
  display:flex;
  align-items:flex-start;
  gap:7px;
  margin-top:12px;
  padding-top:11px;
  border-top:1px solid #ece4df;
  color:#9a5a52;
  font-size:10px;
  line-height:1.55;
}
.settings-license-warning .bi { flex:0 0 auto; color:#c56a43; font-size:12px; }

.settings-update-panel {
  display:grid;
  grid-template-columns:104px minmax(0,1fr);
  align-items:stretch;
  gap:14px;
  padding:13px;
  border:1px solid #dce5df;
  border-radius:10px;
  background:linear-gradient(120deg,#f8faf9 0%,#fffaf5 100%);
}
.settings-update-version {
  display:flex;
  min-width:0;
  flex-direction:column;
  justify-content:center;
  padding-right:14px;
  border-right:1px solid #e1e7e3;
}
.settings-update-version > span { color:#78847e; font-size:9px; font-weight:750; }
.settings-update-version > strong { margin-top:2px; color:#2d453a; font-size:18px; font-weight:850; font-variant-numeric:tabular-nums; }
.settings-update-version > small { width:max-content; margin-top:3px; padding:2px 6px; border-radius:999px; color:#4b7d42; background:#eef7eb; font-size:8px; font-weight:800; }
.settings-update-main { display:flex; min-width:0; flex-direction:column; gap:8px; }
.settings-release-notes-open {
  display:inline-flex;
  width:max-content;
  align-items:center;
  gap:5px;
  margin-top:7px;
  padding:0;
  border:0;
  color:#526d60;
  background:transparent;
  font:inherit;
  font-size:9px;
  font-weight:800;
  cursor:pointer;
}
.settings-release-notes-open:hover { color:#c6671f; }
.settings-release-notes-open[hidden] { display:none; }
.settings-update-copy { display:flex; min-width:0; flex-direction:column; gap:4px; }
.settings-update-copy > strong { color:#34483f; font-size:12px; line-height:1.45; }
.settings-update-meta { display:flex; min-width:0; align-items:center; flex-wrap:wrap; gap:4px; color:#7a8780; font-size:10px; line-height:1.5; }
.settings-update-installed { white-space:nowrap; }
.settings-update-installed strong { color:#52665c; font-size:10px; font-weight:850; font-variant-numeric:tabular-nums; }
.settings-update-meta-divider { color:#a8b1ac; }
.settings-update-check { display:inline-flex; width:100%; min-width:0; height:38px; align-items:center; justify-content:center; gap:7px; padding:0 12px; white-space:nowrap; font-size:11px; }
.settings-update-check:disabled { cursor:wait; opacity:.72; }
.settings-update-spinner { animation:settings-update-spin .85s linear infinite; }
.settings-update-panel.is-latest .settings-update-copy > strong { color:#3e7b35; }
.settings-update-panel.is-available .settings-update-copy > strong { color:#b85e18; }
.settings-update-panel.is-error .settings-update-copy > strong { color:#a84d45; }
.settings-update-panel.is-checking .settings-update-copy > strong { color:#5c6d65; }
.settings-update-result {
  display:flex;
  align-items:stretch;
  flex-direction:column;
  justify-content:space-between;
  gap:14px;
  margin-top:10px;
  padding:11px 12px;
  border:1px solid #dce5df;
  border-radius:9px;
  background:#f8faf9;
}
.settings-update-result[hidden] { display:none; }
.settings-update-result-copy { min-width:0; }
.settings-update-result-copy > strong { color:#42554c; font-size:13px; }
.settings-update-result-copy > p { margin:5px 0 0; color:#697970; font-size:12px; line-height:1.6; word-break:keep-all; overflow-wrap:anywhere; }
.settings-update-result.is-available { border-color:#efc79f; background:#fff8f1; }
.settings-update-result.is-available .settings-update-result-copy > strong { color:#b85e18; }
.settings-update-result.is-latest { border-color:#c9dfc5; background:#f2f8ef; }
.settings-update-result.is-latest .settings-update-result-copy > strong { color:#3e7b35; }
.settings-update-result.is-error { border-color:#e8c4bd; background:#fff5f3; }
.settings-update-result.is-error .settings-update-result-copy > strong { color:#a84d45; }
.settings-update-result.is-checking .settings-update-result-copy > strong { color:#5c6d65; }
.settings-update-result .btn { flex:0 0 auto; width:100%; min-width:0; min-height:40px; font-size:12px; }
.settings-update-result .btn[hidden] { display:none; }
@keyframes settings-update-spin { to { transform:rotate(360deg); } }

html[data-theme="dark"] .settings-update-panel { border-color:#5f7168; background:linear-gradient(120deg,#36453e,#403a35); }
html[data-theme="dark"] .settings-update-version { border-color:#5f6f67; }
html[data-theme="dark"] .settings-update-version > span { color:#c0ccc6; }
html[data-theme="dark"] .settings-update-version > strong { color:#f1f5f3; }
html[data-theme="dark"] .settings-update-version > small { color:#ccebc4; background:#3d533c; }
html[data-theme="dark"] .settings-update-meta { color:#c0ccc6; }
html[data-theme="dark"] .settings-update-copy > strong,
html[data-theme="dark"] .settings-update-installed strong { color:#f1f5f3; }
html[data-theme="dark"] .settings-update-meta-divider { color:#87948d; }
html[data-theme="dark"] .settings-release-notes-open { color:#c9d7cf; }
html[data-theme="dark"] .settings-release-notes-open:hover { color:#ffb57b; }
html[data-theme="dark"] .settings-update-panel.is-latest .settings-update-copy > strong { color:#bfe8b7; }
html[data-theme="dark"] .settings-update-panel.is-available .settings-update-copy > strong { color:#ffc18f; }
html[data-theme="dark"] .settings-update-panel.is-error .settings-update-copy > strong { color:#f2b6b1; }
html[data-theme="dark"] .settings-update-panel.is-checking .settings-update-copy > strong { color:#d6dfda; }
html[data-theme="dark"] .settings-update-result { border-color:#607269; background:#37473f; }
html[data-theme="dark"] .settings-update-result-copy > strong,
html[data-theme="dark"] .settings-update-result-copy > p { color:#edf3ef; }
html[data-theme="dark"] .settings-update-result.is-available { border-color:#956c49; background:#473a30; }
html[data-theme="dark"] .settings-update-result.is-latest { border-color:#587852; background:#344932; }
html[data-theme="dark"] .settings-update-result.is-error { border-color:#875b56; background:#493836; }

@media (max-width:560px) {
  .settings-update-panel { grid-template-columns:92px minmax(0,1fr); gap:10px; }
  .settings-update-version { padding-right:10px; }
  .settings-update-result { align-items:stretch; flex-direction:column; }
  .settings-update-result .btn { width:100%; }
}

.program-release-notes-dialog {
  width:min(540px, calc(100vw - 32px));
  max-width:none;
  max-height:calc(100vh - 32px);
  padding:0;
  overflow:auto;
  border:0;
  border-radius:16px;
  color:#263d33;
  background:#fff;
  box-shadow:0 26px 74px rgba(19,35,27,.3);
}
.program-release-notes-dialog::backdrop { background:rgba(20,34,28,.5); backdrop-filter:blur(2px); }
.program-release-notes-card { display:block; }
.program-release-notes-header {
  display:flex;
  align-items:center;
  gap:12px;
  padding:18px 20px;
  border-bottom:1px solid #e9e3dd;
  background:#fff9f3;
}
.program-release-notes-icon {
  display:grid;
  width:42px;
  height:42px;
  flex:0 0 42px;
  place-items:center;
  border-radius:12px;
  color:#c8661d;
  background:#ffead7;
  font-size:18px;
}
.program-release-notes-heading { display:grid; gap:2px; }
.program-release-notes-heading small { color:#ad5c20; font-size:9px; font-weight:850; letter-spacing:.08em; }
.program-release-notes-heading strong { color:#314239; font-size:13px; }
.program-release-notes-version {
  margin-left:auto;
  padding:6px 10px;
  border-radius:999px;
  color:#fff;
  background:#2e3e72;
  font-size:11px;
  font-weight:800;
  font-variant-numeric:tabular-nums;
}
.program-release-notes-body { padding:20px; }
.program-release-notes-body h2 { margin:0 0 6px; color:#263d33; font-size:21px; }
.program-release-notes-body > p { margin:0; color:#6d7b74; font-size:13px; line-height:1.6; }
.program-release-notes-body ul { display:grid; gap:10px; margin:18px 0; padding:0; list-style:none; }
.program-release-notes-body li {
  display:grid;
  grid-template-columns:30px minmax(0,1fr);
  align-items:center;
  gap:9px;
  min-height:42px;
  padding:12px;
  border-radius:9px;
  color:#3f5148;
  background:#f6f8f6;
  font-size:14px;
  line-height:1.65;
  word-break:keep-all;
  overflow-wrap:anywhere;
}
.program-release-notes-body li > i { color:#54964a; font-size:15px; }
.program-release-notes-data-safe {
  display:grid;
  grid-template-columns:30px minmax(0,1fr);
  align-items:center;
  gap:9px;
  padding:11px 12px;
  border-radius:10px;
  color:#326b2e;
  background:#edf7e9;
}
.program-release-notes-data-safe > i { font-size:16px; }
.program-release-notes-data-safe > span { display:grid; gap:2px; }
.program-release-notes-data-safe strong { font-size:11px; }
.program-release-notes-data-safe small { color:#668061; font-size:9px; line-height:1.45; }
.program-release-notes-footer {
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px 20px;
  border-top:1px solid #e7ece8;
  background:#fafbfa;
}
.program-release-notes-footer > small { color:#75817b; font-size:11px; line-height:1.5; }
.program-release-notes-footer .btn { min-width:76px; margin-left:auto; }

html[data-theme="dark"] .program-release-notes-dialog { color:#edf1ee; background:#252a28; box-shadow:0 28px 80px rgba(0,0,0,.52); }
html[data-theme="dark"] .program-release-notes-dialog::backdrop { background:rgba(4,6,5,.64); }
html[data-theme="dark"] .program-release-notes-header { border-color:#424945; background:#2e2b28; }
html[data-theme="dark"] .program-release-notes-icon { color:#ffad6c; background:#46362c; }
html[data-theme="dark"] .program-release-notes-heading small { color:#e99b60; }
html[data-theme="dark"] .program-release-notes-heading strong,
html[data-theme="dark"] .program-release-notes-body h2 { color:#f0f3f1; }
html[data-theme="dark"] .program-release-notes-body > p { color:#bac3be; }
html[data-theme="dark"] .program-release-notes-body li { color:#e6ebe8; background:#2e3431; }
html[data-theme="dark"] .program-release-notes-body li > i { color:#91ca86; }
html[data-theme="dark"] .program-release-notes-data-safe { color:#c7e9c0; background:#2b3a2c; }
html[data-theme="dark"] .program-release-notes-data-safe small { color:#adbea9; }
html[data-theme="dark"] .program-release-notes-footer { border-color:#424945; background:#292e2b; }
html[data-theme="dark"] .program-release-notes-footer > small { color:#b8c1bc; }

@media (max-width:560px) {
  .program-release-notes-header,
  .program-release-notes-body,
  .program-release-notes-footer { padding-right:15px; padding-left:15px; }
  .program-release-notes-footer { align-items:stretch; flex-direction:column; }
  .program-release-notes-footer .btn { width:100%; margin-left:0; }
}

.program-update-available-dialog .program-release-notes-body h2 { font-size:24px; line-height:1.4; }
.program-update-available-versions { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:16px; margin:22px 0 18px; padding:18px; border:1px solid #f0ddcb; border-radius:12px; background:#fff8f1; }
.program-update-available-versions > span { display:grid; gap:5px; min-width:0; }
.program-update-available-versions small { color:#75695e; font-size:12px; }
.program-update-available-versions strong { color:#445249; font-size:20px; overflow-wrap:anywhere; }
.program-update-available-versions > span:last-child strong { color:#b65313; }
.program-update-available-versions > i { color:#ba855d; font-size:21px; }
.program-update-available-dialog .program-update-available-note { font-size:12px; line-height:1.7; }
.program-update-available-dialog .program-release-notes-footer { justify-content:flex-end; gap:10px; }
.program-update-available-dialog .program-release-notes-footer .btn { min-height:42px; margin-left:0; font-size:13px; }
html[data-theme="dark"] .program-update-available-versions { border-color:#69523f; background:#332d27; }
html[data-theme="dark"] .program-update-available-versions small { color:#c4b8ad; }
html[data-theme="dark"] .program-update-available-versions strong { color:#e8eeea; }
html[data-theme="dark"] .program-update-available-versions > span:last-child strong { color:#ffb67d; }
html[data-theme="dark"] .program-update-available-versions > i { color:#d8a87f; }
@media (max-width:560px) {
  .program-update-available-dialog .program-release-notes-body h2 { font-size:22px; }
  .program-update-available-versions { gap:10px; padding:14px; }
  .program-update-available-versions strong { font-size:18px; }
  .program-update-available-dialog .program-release-notes-footer { flex-direction:row; }
  .program-update-available-dialog .program-release-notes-footer .btn { width:auto; flex:1; padding-right:10px; padding-left:10px; }
}

.settings-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 26px 18px;
  border-top: 1px solid #e7ece8;
  background: #fafbfa;
}

.settings-dialog-footer .btn {
  gap: 6px;
}

#settings-save-status {
  margin-right: auto;
  color: #b44036;
  font-size: 11px;
}

@keyframes settings-panel-enter {
  from { opacity: .7; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.settings-api-summary {
  position: relative;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  cursor: pointer;
}

.settings-api-summary::-webkit-details-marker {
  display: none;
}

.settings-api-summary .settings-summary-chevron {
  margin-left: auto;
  color: #75827b;
  font-size: 12px;
  transition: transform .18s ease;
}

.settings-api-section[open] > .settings-api-summary {
  margin-bottom: 15px;
}

.settings-api-section[open] > .settings-api-summary > .settings-summary-chevron {
  transform: rotate(180deg);
}

.settings-api-content {
  display: grid;
  gap: 12px;
}

.settings-api-subsection {
  min-width: 0;
  padding: 13px;
  border: 1px solid #dfe8e1;
  border-radius: 12px;
  background: #fbfdfb;
}

.settings-api-subsection-heading {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
}

.settings-api-subsection-heading > i {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: #d87228;
  background: #fff1e5;
}

.settings-api-subsection-heading > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.settings-api-subsection-heading strong {
  color: #243b34;
  font-size: 12px;
}

.settings-api-subsection-heading span {
  color: #7a8982;
  font-size: 10px;
  line-height: 1.45;
}

.settings-weather-location {
  margin-bottom: 14px;
  padding: 11px 12px 12px;
  border: 1px solid #dfe8e1;
  border-radius: 10px;
  background: #f7faf7;
}

.settings-weather-location .settings-option-heading { margin-bottom: 10px; }
.settings-weather-location-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-weather-location .settings-region-status { margin-top: 9px; }

@keyframes settings-panel-exit {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: .7; transform: translateX(100%); }
}

@keyframes settings-backdrop-enter {
  from { background: rgba(22, 34, 28, 0); }
  to { background: rgba(22, 34, 28, .18); }
}

@keyframes settings-backdrop-exit {
  from { background: rgba(22, 34, 28, .18); }
  to { background: rgba(22, 34, 28, 0); }
}

@media (max-width: 620px) {
  .settings-dialog {
    width: 100vw;
    border-radius: 0;
  }

  .settings-dialog-header,
  .settings-dialog-body,
  .settings-dialog-footer {
    padding-left: 17px;
    padding-right: 17px;
  }

  .settings-field-grid {
    grid-template-columns: 1fr;
  }

  .settings-dialog-header {
    flex-wrap: wrap;
  }

  .settings-product-status {
    order: 3;
    width: 100%;
    flex-direction: row;
    align-items: center;
    margin-left: 0;
  }

  .settings-data-actions {
    grid-template-columns: 1fr;
  }

  .settings-license-management { grid-template-columns:1fr; }
  .settings-license-management #reset-license-button { width:100%; }

  .settings-dialog-footer {
    flex-wrap: wrap;
  }

  #settings-save-status {
    width: 100%;
  }
}

.edit-banner,
.medicine-note {
  border-radius: 6px;
  box-shadow: none;
}

.history {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-left: 3px solid var(--of-green);
  border-radius: 0 6px 6px 0;
  background: #f8fbf7;
}

.stats-chart {
  display: grid;
  gap: 7px;
  width: min(920px, 100%);
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(180px, 1fr) 52px;
  align-items: center;
  gap: 14px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 7px;
}

.bar-row:nth-child(odd) {
  background: #fafcf9;
}

.bar-row .name {
  color: #34443b;
  font-size: 13px;
  font-weight: 650;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eee8;
  box-shadow: inset 0 1px 2px rgba(39, 65, 45, 0.08);
}

.bar-fill {
  min-width: 5px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #79be68, #3e9e32);
  transition: width 0.48s cubic-bezier(0.22, 0.74, 0.25, 1);
}

.bar-row.is-zero .bar-fill {
  min-width: 0;
}

.bar-row .count {
  justify-self: end;
  min-width: 42px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf6eb;
  color: #34772c;
  font-size: 11px;
  text-align: center;
}

.bar-row.is-zero .count {
  background: #f1f3f4;
  color: #7a8280;
}

.stats-chart.counseling .bar-fill {
  background: linear-gradient(90deg, #f3aa63, #e67820);
}

.stats-chart.counseling .count {
  background: #fff1e4;
  color: #b8580d;
}

.stats-card-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 14px;
}

.stats-card-heading h2 {
  margin-bottom: 0;
}

.stats-period-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid #e2e7e2;
  border-radius: 10px;
  background: #fbfcfa;
}

.stats-period-fields .period-filter-date > .app-date-input-wrap {
  width: 142px;
}

.stats-period-reset {
  height: 40px;
  margin: 0;
  white-space: nowrap;
}

html[data-theme="dark"] .stats-period-toolbar {
  border-color: #5d7066;
  background: #34443d;
}

@media (max-width: 1050px) {
  .stats-card-heading {
    flex-direction: column;
  }

  .stats-period-toolbar {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .bar-row {
    grid-template-columns: 1fr 48px;
    gap: 7px 10px;
  }

  .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .stats-period-fields { flex: 1 1 100%; }
  .stats-period-fields .period-filter-date { flex: 1 1 0; }
  .stats-period-fields .period-filter-date > .app-date-input-wrap { width: 100%; }
  .stats-period-reset { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .bar-fill { transition: none; }
}

.business-links-container {
  display: grid;
  gap: 18px;
}

.link-group {
  margin: 0;
}

.link-group h3 {
  margin: 0 0 9px;
  color: #515b66;
  font-size: 13px;
  font-weight: 700;
}

.link-group>div,
.link-group .links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-item {
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0;
  padding: 0 6px 0 12px;
  border: 1px solid #dde5dc;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(28, 55, 27, 0.025);
  transition: border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.link-item:hover {
  border-color: rgba(53, 157, 38, 0.42);
  background: #f8fcf7;
  box-shadow: 0 3px 9px rgba(53, 157, 38, 0.065);
}

.link-item a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #367b2d;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.link-item a:hover {
  color: #28781d;
}

.site-add-panel {
  width: 100%;
  max-width: 900px;
  margin-top: 20px;
  border: 1px solid #dfe6df;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.site-add-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(53, 157, 38, 0.35);
  border-radius: 4px;
  background: #ffffff;
}

.site-add-icon::before,
.site-add-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 2px;
  border-radius: 2px;
  background: #359d26;
  transform: translate(-50%, -50%);
}

.site-add-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  transition: opacity 0.15s ease;
}

.site-add-panel[open] .site-add-icon::after {
  opacity: 0;
}

.site-add-content {
  padding: 18px;
  background: #fbfcfb;
}

.site-add-form {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(180px, 1fr) minmax(280px, 1.8fr) auto;
  align-items: end;
  gap: 12px;
}

.site-submit-cell {
  display: flex;
  align-items: flex-end;
}

/* ==================================================
   푸터 및 워터마크
================================================== */

.app-footer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(300px, 1fr);
  align-items: center;
  gap: 24px;

  min-height: 66px;
  padding: 4px 28px;

  background: #ffffff;
  border-top: 1px solid #dfe5e2;
  box-shadow: 0 -2px 10px rgba(31, 41, 55, 0.04);

  color: #6b7280;
  font-size: 12px;
}

.footer-app-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.footer-text small {
  margin-top: 3px;
  color: #a2aaa5;
  font-size: 10px;
  letter-spacing: 0.3px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 11px;
}

.footer-release {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 8px;
  padding: 7px 13px;
  color: #6f7d75;
  border: 1px solid #e1e8e2;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff, #f6faf5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
  font-size: 11px;
  white-space: nowrap;
}

.footer-release-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--of-green);
  box-shadow: 0 0 0 3px rgba(53, 157, 38, .1);
}

.footer-release strong {
  color: #33483d;
  font-size: 11px;
}

.footer-release em {
  padding-left: 8px;
  color: #d56d16;
  border-left: 1px solid #dce4de;
  font-style: normal;
  font-weight: 750;
}

.footer-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.footer-text strong {
  color: #27332e;
  font-size: 14px;
  font-weight: 700;
}

.footer-text span {
  color: #8a9490;
  font-size: 11px;
}

.footer-info-item {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.footer-label {
  color: #9aa39f;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.7px;
}

.footer-info-item strong {
  color: #53605a;
  font-size: 14px;
  font-weight: 650;
}

.footer-divider {
  width: 2px;
  height: 18px;
  background: #d8dedb;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 6px;

  color: #4f6f5c;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.footer-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.footer-company-logo {
  display: block;
  width: 92px;
  height: 24px;
  object-fit: contain;
}

.footer-company-link {
  display: block;
  border-radius: 4px;
  transition: opacity .18s ease, transform .18s ease;
}

.footer-company-link:hover {
  opacity: .78;
  transform: translateY(-1px);
}

.footer-company-link:focus-visible {
  outline: 2px solid #4b9f3a;
  outline-offset: 3px;
}

.footer-copyright {
  padding-left: 12px;

  border-left: 1px solid #dfe4e1;

  color: #9aa19e;
  font-size: 10px;
  white-space: nowrap;
}

.page-watermark {
  position: absolute;
  left: 50%;
  bottom: 54px;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.page-watermark img {
  width: min(579.6px, 52.92vw);
  height: auto;

  opacity: .192;
  filter: saturate(1.02);
}

/* ==================================================
   애니메이션 및 특수 규칙
================================================== */

@keyframes statusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(50, 197, 95, 0.55);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(50, 197, 95, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(50, 197, 95, 0);
  }
}

/* ==================================================
   반응형 스타일
================================================== */

@media (max-width: 1100px) {
  .app-header {
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "storage";
    gap: 12px 20px;
    min-height: 132px;
    padding: 16px 22px;
  }

  .header-main-brand {
    padding-left: 28px;
  }

  .web-storage-settings {
    margin-right: 20px;
  }

  .header-main-logo {
    width: min(280px, 100%);
  }

  .kpi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-inner {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-inner button {
    position: relative;
    min-height: 52px;
    font-size: 17px;
  }

  .nav-inner button.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ed7d1d, #f3a457);
    box-shadow: 0 -1px 6px rgba(237, 125, 29, .2);
    animation: nav-indicator-fade-in .16s ease-out both;
  }

}

@keyframes nav-indicator-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1000px) {
  .site-add-panel {
    max-width: 760px;
  }

  .site-add-form {
    grid-template-columns: minmax(130px, 0.7fr) minmax(180px, 1fr) minmax(240px, 1.4fr);
    gap: 12px;
  }

  .site-submit-cell {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .site-submit-cell .btn {
    min-width: 100px;
  }

}

@media (max-width: 800px) {
  .app-header {
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "storage";
    justify-items: center;
    gap: 12px;
    min-height: auto;
    padding: 16px;
  }

  .header-main-brand,
  .storage-settings {
    width: 100%;
    justify-content: center;
    padding-left: 0;
  }

  #reset-license-button {
    justify-self: center;
    width: auto;
    margin-right: 0;
  }

  .web-storage-settings {
    margin-right: 0;
  }

  .header-main-logo {
    width: min(300px, 90vw);
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .flex-between {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-controls {
    width: 100%;
    grid-auto-flow: row;
    grid-auto-columns: 1fr;
  }

  .toolbar-controls input,
  .toolbar-controls select,
  .toolbar-controls .btn {
    width: 100% !important;
  }

  .card {
    border-radius: 14px;
  }

}

@media (max-width: 650px) {

  .memo-input-row {
    grid-template-columns: 1fr;
  }

  .memo-list-toolbar {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .memo-search-wrap {
    width: 100%;
  }

  .memo-list-toolbar select {
    flex: 1;
    width: auto;
  }

  .header-main-logo {
    width: min(220px, 78vw);
  }

  .nav-container {
    padding: 0;
  }

  .nav-container::after {
    right: 0;
    left: 0;
  }

  .nav-inner::-webkit-scrollbar {
    display: none;
  }

  .card h2 {
    margin-bottom: 13px;
    padding-bottom: 9px;
    font-size: 15px;
    line-height: 1.45;
  }

  .muted {
    line-height: 1.55;
  }

  .row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .row>div,
  .row>div[style] {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
  }

  textarea {
    min-height: 96px;
    line-height: 1.55;
  }

  .memo-input-row,
  .toolbar-controls {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-flow: row;
    gap: 8px;
  }

  .memo-input-row .btn,
  .toolbar-controls .btn,
  .btn-group .btn {
    width: 100%;
  }

  .btn-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .flex-between {
    gap: 10px;
  }

  .flex-between>h2 {
    width: 100%;
  }

  .kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .kpi>div {
    padding: 13px 8px;
    border-radius: 12px;
  }

  .kpi .lbl {
    font-size: 11px;
    line-height: 1.35;
  }

  th,
  td {
    min-width: 92px;
    padding: 10px 9px;
  }

  th:first-child,
  td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 3px 0 6px rgba(0, 0, 0, 0.04);
  }

  th:first-child {
    z-index: 3;
    background: #f8f9fb;
  }

  details.section {
    padding: 10px 11px;
    border: 1px solid #edf0f2;
    border-radius: 10px;
    background: #fcfcfc;
  }

  details.section summary {
    min-height: 28px;
    font-weight: 700;
  }

  .checkbox-group label {
    display: flex;
    min-height: 40px;
    margin: 0;
    padding: 8px 0;
  }

  .checkbox-group input {
    width: 20px;
    height: 20px;
  }

  .history {
    padding: 10px;
    line-height: 1.55;
  }

  .web-storage-settings,
  .web-storage-actions {
    width: 100%;
  }

  .web-storage-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .web-storage-actions .storage-button {
    width: 100%;
    min-height: 44px;
  }

  .web-storage-actions .danger {
    grid-column: 1 / -1;
  }

  :root {
    --control-height: 46px;
    --mini-height: 36px;
  }

  input,
  select,
  textarea {
    margin-bottom: 13px;
    font-size: 16px;
  }

  .btn,
  .btn.small {
    min-height: 46px;
    font-size: 14px;
  }

  .btn.mini {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
  }

  .demo-notice .btn {
    margin-top: 6px;
  }

  input,
  select,
  textarea,
  .btn,
  .btn.small,
  .btn.mini {
    border-radius: 6px;
  }

  .kpi .num {
    font-size: 24px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    width: max-content;
    min-width: 100%;
    max-width: none;
    margin-top: 4px;
    border: 1px solid #edf0f2;
    background: #fff;
    font-size: 12px;
    border-radius: 0;
  }

  .demo-notice {
    margin: 0 12px 12px;
    padding: 10px 12px;
    border-radius: 5px;
  }

  .card h2::before {
    height: 17px;
  }

  .kpi>div {
    text-align: left;
    min-height: 92px;
    border-radius: 6px;
  }

  .kpi>div .num,
  .kpi>div:nth-child(n) .num {
    font-size: 24px;
  }

  body {
    padding-bottom: env(safe-area-inset-bottom);
    background: #ffffff !important;
    font-size: 14px;
  }

  .app-header {
    gap: 8px;
    padding: 15px 14px 11px;
    border-top-width: 2px;
    background: #fffaf5;
  }

  nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .nav-inner {
    display: flex;
    min-height: auto;
    gap: 6px;
    padding: 8px 10px;
    overflow-x: auto;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav-inner button {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
    scroll-snap-align: start;
    min-width: 98px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #dfe7de;
    border-radius: 999px;
    background: #ffffff;
    font-size: 12px;
  }

.nav-inner button.active {
    box-shadow: inset 0 -3px 0 var(--brand-orange);
    border-color: var(--of-green);
    background: var(--of-green);
    color: #ffffff;
  }

  main {
    background: #ffffff;
    padding: 12px;
  }

  .card {
    --card-padding: 16px;
    margin-bottom: 12px;
    padding: var(--card-padding);
    box-shadow: var(--shadow-xs);
    border-radius: 8px;
  }

  .site-add-panel {
    max-width: none;
  }

  .site-add-content {
    padding: 14px;
  }

  .site-add-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .site-submit-cell {
    grid-column: auto;
  }

  .site-submit-cell,
  .site-submit-cell .btn {
    width: 100%;
  }

  .link-group>div,
  .link-group .links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .link-item {
    width: 100%;
  }

  .link-item a {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card h2 {
    gap: 8px;
  }

  .card h2::before {
    height: 18px;
  }

  select {
    height: 46px;
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  .storage-settings {
    justify-content: center;
  }

  .header-main-logo {
    width: min(260px, 88vw);
  }

}

@media (max-width: 380px) {
  .nav-inner {
    display: flex;
  }

  .nav-inner button {
    min-width: 86px;
  }

  .kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  main {
    padding: 9px;
  }

  .card {
    --card-padding: 13px;
    padding: var(--card-padding);
  }

}

@media (max-width: 768px) {
  .app-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;

    min-height: auto;
    padding: 14px 16px;
  }

  .footer-left {
    justify-content: flex-start;
  }

  .footer-release {
    order: 2;
    align-self: center;
  }

  .footer-right {
    order: 3;
    justify-content: space-between;
    width: 100%;

    padding-top: 10px;
    border-top: 1px solid #e5e9e7;
  }

  .footer-company-logo {
    width: 76px;
    height: 20px;
  }

  .footer-copyright {
    padding-left: 0;

    border-left: 0;

    font-size: 9px;
    text-align: right;
    white-space: normal;
  }

}
.journal-identity-row {
  display:grid;
  grid-template-columns:minmax(390px,430px) minmax(430px,480px);
  gap:16px;
  align-items:stretch;
  width:min(100%,926px);
  margin-top:14px;
}

.journal-subject-finder {
  position: relative;
  width:100%;
  min-width:0;
  max-width:480px;
  margin:0;
  padding: 16px;
  border: 1px solid #cfe2c9;
  border-radius: 12px;
  background: #f5faf2;
  box-shadow: inset 4px 0 0 #78b967, 0 5px 15px rgba(71, 116, 67, .055);
}

.journal-subject-finder-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}

.journal-subject-finder-heading label { margin: 0 0 2px; color: #315f38; font-size:16px; line-height:1.62; font-weight:800; }
.journal-subject-finder-heading p { margin: 0; color: #758574; font-size: 11px; }
.journal-finder-icon { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid #d1e5cb; border-radius: 10px; color: #43833d; background: #fff; font-size: 17px; }
.journal-subject-search-wrap { max-width: 760px; }
.journal-subject-search-wrap > i { color: #4c9443; }
.journal-subject-results { border-color: #cddfca; }
.journal-subject-result:hover,
.journal-subject-result:focus-visible { background: #f2f9ee; }

.subject-primary-fields {
  grid-template-columns: repeat(2, minmax(0, 180px));
  width: min(100%, 430px);
  min-width: 0;
  box-sizing: border-box;
}

.journal-identity-row .journal-primary-fields,
.journal-identity-row .journal-subject-finder { min-height:126px; height:100%; }
.journal-identity-row .journal-primary-fields { align-content:center; }

.journal-primary-fields {
  width: min(100%, 430px);
  min-width: 0;
  box-sizing: border-box;
}

.journal-primary-fields > .field-short,
.subject-primary-fields > .field-short {
  grid-column: auto;
  min-width: 0;
}

.journal-primary-fields input,
.subject-primary-fields input {
  min-width: 0;
  box-sizing: border-box;
}

.subject-form-status {
  min-height: 20px;
  margin-top: 9px;
  color: #3f7f36;
  font-size: 12px;
  font-weight: 750;
}

.nav-inner button:not(.active):focus-visible {
  position: relative;
  z-index: 2;
  outline: 2px solid rgba(237, 125, 29, .78);
  outline-offset: -3px;
}

.journal-subject-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 400px;
  max-width: 100%;
}

.journal-subject-search-wrap > i {
  color: #4c9443;
}

.journal-subject-search-wrap input {
  flex: 1;
  margin: 0;
}

.journal-subject-results {
  position: absolute;
  z-index: 20;
  top: calc(100% - 8px);
  left: 14px;
  right: 14px;
  overflow: hidden;
  border: 1px solid #cddfca;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(42, 34, 28, .14);
}

.journal-subject-result {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(120px, 1fr) minmax(110px, 1.2fr) minmax(120px, 1fr);
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid #f0ece8;
  background: #fff;
  color: #55605a;
  text-align: left;
  cursor: pointer;
}

.journal-subject-result:hover,
.journal-subject-result:focus-visible,
.journal-subject-result.is-keyboard-active {
  background: #f2f9ee;
  outline: none;
}

.journal-subject-result-name {
  color: #213d34;
  font-weight: 800;
}

.journal-subject-result-empty {
  padding: 16px;
  color: #7d8580;
  text-align: center;
}

@media (max-width: 760px) {
  .journal-subject-result { grid-template-columns: 1fr 1fr; }
  .journal-subject-search-wrap { flex-wrap: wrap; }
  .journal-subject-search-wrap input { flex-basis: calc(100% - 30px); }
}
/* 홈 업무 카드: 낮은 제목 띠에 흰색에 가까운 크림톤을 사용합니다. */
html:not([data-theme="dark"]) #tab-dashboard :is(
  .dashboard-schedule-card,
  .action-target-card,
  .dashboard-planner-card,
  .business-links-card
) {
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8e3d9;
}

html:not([data-theme="dark"]) #tab-dashboard :is(
  .dashboard-schedule-card,
  .action-target-card,
  .dashboard-planner-card,
  .business-links-card
) .collapsible-card-heading {
  box-sizing: border-box;
  min-height: 53px;
  font-size: 17.28px;
  margin-top: calc(-1 * var(--card-padding));
  margin-right: calc(-1 * var(--card-padding));
  margin-left: calc(-1 * var(--card-padding));
  padding-top: 8px;
  padding-right: var(--card-padding);
  padding-bottom: 8px;
  padding-left: var(--card-padding);
  border-bottom-color: #e8e3d9;
  background: #fcfaf6;
}

/* 모든 홈 목록의 빈 상태는 같은 컨테이너와 문구 스타일을 공유합니다. */
#tab-dashboard {
  --dashboard-empty-bg: #f8faf8;
  --dashboard-empty-border: #dfe6df;
  --dashboard-empty-title: #43544a;
  --dashboard-empty-description: #66746c;
}

html[data-theme="dark"] #tab-dashboard {
  --dashboard-empty-bg: #202422;
  --dashboard-empty-border: #414844;
  --dashboard-empty-title: #edf3ef;
  --dashboard-empty-description: #bbc2be;
}

#tab-dashboard :is(
  #schedule-list,
  #action-target-list,
  #memo-list,
  #links-container,
  #work-contacts-container
):has(> .dashboard-empty-state) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: stretch;
  box-sizing: border-box;
  min-height: 112px;
  padding: 0;
  border: 1px solid var(--dashboard-empty-border);
  border-radius: 9px;
  background: var(--dashboard-empty-bg);
  scrollbar-gutter: auto;
}

#tab-dashboard .dashboard-empty-state {
  display: flex;
  box-sizing: border-box;
  min-width: 0;
  min-height: 112px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 24px 16px;
  text-align: center;
  overflow-wrap: anywhere;
}

#tab-dashboard .dashboard-empty-state > strong {
  margin: 0;
  color: var(--dashboard-empty-title);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

#tab-dashboard .dashboard-empty-state > span {
  margin: 0;
  color: var(--dashboard-empty-description);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
}

.collapsible-card-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.collapsible-card-heading > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.collapse-card-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid #d8e1d8;
  border-radius: 6px;
  background: #f8faf8;
  color: #65716a;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: auto;
}

.collapse-card-toggle:hover {
  border-color: #9fbe9b;
  background: #f0f7ef;
  color: #367b2e;
}

.collapse-card-toggle .bi {
  font-size: 12px;
}

.collapsible-dashboard-card.is-collapsed .collapsible-card-content {
  display: none;
}

.collapsible-dashboard-card.is-collapsed .collapsible-card-heading {
  margin-bottom: 0;
  border-bottom-color: transparent;
}

.dashboard-section-count {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #d4e1d1;
  border-radius: 999px;
  background: #f2f8f0;
  color: #477343;
  font-size: 11px;
  font-weight: 800;
}

#tab-dashboard .dashboard-planner-card {
  display:flex;
  min-height:0;
  height:600px;
  margin-top:18px;
  flex-direction:column;
}

#tab-dashboard .dashboard-planner-card:not(.is-collapsed) .collapsible-card-content {
  display:flex;
  min-height:0;
  flex:1 1 auto;
  flex-direction:column;
  overflow:hidden;
}

#tab-dashboard .dashboard-planner-card.is-collapsed {
  height:auto;
}

#tab-dashboard .dashboard-planner-grid {
  display:grid;
  min-height:0;
  flex:1 1 auto;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:18px;
}

#tab-dashboard .dashboard-planner-pane {
  display:flex;
  min-height:0;
  flex-direction:column;
}

#tab-dashboard .dashboard-planner-pane + .dashboard-planner-pane {
  padding-left:18px;
  border-left:1px solid #e3e8e5;
}

#tab-dashboard .dashboard-planner-pane-title {
  display:flex;
  align-items:center;
  gap:7px;
  min-height:32px;
  color:#3b4640;
  font-size:13px;
  font-weight:800;
}

#tab-dashboard .dashboard-calendar-pane .memo-calendar-panel {
  display:flex;
  min-height:0;
  margin:8px 0 0;
  flex:1 1 auto;
  flex-direction:column;
}

#tab-dashboard .dashboard-calendar-pane .memo-calendar-body {
  display:flex;
  min-height:0;
  max-height:none;
  flex:1 1 auto;
  flex-direction:column;
}

#tab-dashboard .dashboard-calendar-pane .memo-calendar-grid {
  min-height:0;
  flex:1 1 auto;
  grid-auto-rows:minmax(48px, 1fr);
}

#tab-dashboard .dashboard-memo-pane .memo-list-section {
  display:flex;
  min-height:0;
  max-height:none;
  flex:1 1 auto;
  flex-direction:column;
}

#tab-dashboard .dashboard-memo-pane .memo-list {
  min-height:0;
  max-height:none;
  flex:1 1 auto;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}

#tab-dashboard .dashboard-memo-pane .memo-input-row {
  margin-top:8px;
}

#tab-dashboard .dashboard-memo-pane .memo-list-section {
  margin-top: 12px;
}

@media (max-width:900px) {
  #tab-dashboard .dashboard-planner-card { height:auto; }
  #tab-dashboard .dashboard-planner-grid { grid-template-columns:1fr; }
  #tab-dashboard .dashboard-planner-pane { min-height:500px; }
  #tab-dashboard .dashboard-planner-pane + .dashboard-planner-pane { padding-top:18px; padding-left:0; border-top:1px solid #e3e8e5; border-left:0; }
}

/* 날짜별 메모 달력 */
.memo-calendar-panel {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #e0e5e2;
  border-radius: 11px;
  background: #fff;
}

.memo-calendar-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.memo-calendar-heading strong {
  min-width: 104px;
  color: #2f3740;
  font-size: 14px;
  text-align: center;
}

.memo-calendar-nav {
  min-height: 30px;
  border: 1px solid #dce2de;
  border-radius: 7px;
  color: #505a55;
  background: #fff;
  cursor: pointer;
}

.memo-calendar-nav { width: 30px; padding: 0; }
.memo-calendar-nav:hover { border-color:#a9cea1; color:#43823b; background:#f6fbf4; }

.memo-calendar-weekdays,
.memo-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.memo-calendar-weekdays {
  margin:0 -12px 7px;
  padding:7px 12px 8px;
  border-top:1px solid #e8ece9;
  border-bottom:1px solid #dde3df;
  background:#fafbfa;
}
.memo-calendar-weekdays span {
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  color:#626b66;
  font-size:10px;
  font-weight:800;
  text-align:center;
}
.memo-calendar-weekdays span::before {
  display:none;
}
.memo-calendar-weekdays span:first-child { color:#c03932; }
.memo-calendar-weekdays span:last-child { color:#66798b; }

.memo-calendar-day {
  position: relative;
  display: grid;
  grid-template-rows: 20px 16px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 60px;
  padding: 7px 4px;
  border: 1px solid #f0f2f0;
  border-radius: 10px;
  color:#424a46;
  background:#fff;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.memo-calendar-today-badge {
  position:absolute;
  top:-7px;
  left:50%;
  transform:translateX(-50%);
  padding:1px 7px;
  border:1px solid #fff;
  border-radius:999px;
  color:#fff;
  background:#ba5817;
  font-size:9px;
  font-style:normal;
  font-weight:700;
  line-height:13px;
  white-space:nowrap;
  pointer-events:none;
}
html[data-theme="dark"] .memo-calendar-today-badge {
  border-color:#262b28;
  color:#23180e;
  background:#f4a46b;
}
.memo-calendar-day > .memo-calendar-day-number {
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}
.memo-calendar-day > .memo-calendar-day-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  width: 100%;
  height: 16px;
  font-size: 10px;
  font-weight: 500;
  line-height: 16px;
}
.memo-calendar-day b { flex:0 0 auto; padding:0 5px; border-radius:5px; color:#52894a; background:#eff7ed; font-size:9px; font-weight:600; line-height:15px; white-space:nowrap; }
.memo-calendar-day:hover { transform:translateY(-1px); border-color:#b8d7b2; background:#f8fcf7; }
.memo-calendar-day.has-memo { border-color:#d5e6d1; background:#f8fcf7; }
.memo-calendar-day.is-today {
  border:2px solid #f08a2b;
  color:#9a5418;
  background:#fff8f1;
  box-shadow:0 3px 9px rgba(240,138,43,.11);
}
.memo-calendar-day.is-selected {
  border:1px solid #79b56e;
  color:#43823b;
  background:#f5fbf3;
  box-shadow:none;
}
.memo-calendar-day.is-today.is-selected {
  border-width:2px;
  border-style:solid;
  border-color:#f08a2b;
  background:#fff8f1;
  box-shadow:0 3px 9px rgba(240,138,43,.11);
}
.memo-calendar-day.is-selected b { color:#4f8d46; background:#e8f5e5; }

.memo-calendar-day.is-sunday > .memo-calendar-day-number,
.memo-calendar-day.is-holiday > .memo-calendar-day-number,
.memo-calendar-holiday-name { color:#bc443d; }
.memo-calendar-day.is-holiday { border-color:#f1dedb; background:#fff5f3; }
.memo-calendar-day.is-holiday:hover { border-color:#dfb0a9; background:#ffefec; }
.memo-calendar-day.is-holiday.is-selected { border-color:#79b56e; background:#fff2ef; }
.memo-calendar-day.is-holiday.is-today { border-color:#f08a2b; background:#fff5f0; }
.memo-calendar-holiday-name {
  display:block;
  min-width:0;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:10px;
  font-weight:500;
  line-height:16px;
}
.memo-calendar-holiday-status { margin:6px 0 0; color:#626b66; font-size:10px; line-height:1.4; }

@media (max-width:560px) {
  .memo-calendar-panel { padding: 9px; }
  .memo-calendar-weekdays, .memo-calendar-grid { gap: 3px; }
  .memo-calendar-weekdays { margin-right:-9px; margin-left:-9px; padding-right:9px; padding-left:9px; }
  .memo-calendar-weekdays span { gap:2px; }
  .memo-calendar-weekdays span::before { width:5px; height:8px; }
  .memo-calendar-day { min-height: 40px; }
  .memo-calendar-heading { flex-wrap:wrap; }
  .memo-input-row { grid-template-columns:1fr auto; }
  .memo-selected-date { grid-column:1 / -1; width:max-content; }
}

/* 날짜별 메모: 날짜 그룹과 내용을 명확히 구분 */
.memo-list {
  padding: 1px 0;
  border-color: #d9e2da;
  background: #f7f9f7;
}

.memo-day {
  margin: 9px;
  overflow: hidden;
  border: 1px solid #dfe6df;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(39, 62, 49, .04);
}

.memo-day + .memo-day {
  margin-top: 11px;
  border-top: 1px solid #dfe6df;
}

.memo-day-header {
  min-height: 38px;
  padding: 8px 13px;
  border-left-width: 4px;
  border-bottom: 1px solid #e4e9e4;
  background: #f1f5f2;
}

.memo-day-header time {
  color: #294338;
  font-size: 13px;
  font-weight: 800;
}

.memo-item {
  gap: 10px;
  min-height: 48px;
  padding: 9px 11px 9px 14px;
  border-bottom-color: #e8ede9;
}

.memo-item-text {
  flex: 1;
  padding-left: 0;
  line-height: 1.6;
}

.memo-item-text::before {
  content: none;
}

.memo-item-icon {
  flex: 0 0 auto;
  color: #7c9a82;
  font-size: 15px;
}

.memo-item .actions {
  opacity: .72;
  transition: opacity .15s ease;
}

.memo-item:hover {
  background: #fbfcfb;
}

.memo-item:hover .actions,
.memo-item:focus-within .actions {
  opacity: 1;
}

.memo-day.is-today {
  border-color: #63a857;
  background: #f8fcf7;
  box-shadow: 0 4px 14px rgba(54, 132, 43, .18);
}

.memo-day.is-today .memo-day-header {
  border-left-color: #2f8727;
  border-bottom-color: #b9d8b4;
  background: linear-gradient(90deg, #dcefd8, #edf7eb);
}

.memo-day.is-today .memo-day-header time {
  color: #246c20;
  font-weight: 900;
}

.memo-day.is-today .memo-today-label {
  padding: 3px 7px;
  background: #318b29;
  box-shadow: 0 2px 5px rgba(49, 139, 41, .22);
}

/* 대상자 일괄등록 엑셀 양식 미리보기 */
.excel-template-preview {
  margin: 12px 0;
  border: 1px solid #dce5dc;
  border-radius: 10px;
  background: #fbfdfb;
}

.excel-template-preview > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 13px;
  color: #376b32;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.excel-template-preview > summary::-webkit-details-marker {
  display: none;
}

.excel-template-preview > summary::after {
  content: "펼치기";
  margin-left: auto;
  color: #758078;
  font-size: 11px;
  font-weight: 700;
}

.excel-template-preview[open] > summary::after {
  content: "접기";
}

.excel-template-preview[open] > summary {
  border-bottom: 1px solid #e1e8e1;
  background: #f3f8f2;
}

.excel-template-preview-body {
  padding: 13px;
}

.excel-template-preview-guide {
  display: flex;
  align-items: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  color: #707a73;
  font-size: 11px;
}

.excel-template-preview-guide {
  justify-content: space-between;
  margin-bottom: 9px;
}

.excel-required-mark {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border-radius: 4px;
  background: #fff0e4;
  color: #c65e0b;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.excel-template-scroll {
  overflow-x: auto;
  border: 1px solid #cfd9cf;
  border-radius: 7px;
  background: #fff;
  scrollbar-color: #a7bda4 #eef3ee;
  scrollbar-width: thin;
}

.excel-template-scroll:focus-visible {
  outline: 2px solid rgba(69, 157, 53, .38);
  outline-offset: 2px;
}

.excel-template-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
}

.excel-template-table th,
.excel-template-table td {
  min-width: 126px;
  max-width: 170px;
  height: 38px;
  padding: 7px 9px;
  border: 0;
  border-right: 1px solid #dfe6df;
  border-bottom: 1px solid #dfe6df;
  color: #38443d;
  text-align: left;
  white-space: nowrap;
}

.excel-template-table th {
  background: #4b9b2d;
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.excel-template-table tr > :last-child {
  border-right: 0;
}

.excel-template-table tbody tr:last-child td {
  border-bottom: 0;
  background: #fff0e1;
  color: #8a5a31;
  font-style: italic;
  text-align: center;
}

.excel-template-table .excel-column-letters th {
  min-width: 126px;
  height: 24px;
  padding: 3px 8px;
  background: #f3f5f3;
  color: #89918c;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
}

.excel-template-table .excel-preview-title-row th {
  height: 64px;
  padding: 10px 14px;
  border-top: 5px solid #ef7d22;
  background: #e4f0df;
  color: #263b31;
  text-align: left;
}

.excel-preview-title-row strong,
.excel-preview-title-row span {
  display: block;
}

.excel-preview-title-row strong {
  margin-bottom: 7px;
  font-size: 18px;
  letter-spacing: -.03em;
}

.excel-preview-title-row span {
  color: #718073;
  font-size: 10px;
  font-weight: 600;
}

.excel-template-table .excel-preview-guide-row th {
  height: 40px;
  padding: 8px 14px;
  background: #fffaf5;
  color: #505b54;
  text-align: left;
  font-size: 10px;
}

.excel-preview-guide-row b {
  margin-right: 7px;
  color: #293f34;
}

.excel-template-table .excel-preview-hint-row th {
  height: 48px;
  padding: 6px 8px;
  background: #f3f5f6;
  color: #818990;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
}

.excel-required-dot {
  color: #dff5d4;
  font-size: 8px;
  vertical-align: middle;
}

/* 대시보드의 절제된 동적 피드백 */
.dashboard-live-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 9px;
  color: #4d6753;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.dashboard-live-date .bi {
  color: #df7620;
  font-size: 17px;
}

#tab-dashboard:not(.hidden) .dashboard-hero-copy {
  animation: dashboard-copy-enter .5s ease-out both;
}

#tab-dashboard:not(.hidden) .dashboard-hero-watermark {
  animation: dashboard-character-enter .65s cubic-bezier(.2, .8, .2, 1) both;
}

.kpi > div,
main .card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.kpi > div:hover,
main .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(42, 74, 54, .09);
}

main > section:not(.hidden) .card {
  animation: none;
}

main > section:not(.hidden) .card:nth-of-type(2) { animation-delay: .035s; }
main > section:not(.hidden) .card:nth-of-type(3) { animation-delay: .07s; }
main > section:not(.hidden) .card:nth-of-type(4) { animation-delay: .105s; }
main > section:not(.hidden) .card:nth-of-type(n+5) { animation-delay: .14s; }

#tab-dashboard:not(.hidden) .kpi > div {
  animation: dashboard-kpi-enter .42s ease-out backwards;
}

#tab-dashboard:not(.hidden) .kpi > div:nth-child(2) { animation-delay: .04s; }
#tab-dashboard:not(.hidden) .kpi > div:nth-child(3) { animation-delay: .08s; }
#tab-dashboard:not(.hidden) .kpi > div:nth-child(4) { animation-delay: .12s; }
#tab-dashboard:not(.hidden) .kpi > div:nth-child(5) { animation-delay: .16s; }

.action-target.overdue {
  animation: action-target-attention 2.8s ease-in-out infinite;
}

.collapsible-dashboard-card:not(.is-collapsed) .collapsible-card-content {
  animation: dashboard-content-open .24s ease-out both;
}

@keyframes dashboard-copy-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dashboard-character-enter {
  from { opacity: 0; transform: translate(18px, -50%); }
  to { opacity: .9; transform: translate(0, -50%); }
}

@keyframes dashboard-kpi-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes workspace-card-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
    box-shadow: 0 5px 14px rgba(42, 74, 54, .03);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dashboard-content-open {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes action-target-attention {
  0%, 100% { box-shadow: 0 2px 7px rgba(194, 54, 47, 0); }
  50% { box-shadow: 0 3px 10px rgba(194, 54, 47, .08); }
}

/* 응급기록 */
.emergency-form-card { position:relative; overflow:hidden; border-color:#ead6d4; }
#tab-emergency { --card-accent:#c95852; }
.emergency-form-card > .workspace-eyebrow { color:#b94e49; }
.emergency-form-card > .workspace-eyebrow i { color:#c6534d; }
.emergency-form-card > h2 { color:#293c3a; }
#tab-emergency .card h2::before { background:#c95852; }
#tab-emergency .workspace-eyebrow,
#tab-emergency .workspace-eyebrow i { color:#b94e49; }
.workspace-form-guide { max-width:900px; margin:8px 0 18px; color:#758079; font-size:12px; line-height:1.6; }
.workspace-form-guide b { color:#d65045; }
.emergency-list-note { margin:0; color:#7b8780; font-size:12px; line-height:1.55; }
.workspace-eyebrow { display:flex; align-items:center; gap:7px; width:max-content; margin:0 0 6px; color:#df701c; font-size:10px; font-weight:850; letter-spacing:1.15px; line-height:1.2; }
.workspace-eyebrow i { font-size:15px; }
.workspace-eyebrow + h2 { margin-top:0; }
.emergency-form-grid { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:12px 14px; max-width:1120px; }
.emergency-field { display:flex; flex-direction:column; min-width:0; }
.emergency-form-grid .field-short { grid-column:span 3; }
.emergency-form-grid .field-medium { grid-column:span 4; }
.emergency-form-grid .field-long { grid-column:span 8; }
.emergency-field-wide { grid-column:1 / -1; }
.emergency-primary-fields { grid-template-columns:minmax(210px,.85fr) minmax(285px,1.15fr); max-width:650px; margin:12px 0 18px; padding:14px; border:1px solid #ebd1cf; border-radius:12px; background:#fff8f7; box-shadow:inset 3px 0 0 #ce5d57; }
.emergency-primary-fields .field-short,
.emergency-primary-fields .field-medium { grid-column:auto; min-width:0; }
.emergency-primary-fields input { min-width:0; width:100%; }
.emergency-field label { margin-bottom:7px; }
.emergency-field label b { color:inherit; }
.emergency-field textarea { min-height:82px; resize:vertical; }
.emergency-status-panel { margin:4px 0 14px; padding:15px 16px; border:1px solid #e2dddd; border-radius:10px; background:#faf9f9; }
.emergency-status-panel > strong { display:flex; align-items:center; gap:7px; margin-bottom:12px; color:#5a4140; font-size:12px; }
.emergency-status-panel > strong i { color:#bf514c; }
.emergency-status-options { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; }
.emergency-status-options label { position:relative; min-width:0; margin:0; cursor:pointer; }
.emergency-status-options input { position:absolute; top:0; left:0; width:1px; height:1px; margin:0; padding:0; border:0; clip-path:inset(50%); opacity:0; pointer-events:none; }
.emergency-status-options input:focus-visible + span { outline:2px solid #bf514c; outline-offset:2px; }
.emergency-status-options span { display:flex; align-items:center; justify-content:center; gap:7px; min-height:38px; padding:7px 9px; border:1px solid #d9e2da; border-radius:9px; color:#526159; background:#fff; font-size:11px; font-weight:700; transition:.16s ease; }
.emergency-status-options span i { color:#78917e; font-size:15px; }
.emergency-status-options input:checked + span { border-color:#cf6963; color:#9e3935; background:#fff1f0; box-shadow:0 0 0 2px rgba(190,75,69,.09); }
.emergency-status-options input:checked + span i { color:#bf514c; }
.emergency-bottom-grid { align-items:start; margin-bottom:16px; }
.emergency-bottom-grid textarea { min-height:64px; }
.emergency-list-card .flex-between { align-items:flex-start; margin-bottom:14px; }
.emergency-list-card h2 { display:flex; align-items:center; gap:8px; margin-bottom:5px; }
.emergency-list-card h2 i { color:#418f37; font-size:18px; }
.emergency-list-card { min-width:0; max-width:100%; }
.emergency-table-wrap { box-sizing:border-box; width:100%; max-width:100%; min-width:0; overflow-x:auto; overscroll-behavior-x:contain; border:1px solid #e1e8e2; border-radius:10px; }
.emergency-table-wrap:focus-visible { outline:2px solid var(--work-danger,#bf514c); outline-offset:2px; }
.emergency-table-wrap table { width:100%; min-width:1440px; margin:0; table-layout:auto; }
.emergency-table-wrap thead th { background:#f3f7f3; white-space:nowrap; }
.emergency-table-wrap tbody tr:hover { background:#fffaf5; }
.emergency-table-wrap td { vertical-align:middle; }
.emergency-table-wrap :is(th,td):nth-child(1):not([colspan]) { min-width:160px; white-space:nowrap; }
.emergency-table-wrap :is(th,td):nth-child(2):not([colspan]) { min-width:150px; white-space:nowrap; word-break:keep-all; overflow-wrap:normal; }
.emergency-table-wrap :is(th,td):nth-child(3):not([colspan]),
.emergency-table-wrap :is(th,td):nth-child(6):not([colspan]) { min-width:230px; max-width:360px; white-space:normal; overflow-wrap:anywhere; }
.emergency-table-wrap :is(th,td):nth-child(4):not([colspan]) { min-width:70px; white-space:nowrap; }
.emergency-table-wrap :is(th,td):nth-child(5):not([colspan]) { min-width:160px; max-width:260px; overflow-wrap:anywhere; }
.emergency-table-wrap :is(th,td):nth-child(7):not([colspan]) { min-width:110px; white-space:nowrap; word-break:keep-all; overflow-wrap:normal; }
.emergency-table-wrap td:nth-child(7) .status { display:inline-flex; align-items:center; white-space:nowrap; }
.emergency-table-wrap :is(th,td):nth-child(8):not([colspan]) { width:240px; min-width:240px; white-space:nowrap; }
.emergency-table-wrap .record-actions { display:flex; flex-wrap:nowrap; align-items:center; gap:6px; width:max-content; }
.emergency-table-wrap .record-actions > .btn { flex:0 0 auto; white-space:nowrap; }
.workspace-detail-fields { overflow:hidden; max-width:1120px; margin:16px 0; border:1px solid #dfe7df; border-radius:10px; background:#fff; }
.workspace-detail-fields > summary { padding:10px 13px; color:#34742e; background:#fbfdfb; font-size:12px; font-weight:800; cursor:pointer; }
.workspace-detail-fields[open] > summary { border-bottom:1px solid #e5ebe5; }
.workspace-detail-fields > :not(summary) { margin-right:14px; margin-left:14px; }
.workspace-detail-fields .emergency-bottom-grid { margin-bottom:14px; }
#tab-emergency .workspace-detail-fields { border-color:#e5dddd; }
#tab-emergency .workspace-detail-fields > summary { color:#9b403c; background:#fffafa; }
#tab-emergency #e-save-btn,
#tab-emergency button[onclick="addEmergency()"] { border-color:#a94440; background:#bd514b; box-shadow:0 3px 8px rgba(154,55,50,.16); }
#tab-emergency #e-save-btn:hover,
#tab-emergency button[onclick="addEmergency()"]:hover { background:#a9433e; }
.medicine-form-card { position:relative; z-index:2; overflow:visible; }
.medicine-form-card .workspace-detail-fields[open] { overflow:visible; }
.medicine-form-card:has(.medicine-unit-menu:not(.hidden)) { z-index:40; }
.medicine-primary-fields { grid-template-columns:minmax(210px,1.5fr) minmax(130px,.8fr) minmax(120px,.72fr) minmax(130px,.82fr); gap:12px 14px; max-width:850px; margin:12px 0 16px; padding:14px; border:1px solid #f0d8c5; border-radius:12px; background:#fffaf5; }
.medicine-primary-fields .field-medium,
.medicine-primary-fields .field-short { grid-column:auto; min-width:0; }
.medicine-primary-fields > div,
.medicine-primary-fields input { min-width:0; width:100%; }
.infection-primary-fields { grid-template-columns:minmax(160px,.8fr) minmax(230px,1.2fr) minmax(170px,.85fr); gap:12px 14px; max-width:760px; margin:12px 0 18px; padding:14px; border:1px solid #f0d8c5; border-radius:12px; background:#fffaf5; }
.infection-primary-fields .field-short,
.infection-primary-fields .field-medium { grid-column:auto; min-width:0; }
.infection-primary-fields > div,
.infection-primary-fields input { min-width:0; width:100%; }
.medicine-form-card .medicine-note { display:flex; align-items:flex-start; gap:9px; margin:14px; padding:11px 12px; border:1px solid #f0d7bc; border-radius:9px; color:#76583e; background:#fff8ef; font-size:11px; line-height:1.55; }
.medicine-form-card .medicine-note i { flex:0 0 auto; color:#df7420; font-size:16px; }
.medicine-form-card .workspace-detail-fields .form-grid { margin:0 14px 15px; }
.medicine-current-stock-field { margin:0; }
.subject-primary-fields, .journal-primary-fields { margin-top:14px; padding:14px; border:1px solid #f0d8c5; border-radius:12px; background:linear-gradient(135deg,#fffaf5,#fffdfb); }
.journal-identity-row .journal-primary-fields { margin-top:0; }
.subject-primary-fields { max-width:430px; }
.journal-primary-fields { max-width:430px; }
.subject-primary-fields > div, .journal-primary-fields > div { min-width:0; }
.subject-primary-fields label, .journal-primary-fields label { color:#263f36; font-weight:800; }
.subject-primary-fields input, .journal-primary-fields input { background:#fff; }
.journal-inline-choice,
.journal-inline-choice > select,
.journal-inline-custom { width:100%; min-width:0; }
.journal-inline-custom { display:flex; align-items:stretch; height:42px; }
.journal-inline-custom.hidden { display:none; }
.journal-visit-fields .journal-inline-custom input {
  flex:1 1 0;
  width:auto;
  min-width:0;
  height:42px;
  margin:0;
  box-sizing:border-box;
  border-radius:7px 0 0 7px;
}
.journal-inline-custom button {
  flex:0 0 38px;
  width:38px;
  height:42px;
  min-height:42px;
  margin:0;
  padding:0;
  box-sizing:border-box;
  border:1px solid #cfd9d0;
  border-left:0;
  border-radius:0 7px 7px 0;
  color:#53665a;
  background:#f8faf8;
  cursor:pointer;
}
.journal-inline-custom button:hover { color:#2f772b; background:#f0f7ef; }
html[data-theme="dark"] .journal-inline-custom input,
html[data-theme="dark"] .journal-inline-custom button { border-color:#687b71; color:#edf4ef; background:#35463f; }
html[data-theme="dark"] .journal-inline-custom button:hover { color:#cce7c7; background:#40554a; }
.journal-visit-fields {
  display:grid;
  grid-template-columns:minmax(210px,230px) minmax(135px,155px) repeat(2,minmax(185px,210px)) minmax(160px,180px);
  gap:12px;
  align-items:start;
  width:min(100%,1080px);
  margin-top:14px;
}
.journal-visit-fields > div { min-width:0; }
.journal-visit-fields label { display:block; margin-bottom:6px; }
.journal-visit-fields input,
.journal-visit-fields select { width:100%; min-width:0; box-sizing:border-box; }
.journal-detail-fields { margin:16px 0; }

/* 등록 폼 상세정보 펼침 버튼 */
#tab-journal details.section,
#tab-subjects details.section {
  overflow: hidden;
  margin:14px 0 16px;
  border:1px solid #dce7da;
  border-radius:10px;
  background:#fff;
}

#tab-journal details.section > summary,
#tab-subjects details.section > summary {
  display:flex;
  align-items:center;
  gap:9px;
  min-height:44px;
  margin:0;
  padding:0 14px;
  color:#3f743b;
  background:linear-gradient(90deg,#f4faef,#fbfdf9);
  font-size:13px;
  font-weight:800;
  list-style:none;
  cursor:pointer;
  transition:background-color .16s ease, color .16s ease;
}

#tab-journal details.section > summary::-webkit-details-marker,
#tab-subjects details.section > summary::-webkit-details-marker { display:none; }

#tab-journal details.section > summary::before,
#tab-subjects details.section > summary::before {
  content:"＋";
  display:grid;
  place-items:center;
  width:26px;
  height:26px;
  border:1px solid #d2e5ce;
  border-radius:7px;
  color:#4c9343;
  background:#fff;
  font-size:16px;
  font-weight:700;
}

#tab-journal details.section[open] > summary::before,
#tab-subjects details.section[open] > summary::before { content:"−"; }

#tab-journal details.section > summary::after,
#tab-subjects details.section > summary::after {
  content:"펼치기";
  margin-left:auto;
  color:#758574;
  font-size:11px;
  font-weight:700;
}

#tab-journal details.section[open] > summary,
#tab-subjects details.section[open] > summary { border-bottom:1px solid #e1e9df; background:#eef7e9; }
#tab-journal details.section[open] > summary::after,
#tab-subjects details.section[open] > summary::after { content:"접기"; }
#tab-journal details.section > .form-grid,
#tab-subjects details.section > .form-grid,
#tab-subjects details.section > .field-full,
#tab-subjects details.section > label,
#tab-subjects details.section > textarea,
#tab-subjects details.section > div:not(.form-grid):not(.field-full) { margin-left:14px; margin-right:14px; }
#tab-journal details.section > .form-grid,
#tab-subjects details.section > .form-grid { width:calc(100% - 28px); margin-top:14px; }
#tab-journal details.section > .risk-management-fields,
#tab-journal details.section > .field-full,
#tab-subjects details.section > .field-full { width:calc(100% - 28px); margin-left:14px; margin-right:14px; }

/* 방문·처치 기록 */
.journal-sort-toggle { display:inline-flex; align-items:center; height:40px; overflow:hidden; border:1px solid #d8e0da; border-radius:8px; background:#fff; }
.journal-sort-toggle button { min-width:94px; height:100%; margin:0; padding:0 12px; border:0; color:#6b7771; background:transparent; font-size:11px; font-weight:750; cursor:pointer; }
.journal-sort-toggle button + button { border-left:1px solid #e2e7e3; }
.journal-sort-toggle button:hover { color:#ad5a1d; background:#fff8f2; }
.journal-sort-toggle button.is-active { color:#b55e1c; background:#fff2e7; box-shadow:inset 0 0 0 1px rgba(224,118,32,.08); }
.journal-sort-toggle button:focus-visible { position:relative; z-index:1; outline:2px solid #df7620; outline-offset:-3px; }
html[data-theme="dark"] .journal-sort-toggle { border-color:#63766d; background:#34443d; }
html[data-theme="dark"] .journal-sort-toggle button { color:#c8d3cd; }
html[data-theme="dark"] .journal-sort-toggle button + button { border-color:#63766d; }
html[data-theme="dark"] .journal-sort-toggle button:hover { color:#ffd0aa; background:#49382e; }
html[data-theme="dark"] .journal-sort-toggle button.is-active { color:#ffd0aa; background:#594132; box-shadow:inset 0 0 0 1px rgba(240,154,81,.18); }
.journal-history-search-control { position:relative; display:flex; align-items:center; width:360px; }
.journal-history-search-control > #j-search { flex:1; min-width:0; height:40px; margin:0; padding-right:45px; border-radius:8px; }
.journal-period-open { position:absolute; z-index:2; top:1px; right:1px; display:grid; place-items:center; width:40px; height:38px; padding:0; border:0; border-left:1px solid #d9e0da; border-radius:0 7px 7px 0; color:var(--of-orange); background:#fff; cursor:pointer; }
.journal-period-open:hover, .journal-period-open.is-active { color:#fff; background:var(--of-orange); }
.journal-period-panel { position:absolute; z-index:1200; top:47px; right:0; width:430px; padding:16px; border:1px solid #e3d8ca; border-radius:12px; background:#fff; box-shadow:0 14px 34px rgba(40,48,43,.16); }
.journal-period-panel > strong { display:block; margin-bottom:12px; color:#273142; }
.period-filter-fields { display:flex; align-items:flex-end; gap:8px; white-space:nowrap; }
.period-filter-date { display:grid; gap:4px; min-width:0; }
.period-filter-date > label { margin:0; color:#59675f; font-size:12px; font-weight:700; }
.period-filter-fields > span { padding-bottom:11px; color:#76827c; font-size:12px; font-weight:800; }
.period-filter-date > .app-date-input-wrap { width:150px; height:40px; }
.period-filter-date input { width:100%; height:40px; margin:0; }
.journal-period-fields { display:grid; grid-template-columns:1fr auto 1fr; align-items:end; gap:8px; }
.journal-period-fields label { margin:0 0 5px; }
.journal-period-fields > span { padding-bottom:11px; color:#7b8493; }
.journal-period-fields .app-date-input-wrap { width:100%; }
.journal-period-fields input { margin:0; }
.journal-period-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }
@media (max-width:700px) { .journal-sort-toggle, .journal-history-search-control { width:100%; } .journal-sort-toggle button { flex:1; } .journal-period-panel { right:auto; left:0; width:min(430px, calc(100vw - 52px)); } .journal-period-fields { grid-template-columns:1fr; } .journal-period-fields > span { display:none; } }
.journal-date-group { margin:0 0 18px; }
.journal-date-header { display:flex; align-items:center; gap:9px; margin-bottom:9px; padding:0 2px; color:#29453b; }
.journal-date-icon { display:inline-grid; place-items:center; width:30px; height:30px; border-radius:9px; color:#fff; background:linear-gradient(135deg,#ef862d,#dc6c14); box-shadow:0 5px 12px rgba(226,113,25,.2); }
.journal-date-header strong { font-size:16px; }
.journal-date-count { padding:3px 8px; border:1px solid #d7e4d3; border-radius:999px; color:#4f7048; background:#f5faf2; font-size:12px; font-weight:800; }
.journal-record-list { display:grid; gap:10px; }
.journal-record-card { overflow:hidden; border:1px solid #dfe8e1; border-left:4px solid #55a542; border-radius:11px; background:rgba(255,255,255,.94); box-shadow:0 5px 16px rgba(35,68,52,.055); transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.journal-record-card:hover { transform:translateY(-2px); border-color:#c9dcc9; box-shadow:0 9px 22px rgba(35,68,52,.1); }
.journal-record-main { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 14px 10px; }
.journal-record-person { display:flex; align-items:center; gap:9px; min-width:0; }
.journal-person-icon { display:grid; place-items:center; flex:0 0 auto; width:34px; height:34px; border-radius:10px; color:#326a40; background:#edf7ec; font-size:17px; }
.journal-record-person strong { display:block; color:#263e36; font-size:15px; }
.journal-record-person span:not(.journal-person-icon) { display:block; margin-top:2px; color:#7b8983; font-size:11px; }
.journal-record-badges { display:flex; justify-content:flex-end; align-items:center; gap:6px; flex-wrap:wrap; }
.journal-record-content { display:grid; grid-template-columns:1fr 1fr; border-top:1px solid #edf1ee; border-bottom:1px solid #edf1ee; background:#fbfcfb; }
.journal-record-content > div { padding:11px 14px; min-width:0; }
.journal-record-content > div + div { border-left:1px solid #e6ece8; }
.journal-record-content span { display:block; margin-bottom:4px; color:#648075; font-size:11px; font-weight:800; }
.journal-record-content > div > span { display:flex; align-items:center; gap:6px; }
.journal-record-content p { margin:0; color:#2f403a; line-height:1.55; overflow-wrap:anywhere; }
.journal-record-footer { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 12px 9px 14px; }
.journal-recheck { display:inline-flex; align-items:center; gap:6px; color:#df7620; font-size:12px; font-weight:700; }
.journal-record-actions { display:flex; gap:6px; }

/* 고위험군 관리 */
#risk-checkboxes, #s-risk-checkboxes, #j-risk-checkboxes { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 14px; }
#risk-checkboxes label, #s-risk-checkboxes label, #j-risk-checkboxes label { margin:0; padding:8px 11px; border:1px solid #dce6dd; border-radius:9px; background:#fafcf9; color:#3d5149; transition:.16s ease; }
#risk-checkboxes label:has(input:checked), #s-risk-checkboxes label:has(input:checked), #j-risk-checkboxes label:has(input:checked) { border-color:#77b868; color:#2f7131; background:#f0f8ed; box-shadow:inset 0 0 0 1px rgba(83,157,66,.08); }
.risk-management-fields { margin-top:12px; padding-top:12px; border-top:1px solid #e4e9e4; }
.risk-management-fields > label { color:#344c42; }
.field-help-text { margin-left:5px; color:#87928c; font-size:11px; font-weight:600; }
.custom-risk-editor { margin:4px 0 14px; padding:14px; border:1px solid #eadfce; border-radius:11px; background:linear-gradient(135deg,#fffaf4,#fffdf9); }
.custom-risk-editor > label { margin-top:0; color:#594b3d; }
.custom-risk-input-row { display:flex; align-items:center; gap:8px; }
.custom-risk-input-row input { margin:0; }
.custom-risk-list { display:flex; flex-wrap:wrap; gap:7px; min-height:27px; margin-top:10px; }
.custom-risk-chip { display:inline-flex; align-items:center; gap:6px; padding:5px 7px 5px 9px; border:1px solid #efcda9; border-radius:999px; color:#8b541f; background:#fff6eb; font-size:12px; font-weight:750; }
.custom-risk-chip button { display:grid; place-items:center; width:18px; height:18px; padding:0; border:0; border-radius:50%; color:#a45b26; background:#f7dfc8; cursor:pointer; line-height:1; }
.custom-risk-empty { color:#989d99; font-size:12px; }

@media (max-width:700px) {
  .form-grid { grid-template-columns:1fr; max-width:none; gap:10px; }
  .field-short, .field-medium, .field-long { grid-column:1; min-width:0; }
  .journal-primary-fields, .subject-primary-fields { grid-template-columns:1fr; width:100%; min-width:0; max-width:none; }
  .journal-identity-row { grid-template-columns:1fr; width:100%; gap:12px; }
  .journal-visit-fields { grid-template-columns:1fr; width:100%; }
  .journal-subject-finder { max-width:none; }
  .journal-record-main, .journal-record-footer { align-items:flex-start; }
  .journal-record-content { grid-template-columns:1fr; }
  .journal-record-content > div + div { border-left:0; border-top:1px solid #e6ece8; }
  .custom-risk-input-row { align-items:stretch; flex-direction:column; }
}

@media (min-width:701px) and (max-width:1200px) {
  .journal-identity-row { grid-template-columns:1fr; width:100%; max-width:760px; gap:12px; }
  .journal-identity-row .journal-primary-fields { width:100%; max-width:430px; }
}

@media (min-width:701px) and (max-width:1100px) {
  .journal-visit-fields { grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; }
}

@media (min-width:701px) and (max-width:1050px) {
  .field-short { grid-column:span 3; }
  .field-medium { grid-column:span 4; }
  .field-long { grid-column:span 6; }
  .emergency-form-grid .field-short { grid-column:span 4; }
  .emergency-form-grid .field-medium { grid-column:span 6; }
  .medicine-primary-fields { grid-template-columns:1.4fr .8fr .75fr .8fr; }
}

.dashboard-weather {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: min(720px, 72vw);
  margin: 0 0 8px 12px;
  padding: 5px 10px;
  border: 1px solid rgba(76, 143, 70, .18);
  border-radius: 999px;
  color: #52665a;
  background: rgba(255, 255, 255, .68);
  font-size: 11px;
  line-height: 1.2;
  vertical-align: middle;
}

.header-weather {
  display: block;
  width: min(340px, calc(100% - 88px));
  flex: 0 1 340px;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 3px 10px;
  overflow: hidden;
  border: 1px solid rgba(76, 143, 70, .17);
  border-radius: 9px;
  background: rgba(255, 255, 255, .74);
  box-shadow: 0 2px 7px rgba(47, 95, 48, .04);
  white-space: nowrap;
}

/* 로딩·오류 상태에서 직접 배치되는 아이콘과 안내 문구의 간격 */
.header-weather > .bi + span {
  display: inline-block;
  margin-left: 7px;
}

.header-weather-viewport {
  position: relative;
  height: 25px;
  overflow: hidden;
}

.header-weather-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  justify-content: stretch;
  gap: 7px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .28s ease, visibility 0s linear .28s;
  pointer-events: none;
}

.header-weather-slide-1 {
  grid-template-columns: 16px minmax(104px, 1.45fr) minmax(58px, .65fr) minmax(58px, .7fr);
}

.header-weather-slide-2 {
  grid-template-columns: 16px minmax(58px, .72fr) minmax(92px, 1.18fr) minmax(72px, .9fr);
}

.header-weather-slide.is-active {
  z-index: 1;
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.header-weather-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding-left: 8px;
  overflow: hidden;
  border-left: 1px solid #dce5dc;
  color: #52665a;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-weather-slide .bi {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}

.header-weather > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-weather[hidden] { display: none; }
.dashboard-weather .bi { color: #df7620; font-size: 15px; }

.settings-api-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.settings-basic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.settings-weather-status:not(:empty) {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 5px 9px;
  border: 1px solid #dce5dd;
  border-radius: 999px;
  color: #66736b;
  background: #f7f9f7;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1;
}

.settings-weather-status.is-checking {
  color: #77705d;
  border-color: #e5dec7;
  background: #fffaf0;
}

.settings-weather-status.is-checking .bi {
  animation: settings-status-spin .8s linear infinite;
}

.settings-weather-status.is-success {
  color: #39733a;
  border-color: #cce1c9;
  background: #f1f8ef;
}

.settings-weather-status.is-error {
  color: #a5413b;
  border-color: #ecc9c6;
  background: #fff3f2;
}

.settings-weather-actions { flex-wrap: wrap; }
#settings-weather-check { flex: 0 0 auto; }
#settings-weather-status.is-error {
  display: block;
  flex: 1 0 100%;
  max-width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

@keyframes settings-status-spin {
  to { transform: rotate(360deg); }
}

.settings-region-status {
  display: flex;
  align-items: center;
  min-height: 30px;
  margin-top: 10px;
  padding: 7px 10px;
  border: 1px solid #e0e8dd;
  border-radius: 8px;
  background: #fafcf9;
  color: #4d6d50;
  font-size: 10.5px;
}

@media (max-width: 760px) {
  .dashboard-weather { margin-left: 0; max-width: 82%; flex-wrap: wrap; border-radius: 12px; }
  .web-storage-settings { width: min(440px, 100%); }
  .header-weather { width: min(340px, calc(100% - 88px)); max-width: none; white-space: nowrap; }
  .header-weather-slide { justify-content: stretch; }
  .settings-api-actions { align-items: flex-start; flex-direction: column; }
  .settings-basic-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .emergency-form-grid { grid-template-columns:1fr; }
  .emergency-field-wide { grid-column:auto; }
  .emergency-status-options { grid-template-columns:1fr 1fr; }
  .emergency-primary-fields { grid-template-columns:1fr 1.25fr; max-width:none; }
  .infection-primary-fields { grid-template-columns:1fr 1.35fr 1fr; max-width:none; }
  .medicine-primary-fields { grid-template-columns:1fr 1fr; max-width:none; }
  .medicine-primary-fields .field-medium,
  .medicine-primary-fields .field-short { grid-column:auto; }
}

@media (max-width:560px) {
  .medicine-primary-fields { grid-template-columns:1fr; }
  .emergency-primary-fields,
  .infection-primary-fields { grid-template-columns:1fr; }
  .workspace-detail-fields > :not(summary),
  .medicine-form-card .workspace-detail-fields .form-grid { margin-right:10px; margin-left:10px; }
}

/* 업무 화면별 절제된 색상 테마 */
.journal-form-card,
#subject-form-card,
.infection-form-card,
.medicine-form-card { position:relative; }

/* One accent border for every business card, including dynamically added cards.
 * The card's own radius shapes the corners in all frames. Do not clip card
 * contents: autocomplete results and unit menus must remain free to overflow.
 * This selector also keeps frame-wide border shorthands from thinning the band.
 */
html:root body.workspace-refresh main > section:not(#tab-dashboard) .card {
  border-top:3px solid var(--card-accent, #4c9c3d);
}

/* 보건일지: 오렌지 */
#tab-journal { --card-accent:#e67a24; }
.journal-form-card > h2::before,
#tab-journal > .card h2::before { background:#e67a24; }
.journal-form-card > .workspace-eyebrow { color:#d86818; }
.journal-primary-fields { border-color:#efd2b7; background:#fff8f1; box-shadow:inset 3px 0 0 #e78638; }
#tab-journal details.section { border-color:#ecd8c5; }
#tab-journal details.section > summary { color:#9a531d; background:#fff9f2; }
#tab-journal details.section > summary::before { border-color:#eccdab; color:#d86c1c; }
#tab-journal details.section[open] > summary { border-bottom-color:#ead3bd; background:#fff3e6; }
#tab-journal #j-save-btn { border-color:#d66c1a; background:#df7620; }
#tab-journal #j-save-btn:hover { background:#c96218; }

/* 방문자·대상자: 그린 */
#tab-subjects,
#tab-detail { --card-accent:#4c9c3d; }
#tab-subjects .card h2::before { background:#4c9c3d; }
#subject-form-card > .workspace-eyebrow { color:#438b37; }
#tab-subjects .workspace-eyebrow,
#tab-subjects .workspace-eyebrow i { color:#438b37; }
.subject-primary-fields { border-color:#cfe2cb; background:#f6fbf3; box-shadow:inset 3px 0 0 #68aa59; }
#tab-subjects details.section { border-color:#d5e4d2; }
#tab-subjects details.section > summary { color:#397533; background:#f6fbf3; }
#tab-subjects details.section > summary::before { border-color:#cae0c5; color:#4b9441; }
#tab-subjects details.section[open] > summary { border-bottom-color:#d2e2cf; background:#eef7e9; }
#tab-subjects #subject-save-btn { border-color:#3e8e33; background:#4b9b3d; }
#tab-subjects #subject-save-btn:hover { background:#3f8734; }

/* 감염병 관리: 뉴트럴 그레이 */
#tab-infection { --card-accent:#7d8588; }
#tab-infection .card h2::before { background:#7d8588; }
.infection-form-card > .workspace-eyebrow { color:#697174; }
#tab-infection .workspace-eyebrow,
#tab-infection .workspace-eyebrow i { color:#697174; }
.infection-primary-fields { border-color:#d9ddde; background:#f7f8f8; box-shadow:inset 3px 0 0 #8b9396; }
.infection-form-card button[onclick="addInfection()"] { border-color:#697174; background:#7a8285; }
.infection-form-card button[onclick="addInfection()"]:hover { background:#666e71; }

/* 약품 재고: 보건관리자 뱃지 네이비 */
#tab-medicine { --card-accent:#24345f; }
#tab-medicine .card h2::before { background:#24345f; }
.medicine-form-card > .workspace-eyebrow { color:#293b6b; }
#tab-medicine .workspace-eyebrow,
#tab-medicine .workspace-eyebrow i { color:#293b6b; }
.medicine-primary-fields { border-color:#ccd2df; background:#f6f7fb; box-shadow:inset 3px 0 0 #344878; }
.medicine-form-card .workspace-detail-fields { border-color:#d4d9e4; }
.medicine-form-card .workspace-detail-fields > summary { color:#2d416f; background:#f6f7fb; }
.medicine-form-card .workspace-detail-fields[open] > summary { border-bottom-color:#d4d9e4; background:#eef1f7; }
.medicine-form-card .medicine-note { border-color:#d8ddeb; color:#4d5872; background:#f7f8fc; }
.medicine-form-card .medicine-note i { color:#304474; }
#tab-medicine #m-save-btn,
#tab-medicine button[onclick="addMedicine()"] { border-color:#1f3059; background:#293b6b; }
#tab-medicine #m-save-btn:hover,
#tab-medicine button[onclick="addMedicine()"]:hover { background:#203057; }

/* 버튼: 오렌지팜 웹 UI와 맞춘 단색 표현 */
.btn,
.btn:hover,
.btn:active {
  border-color:#d66c1a;
  background:#df7620;
  color:#fff;
  box-shadow:none;
  transform:none;
}

.btn.green,
.btn.green:hover,
.btn.green:active {
  border-color:#3e8e33;
  background:#4b9b3d;
  color:#fff;
  box-shadow:none;
  transform:none;
}

.btn.gray,
.btn.gray:hover,
.btn.gray:active {
  border-color:#cfd5db;
  background:#f4f6f5;
  color:#55606c;
  box-shadow:none;
  transform:none;
}

.btn.danger,
.btn.danger:hover,
.btn.danger:active,
.settings-data-actions .btn.danger,
.settings-data-actions .btn.danger:hover {
  border-color:#b93630;
  background:#c9433d;
  color:#fff;
  box-shadow:none;
  transform:none;
}

.btn.outline,
.btn.outline:hover,
.btn.outline:active {
  border-color:rgba(53,157,38,.4);
  background:#fff;
  color:var(--of-green-deep);
  box-shadow:none;
  transform:none;
}

.storage-button,
.storage-button:hover,
.storage-button:active,
.settings-launch-button,
.settings-launch-button:hover,
.settings-launch-button:active {
  border-color:rgba(53,157,38,.26);
  background:#f4f8f2;
  color:var(--of-green-deep);
  box-shadow:none;
  transform:none;
}

.storage-button.danger,
.storage-button.danger:hover,
.storage-button.danger:active {
  border-color:#d4a3a0;
  background:#fffafa;
  color:#a9322d;
  box-shadow:none;
  transform:none;
}

#tab-journal #j-save-btn,
#tab-journal #j-save-btn:hover,
#tab-subjects #subject-save-btn,
#tab-subjects #subject-save-btn:hover,
#tab-emergency #e-save-btn,
#tab-emergency #e-save-btn:hover,
#tab-emergency button[onclick="addEmergency()"],
#tab-emergency button[onclick="addEmergency()"]:hover,
.infection-form-card button[onclick="addInfection()"],
.infection-form-card button[onclick="addInfection()"]:hover,
#tab-medicine #m-save-btn,
#tab-medicine #m-save-btn:hover,
#tab-medicine button[onclick="addMedicine()"],
#tab-medicine button[onclick="addMedicine()"]:hover {
  box-shadow:none;
  transform:none;
}

.link-item .btn.danger:hover,
.link-item .btn.mini.danger:hover {
  background:transparent;
  color:#9b6763;
}

@media (prefers-reduced-motion: reduce) {
  main *,
  main *::before,
  main *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

/* 화면 모드 */
.settings-theme-options {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:9px;
}
.settings-theme-options label { cursor:pointer; }
.settings-theme-options input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.settings-theme-options span {
  display:grid;
  grid-template-columns:28px 1fr;
  grid-template-rows:auto auto;
  column-gap:9px;
  min-height:61px;
  padding:11px 12px;
  border:1px solid #dfe5e1;
  border-radius:10px;
  background:#fff;
  color:#52605a;
}
.settings-theme-options i { grid-row:1 / 3; align-self:center; color:#d66c1a; font-size:19px; }
.settings-theme-options b { align-self:end; color:#33423b; font-size:12px; }
.settings-theme-options small { color:#87918c; font-size:10px; }
.settings-theme-options input:checked + span { border-color:#e07a27; background:#fff7ef; box-shadow:inset 0 0 0 1px #e07a27; }
.settings-theme-options input:focus-visible + span { outline:2px solid #4b9b3d; outline-offset:2px; }

@media (max-width:520px) {
  .settings-theme-options { grid-template-columns:1fr; }
}

/* 소프트 다크 모드: 검정보다 밝은 차콜을 사용해 장시간 가독성 확보 */
html[data-theme="dark"] { color-scheme:dark; }
html[data-theme="dark"],
html[data-theme="dark"] body { color:#f3f7f4; background:#26322f !important; }
html[data-theme="dark"] main { background:#2b3834; }
html[data-theme="dark"] body::before { opacity:.02; }
html[data-theme="dark"] .demo-notice,
html[data-theme="dark"] .app-header,
html[data-theme="dark"] nav,
html[data-theme="dark"] .app-footer { background:#31413c; border-color:#61736b; color:#f3f7f4; box-shadow:none; }
html[data-theme="dark"] .service-badge { border-color:#465477; background:#26345e; }
html[data-theme="dark"] .storage-button,
html[data-theme="dark"] .settings-launch-button { border-color:#6a7771; background:#46504b; color:#f3f7f5; }
html[data-theme="dark"] .storage-button.danger { border-color:#9d6662; background:#513937; color:#ffd0cc; }
html[data-theme="dark"] nav button { color:#edf3f0; background:#31413c; border-color:#61736b; }
html[data-theme="dark"] nav button.active { color:#fff; background:#4a963e; }
html[data-theme="dark"] .card,
html[data-theme="dark"] #tab-dashboard .card,
html[data-theme="dark"] #tab-dashboard .kpi > div,
html[data-theme="dark"] .subject-detail-card,
html[data-theme="dark"] .journal-record-card { background:#384943; border-color:#657a71; box-shadow:0 6px 18px rgba(8,18,14,.15); }
html[data-theme="dark"] .dashboard-hero { color:#f7faf8; border-color:#a67a55; background:linear-gradient(120deg,#40534c,#395049 62%,#604b3c); box-shadow:none; }
html[data-theme="dark"] .dashboard-hero-overview { background:linear-gradient(105deg,#3d5049,#4a443d 58%,#374b42); }
html[data-theme="dark"] .dashboard-hero-overview .dashboard-live-date { color:#d1ddd6; }
html[data-theme="dark"] .dashboard-overview-clock .dashboard-live-date { color:#d1ddd6; }
html[data-theme="dark"] .dashboard-overview-clock { border-color:#725c49; }
html[data-theme="dark"] .dashboard-analog-clock { border-color:#64736c; background:radial-gradient(circle at 38% 31%,#52625c,#3e4e48 68%,#33413c); box-shadow:0 8px 18px rgba(8,18,14,.18),inset 0 0 0 4px rgba(86,104,96,.62); }
html[data-theme="dark"] .dashboard-analog-clock::before { background:repeating-conic-gradient(from -1deg,#f0f5f2 0 2deg,transparent 2deg 30deg); }
html[data-theme="dark"] .dashboard-analog-clock::after { background:repeating-conic-gradient(from -.5deg,rgba(224,233,228,.55) 0 1deg,transparent 1deg 6deg); }
html[data-theme="dark"] .dashboard-clock-hand { background:#f2f6f4; }
html[data-theme="dark"] .dashboard-clock-second,
html[data-theme="dark"] .dashboard-clock-pin { background:#ff9a49; }
html[data-theme="dark"] .dashboard-clock-meta > strong { color:#ffad6b; }
html[data-theme="dark"] .dashboard-hero-tip { background:linear-gradient(108deg,#3a4e46,#344b41 64%,#4c4439); }
html[data-theme="dark"] .dashboard-hero-tip .dashboard-tip-label { color:#cfe8ca; }
html[data-theme="dark"] .dashboard-tip-symbol { border-color:#607760; color:#cfe8ca; }
html[data-theme="dark"] .dashboard-tip-symbol .bi { color:#ffc18d; background:#594132; box-shadow:inset 0 0 0 1px #7b604b; }
html[data-theme="dark"] .dashboard-hero-tip h1 { color:#eef6f0; }
html[data-theme="dark"] .dashboard-hero-ai-slide { background:linear-gradient(108deg,#3d5049,#504238 60%,#374b42); }
html[data-theme="dark"] .dashboard-hero-ai-slide .dashboard-hero-copy { background:transparent; }
html[data-theme="dark"] .dashboard-hero-ai-slide .dashboard-tip-label { color:#ffc18d; }
html[data-theme="dark"] .dashboard-hero-ai-slide .dashboard-tip-label .bi { background:#594132; }
html[data-theme="dark"] .dashboard-hero-ai-slide h1 { color:#f2f6f4; }
html[data-theme="dark"] .dashboard-ai-preview { border-color:#725c49; background:rgba(55,66,61,.78); box-shadow:none; }
html[data-theme="dark"] .dashboard-ai-preview-question { color:#d1dad5; background:#45534e; }
html[data-theme="dark"] .dashboard-ai-preview-question i { color:#d1dad5; background:#35423e; }
html[data-theme="dark"] .dashboard-ai-preview-answer { color:#d7e6d4; background:linear-gradient(100deg,#594132,#35483e); box-shadow:inset 0 0 0 1px #607760; }
html[data-theme="dark"] .dashboard-ai-preview-answer i { background:#4c4037; }
html[data-theme="dark"] .dashboard-weather-briefing { background:linear-gradient(120deg,#40534c,#344a43 52%,#574538); }
html[data-theme="dark"] .dashboard-weather-label-icon { border-color:#60776d; color:#c5e0d7; background:linear-gradient(145deg,#455a52,#354941); box-shadow:none; }
html[data-theme="dark"] .dashboard-weather-label small { color:#b6c7bf; }
html[data-theme="dark"] .dashboard-weather-label strong { color:#d3e7dd; }
html[data-theme="dark"] .weather-briefing-time { border-color:#627970; color:#d3e2db; background:#3b5149; }
html[data-theme="dark"] .weather-briefing-status { color:#ffc18d; }
html[data-theme="dark"] .risk-level-0 .weather-briefing-status,
html[data-theme="dark"] .weather-briefing-status.is-stable { color:#c8e4c3; }
html[data-theme="dark"] .risk-level-2 .weather-briefing-status { color:#ffaaa4; }
html[data-theme="dark"] .dashboard-weather-briefing-advice > i { color:#ffad6b; }
html[data-theme="dark"] .dashboard-weather-timeline::before { background:#657a71; }
html[data-theme="dark"] .dashboard-weather-timeline { border-color:#60756b; background:rgba(47,64,57,.72); box-shadow:none; }
html[data-theme="dark"] .weather-risk-time,
html[data-theme="dark"] .weather-risk-point small { color:#c4d0ca; }
html[data-theme="dark"] .weather-risk-marker { border-color:#40534c; box-shadow:none; }
html[data-theme="dark"] .dashboard-hero p,
html[data-theme="dark"] .dashboard-meta-line,
html[data-theme="dark"] .muted { color:#c8d2cd; }
html[data-theme="dark"] #tab-dashboard .kpi .num,
html[data-theme="dark"] #tab-dashboard .card h2,
html[data-theme="dark"] .card h2,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 { color:#e5eee9; }
html[data-theme="dark"] #tab-dashboard .kpi .lbl,
html[data-theme="dark"] label { color:#d7e0dc; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { color:#f7faf8; background:#2d3b37; border-color:#70847b; }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color:#aab6b0; }
html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td { border-color:#3b4842; }
html[data-theme="dark"] th { color:#f3f7f5; background:#465b53; }
html[data-theme="dark"] td { color:#edf4f0; background:#384943; }
html[data-theme="dark"] details.section,
html[data-theme="dark"] .workspace-detail-fields,
html[data-theme="dark"] .settings-section { border-color:#657a71; background:#384943; }
html[data-theme="dark"] details.section > summary,
html[data-theme="dark"] .workspace-detail-fields > summary { color:#f1f6f3; background:#465b53; border-color:#657a71; }
html[data-theme="dark"] .journal-primary-fields { border-color:#916b4d; background:#504239; }
html[data-theme="dark"] .subject-primary-fields { border-color:#657d60; background:#3c4a3c; }
html[data-theme="dark"] .infection-primary-fields { border-color:#6b7375; background:#444a4c; }
html[data-theme="dark"] .medicine-primary-fields { border-color:#65708c; background:#3e4354; }
html[data-theme="dark"] .journal-subject-finder { border-color:#657d60; background:#3c4a3c; }
html[data-theme="dark"] .settings-dialog { color:#f3f7f4; background:#31413c; border-color:#657a71; }
html[data-theme="dark"] .settings-dialog::backdrop { background:rgba(15,21,18,.08); }
html[data-theme="dark"] .settings-dialog-header { background:linear-gradient(135deg,#40534c,#3b514a 58%,#604c3e); border-color:#657a71; }
html[data-theme="dark"] .settings-dialog-body,
html[data-theme="dark"] .settings-dialog-footer { background:#2b3834; border-color:#657a71; }
html[data-theme="dark"] .settings-dialog-header h2,
html[data-theme="dark"] .settings-section-heading strong { color:#e6efea; }
html[data-theme="dark"] .settings-dialog-header p,
html[data-theme="dark"] .settings-section-heading span { color:#c3cec8; }
html[data-theme="dark"] .settings-license-copy strong { color:#e6efea; }
html[data-theme="dark"] .settings-license-copy span { color:#c3cec8; }
html[data-theme="dark"] .settings-license-current { border-color:#657a71; background:#31413b; }
html[data-theme="dark"] .settings-license-current-copy span { color:#b7c4bd; }
html[data-theme="dark"] .settings-license-current-copy strong { color:#f2f7f4; }
html[data-theme="dark"] .settings-license-key-toggle { border-color:#71857b; background:#43564f; color:#eef5f1; }
html[data-theme="dark"] .settings-license-key-toggle:hover { border-color:#91bd83; background:#4a6057; color:#fff; }
html[data-theme="dark"] .settings-license-warning { border-color:#657a71; color:#efb1aa; }
html[data-theme="dark"] .settings-theme-options span { color:#edf4f0; background:#2d3b37; border-color:#70847b; }
html[data-theme="dark"] .settings-theme-options b { color:#e2ebe6; }
html[data-theme="dark"] .settings-theme-options input:checked + span { border-color:#f09a51; background:#554033; box-shadow:inset 0 0 0 1px #f09a51; }
html[data-theme="dark"] .settings-api-subsection { border-color:#657a71; background:#31413b; }
html[data-theme="dark"] .settings-api-subsection-heading strong { color:#eef5f1; }
html[data-theme="dark"] .settings-api-subsection-heading span { color:#bdcbc4; }
html[data-theme="dark"] .settings-api-subsection-heading > i { color:#ffc28f; background:#594132; }
html[data-theme="dark"] .settings-field-help { color:#bdcbc4; }
html[data-theme="dark"] .settings-weather-location { border-color:#657a71; background:#384943; }
html[data-theme="dark"] .settings-weather-location .settings-field > span { color:#c7d4cc; }

.settings-suboption { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; margin-top:14px; padding-top:14px; border-top:1px solid #edf0ee; }
body > :not(dialog):not(script):not(.app-date-picker) { zoom:var(--app-display-zoom, 1); }
.settings-suboption-copy, .settings-auto-backup-copy { display:flex; flex-direction:column; gap:3px; }
.settings-suboption-copy strong, .settings-auto-backup-copy strong { color:#33423b; font-size:12px; }
.settings-auto-backup-copy strong { display:inline-flex; width:max-content; align-items:center; gap:6px; }
.settings-suboption-copy span, .settings-auto-backup-copy span { color:#7d8983; font-size:10px; }
.settings-zoom-control { display:grid; grid-template-columns:40px minmax(0,1fr); align-items:center; gap:12px; width:100%; min-width:0; }
.settings-zoom-value { display:flex; align-items:center; justify-content:flex-start; min-width:0; margin:0; }
.settings-zoom-value output { min-width:0; padding:0; border:0; background:transparent; color:#b85f19; font-size:12px; font-weight:800; line-height:1; text-align:left; }
.settings-zoom-slider-row { display:grid; grid-template-columns:25px minmax(0,1fr) 30px; align-items:center; gap:8px; min-width:0; }
.settings-zoom-slider-row span { color:#849089; font-size:9px; font-weight:700; }
.settings-zoom-slider-row input[type="range"] { width:100%; height:20px; margin:0; padding:0; border:0; background:transparent; accent-color:#e07a27; cursor:pointer; }
.settings-zoom-slider-row input[type="range"]::-webkit-slider-runnable-track { height:7px; border:1px solid #e07a27; border-radius:999px; background:#fff7ef; box-shadow:inset 0 1px 2px rgba(224, 122, 39, .10); }
.settings-zoom-slider-row input[type="range"]::-webkit-slider-thumb { width:17px; height:17px; margin-top:-6px; border:2px solid #fff7ef; border-radius:50%; background:#e07a27; box-shadow:0 2px 5px rgba(183, 86, 15, .22); -webkit-appearance:none; }
.settings-zoom-slider-row input[type="range"]::-moz-range-track { height:7px; border:1px solid #e07a27; border-radius:999px; background:#fff7ef; box-shadow:inset 0 1px 2px rgba(224, 122, 39, .10); }
.settings-zoom-slider-row input[type="range"]::-moz-range-thumb { width:15px; height:15px; border:2px solid #fff7ef; border-radius:50%; background:#e07a27; box-shadow:0 2px 5px rgba(183, 86, 15, .22); }
.settings-zoom-slider-row input[type="range"]:focus-visible { outline:2px solid #4b9b3d; outline-offset:3px; border-radius:999px; }
.settings-api-section .settings-api-content { gap:14px; }
.settings-api-section .settings-api-common-notice {
  border-color:#d6dee8;
  color:#56677a;
  background:#f5f7fa;
}

.settings-region-status[hidden] {
  display: none;
}
.settings-api-help {
  overflow:hidden;
  border:1px solid #ced8e5;
  border-radius:12px;
  background:#fbfcfe;
  box-shadow:0 4px 13px rgba(32,53,79,.05);
}
.settings-api-help-summary {
  display:flex;
  min-height:54px;
  align-items:center;
  gap:10px;
  padding:10px 13px;
  list-style:none;
  color:var(--of-navy);
  background:linear-gradient(105deg,#f3f6fb 0%,#f7faf7 100%);
  cursor:pointer;
  user-select:none;
}
.settings-api-help-summary::-webkit-details-marker { display:none; }
.settings-api-help-symbol {
  display:grid;
  flex:0 0 32px;
  width:32px;
  height:32px;
  place-items:center;
  border-radius:9px;
  color:#fff;
  background:linear-gradient(145deg,#203a5f,#334f77);
  box-shadow:0 4px 10px rgba(32,58,95,.17);
}
.settings-api-help-symbol .bi { font-size:14px; }
.settings-api-help-heading { display:flex; min-width:0; flex:1 1 auto; flex-direction:column; gap:2px; }
.settings-api-help-heading strong { color:var(--of-navy); font-size:12px; line-height:1.35; }
.settings-api-help-heading small { color:#74808d; font-size:10px; line-height:1.4; }
.settings-api-help-badge {
  flex:0 0 auto;
  padding:4px 7px;
  border:1px solid #c9ddc5;
  border-radius:999px;
  color:#3e7d37;
  background:#f1f8ef;
  font-size:9px;
  font-weight:800;
}
.settings-api-help-chevron { flex:0 0 auto; color:#718097; font-size:10px; transition:transform .18s ease; }
.settings-api-help[open] > .settings-api-help-summary { border-bottom:1px solid #d7e0ea; background:linear-gradient(105deg,#edf2f8 0%,#f3f8f1 100%); }
.settings-api-help[open] > .settings-api-help-summary .settings-api-help-chevron { transform:rotate(180deg); }
.settings-api-help-summary:hover { background:linear-gradient(105deg,#edf2f8 0%,#f2f7f0 100%); }
.settings-api-help-summary:focus-visible { outline:2px solid var(--of-green); outline-offset:-2px; }
.settings-api-help-content { padding:13px; color:#526171; font-size:10.5px; line-height:1.6; }
.settings-api-help-intro {
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  align-items:start;
  gap:9px;
  padding:10px 11px;
  border:1px solid #dae2eb;
  border-radius:9px;
  background:#f8fafc;
}
.settings-api-help-intro > .bi { color:#315078; font-size:15px; }
.settings-api-help-intro p { display:grid; gap:3px; margin:0; }
.settings-api-help-intro strong { color:#293f5c; font-size:10.5px; }
.settings-api-help-intro p > span { color:#697785; }
.settings-api-help-steps { display:grid; gap:8px; margin:10px 0 0; padding:11px 12px; border:1px solid #d9e1e9; border-radius:9px; background:#fff; list-style:none; }
.settings-api-help-steps li { display:grid; grid-template-columns:22px minmax(0,1fr); align-items:start; gap:9px; }
.settings-api-help-steps li > b { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:6px; color:#fff; background:#29496f; font-size:9px; box-shadow:0 2px 5px rgba(32,58,95,.13); }
.settings-api-help-steps li > span { display:grid; gap:2px; min-width:0; }
.settings-api-help-steps li strong { color:#30445e; font-size:10.5px; }
.settings-api-help-steps li small { color:#74808a; font-size:10px; line-height:1.45; }
.settings-api-help-steps a { display:inline-flex; width:max-content; max-width:100%; align-items:center; gap:4px; margin-top:2px; color:#32752e; font-weight:800; text-decoration:none; overflow-wrap:anywhere; }
.settings-api-help-steps a:hover { text-decoration:underline; }
.settings-api-help-note { display:flex; align-items:flex-start; gap:7px; margin:10px 1px 0; color:#607169; font-size:10px; }
.settings-api-help-note .bi { flex:0 0 auto; margin-top:1px; color:var(--of-orange); }
.settings-api-notice-copy { display:flex; min-width:0; flex-direction:column; gap:2px; }
.settings-api-notice-copy strong { color:#326a32; font-size:10.5px; }
.settings-api-notice-copy > span { color:#5d745b; font-size:10px; }
.settings-api-guide { margin-bottom:14px; padding:12px 13px; border:1px solid #f0d8c6; border-radius:10px; background:#fff8f2; }
.settings-api-guide-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.settings-api-guide-heading > div { display:flex; flex-direction:column; gap:3px; }
.settings-api-guide-heading strong { color:#5e4637; font-size:11.5px; }
.settings-api-guide-heading span { color:#8b776a; font-size:9.5px; line-height:1.45; }
.settings-api-guide-heading a { display:inline-flex; flex:0 0 auto; align-items:center; gap:5px; padding:6px 8px; border:1px solid #e8bc9a; border-radius:7px; color:#ad5a1d; background:#fff; font-size:9.5px; font-weight:800; text-decoration:none; }
.settings-api-guide-heading a:hover { border-color:#dc8c50; background:#fff3e9; }
.settings-api-guide ol { display:grid; gap:7px; margin:11px 0 0; padding:0; list-style:none; }
.settings-api-guide li { display:grid; grid-template-columns:20px minmax(0,1fr); align-items:start; gap:8px; color:#665b54; font-size:10px; line-height:1.5; }
.settings-api-guide li > b { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:50%; color:#b45c1c; background:#f9dfca; font-size:9px; }
.settings-api-guide li span strong { color:#77503a; }
.settings-auto-backup { display:flex; flex-direction:column; align-items:stretch; gap:12px; width:100%; max-width:100%; box-sizing:border-box; margin-top:14px; padding:14px; border:1px solid #e4e9e6; border-radius:9px; background:#f8faf8; }
.settings-auto-backup-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:end; gap:10px; width:100%; max-width:100%; box-sizing:border-box; }
.settings-auto-backup-controls #settings-auto-backup-time-field { grid-column:1 / -1; }
.settings-auto-backup-location { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:10px; width:100%; min-width:0; padding-top:12px; border-top:1px solid #e4e9e6; }
.settings-auto-backup-location .settings-field { min-width:0; }
.settings-auto-backup-location-actions { display:flex; gap:7px; flex-wrap:nowrap; }
.settings-folder-select-button { gap:6px; }
.settings-auto-backup .settings-field { width:auto; min-width:0; margin:0; }
.settings-auto-backup .settings-field > span { display:block; margin-bottom:5px; color:#6e7973; font-size:9px; font-weight:700; }
.settings-auto-backup .settings-field select,
.settings-auto-backup .settings-field input { width:100%; min-width:0; max-width:100%; box-sizing:border-box; }
.settings-auto-backup [hidden] { display:none !important; }
.settings-auto-backup-status { min-height:16px; margin-top:7px; color:#758079; font-size:10px; overflow-wrap:anywhere; }
html[data-theme="dark"] .settings-suboption { border-color:#657a71; }
html[data-theme="dark"] .settings-suboption-copy strong, html[data-theme="dark"] .settings-auto-backup-copy strong { color:#e6efea; }
html[data-theme="dark"] .settings-suboption-copy span, html[data-theme="dark"] .settings-auto-backup-copy span, html[data-theme="dark"] .settings-auto-backup-status { color:#c3cec8; }
html[data-theme="dark"] .settings-auto-backup { background:#2d3b37; border-color:#70847b; color:#edf4f0; }
html[data-theme="dark"] .settings-auto-backup-location { border-color:#60736a; }
html[data-theme="dark"] .settings-auto-backup .settings-field > span { color:#c3cec8; }
html[data-theme="dark"] .settings-zoom-value output { background:transparent; border-color:transparent; color:#ffd0a7; }
html[data-theme="dark"] .settings-zoom-slider-row span { color:#c3cec8; }
html[data-theme="dark"] .settings-zoom-slider-row input[type="range"]::-webkit-slider-runnable-track { border-color:#89664f; background:linear-gradient(90deg, #664b39 0%, #a66a41 55%, #c17a45 100%); }
html[data-theme="dark"] .settings-zoom-slider-row input[type="range"]::-webkit-slider-thumb { border-color:#3b2d25; background:#efaa72; }
html[data-theme="dark"] .settings-zoom-slider-row input[type="range"]::-moz-range-track { border-color:#89664f; background:linear-gradient(90deg, #664b39 0%, #a66a41 55%, #c17a45 100%); }
html[data-theme="dark"] .settings-zoom-slider-row input[type="range"]::-moz-range-thumb { border-color:#3b2d25; background:#efaa72; }
html[data-theme="dark"] .settings-api-section .settings-api-common-notice { border-color:#505c68; color:#d1d8df; background:#293036; }
html[data-theme="dark"] .settings-api-help { border-color:#556170; background:#252b2f; box-shadow:none; }
html[data-theme="dark"] .settings-api-help-summary { color:#eef2f5; background:linear-gradient(105deg,#2e3743 0%,#2c352f 100%); }
html[data-theme="dark"] .settings-api-help-summary:hover { background:linear-gradient(105deg,#343f4e 0%,#303b34 100%); }
html[data-theme="dark"] .settings-api-help-symbol { color:#fff; background:linear-gradient(145deg,#425b82,#344b70); box-shadow:none; }
html[data-theme="dark"] .settings-api-help-heading strong { color:#f0f3f6; }
html[data-theme="dark"] .settings-api-help-heading small,
html[data-theme="dark"] .settings-api-help-chevron,
html[data-theme="dark"] .settings-api-help-content { color:#c1cad1; }
html[data-theme="dark"] .settings-api-help-badge { border-color:#52724e; color:#d4eccf; background:#2c422e; }
html[data-theme="dark"] .settings-api-help[open] > .settings-api-help-summary { border-color:#526070; background:linear-gradient(105deg,#343f4d 0%,#303a33 100%); }
html[data-theme="dark"] .settings-api-help-intro { border-color:#4c5965; background:#293136; }
html[data-theme="dark"] .settings-api-help-intro > .bi { color:#aebfdd; }
html[data-theme="dark"] .settings-api-help-intro strong,
html[data-theme="dark"] .settings-api-help-steps li strong { color:#edf1f4; }
html[data-theme="dark"] .settings-api-help-intro p > span,
html[data-theme="dark"] .settings-api-help-steps li small { color:#bac4ca; }
html[data-theme="dark"] .settings-api-help-steps { border-color:#48535d; background:#22282b; }
html[data-theme="dark"] .settings-api-help-steps li > b { color:#fff; background:#476087; box-shadow:none; }
html[data-theme="dark"] .settings-api-help-steps a { color:#a9d6a2; }
html[data-theme="dark"] .settings-api-help-note { color:#c5d0ca; }
html[data-theme="dark"] .settings-api-notice-copy strong { color:#d5ebd1; }
html[data-theme="dark"] .settings-api-notice-copy > span { color:#bfd1bb; }
html[data-theme="dark"] .settings-api-guide { border-color:#765b49; background:#3d322b; }
html[data-theme="dark"] .settings-api-guide-heading strong { color:#f2e7df; }
html[data-theme="dark"] .settings-api-guide-heading span, html[data-theme="dark"] .settings-api-guide li { color:#d1c2b8; }
html[data-theme="dark"] .settings-api-guide-heading a { border-color:#8d674c; color:#ffd0aa; background:#49382e; }
html[data-theme="dark"] .settings-api-guide-heading a:hover { border-color:#d59667; background:#554035; }
html[data-theme="dark"] .settings-api-guide li > b { color:#ffd1ad; background:#684632; }
html[data-theme="dark"] .settings-api-guide li span strong { color:#f3c7a6; }
@media (max-width:700px) { .settings-suboption, .settings-auto-backup { align-items:stretch; } .settings-auto-backup-controls, .settings-auto-backup-location { grid-template-columns:1fr; } .settings-auto-backup-controls #settings-auto-backup-time-field { grid-column:auto; } .settings-zoom-control, .settings-auto-backup .settings-field { width:100%; max-width:none; } .settings-auto-backup-location-actions { justify-content:flex-start; } .settings-api-help-badge { display:none; } }
html[data-theme="dark"] .settings-region-status,
html[data-theme="dark"] .settings-security-note,
html[data-theme="dark"] .medicine-note { color:#d6e0db; background:#35433b; border-color:#5c7065; }
html[data-theme="dark"] .footer-text strong,
html[data-theme="dark"] .footer-release strong { color:#dce6e1; }
html[data-theme="dark"] .footer-text span,
html[data-theme="dark"] .footer-text small,
html[data-theme="dark"] .footer-copyright { color:#8f9c96; }
html[data-theme="dark"] .page-watermark { opacity:.18; }

/* 다크 모드 세부 화면 보정: 화면별 라이트 전용 배경과 글자색 제거 */
html[data-theme="dark"] .empty,
html[data-theme="dark"] .action-target-guide,
html[data-theme="dark"] .emergency-list-note { color:#b7c6bf; }

html[data-theme="dark"] .emergency-primary-fields {
  border-color:#a7605c;
  background:#453b3a;
  box-shadow:inset 3px 0 0 #d46b64;
}
html[data-theme="dark"] #tab-emergency .workspace-detail-fields {
  border-color:#7d625f;
  background:#384943;
}
html[data-theme="dark"] #tab-emergency .workspace-detail-fields > summary {
  color:#ffd3cf;
  background:#4b3d3c;
  border-color:#7d625f;
}
html[data-theme="dark"] .emergency-status-panel {
  border-color:#687b73;
  background:#31413c;
}
html[data-theme="dark"] .emergency-status-panel > strong { color:#f0d5d2; }
html[data-theme="dark"] .emergency-status-options span {
  border-color:#70847b;
  color:#e5eee9;
  background:#3b4c46;
}
html[data-theme="dark"] .emergency-status-options input:checked + span {
  border-color:#dc7b74;
  color:#ffe0dd;
  background:#5a403e;
}
html[data-theme="dark"] .emergency-table-wrap { border-color:#657a71; }
html[data-theme="dark"] .emergency-table-wrap thead th { background:#465b53; }

html[data-theme="dark"] .action-target-list {
  border-color:#657a71;
  background:#31413c;
}
html[data-theme="dark"] .action-target {
  border-bottom-color:#52675e;
  color:#edf4f0;
  background:#384943;
}
html[data-theme="dark"] .action-target.overdue { background:#4b3a39; }
html[data-theme="dark"] .action-target.today { background:#4c4338; }
html[data-theme="dark"] .action-target-person strong { color:#f5f8f6; }
html[data-theme="dark"] .action-target-person span { color:#bdc9c3; }
html[data-theme="dark"] .action-reason { border-color:#667970; background:#405149; color:#dae5df; }

html[data-theme="dark"] .schedule { color:#eef5f1; border:1px solid #61756b; }
html[data-theme="dark"] .schedule.overdue { background:#543b3b; }
html[data-theme="dark"] .schedule.today { background:#574737; }
html[data-theme="dark"] .schedule.upcoming { background:#3e523f; }
html[data-theme="dark"] .schedule > span,
html[data-theme="dark"] .schedule b { color:#f5f8f6; }

html[data-theme="dark"] .link-group h3 { color:#dce7e1; }
html[data-theme="dark"] .link-item {
  border-color:#687c72;
  background:#3a4b45;
  box-shadow:none;
}
html[data-theme="dark"] .link-item:hover { border-color:#79a46f; background:#40544c; }
html[data-theme="dark"] .link-item a,
html[data-theme="dark"] .link-item a:hover { color:#bce2b3; }
html[data-theme="dark"] .site-add-panel { border-color:#657a71; background:#34443e; }
html[data-theme="dark"] .site-add-panel summary,
html[data-theme="dark"] .site-add-panel summary:hover,
html[data-theme="dark"] .site-add-panel[open] summary {
  color:#e9f2ed;
  background:#3b4c46;
  border-color:#657a71;
}

html[data-theme="dark"] .journal-date-header,
html[data-theme="dark"] .journal-date-header strong { color:#edf4f0; }
html[data-theme="dark"] .journal-record-main,
html[data-theme="dark"] .journal-record-footer { background:#384943; }
html[data-theme="dark"] .journal-record-person strong { color:#f4f8f6; }
html[data-theme="dark"] .journal-record-person span:not(.journal-person-icon) { color:#bdc9c3; }
html[data-theme="dark"] .journal-record-content {
  border-color:#61756c;
  background:#31413c;
}
html[data-theme="dark"] .journal-record-content > div + div { border-color:#61756c; }
html[data-theme="dark"] .journal-record-content span { color:#a9c9bc; }
html[data-theme="dark"] .journal-record-content p { color:#f1f6f3; }
html[data-theme="dark"] .journal-recheck { color:#f2b96f; }

html[data-theme="dark"] .bar-row { color:#edf4f0; }
html[data-theme="dark"] .bar-row:nth-child(odd) { background:#405149; }
html[data-theme="dark"] .bar-row .name { color:#f1f6f3; }
html[data-theme="dark"] .bar-track { background:#263530; box-shadow:inset 0 1px 2px rgba(0,0,0,.25); }
html[data-theme="dark"] .bar-row .count { background:#40583f; color:#d9f0d2; }
html[data-theme="dark"] .bar-row.is-zero .count { background:#46534e; color:#c0cbc6; }
html[data-theme="dark"] .stats-chart.counseling .count { background:#5a4534; color:#ffd4a9; }

html[data-theme="dark"] .tag,
html[data-theme="dark"] .status,
html[data-theme="dark"] .dashboard-section-count,
html[data-theme="dark"] .journal-date-count { color:#28442d; }

/* 펼침 바: 기능별 강조색은 유지하되 다크 배경과 명도를 통일 */
html[data-theme="dark"] #tab-journal details.section,
html[data-theme="dark"] #tab-subjects details.section { background:#34443e; }
html[data-theme="dark"] #tab-journal details.section > summary,
html[data-theme="dark"] #tab-journal details.section[open] > summary {
  color:#ffd2ad;
  background:#4b4038;
  border-color:#88664b;
}
html[data-theme="dark"] #tab-subjects details.section > summary,
html[data-theme="dark"] #tab-subjects details.section[open] > summary {
  color:#cce8c5;
  background:#3d4e3d;
  border-color:#657d60;
}
html[data-theme="dark"] #tab-journal details.section > summary::before {
  border-color:#a97b55;
  color:#ffad69;
  background:#3b332e;
}
html[data-theme="dark"] #tab-subjects details.section > summary::before {
  border-color:#789671;
  color:#9bd18d;
  background:#324130;
}
html[data-theme="dark"] #tab-journal details.section > summary::after,
html[data-theme="dark"] #tab-subjects details.section > summary::after { color:#c6d1cb; }
html[data-theme="dark"] .medicine-form-card .workspace-detail-fields > summary,
html[data-theme="dark"] .medicine-form-card .workspace-detail-fields[open] > summary {
  color:#d8e0ff;
  background:#42485a;
  border-color:#68728e;
}

/* 표 행 호버 시 흰색으로 반전되는 현상 방지 */
html[data-theme="dark"] tbody tr:hover td,
html[data-theme="dark"] tr:hover td,
html[data-theme="dark"] .emergency-table-wrap tbody tr:hover td {
  color:#f5f8f6;
  background:#43564f;
}
html[data-theme="dark"] .exam-schedule-date { color:#f3f7f5; }

/* 주요 버튼은 각 화면의 원래 강조색과 흰 글자를 유지 */
html[data-theme="dark"] .btn { color:#fff; }
html[data-theme="dark"] #tab-journal #j-save-btn { color:#fff; background:#df7620; border-color:#df7620; }
html[data-theme="dark"] #tab-subjects #subject-save-btn { color:#fff; background:#4b9b3d; border-color:#4b9b3d; }
html[data-theme="dark"] #tab-emergency #e-save-btn,
html[data-theme="dark"] #tab-emergency button[onclick="addEmergency()"] { color:#fff; background:#bd514b; border-color:#bd514b; }
html[data-theme="dark"] .infection-form-card button[onclick="addInfection()"] { color:#fff; background:#7a8285; border-color:#7a8285; }
html[data-theme="dark"] #tab-medicine #m-save-btn,
html[data-theme="dark"] #tab-medicine button[onclick="addMedicine()"] {
  color:#fff;
  background:#40558d;
  border-color:#6177ad;
}
html[data-theme="dark"] #tab-medicine #m-save-btn:hover,
html[data-theme="dark"] #tab-medicine button[onclick="addMedicine()"]:hover { color:#fff; background:#4c63a0; }

/* 밝은 배경을 사용하는 보조 버튼만 어두운 글자를 사용 */
html[data-theme="dark"] .btn.gray,
html[data-theme="dark"] .btn.outline,
html[data-theme="dark"] .collapse-card-toggle,
html[data-theme="dark"] button[onclick*="export"] { color:#33423d; }

/* 설정창 데이터 관리 및 하단 버튼 */
html[data-theme="dark"] .settings-data-actions .btn.gray,
html[data-theme="dark"] .settings-dialog-footer .btn.gray {
  border-color:#71847b;
  color:#eef4f1;
  background:#43534d;
}
html[data-theme="dark"] .settings-data-actions .btn.gray:hover,
html[data-theme="dark"] .settings-dialog-footer .btn.gray:hover {
  border-color:#8ca097;
  color:#fff;
  background:#50635b;
}
html[data-theme="dark"] .settings-data-actions .btn.danger {
  border-color:#c7605a;
  color:#fff;
  background:#b94741;
}
html[data-theme="dark"] .settings-dialog-footer .btn:not(.gray) {
  border-color:#e47a27;
  color:#fff;
  background:#df7620;
}
html[data-theme="dark"] .settings-dialog-footer .btn {
  min-width:82px;
  height:40px;
}

/* 공통 날짜 선택기 */
.app-date-input-wrap { position:relative; display:flex; align-items:center; width:100%; height:var(--control-height); }
.app-date-input-wrap > input { width:100%; height:100%; margin:0; padding-right:42px; }
.app-date-open { position:absolute; right:1px; top:1px; bottom:1px; display:grid; place-items:center; width:39px; min-width:0; min-height:0; height:auto; margin:0; padding:0; border:0; border-left:1px solid #d8ded8; border-radius:0 5px 5px 0; color:#d97724; background:#fffaf5; line-height:1; cursor:pointer; box-shadow:none; transform:none; }
.app-date-open .bi { display:block; font-size:15px; line-height:1; pointer-events:none; }
.app-date-open:hover { color:#b95f16; background:#fff0e1; }
.app-date-picker { position:fixed; z-index:3000; width:min(330px, calc(100vw - 20px)); padding:13px; border:1px solid #edbf92; border-radius:13px; background:#fffaf4; box-shadow:0 16px 38px rgba(76,51,31,.22); box-sizing:border-box; transform:scale(var(--app-date-picker-zoom, var(--app-display-zoom, 1))); transform-origin:top left; }
dialog:has(> .app-date-picker) { overflow:visible; }
.app-date-picker-head { display:grid; grid-template-columns:32px 1fr 32px; align-items:center; gap:7px; margin-bottom:10px; }
.app-date-picker-head > button,
.app-date-picker-actions button { min-height:31px; border:1px solid #ebc9a8; border-radius:8px; color:#a65b20; background:#fff; font-weight:800; cursor:pointer; }
.app-date-picker-head > button:hover,
.app-date-picker-actions button:hover { border-color:#df8a3d; background:#fff0df; }
.app-date-picker-selectors { display:flex; justify-content:center; align-items:center; gap:5px; }
.app-date-picker-selectors input { width:76px; height:32px; margin:0; padding:5px 7px; color:#65452d; text-align:center; font-size:12px; font-weight:800; }
.app-date-picker-selectors select { width:68px; height:32px; margin:0; padding:5px 7px; color:#65452d; font-size:12px; font-weight:800; }
.app-date-picker-selectors span { color:#80664f; font-size:11px; font-weight:800; }
.app-date-picker-weekdays,
.app-date-picker-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.app-date-picker-weekdays { margin:0 -13px; padding:7px 13px; border-top:1px solid #f0dfcf; border-bottom:1px solid #ecd7c3; background:#fff3e5; }
.app-date-picker-weekdays span { color:#806b58; text-align:center; font-size:10px; font-weight:850; }
.app-date-picker-weekdays span:first-child { color:#c35c54; }
.app-date-picker-weekdays span:last-child { color:#587ca1; }
.app-date-picker-grid { grid-template-rows:repeat(6,32px); min-height:212px; padding-top:7px; }
.app-date-picker-day { display:grid; place-items:center; min-height:32px; border:1px solid transparent; border-radius:8px; color:#59483a; background:#fffdf9; font-size:11px; font-weight:750; cursor:pointer; }
.app-date-picker-day:hover { border-color:#e9a562; background:#fff0df; }
.app-date-picker-day.is-today { border-color:#76a967; color:#397238; background:#eff8eb; }
.app-date-picker-day.is-selected { border-color:#df7620; color:#fff; background:#df7620; }
.app-date-picker-blank { min-height:32px; }
.app-date-picker-time { display:flex; align-items:center; gap:12px; margin-top:9px; padding:9px 2px 0; border-top:1px solid #ecd7c3; }
.app-date-picker-time.hidden { display:none; }
.app-date-picker-time label { flex:0 0 auto; margin:0; color:#6d5948; font-size:11px; font-weight:800; }
.app-date-picker-time input { flex:0 0 158px; width:158px; min-width:158px; height:36px; margin:0; padding:6px 10px; box-sizing:border-box; font-variant-numeric:tabular-nums; }
.app-date-picker-actions { display:flex; justify-content:flex-end; gap:7px; margin-top:10px; padding-top:10px; border-top:1px solid #ecd7c3; }
.app-date-picker-actions button { padding:0 12px; }
.app-date-picker-actions button.primary { border-color:#df7620; color:#fff; background:#df7620; }
.birth-validation-message { display:none; margin-top:5px; color:#c7463d; font-size:11px; font-weight:750; line-height:1.35; }
.birth-validation-message.is-visible { display:block; }
input.is-invalid-date { border-color:#d9544d; background:#fff8f7; box-shadow:0 0 0 2px rgba(217,84,77,.1); }
html[data-theme="dark"] .app-date-open { border-color:#65776e; color:#f1a157; background:#3a4942; }
html[data-theme="dark"] .app-date-picker { border-color:#7f6a59; background:#34423c; box-shadow:0 18px 42px rgba(0,0,0,.4); }
html[data-theme="dark"] .app-date-picker-weekdays { border-color:#68776f; background:#3e4b45; }
html[data-theme="dark"] .app-date-picker-head > button,
html[data-theme="dark"] .app-date-picker-actions button,
html[data-theme="dark"] .app-date-picker-day { border-color:#63736b; color:#edf3ef; background:#405048; }
html[data-theme="dark"] .app-date-picker-selectors input,
html[data-theme="dark"] .app-date-picker-selectors select,
html[data-theme="dark"] .app-date-picker-time input { border-color:#63736b; color:#edf3ef; background:#2d3934; }
html[data-theme="dark"] .app-date-picker-day.is-today { border-color:#82b36f; color:#dff4d8; background:#3d543c; }
html[data-theme="dark"] .app-date-picker-day.is-selected,
html[data-theme="dark"] .app-date-picker-actions button.primary { border-color:#df7620; color:#fff; background:#df7620; }
html[data-theme="dark"] .birth-validation-message { color:#ffaaa4; }
html[data-theme="dark"] input.is-invalid-date { border-color:#dc6c65; background:#493836; }

/* 업무용 등록 폼 공통 규격 */
.detail-form-layout {
  display:grid;
  gap:12px;
  margin:0 !important;
  padding:14px;
  background:#f7f9f7;
}
.detail-form-group {
  min-width:0;
  padding:14px;
  border:1px solid #dde5df;
  border-radius:10px;
  background:#fff;
}
.detail-form-group h3 {
  display:flex;
  align-items:center;
  gap:7px;
  margin:0 0 12px;
  color:#30443b;
  font-size:13px;
  font-weight:850;
}
.detail-form-group h3 span { color:inherit; font-size:inherit; font-weight:inherit; }
.detail-form-group h3 .detail-heading-note { margin-left:2px; color:#718078; font-size:10px; font-weight:700; }
.detail-form-grid { display:grid; gap:12px 14px; align-items:start; }
.detail-grid-four { grid-template-columns:repeat(4,minmax(0,1fr)); }
.detail-grid-three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.detail-grid-two { grid-template-columns:minmax(220px,.75fr) minmax(360px,1.75fr); }
.detail-form-grid > div { min-width:0; }
.detail-form-group label {
  display:block;
  margin:0 0 6px;
  color:#374a41;
  font-size:12px;
  font-weight:800;
}
.detail-form-group input,
.detail-form-group select,
.detail-form-group textarea {
  width:100%;
  min-width:0;
  margin:0;
  box-sizing:border-box;
  background:#fff;
}
.detail-form-group input,
.detail-form-group select { height:42px; }
.detail-form-group textarea { min-height:72px; resize:vertical; }
.detail-risk-group .checkbox-group { margin-bottom:12px; }
.detail-risk-group .checkbox-group label {
  display:inline-flex;
  align-items:center;
  min-height:0;
  margin:0 8px 8px 0;
  padding:8px 11px;
  border:1px solid #dce5dc;
  border-radius:8px;
  background:#fbfdfb;
  cursor:pointer;
}
.detail-risk-group .checkbox-group input[type="checkbox"] {
  flex:0 0 15px;
  width:15px;
  height:15px;
  margin:0 6px 0 0;
  padding:0;
  accent-color:var(--of-green);
  box-shadow:none;
}
.detail-note-group textarea { min-height:74px; }
.subject-risk-content { display:grid; gap:12px; }
.subject-risk-content .checkbox-group { margin:0; }
.workspace-detail-fields > .detail-form-layout { margin:0 !important; }
.workspace-detail-fields > .medicine-note { margin:14px 14px 12px; }
.medicine-detail-layout { padding-top:12px; }
.emergency-detail-layout .emergency-status-panel { margin:0; padding:0; border:0; background:transparent; }
.emergency-detail-layout .emergency-bottom-grid { margin:0; }
.emergency-detail-layout .emergency-bottom-grid textarea { min-height:72px; }

/* 핵심 입력란은 화면마다 같은 높이와 예측 가능한 폭을 사용한다. */
.subject-primary-fields,
.journal-primary-fields { grid-template-columns:180px 180px; width:min(430px,100%); max-width:100%; box-sizing:border-box; }
.emergency-primary-fields { grid-template-columns:180px 230px; width:min(470px,100%); max-width:100%; box-sizing:border-box; }
.infection-primary-fields { grid-template-columns:180px 300px 190px; width:min(750px,100%); max-width:100%; box-sizing:border-box; }
.medicine-primary-fields { grid-template-columns:260px 150px 210px 160px; width:min(980px,100%); max-width:100%; box-sizing:border-box; }
.medicine-primary-fields .medicine-conversion-quantity { grid-column:3; grid-row:2; }
.medicine-primary-fields .medicine-usage-unit { grid-column:4; grid-row:2; }
.medicine-primary-fields .medicine-use-method-field { grid-column:1 / span 2; grid-row:2; min-width:0; }
.medicine-primary-fields .medicine-use-method-field select { width:100%; }
.medicine-primary-fields .medicine-conversion-quantity > .field-label-with-help { white-space:nowrap; }
.field-label-with-help { display:flex; align-items:center; gap:5px; width:max-content; max-width:100%; }
.field-info-tooltip { position:relative; display:inline-flex; align-items:center; justify-content:center; color:#687993; cursor:help; line-height:1; }
.field-info-tooltip > i { font-size:13px; }
.field-info-tooltip > span { position:absolute; z-index:80; left:50%; bottom:calc(100% + 9px); width:max-content; max-width:280px; padding:8px 10px; border:1px solid #cfd6df; border-radius:7px; background:#263448; color:#fff; box-shadow:0 8px 20px rgba(25,38,52,.18); font-size:11px; font-weight:500; line-height:1.55; white-space:normal; opacity:0; visibility:hidden; pointer-events:none; transform:translate(-50%,4px); transition:opacity .15s ease,transform .15s ease,visibility .15s ease; }
.field-info-tooltip:hover > span,
.field-info-tooltip:focus > span,
.field-info-tooltip:focus-visible > span { opacity:1; visibility:visible; transform:translate(-50%,0); }
html[data-theme="dark"] .field-info-tooltip { color:#c4cddd; }
html[data-theme="dark"] .field-info-tooltip > span { border-color:#647083; background:#f5f7fa; color:#263448; }
.subject-primary-fields input,
.journal-primary-fields input,
.emergency-primary-fields input,
.infection-primary-fields input,
.medicine-primary-fields input,
.journal-visit-fields input,
.journal-visit-fields select { height:42px; }

@media (max-width:1000px) {
  .detail-grid-four,
  .detail-grid-three { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .detail-grid-two { grid-template-columns:1fr; }
  .infection-primary-fields { grid-template-columns:minmax(0,.9fr) minmax(0,1.5fr) minmax(0,.95fr); max-width:none; }
  .medicine-primary-fields { grid-template-columns:repeat(2,minmax(180px,1fr)); max-width:none; }
  .medicine-primary-fields .medicine-conversion-quantity,
  .medicine-primary-fields .medicine-usage-unit { grid-column:auto; grid-row:auto; }
  .medicine-primary-fields .medicine-use-method-field { grid-column:span 2; grid-row:auto; }
}

.journal-new-subject-card {
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:11px;
  padding:14px 16px;
  border:1px solid #efd2b7;
  border-radius:12px;
  background:#fff8f1;
  box-shadow:inset 3px 0 0 #e78638;
}

.journal-new-subject-heading { display:flex; align-items:center; gap:10px; }
.journal-new-subject-heading strong { display:block; margin-bottom:2px; color:#8b4b1d; font-weight:800; }
.journal-new-subject-heading p { margin:0; color:#8d7c70; font-size:11px; }
.journal-new-subject-icon { display:grid; place-items:center; flex:0 0 36px; width:36px; height:36px; border:1px solid #efd2b7; border-radius:10px; color:#d66c1a; background:#fff; font-size:17px; }
.journal-new-subject-fields {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  width:100%;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
}
.journal-new-subject-fields > .field-short { grid-column:auto; width:auto; min-width:0; }
.journal-new-subject-fields input { width:100%; min-width:0; }

.journal-care-card {
  margin:16px 0;
  padding:16px;
  border:1px solid #efd2b7;
  border-radius:12px;
  background:#fffaf5;
  box-shadow:inset 3px 0 0 #e78638;
}
.journal-care-card .journal-visit-fields { margin-top:0; }

.medicine-stock-overview {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:8px;
  margin:14px 0 12px;
}
.medicine-stock-overview-item {
  appearance:none;
  width:100%;
  min-width:0;
  padding:11px 13px;
  border:1px solid #dde4df;
  border-radius:10px;
  background:#f8faf8;
  color:inherit;
  font:inherit;
  text-align:left;
  cursor:pointer;
  transition:border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.medicine-stock-overview-item:hover { transform:translateY(-1px); box-shadow:0 5px 12px rgba(31,56,46,.08); }
.medicine-stock-overview-item:focus-visible { outline:2px solid #e8873c; outline-offset:2px; }
.medicine-stock-overview-item.active { box-shadow:inset 0 0 0 2px currentColor; }
.medicine-stock-overview-item > span {
  display:block;
  margin-bottom:5px;
  color:#6c756f;
  font-size:11px;
  font-weight:700;
}
.medicine-stock-overview-item strong {
  display:flex;
  align-items:baseline;
  gap:4px;
  color:#263d34;
  font-size:20px;
  line-height:1;
}
.medicine-stock-overview-item strong small { color:inherit; font-size:10px; font-weight:700; opacity:.72; }
.medicine-stock-overview-item.all { border-color:#d7deec; background:#f4f6fb; }
.medicine-stock-overview-item.all strong { color:#344c7b; }
.medicine-stock-overview-item.all.active { color:#7082a8; }
.medicine-stock-overview-item.enough { border-color:#cfe3ca; background:#f3f9f1; }
.medicine-stock-overview-item.enough strong { color:#3f8136; }
.medicine-stock-overview-item.enough.active { color:#63a257; }
.medicine-stock-overview-item.low { border-color:#efd6b6; background:#fff8ee; }
.medicine-stock-overview-item.low strong { color:#b56422; }
.medicine-stock-overview-item.low.active { color:#d48843; }
.medicine-stock-overview-item.empty { border-color:#e8c8c5; background:#fff4f3; }
.medicine-stock-overview-item.empty strong { color:#a84f49; }
.medicine-stock-overview-item.empty.active { color:#c86a63; }
.medicine-stock-overview-item.unset strong { color:#65706a; }
.medicine-stock-overview-item.unset.active { color:#7d8a83; }

html[data-theme="dark"] .journal-new-subject-card,
html[data-theme="dark"] .journal-care-card {
  border-color:#70543e;
  background:#3d352f;
  box-shadow:inset 3px 0 0 #e78638;
}
html[data-theme="dark"] .journal-new-subject-heading strong,
html[data-theme="dark"] .journal-medication-heading strong { color:#f0b17d; }
html[data-theme="dark"] .journal-new-subject-heading p { color:#c9b8aa; }
html[data-theme="dark"] .journal-new-subject-icon { border-color:#70543e; background:#314039; color:#f0a264; }
html[data-theme="dark"] .journal-medication-section { border-top-color:#70543e; }
html[data-theme="dark"] .medicine-stock-overview-item { border-color:#607069; background:#35443e; }
html[data-theme="dark"] .medicine-stock-overview-item > span { color:#c6d0cb; }
html[data-theme="dark"] .medicine-stock-overview-item.all strong { color:#bdc9e8; }
html[data-theme="dark"] .medicine-stock-overview-item.enough strong { color:#9bd08f; }
html[data-theme="dark"] .medicine-stock-overview-item.low strong { color:#efb375; }
html[data-theme="dark"] .medicine-stock-overview-item.empty strong { color:#efa09a; }
html[data-theme="dark"] .medicine-stock-overview-item.unset strong { color:#d0d7d3; }

@media (max-width:1000px) {
  .medicine-stock-overview { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:640px) {
  .journal-new-subject-fields { grid-template-columns:1fr; }
  .medicine-stock-overview { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

.settings-api-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

/* 선택 메뉴 자체에 고정된 하단선이 표시되어 화면 배율과 관계없이 위치가 유지됩니다. */
.nav-inner button { position:relative; }
.nav-inner button.active::after {
  content:"";
  position:absolute;
  z-index:2;
  right:0;
  bottom:0;
  left:0;
  height:4px;
  border-radius:4px 4px 0 0;
  background:linear-gradient(90deg, #ed7d1d, #f3a457);
  box-shadow:0 -1px 6px rgba(237,125,29,.2);
  animation:nav-indicator-fade-in .16s ease-out both;
  pointer-events:none;
}
@media (max-width:640px) {
  .detail-form-layout { padding:10px; }
  .detail-form-group { padding:12px; }
  .detail-grid-four,
  .detail-grid-three,
  .detail-grid-two,
  .subject-primary-fields,
  .journal-primary-fields,
  .emergency-primary-fields,
  .infection-primary-fields,
  .medicine-primary-fields { grid-template-columns:1fr; max-width:none; }
  .medicine-primary-fields .medicine-conversion-quantity,
  .medicine-primary-fields .medicine-usage-unit,
  .medicine-primary-fields .medicine-use-method-field { grid-column:1; grid-row:auto; }
  .emergency-status-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

html[data-theme="dark"] .detail-form-layout { background:#34413b; }
html[data-theme="dark"] .detail-form-group { border-color:#62736b; background:#3d4b45; }
html[data-theme="dark"] .detail-form-group h3,
html[data-theme="dark"] .detail-form-group label { color:#eef4f1; }
html[data-theme="dark"] .detail-form-group h3 .detail-heading-note { color:#b6c4bd; }
html[data-theme="dark"] .detail-form-group input,
html[data-theme="dark"] .detail-form-group select,
html[data-theme="dark"] .detail-form-group textarea { border-color:#65776e; color:#f1f5f3; background:#2f3b36; }
html[data-theme="dark"] .detail-risk-group .checkbox-group label { border-color:#63756b; background:#35433d; }

/* 응급·감염병 이력 검색 도구 */
.record-list-tools {
  display:flex;
  flex:1 1 auto;
  align-items:flex-end;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  min-width:0;
  max-width:none;
}
.record-list-search { width:210px; }
.record-list-search input { width:100%; height:40px; }
.infection-list-search { width:245px; }
.record-period-filter {
  display:flex;
  align-items:flex-end;
  gap:8px;
  padding:0;
  white-space:nowrap;
}
.record-period-filter > span { padding-bottom:11px; color:#76827c; font-size:12px; font-weight:800; }
.record-status-filter {
  width:170px;
  height:40px;
  margin:0;
  padding-top:0;
  padding-bottom:0;
  line-height:normal;
  vertical-align:middle;
}
.record-list-tools .btn { height:40px; margin:0; white-space:nowrap; }

@media (max-width:1100px) {
  .emergency-list-card .flex-between,
  .infection-list-card .flex-between { align-items:flex-start; flex-direction:column; gap:12px; }
  .record-list-tools { width:100%; justify-content:flex-start; max-width:none; }
}
@media (max-width:700px) {
  .record-list-search,
  .infection-list-search { width:100%; }
  .record-period-filter { width:100%; }
  .record-period-filter .period-filter-date { flex:1 1 0; }
  .record-period-filter .period-filter-date > .app-date-input-wrap { width:100%; }
}
/* Feature module presentation rules. Kept in module load order. */
body { font-size:16px; line-height:1.62; font-weight:500; color:#1f2937; }
header h1 { font-size:22px; font-weight:700; }
nav button { font-size:15px; font-weight:600; padding:11px 17px; }
.card h2 { font-size:18px; font-weight:700; }
label { font-size:14px; font-weight:600; color:#444; }
input, select, textarea { font-size:15px; padding:10px 12px; font-weight:500; }
textarea { min-height:72px; }
.btn { font-size:14px; font-weight:700; padding:10px 18px; }
.btn.small { font-size:13px; font-weight:700; }
.btn.mini { font-size:12px; font-weight:700; }

/* 상세 열람 버튼은 화면 전반에서 동일한 보조 버튼으로 사용합니다. */
.btn.detail-btn,
.btn.detail-btn:hover,
.btn.detail-btn:active {
  min-width:52px;
  border-color:#d5dcd8;
  color:#4e5953;
  background:#fff;
  box-shadow:none;
  transform:none;
}

.btn.detail-btn:hover {
  border-color:#9fc795;
  color:#43823b;
  background:#f6fbf4;
}

.btn.detail-btn:focus-visible {
  outline:2px solid rgba(75,155,61,.22);
  outline-offset:2px;
  box-shadow:none;
}

html[data-theme="dark"] .btn.detail-btn,
html[data-theme="dark"] .btn.detail-btn:hover,
html[data-theme="dark"] .btn.detail-btn:active {
  border-color:#d8e0dc !important;
  color:#26332d !important;
  background:#edf2ef !important;
  opacity:1;
}

html[data-theme="dark"] .btn.detail-btn:hover {
  border-color:#9fc795 !important;
  color:#326b2d !important;
  background:#fff !important;
}

/* 수정·삭제는 상세 버튼과 같은 규격을 사용하고 의미만 색으로 구분합니다. */
.btn.edit-action-btn,
.btn.edit-action-btn:hover,
.btn.edit-action-btn:active,
button.edit-action-btn,
button.edit-action-btn:hover,
button.edit-action-btn:active {
  min-width:52px;
  border:1px solid #d5dcd8;
  border-radius:6px;
  color:#4e5953;
  background:#fff;
  box-shadow:none;
  transform:none;
}

.btn.edit-action-btn:hover,
button.edit-action-btn:hover {
  border-color:#aebbb4;
  color:#37433d;
  background:#f6f8f7;
}

.btn.delete-action-btn,
.btn.delete-action-btn:hover,
.btn.delete-action-btn:active,
button.delete-action-btn,
button.delete-action-btn:hover,
button.delete-action-btn:active {
  min-width:52px;
  border:1px solid #e4c3c0;
  border-radius:6px;
  color:#a45651;
  background:#fff;
  box-shadow:none;
  transform:none;
}

.btn.delete-action-btn:hover,
button.delete-action-btn:hover {
  border-color:#d89c97;
  color:#984741;
  background:#fff6f5;
}

.btn.edit-action-btn:focus-visible,
.btn.delete-action-btn:focus-visible,
button.edit-action-btn:focus-visible,
button.delete-action-btn:focus-visible {
  outline:2px solid rgba(75,155,61,.18);
  outline-offset:2px;
  box-shadow:none;
}

html[data-theme="dark"] .btn.edit-action-btn,
html[data-theme="dark"] button.edit-action-btn {
  border-color:#d8e0dc !important;
  color:#26332d !important;
  background:#edf2ef !important;
  opacity:1;
}

html[data-theme="dark"] .btn.edit-action-btn:hover,
html[data-theme="dark"] button.edit-action-btn:hover {
  border-color:#9fc795 !important;
  color:#326b2d !important;
  background:#fff !important;
}

html[data-theme="dark"] .btn.delete-action-btn,
html[data-theme="dark"] button.delete-action-btn {
  border-color:#e7b7b2 !important;
  color:#7f342f !important;
  background:#f5dcda !important;
  opacity:1;
}

html[data-theme="dark"] .btn.delete-action-btn:hover,
html[data-theme="dark"] button.delete-action-btn:hover {
  border-color:#efc8c4 !important;
  color:#702a26 !important;
  background:#fff1ef !important;
}

/* 다크 모드에서 개별 밝은 화면용 글자색이 공통 대비를 덮지 않도록 보정합니다. */
html[data-theme="dark"] .schedule-person {
  color:#eef4f1;
}

html[data-theme="dark"] .schedule-person::before {
  color:#aebbb4;
}

html[data-theme="dark"] .medicine-stock-table .medicine-company,
html[data-theme="dark"] .medicine-stock-table .medicine-conversion {
  color:#d6e0da;
}

html[data-theme="dark"] .medicine-stock-table .medicine-name,
html[data-theme="dark"] .medicine-stock-table .medicine-spec,
html[data-theme="dark"] .medicine-stock-table .medicine-number {
  color:#f2f6f4;
}

html[data-theme="dark"] .medicine-stock-table .medicine-current {
  color:#8fd47f;
}
table { font-size:14px; }
th, td { padding:11px 12px; }
th { font-weight:700; }
.tag, .status { font-size:12px; font-weight:700; }
.muted { font-size:13px; color:#6b7280; }
.empty { font-size:14px; }
.list-empty-cell { padding:14px; }
.list-empty-state {
  display:flex;
  min-height:128px;
  box-sizing:border-box;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:7px;
  margin-top:12px;
  padding:24px 18px;
  border:1px dashed #d5ddd7;
  border-radius:10px;
  color:#6b7871;
  background:#fbfcfb;
  text-align:center;
}
.list-empty-cell .list-empty-state { min-height:110px; margin-top:0; }
.list-empty-state strong { color:#34483d; font-size:14px; }
.list-empty-state > span { font-size:12px; line-height:1.55; }
.list-empty-state .list-empty-reset { min-height:36px; margin-top:3px; padding:0 12px; font-size:12px; }
html[data-theme="dark"] .list-empty-state {
  border-color:#4e5953;
  color:#b7c2bc;
  background:#242927;
}
html[data-theme="dark"] .list-empty-state strong { color:#edf2ef; }
.history { border-left-width:4px; }
.medicine-note, .edit-banner, .trash-note { font-size:13px; }
.trash-note { background:#eef6ff; border:1px solid #cfe3ff; color:#27548a; border-radius:8px; padding:10px 12px; margin-bottom:12px; }
.danger-text { color:#b42318; font-weight:700; }
.log-chip { display:inline-block; padding:3px 8px; border-radius:999px; font-size:12px; font-weight:700; }
.log-chip.use { background:#fff3e0; color:#b45309; }
.log-chip.restock { background:#ecfdf3; color:#027a48; }
.log-chip.edit { background:#eff6ff; color:#1d4ed8; }
.log-chip.delete { background:#fef2f2; color:#b42318; }
.log-chip.create { background:#f3f4f6; color:#374151; }

#j-match { margin:10px 0 18px; line-height:1.7; }
#j-match > .bi { display:inline-block; margin-right:6px; }
.counseling-history-content { display:flex; align-items:flex-start; gap:6px; margin-top:6px; }
.counseling-history-content > .bi { flex:0 0 auto; margin-top:2px; }
#s-name-guide { margin-top:-2px; margin-bottom:12px; line-height:1.7; }
.memo-toolbar { display:flex; gap:8px; align-items:center; flex-wrap:nowrap; }
.memo-toolbar input[type="text"], .memo-toolbar input:not([type]) { margin:0; }
.memo-toolbar .text-wrap { flex:1; }
.memo-toolbar .btn-wrap { flex:0 0 72px; }
.memo-toolbar .date-wrap { flex:0 0 170px; }
.memo-item .actions { display:flex; gap:6px; flex-wrap:wrap; }

.record-actions { display:flex; gap:6px; flex-wrap:wrap; }
.sub-note-box { margin-top:10px; padding:10px 12px; border:1px solid #e5e7eb; border-radius:8px; background:#f9fafb; }
.sub-note-box .tit { font-weight:700; margin-bottom:4px; color:#374151; }
#s-risk-checkboxes { margin-bottom:12px; }
#e-edit-banner, #i-edit-banner { margin-top:10px; }

#medicine-log-filters { display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; margin:6px 0 14px; }
#medicine-log-filters > div { flex:0 0 auto; }
#medicine-log-filters .medicine-log-period { min-width:308px; }
#medicine-log-filters .medicine-log-item-filter { width:240px; min-width:180px; }
.medicine-log-item-filter > label { display:block; margin:0 0 4px; color:#59675f; font-size:12px; font-weight:700; }
.medicine-log-item-combobox { position:relative; width:100%; }
.medicine-log-item-combobox > input { width:100%; height:40px; margin:0; padding-right:42px; box-sizing:border-box; }
.medicine-log-item-toggle {
  position:absolute; z-index:2; top:0; right:0; width:40px; height:40px; min-height:40px;
  margin:0; padding:0; border:0; border-left:1px solid #d9e0da; border-radius:0 7px 7px 0;
  color:#34493f; background:transparent; cursor:pointer;
}
.medicine-log-item-toggle:hover { color:#397e2d; background:#f6fbf4; }
.medicine-log-item-toggle i { display:block; font-size:12px; line-height:1; }
.medicine-log-item-menu {
  position:absolute; z-index:1250; top:calc(100% + 4px); left:0; right:0;
  display:flex; flex-direction:column; padding:4px;
  overflow:hidden;
  border:1px solid #cfd8d1; border-radius:9px; background:#fff;
  box-shadow:0 12px 28px rgba(33,50,40,.18);
}
.medicine-log-item-menu.hidden { display:none; }
.medicine-log-item-menu > button,
.medicine-log-item-options > button {
  display:flex; align-items:center; gap:8px; flex:0 0 36px; width:100%; min-height:36px;
  padding:7px 10px; border:0; border-radius:6px; color:#304039; background:transparent;
  font:inherit; text-align:left; cursor:pointer;
}
.medicine-log-item-menu > button:hover,
.medicine-log-item-menu > button:focus-visible,
.medicine-log-item-options > button:hover,
.medicine-log-item-options > button:focus-visible { color:#2f7e31; background:#eef7ec; outline:none; font-weight:700; }
.medicine-log-item-menu > button:nth-child(2) { margin-bottom:3px; border-bottom:1px solid #e5ebe6; border-radius:6px 6px 0 0; }
.medicine-log-item-options { display:flex; flex-direction:column; max-height:360px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.medicine-log-item-options > p { margin:0; padding:12px 10px; color:#7b8780; font-size:12px; }
#medicine-log-filters .period-filter-date > label { margin-bottom:0; }
#medicine-log-filters input { margin-bottom:0; }
@media (max-width:480px) {
  #medicine-log-filters .medicine-log-period { display:grid; grid-template-columns:minmax(0,1fr); width:100%; min-width:0; white-space:normal; }
  #medicine-log-filters .period-filter-date { width:100%; min-width:0; }
  #medicine-log-filters .period-filter-date input { width:100%; min-width:0; }
  #medicine-log-filters .medicine-log-period > span { display:none; }
}
html[data-theme="dark"] .period-filter-date > label { color:#d7e2dc; }
html[data-theme="dark"] .medicine-log-item-filter > label { color:#d7e2dc; }
html[data-theme="dark"] .medicine-log-item-toggle { border-color:#66756d; color:#e5eee8; }
html[data-theme="dark"] .medicine-log-item-toggle:hover { color:#c6e7bf; background:#405149; }
html[data-theme="dark"] .medicine-log-item-menu { border-color:#66736b; background:#34413a; }
html[data-theme="dark"] .medicine-log-item-menu > button,
html[data-theme="dark"] .medicine-log-item-options > button { color:#eef4ef; }
html[data-theme="dark"] .medicine-log-item-menu > button:hover,
html[data-theme="dark"] .medicine-log-item-menu > button:focus-visible,
html[data-theme="dark"] .medicine-log-item-options > button:hover,
html[data-theme="dark"] .medicine-log-item-options > button:focus-visible { color:#c6e7bf; background:#405149; }
html[data-theme="dark"] .medicine-log-item-options > p { color:#bac7c0; }
.medicine-stock-tools > select { width:auto; min-width:150px; margin:0; }
.memo-toolbar { align-items:stretch !important; }
.memo-toolbar .date-wrap input,
.memo-toolbar .text-wrap input,
.memo-toolbar .btn-wrap button { height:44px; }
.memo-toolbar .btn-wrap { display:flex; align-items:stretch; }
.memo-toolbar .btn-wrap button { width:100%; }

/* 홈 현황 카드는 관련 화면이나 목록으로 이동하는 바로가기입니다. */
#tab-dashboard .kpi > .kpi-link::after {
  display: block !important;
  content: "" !important;
  position: absolute;
  top: 50%;
  width: 25px;
  height: 25px;
  right: 14px;
  border:1px solid #d6dfd9;
  border-radius:50%;
  background-color:rgba(255,255,255,.9);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m8 5 5 5-5 5' stroke='%234f655a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position:center;
  background-repeat:no-repeat;
  background-size:12px 12px;
  box-shadow:0 3px 9px rgba(43,64,53,.08);
  opacity: 1;
  transform: translateY(-50%);
  transition:border-color .16s ease,background-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
#tab-dashboard .kpi > .kpi-link:hover::after,
#tab-dashboard .kpi > .kpi-link:focus-visible::after { border-color:var(--kpi-accent,#4c8f46); background-color:var(--kpi-accent,#4c8f46); background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m8 5 5 5-5 5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); box-shadow:0 5px 12px rgba(43,64,53,.16); transform:translate(2px,-50%); }
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-link::after { border-color:#6d7d76; background-color:#465750; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m8 5 5 5-5 5' stroke='%23e5eee9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); box-shadow:none; }

.schedule-heading-tools { display:inline-flex; align-items:center; gap:8px; margin-left:auto; }
.schedule-heading-tools #dashboard-schedule-filter { width:auto; min-width:145px; height:36px; margin:0; padding:5px 32px 5px 11px; border-color:#d8e1da; border-radius:7px; color:#435149; background-color:#fff; font-size:12px; }
@media (max-width:700px) {
  .collapsible-card-heading { align-items:flex-start; }
  .schedule-heading-tools { align-items:flex-end; flex-direction:column-reverse; }
  .schedule-heading-tools #dashboard-schedule-filter { min-width:125px; }
}

/* 홈 KPI: 메뉴별 파스텔 색상의 얇고 균일한 테두리를 사용합니다. */
#tab-dashboard .kpi > .kpi-accent-journal {
  --kpi-accent:#dc7625;
  --kpi-border:#e6c4a8;
  --kpi-text:#b85d18;
  --kpi-label:#9a5a2b;
  --kpi-illustration-bg:#fff2e7;
  --kpi-illustration-border:#f4d4b8;
}
#tab-dashboard .kpi > .kpi-accent-subjects {
  --kpi-accent:#4b963f;
  --kpi-border:#c1d5b5;
  --kpi-text:#33792f;
  --kpi-label:#4f7650;
  --kpi-illustration-bg:#edf7ea;
  --kpi-illustration-border:#cfe5c8;
}
#tab-dashboard .kpi > .kpi-accent-medicine {
  --kpi-accent:#344878;
  --kpi-border:#bec7dc;
  --kpi-text:#304879;
  --kpi-label:#52617d;
  --kpi-illustration-bg:#eef1f8;
  --kpi-illustration-border:#d1d8e9;
}
#tab-dashboard .kpi > .kpi-accent-emergency {
  --kpi-accent:#c95852;
  --kpi-border:#e7bfbb;
  --kpi-text:#aa4540;
  --kpi-label:#8f5955;
  --kpi-illustration-bg:#fbeeed;
  --kpi-illustration-border:#edcecb;
}
#tab-dashboard .kpi > .kpi-link { border:1px solid var(--kpi-border); }
#tab-dashboard .kpi > .kpi-link::before { content:none; }
#tab-dashboard .kpi > .kpi-link:hover {
  border-color:color-mix(in srgb, var(--kpi-accent) 55%, #e2e9e5);
}
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-link {
  border-color:color-mix(in srgb, var(--kpi-accent) 30%, var(--dark-border, #657a71));
}
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-link:hover {
  border-color:color-mix(in srgb, var(--kpi-accent) 60%, var(--dark-border, #657a71));
}
#tab-dashboard .kpi > .kpi-link .num { color:var(--kpi-text); }
#tab-dashboard .kpi > .kpi-link .lbl { color:#78847c; }
#tab-dashboard .kpi > .kpi-link .kpi-value {
  position:relative;
  z-index:1;
  display:flex;
  align-items:baseline;
  gap:6px;
  max-width:calc(100% - 42px);
  min-height:40px;
}
#tab-dashboard .kpi > .kpi-link .kpi-value .num {
  display:block;
  width:auto;
  min-width:0;
  box-sizing:border-box;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  color:#234237;
  background:none;
  box-shadow:none;
  font-size:36px;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  letter-spacing:-1.1px;
  line-height:1.05;
  text-align:left;
  overflow-wrap:anywhere;
}
#tab-dashboard .kpi > .kpi-link .kpi-unit {
  flex:0 0 auto;
  color:#78847c;
  font-size:12px;
  font-weight:500;
  line-height:1.4;
}
#tab-dashboard .kpi > .kpi-link .lbl { margin-top:9px; font-size:15.6px; font-weight:700; letter-spacing:-.15px; transition:color .2s ease; }
#tab-dashboard .kpi > .kpi-link { padding:19px 22px; }
#tab-dashboard .kpi > .kpi-link::after { z-index:2; }
#tab-dashboard .kpi > .kpi-link .kpi-illustration {
  position:absolute;
  z-index:0;
  top:50%;
  left:74%;
  right:auto;
  width:246px;
  height:216px;
  border:0;
  border-radius:0;
  background-color:transparent;
  background-repeat:no-repeat;
  background-position:center;
  background-size:78%;
  box-shadow:none;
  opacity:.2;
  filter:none;
  transform:translate(-50%,-50%);
  pointer-events:none;
  user-select:none;
}
.kpi-illustration-journal { background-image:url('../assets/illustrations/kpi-journal-handdrawn.png'); }
#tab-dashboard .kpi > .kpi-link .kpi-illustration-subjects {
  background-image:url('../assets/illustrations/kpi-subjects-handdrawn.png');
  background-size:72%;
}
.kpi-illustration-medicine { background-image:url('../assets/illustrations/kpi-medicine-handdrawn.png'); }
#tab-dashboard .kpi > .kpi-link .kpi-illustration-medicine { background-size:101.4%; }
.kpi-illustration-emergency { background-image:url('../assets/illustrations/kpi-emergency-handdrawn.png'); }
#tab-dashboard .kpi > .kpi-link .kpi-illustration { transition:opacity .2s ease; }
html #tab-dashboard .kpi > .kpi-link:hover .kpi-illustration,
html #tab-dashboard .kpi > .kpi-link:focus-visible .kpi-illustration { opacity:.45; }
@media (prefers-reduced-motion:reduce) {
  #tab-dashboard .kpi > .kpi-link .kpi-illustration,
  #tab-dashboard .kpi > .kpi-link .lbl { transition:none; }
}
#tab-dashboard .kpi .num,
#tab-dashboard .kpi .lbl {
  position:relative;
  z-index:1;
}
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-link .kpi-illustration {
  opacity:.24;
  filter:brightness(1.08);
  background-color:transparent;
  box-shadow:none;
}
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-link .kpi-value .num {
  color:#edf3ef;
  background:none;
  box-shadow:none;
}
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-link .kpi-unit,
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-link .lbl { color:#b2c0b7; }
#tab-dashboard .kpi > .kpi-link:hover .lbl,
#tab-dashboard .kpi > .kpi-link:focus-visible .lbl,
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-link:hover .lbl,
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-link:focus-visible .lbl { color:var(--kpi-label); }
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-accent-journal { --kpi-text:#f0a264; --kpi-label:#e5b087; }
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-accent-subjects { --kpi-text:#91cf80; --kpi-label:#aed3a4; }
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-accent-medicine { --kpi-text:#a9bced; --kpi-label:#b9c5e1; }
html[data-theme="dark"] #tab-dashboard .kpi > .kpi-accent-emergency { --kpi-text:#ef9994; --kpi-label:#e7b1ad; }
@media (max-width:900px) {
  #tab-dashboard .kpi > .kpi-link .kpi-illustration {
    width:228px;
    height:204px;
  }
}

.journal-medication-section { position:relative; z-index:2; margin:18px 0 0; padding:16px 0 0; border:0; border-top:1px solid #ead9ca; border-radius:0; background:transparent; }
.journal-medication-section:focus-within { z-index:100; }
/* 하단 이력 카드가 호버로 별도 레이어가 되어도 열린 자동완성을 가리지 않습니다. */
#tab-journal .journal-form-card:focus-within,
#tab-journal .journal-form-card:has(.journal-medication-results:not(.hidden)) { z-index:1000; }
#tab-journal:has(.journal-medication-results:not(.hidden)) > .card:not(.journal-form-card) { z-index:0; }
.journal-medication-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.journal-medication-heading > div:first-child { display:flex; flex-direction:column; gap:3px; }
.journal-medication-heading strong { color:#6f431f; font-size:14px; }
.journal-medication-heading span { color:#7d827e; font-size:12px; }
.journal-medication-list { display:grid; gap:8px; margin-top:12px; }
.journal-medication-empty { padding:12px; border:1px dashed #dfd6ce; border-radius:8px; color:#818782; background:#fff; text-align:center; font-size:12px; }
.journal-medication-row { position:relative; display:grid; grid-template-columns:90px minmax(260px,1fr) 150px 70px auto; align-items:end; gap:10px; padding:11px; border:1px solid #e2e7e3; border-radius:9px; background:#fff; }
.journal-medication-row:focus-within { z-index:50; }
.journal-medication-row.inventory { grid-template-columns:90px minmax(280px,.9fr) minmax(210px,.55fr) 105px 120px auto; }
.journal-medication-row.manual { grid-template-columns:90px minmax(240px,1fr) 150px 130px auto; }
.journal-medication-row label { display:flex; flex-direction:column; gap:4px; margin:0; }
.journal-medication-row label > span { color:#6c756f; font-size:11px; }
.journal-medication-row input, .journal-medication-row select { width:100%; min-width:0; margin:0; }
.journal-medication-source { align-self:center; display:inline-flex; justify-content:center; padding:5px 8px; border-radius:999px; color:#9b5019; background:#fff0e3; font-size:11px; font-weight:700; }
.journal-medication-row.manual .journal-medication-source { color:#526159; background:#eef3ef; }
.journal-medication-unit-field { display:flex; min-width:0; flex-direction:column; gap:4px; }
.journal-medication-unit-field > span { color:#6c756f; font-size:11px; }
.journal-medication-unit { display:flex; align-items:center; width:100%; height:43px; box-sizing:border-box; padding:10px 12px; border:1px solid #d5ded7; border-radius:6px; color:#536159; background:#f7f9f7; font-weight:700; }
.journal-medication-stock-field { display:flex; min-width:0; flex-direction:column; gap:4px; }
.journal-medication-stock-field > span { color:#6c756f; font-size:11px; }
.journal-medication-stock-field > div { display:flex; min-height:43px; box-sizing:border-box; align-content:center; flex-direction:column; gap:2px; padding:6px 10px; border:1px solid #d7e2d5; border-radius:6px; color:#3f7c37; background:#f3f9f1; font-size:11px; font-weight:800; }
.journal-medication-stock-field strong { color:#3f7c37; font-size:11px; line-height:1.35; white-space:normal; }
.journal-medication-stock-field strong i { padding:0 3px; color:#8a968e; font-style:normal; }
.journal-medication-stock-field em { color:#748078; font-size:9px; font-style:normal; font-weight:650; }
.medicine-dispense-guide { display:block; margin-top:5px; color:#6f7b73; font-size:10px; line-height:1.45; }
.journal-medication-selected-detail { overflow:hidden; color:#59665e; font-size:9px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.journal-medication-stock-empty { display:flex; min-height:29px; align-items:center; color:#748078; font-size:10px; font-weight:650; }
.journal-medication-name-field { position:relative; }
.journal-medication-results { position:absolute; z-index:200; top:calc(100% + 5px); right:0; left:0; overflow-x:hidden; overflow-y:auto; max-height:560px; overscroll-behavior:contain; scrollbar-gutter:stable; border:1px solid #cfd9d1; border-radius:8px; background:#fff; box-shadow:0 12px 30px rgba(32, 55, 40, .2); }
.journal-medication-results.hidden { display:none; }
.journal-medication-results button { display:flex; width:100%; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border:0; border-bottom:1px solid #edf1ee; color:#26352b; background:#fff; text-align:left; cursor:pointer; }
.journal-medication-results button:last-child { border-bottom:0; }
.journal-medication-results button:hover, .journal-medication-results button:focus, .journal-medication-results button.is-keyboard-active { background:#f2f8ef; }
.journal-medication-results button:disabled { cursor:not-allowed; opacity:.64; }
.journal-medication-result-main { display:flex; min-width:0; flex:1 1 auto; flex-direction:column; gap:2px; }
.journal-medication-results button strong { overflow:hidden; color:#26352b; text-overflow:ellipsis; white-space:nowrap; }
.journal-medication-results button small { overflow:hidden; color:#7a847e; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.journal-medication-result-stock { flex:0 0 auto; padding:4px 7px; border-radius:6px; color:#447b3d; background:#edf7ea; font-size:11px; font-weight:750; white-space:nowrap; }
.journal-medication-result-stock.is-empty { color:#8a5c58; background:#f8eceb; }
.journal-medication-no-result { padding:11px 12px; color:#707a73; background:#fafbfa; font-size:12px; line-height:1.5; }
.journal-record-medications { display:flex; align-items:center; flex-wrap:wrap; gap:7px; padding:10px 14px; border-top:1px solid #edf0ed; background:#fffaf5; }
.journal-record-medications strong { margin-right:3px; color:#6f431f; font-size:12px; }
.journal-record-medications span { display:inline-flex; align-items:center; gap:5px; padding:4px 7px; border:1px solid #ead8c8; border-radius:7px; background:#fff; font-size:12px; }
.journal-record-medications em { color:#78817b; font-size:10px; font-style:normal; }
@media (max-width:900px) {
  .journal-medication-heading { align-items:flex-start; flex-direction:column; }
  .journal-medication-row, .journal-medication-row.inventory, .journal-medication-row.manual { grid-template-columns:1fr 1fr; }
  .journal-medication-source { justify-self:start; }
}

/* 모든 목록에서 사용하는 숫자형 페이지 이동 */
.app-pagination {
  display:flex;
  width:100%;
  max-width:100%;
  align-items:center;
  justify-content:center;
  gap:2px;
  overflow-x:auto;
  box-sizing:border-box;
  padding:3px 0;
  scrollbar-width:thin;
  white-space:nowrap;
}
.app-pagination-button {
  display:inline-grid;
  width:34px;
  height:34px;
  min-width:34px;
  min-height:34px;
  flex:0 0 34px;
  place-items:center;
  box-sizing:border-box;
  margin:0;
  padding:0;
  border:1px solid transparent;
  border-radius:5px;
  color:#758079;
  background:transparent;
  font:inherit;
  font-size:13px;
  font-weight:650;
  line-height:1;
  cursor:pointer;
}
.app-pagination-button:hover:not(:disabled) {
  border-color:#f2c49d;
  color:#b85f19;
  background:#fff4e9;
}
.app-pagination-button.is-active {
  border-color:#db6d10;
  color:#fff;
  background:#ed7d1d;
  box-shadow:0 4px 10px rgba(237,125,29,.18);
}
.app-pagination-button:disabled {
  color:#aeb7b1;
  background:transparent;
  cursor:default;
  opacity:.55;
}
.app-pagination-button i {
  font-size:14px;
  line-height:1;
  -webkit-text-stroke:.35px currentColor;
  text-shadow:0 0 currentColor;
}
html[data-theme="dark"] .app-pagination-button { color:#c7d1cb; }
html[data-theme="dark"] .app-pagination-button:hover:not(:disabled) { border-color:#b87542; color:#ffd8b5; background:#554235; }
html[data-theme="dark"] .app-pagination-button.is-active { border-color:#f09a50; color:#fff; background:#d96e16; box-shadow:0 4px 10px rgba(0,0,0,.16); }
html[data-theme="dark"] .app-pagination-button:disabled { color:#77857d; }
@media (max-width:700px) {
  .app-pagination { justify-content:flex-start; gap:1px; }
  .app-pagination-button { width:32px; height:32px; min-width:32px; min-height:32px; flex-basis:32px; }
}

/* 헤더 바로가기와 설정 도구 */
.header-utility-bar {
  display:flex;
  width:100%;
  max-width:100%;
  align-items:center;
  justify-content:flex-end;
  justify-self:end;
  gap:10px;
  box-sizing:border-box;
  margin:0;
  padding-right:60px;
}
.header-utility-bar .header-weather {
  flex:1 1 340px;
  width:340px;
  min-width:320px;
  max-width:340px;
}
.header-utility-bar .web-storage-actions {
  display:flex;
  flex:0 0 auto;
  align-items:center;
  flex-wrap:nowrap;
  gap:7px;
}
.header-utility-bar .storage-button {
  display:inline-flex;
  height:34px;
  min-height:34px;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  padding:0 11px;
  text-decoration:none;
  font-size:13.2px;
  font-weight:700;
  line-height:1;
}
.orangefarm-header-link {
  gap:8px;
  min-width:142px;
  border-color:#d8dfda;
  color:#4f5d55;
  background:#fff;
}
.orangefarm-header-link img {
  display:block;
  width:82px;
  height:22px;
  object-fit:contain;
}
.orangefarm-header-link span {
  padding-left:8px;
  border-left:1px solid #e5e9e6;
  color:#65716a;
  font-size:13.2px;
  font-weight:700;
  letter-spacing:-.1px;
  line-height:1;
  white-space:nowrap;
}
#reset-license-button {
  height:34px;
  min-height:34px;
  padding:0 11px;
  gap:5px;
  font-size:13.2px;
}
#reset-license-button .bi { font-size:14px; }
#reset-license-button:disabled .bi { animation:settings-status-spin .8s linear infinite; }
.header-utility-bar .header-weather-item {
  font-size:13.2px;
  font-weight:700;
}
.header-utility-bar .header-weather-slide .bi,
.header-utility-bar .settings-launch-button .bi {
  font-size:14px;
}
html[data-theme="dark"] .orangefarm-header-link {
  border-color:#748078;
  background:#fff;
}
@media (max-width:1250px) {
  .app-header {
    grid-template-columns:1fr;
    grid-template-areas:"brand" "storage";
    min-height:auto;
  }
  .header-main-brand { justify-content:center; padding-left:0; }
  .header-utility-bar { width:min(760px, 100%); justify-self:center; padding-right:0; }
}
@media (max-width:760px) {
  .header-utility-bar { align-items:stretch; flex-direction:column; }
  .header-utility-bar .header-weather { flex:0 0 auto; width:100%; min-width:0; max-width:none; }
  .header-utility-bar .web-storage-actions { justify-content:center; flex-wrap:wrap; }
}

/* 인증 화면과 맞춘 공통 프레임 색상 */
.app-footer {
  border-top-color:#dce6d7;
  color:#64705f;
  background:linear-gradient(110deg,#fcfdfb,#f7faf4 52%,#f0f5ec);
  box-shadow:none;
}
.footer-release {
  border-color:#e5e3df;
  color:#67716c;
  background:rgba(255,255,255,.76);
}
.footer-release strong,
.footer-text strong {
  color:#34523c;
}
.footer-release-dot {
  background:#359d26;
}
.footer-company-link:focus-visible {
  outline-color:#ed7d1d;
}
html[data-theme="dark"] .app-footer {
  border-color:#61736b;
  color:#f3f7f4;
  background:linear-gradient(110deg,#31413c,#35443f 55%,#493c33);
}

/* AI 문장 정리 */
.field-label-actions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:7px;
}
.field-label-actions label { margin:0; }
.ai-polish-button { flex:0 0 auto; }
.ai-polish-actions { display:inline-flex; align-items:center; gap:7px; }
.ai-polish-help { width:24px; height:24px; color:#c86b25; }
.ai-polish-help > i { font-size:15px; }
.ai-polish-help > span { right:0; left:auto; transform:translateY(4px); }
.ai-polish-help:hover > span,
.ai-polish-help:focus > span,
.ai-polish-help:focus-visible > span { transform:translateY(0); }
.settings-api-notice {
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin-top:12px;
  padding:10px 12px;
  border-radius:10px;
  font-size:12px;
  line-height:1.55;
}
.settings-api-notice .bi { flex:0 0 auto; margin-top:2px; }
.settings-api-notice-weather { border:1px solid #cfe2cd; color:#426b3f; background:#f4faf2; }
.settings-api-notice-weather .bi { color:#4c9744; }
.settings-api-notice-ai { border:1px solid #f0cfaa; color:#87551f; background:#fff8ef; }
.settings-api-notice-ai .bi { color:#dc761d; }
.settings-api-common-notice {
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin:2px 2px 0;
  padding:10px 12px;
  border:1px solid #d9e3dc;
  border-radius:10px;
  color:#62736a;
  background:#f7faf8;
  font-size:11px;
  line-height:1.55;
}
.settings-api-common-notice .bi { flex:0 0 auto; margin-top:2px; color:#4c9744; }
.ai-preview-dialog {
  width:min(860px, calc(100vw - 36px));
  max-width:none;
  padding:0;
  border:0;
  border-radius:18px;
  color:#1d332c;
  background:#fff;
  box-shadow:0 24px 70px rgba(24,39,34,.24);
}
.ai-preview-dialog::backdrop { background:rgba(26,39,35,.42); }
.ai-preview-panel { padding:0; }
.ai-preview-header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  padding:22px 24px 17px;
  border-bottom:1px solid #e8ece9;
  background:linear-gradient(110deg,#fff,#fffaf5);
}
.ai-preview-header h2 { margin:7px 0 0; font-size:21px; }
.ai-preview-close {
  width:36px;
  height:36px;
  border:1px solid #d9dfdb;
  border-radius:10px;
  color:#55625d;
  background:#fff;
}
.ai-preview-guide { margin:16px 24px 0; color:#67736e; font-size:13px; }
.ai-preview-compare {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  padding:16px 24px;
}
.ai-preview-compare label { display:grid; gap:7px; font-weight:700; }
.ai-preview-compare textarea {
  min-height:210px;
  resize:vertical;
  line-height:1.65;
  font-weight:400;
}
.ai-preview-compare label:first-child textarea { color:#69736f; background:#f6f8f7; }
.ai-preview-redacted {
  display:flex;
  gap:7px;
  margin:0 24px 16px;
  color:#4e713f;
  font-size:12px;
}
.ai-preview-redacted[hidden] { display:none; }
.ai-preview-actions {
  display:flex;
  justify-content:flex-end;
  gap:8px;
  padding:15px 24px 20px;
  border-top:1px solid #edf0ee;
}
.ai-spin { animation:settings-status-spin .8s linear infinite; }
html[data-theme="dark"] .settings-api-notice-ai {
  border-color:#715b42;
  color:#f2cfaa;
  background:#40372e;
}
html[data-theme="dark"] .settings-api-notice-weather {
  border-color:#587457;
  color:#cfe8ca;
  background:#324336;
}
html[data-theme="dark"] .settings-api-common-notice {
  border-color:#5c7065;
  color:#d6e0db;
  background:#35433b;
}
html[data-theme="dark"] .ai-preview-dialog { color:#f3f7f4; background:#34433e; }
html[data-theme="dark"] .ai-preview-header {
  border-color:#5e6e68;
  background:linear-gradient(110deg,#34433e,#403a34);
}
html[data-theme="dark"] .ai-preview-close { border-color:#718079; color:#f4f7f5; background:#40504a; }
html[data-theme="dark"] .ai-preview-guide { color:#cbd4d0; }
html[data-theme="dark"] .ai-preview-compare label:first-child textarea { color:#d2dad6; background:#2e3b37; }
html[data-theme="dark"] .ai-preview-actions { border-color:#5e6e68; }
@media (max-width:720px) {
  .ai-preview-compare { grid-template-columns:1fr; }
  .ai-preview-compare textarea { min-height:140px; }
}

/* Conversational AI assistant */
.ai-chat-launcher { position:fixed; z-index:2760; right:28px; bottom:72px; display:inline-flex; width:184px; min-width:48px; min-height:48px; align-items:center; justify-content:center; gap:9px; padding:0 17px 0 15px; overflow:hidden; border:1px solid #ead9c9; border-radius:24px; color:#34463d; background:rgba(255,253,250,.97); box-shadow:0 8px 24px rgba(63,54,45,.14); font:inherit; font-size:14px; font-weight:800; cursor:pointer; transition:width .2s ease,padding .2s ease,gap .2s ease,opacity .16s ease,transform .16s ease,box-shadow .16s ease,border-color .16s ease,background .16s ease; }
.ai-chat-launcher:not(.is-header-docked) { scale:1.2; transform-origin:right bottom; }
.ai-chat-launcher:hover { border-color:#e1b185; background:#fffaf5; box-shadow:0 11px 28px rgba(63,54,45,.18); transform:translateY(-2px); }
.ai-chat-launcher:focus-visible,.ai-chat-panel button:focus-visible,.ai-chat-panel textarea:focus-visible { outline:3px solid rgba(221,118,37,.24); outline-offset:2px; }
.ai-chat-launcher-sparkle { flex:0 0 auto; color:#d96e1f; font-size:16px; }
.ai-chat-launcher-logo { display:grid; max-width:78px; place-items:center; height:25px; padding-right:9px; overflow:hidden; border-right:1px solid #eadfd5; opacity:1; transition:max-width .18s ease,padding .18s ease,border-color .18s ease,opacity .12s ease; }
.ai-chat-launcher-logo img { display:block; width:auto; height:18px; object-fit:contain; }
.ai-chat-launcher-label { max-width:72px; overflow:hidden; opacity:1; white-space:nowrap; transition:max-width .18s ease,opacity .12s ease; }
.ai-chat-launcher.is-scroll-compact:not(:hover):not(:focus-visible) { width:48px; padding-right:0; padding-left:0; gap:0; }
.ai-chat-launcher.is-scroll-compact:not(:hover):not(:focus-visible) .ai-chat-launcher-logo { max-width:0; padding-right:0; border-color:transparent; opacity:0; }
.ai-chat-launcher.is-scroll-compact:not(:hover):not(:focus-visible) .ai-chat-launcher-label { max-width:0; opacity:0; }
.ai-chat-launcher.is-panel-open { opacity:0; pointer-events:none; transform:translateY(7px) scale(.92); }
.ai-chat-panel { position:fixed; z-index:2770; right:28px; bottom:130px; display:flex; flex-direction:column; width:min(440px,calc(100vw - 32px)); height:min(650px,calc(100vh - 152px)); overflow:hidden; border:1px solid #e5d9cc; border-radius:18px; color:#24372f; background:#fff; box-shadow:0 22px 54px rgba(37,49,43,.23); opacity:0; pointer-events:none; transform:translateY(14px) scale(.98); transform-origin:right bottom; transition:opacity .18s ease,transform .18s ease; }
.ai-chat-panel.is-open { opacity:1; pointer-events:auto; transform:translateY(0) scale(1); }
.ai-chat-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 17px; border-bottom:1px solid #eee2d6; background:linear-gradient(110deg,#fff9f2 0%,#f5faf3 100%); }
.ai-chat-title { display:flex; align-items:center; gap:11px; min-width:0; }
.ai-chat-title-icon { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; border:1px solid #efc69f; border-radius:12px; color:#d96e1f; background:#fff3e7; }
.ai-chat-title>div { display:grid; gap:2px; min-width:0; }
.ai-chat-title strong { display:flex; align-items:center; gap:8px; color:#1d382d; font-size:16px; }
.ai-chat-title strong > span:not(.ai-chat-model-badge) { white-space:nowrap; }
.ai-chat-title-logo { display:block; width:auto; height:22px; object-fit:contain; }
.ai-chat-model-badge { display:inline-flex; align-items:center; min-height:20px; padding:2px 7px; border:1px solid #d8e4d3; border-radius:999px; color:#55734c; background:#f2f8ef; font-size:9px; font-weight:800; line-height:1; letter-spacing:.01em; white-space:nowrap; }
.ai-chat-title small { color:#758078; font-size:11px; font-weight:600; }
.ai-chat-header-actions { display:flex; gap:5px; }
.ai-chat-header-actions button { display:grid; place-items:center; width:34px; height:34px; padding:0; border:1px solid #dce3de; border-radius:9px; color:#5b6c63; background:#fff; cursor:pointer; }
.ai-chat-header-actions button:hover { color:#ce671b; border-color:#e7bc98; background:#fff8f1; }
.ai-chat-notice { display:flex; align-items:flex-start; gap:8px; margin:12px 14px 0; padding:9px 11px; border:1px solid #dde9d8; border-radius:10px; color:#607067; background:#f5faf2; font-size:11px; line-height:1.5; }
.ai-chat-notice i { flex:0 0 auto; margin-top:1px; color:#4d963d; }
.ai-chat-quick { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; flex:0 0 auto; padding:10px 14px; }
.ai-chat-quick button { min-width:0; min-height:34px; padding:6px 8px; overflow:hidden; border:1px solid #e2d7ca; border-radius:10px; color:#5d625e; background:#fffaf5; font:inherit; font-size:11px; font-weight:700; line-height:1.3; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.ai-chat-quick button:hover { border-color:#dfad82; color:#b95b18; background:#fff4e9; }
.ai-chat-messages { flex:1 1 auto; min-height:0; padding:14px; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; background:#f8faf8; }
.ai-chat-welcome { display:grid; justify-items:center; gap:6px; margin:38px 12px; color:#78847d; text-align:center; }
.ai-chat-welcome i { margin-bottom:3px; color:#d9782a; font-size:24px; }
.ai-chat-welcome strong { color:#415248; font-size:15px; }
.ai-chat-welcome span { font-size:12px; }
.ai-chat-message { display:flex; flex-direction:column; align-items:flex-start; margin:0 0 14px; }
.ai-chat-message.is-user { align-items:flex-end; }
.ai-chat-message-label { margin:0 6px 4px; color:#7a857f; font-size:10px; font-weight:800; }
.ai-chat-message-body { max-width:86%; padding:10px 12px; border:1px solid #dce5df; border-radius:5px 14px 14px 14px; color:#293b32; background:#fff; box-shadow:0 2px 7px rgba(43,58,50,.05); font-size:13px; line-height:1.62; white-space:pre-wrap; word-break:break-word; }
.ai-chat-message.is-user .ai-chat-message-body { border-color:#edc7a5; border-radius:14px 5px 14px 14px; color:#56341d; background:#fff2e5; }
.ai-chat-redacted { margin:5px 6px 0; color:#8b7566; font-size:10px; }
.ai-chat-message-tools { display:flex; gap:8px; margin:5px 4px 0; }
.ai-chat-message-tools button { padding:5px 9px; border:1px solid #cbd5cf; border-radius:7px; color:#42564a; background:#fff; font:inherit; font-size:11px; line-height:1.4; cursor:pointer; }
.ai-chat-message-tools button:hover { border-color:#ca814d; color:#9a4e17; background:#fff6ee; }
.ai-chat-message.is-pending .ai-chat-message-body { color:#596960; background:#f2f5f3; }
.ai-chat-message-body strong { font-weight:800; color:inherit; }
html[data-theme="dark"] .ai-chat-message-tools button { border-color:#59635d; color:#e3e8e5; background:#2b302e; }
html[data-theme="dark"] .ai-chat-message-tools button:hover { border-color:#b67e54; color:#ffdfc2; background:#3b3028; }
html[data-theme="dark"] .ai-chat-message.is-pending .ai-chat-message-body { color:#bdc8c1; background:#252b27; }
.ai-chat-composer { display:grid; gap:5px; padding:11px 14px 10px; border-top:1px solid #e3e8e4; background:#fff; }
.ai-chat-composer-shell { display:grid; grid-template-columns:28px minmax(0,1fr) 38px; align-items:center; gap:6px; min-height:54px; padding:4px 5px 4px 8px; border:1px solid #dfd8d0; border-radius:20px; background:#fff; box-shadow:0 5px 16px rgba(57,68,61,.08); transition:border-color .16s ease,box-shadow .16s ease; }
.ai-chat-composer-shell:focus-within { border-color:#dc8a4c; box-shadow:0 0 0 3px rgba(221,118,37,.12),0 7px 18px rgba(57,68,61,.09); }
.ai-chat-composer-mark { display:grid; place-items:center; width:28px; height:28px; border-radius:9px; color:#d97224; background:#fff1e4; font-size:14px; }
.ai-chat-composer textarea { box-sizing:border-box; width:100%; height:44px; min-height:44px; max-height:104px; padding:11px 4px 8px; resize:none; overflow-y:auto; border:0; outline:0; color:#273a31; background:transparent; font:inherit; font-size:13px; line-height:1.45; box-shadow:none; }
.ai-chat-composer textarea:focus { border:0; outline:0; box-shadow:none; }
.ai-chat-composer textarea::placeholder { color:#9aa49e; }
.ai-chat-composer button { box-sizing:border-box; display:flex; align-items:center; justify-content:center; width:38px; height:38px; min-width:38px; min-height:38px; margin:0; padding:0; border:1px solid #d96f1e; border-radius:50%; color:#fff; background:#dd7625; box-shadow:0 3px 8px rgba(194,92,18,.2); line-height:0; cursor:pointer; transition:transform .15s ease,background-color .15s ease,box-shadow .15s ease; }
.ai-chat-composer button:hover { background:#cf681b; box-shadow:0 5px 12px rgba(194,92,18,.25); transform:translateY(-1px); }
.ai-chat-composer button:active { transform:translateY(0); }
.ai-chat-send-arrow { position:static; display:block; flex:0 0 20px; width:20px; height:20px; margin:0; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; transform:none; }
.ai-chat-composer button i.bi-arrow-repeat { transform:none; }
.ai-chat-composer button:disabled { opacity:.58; cursor:wait; transform:none; }
.ai-chat-composer-hint { padding-right:8px; color:#9aa29d; font-size:9px; text-align:right; }
html[data-theme="dark"] .ai-chat-panel { border-color:#65766f; color:#f1f5f3; background:#33433d; box-shadow:0 24px 58px rgba(0,0,0,.38); }
html[data-theme="dark"] .ai-chat-header { border-color:#62736c; background:linear-gradient(110deg,#3b4b45,#34443e); }
html[data-theme="dark"] .ai-chat-title strong { color:#f5f8f6; }
html[data-theme="dark"] .ai-chat-title small { color:#c5d0cb; }
html[data-theme="dark"] .ai-chat-model-badge { border-color:#697e68; color:#dcebd7; background:#40533f; }
html[data-theme="dark"] .ai-chat-title-icon { border-color:#8a694e; color:#f0a566; background:#4a4037; }
html[data-theme="dark"] .ai-chat-header-actions button { border-color:#708079; color:#e9efec; background:#40514a; }
html[data-theme="dark"] .ai-chat-notice { border-color:#63765f; color:#d1dbd5; background:#354b3c; }
html[data-theme="dark"] .ai-chat-quick button { border-color:#756b5f; color:#eee5dc; background:#493f36; }
html[data-theme="dark"] .ai-chat-messages { background:#2b3934; }
html[data-theme="dark"] .ai-chat-welcome { color:#b9c5bf; }
html[data-theme="dark"] .ai-chat-welcome strong { color:#edf3ef; }
html[data-theme="dark"] .ai-chat-message-label { color:#bdc8c2; }
html[data-theme="dark"] .ai-chat-message-body { border-color:#61736b; color:#eff4f1; background:#3c4c46; box-shadow:none; }
html[data-theme="dark"] .ai-chat-message.is-user .ai-chat-message-body { border-color:#987054; color:#fff0e3; background:#554335; }
html[data-theme="dark"] .ai-chat-redacted { color:#d2c0b1; }
html[data-theme="dark"] .ai-chat-composer { border-color:#63736c; background:#34433e; }
html[data-theme="dark"] .ai-chat-composer-shell { border-color:#697a72; background:#293833; box-shadow:0 5px 16px rgba(0,0,0,.18); }
html[data-theme="dark"] .ai-chat-composer-shell:focus-within { border-color:#dc8a4c; box-shadow:0 0 0 3px rgba(221,118,37,.16),0 7px 18px rgba(0,0,0,.2); }
html[data-theme="dark"] .ai-chat-composer-mark { color:#f0a064; background:#4d4035; }
html[data-theme="dark"] .ai-chat-composer textarea { color:#f1f5f3; background:transparent; }
html[data-theme="dark"] .ai-chat-composer textarea::placeholder { color:#aab5af; }
html[data-theme="dark"] .ai-chat-composer-hint { color:#aeb9b3; }
@media (max-width:640px) {
  .ai-chat-launcher { right:14px; bottom:68px; }
  .ai-chat-launcher.is-header-docked {
    position:static; z-index:auto; flex:0 0 auto; width:auto; min-width:0;
    min-height:40px; padding:0 12px; gap:7px; border-radius:10px;
    font-size:12px; box-shadow:none; transform:none;
    transition:border-color .16s ease,background .16s ease;
  }
  .ai-chat-launcher.is-header-docked .ai-chat-launcher-logo { display:none; }
  .ai-chat-launcher.is-header-docked .ai-chat-launcher-label { max-width:none; opacity:1; }
  .ai-chat-panel { right:8px; bottom:12px; width:calc(100vw - 16px); height:min(680px,calc(100vh - 24px)); height:min(680px,calc(100dvh - 24px)); border-radius:15px; }
  .ai-chat-title small { display:none; }
  .ai-chat-title strong { flex-wrap:wrap; gap:5px 7px; }
  .ai-chat-composer-shell { grid-template-columns:26px minmax(0,1fr) 38px; }
}

/* 중성 차콜 다크 모드
   녹색이 넓은 면적을 차지해 칠판처럼 보이지 않도록 하고,
   기능별 주황·초록·빨강·회색·남색은 강조색으로만 유지합니다. */
html[data-theme="dark"] {
  --dark-canvas:#171a19;
  --dark-main:#1b1f1d;
  --dark-chrome:#202422;
  --dark-surface:#252a28;
  --dark-surface-raised:#2b302e;
  --dark-surface-soft:#202422;
  --dark-border:#414844;
  --dark-border-strong:#555e59;
  --dark-text:#f1f3f2;
  --dark-muted:#bbc2be;
  --dark-subtle:#969f9a;
  --text:var(--dark-text);
  --of-text:var(--dark-text);
  --border:var(--dark-border);
  --input-border:var(--dark-border-strong);
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  color:var(--dark-text);
  background:var(--dark-canvas) !important;
}

html[data-theme="dark"] main { background:var(--dark-main); }
html[data-theme="dark"] body::before { opacity:.012; }

html[data-theme="dark"] .demo-notice,
html[data-theme="dark"] .app-header,
html[data-theme="dark"] nav,
html[data-theme="dark"] .app-footer {
  border-color:var(--dark-border);
  color:var(--dark-text);
  background:var(--dark-chrome);
  box-shadow:none;
}
html[data-theme="dark"] nav { background:var(--dark-chrome) !important; }

html[data-theme="dark"] .app-footer {
  background:linear-gradient(110deg,#202622,#222b25 58%,#273328);
}

html[data-theme="dark"] nav button {
  border-color:var(--dark-border);
  color:#e9ecea;
  background:var(--dark-chrome);
}

html[data-theme="dark"] nav button:hover { background:#2a2f2c; }
html[data-theme="dark"] nav button.active { color:#fff; background:#3f8f35; }
html[data-theme="dark"] .nav-container,
html[data-theme="dark"] .nav-inner { background:var(--dark-chrome) !important; }

html[data-theme="dark"] .storage-button,
html[data-theme="dark"] .settings-launch-button {
  border-color:#505854;
  color:#eef1ef;
  background:#303532;
}

html[data-theme="dark"] .storage-button:hover,
html[data-theme="dark"] .settings-launch-button:hover { background:#393f3b; }

html[data-theme="dark"] .card,
html[data-theme="dark"] #tab-dashboard .card,
html[data-theme="dark"] #tab-dashboard .kpi > div,
html[data-theme="dark"] .subject-detail-card,
html[data-theme="dark"] .journal-record-card {
  border-color:var(--dark-border);
  background:var(--dark-surface);
  box-shadow:0 8px 22px rgba(0,0,0,.15);
}

html[data-theme="dark"] .dashboard-hero {
  border-color:#705541;
  color:#f6f7f6;
  background:linear-gradient(120deg,#2b302e,#292d2b 62%,#342a25);
  box-shadow:none;
}

html[data-theme="dark"] .dashboard-hero-overview,
html[data-theme="dark"] .dashboard-hero-tip,
html[data-theme="dark"] .dashboard-hero-ai-slide {
  background:linear-gradient(108deg,#2b302e,#292d2b 62%,#332a25);
}

html[data-theme="dark"] .dashboard-weather-briefing {
  background:linear-gradient(120deg,#2b302e,#272c2a 54%,#342a25);
}

html[data-theme="dark"] .dashboard-ai-preview,
html[data-theme="dark"] .dashboard-weather-timeline {
  border-color:#4c514e;
  background:rgba(31,35,33,.82);
}

html[data-theme="dark"] .dashboard-ai-preview-question,
html[data-theme="dark"] .weather-briefing-time {
  border-color:#4b514d;
  color:#d8dcda;
  background:#303532;
}

html[data-theme="dark"] .dashboard-ai-preview-question i { background:#252927; }
html[data-theme="dark"] .dashboard-ai-preview-answer {
  color:#e5e9e6;
  background:linear-gradient(100deg,#3b2e27,#29302c);
  box-shadow:inset 0 0 0 1px #51483f;
}

html[data-theme="dark"] .dashboard-weather-label-icon {
  border-color:#4c5651;
  color:#d7dfdb;
  background:linear-gradient(145deg,#343a37,#272c2a);
}

html[data-theme="dark"] .dashboard-analog-clock {
  border-color:#505854;
  background:radial-gradient(circle at 38% 31%,#414643,#303532 68%,#252927);
  box-shadow:0 8px 18px rgba(0,0,0,.2),inset 0 0 0 4px rgba(78,84,81,.55);
}

html[data-theme="dark"] .dashboard-hero p,
html[data-theme="dark"] .dashboard-meta-line,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .dashboard-live-date,
html[data-theme="dark"] .weather-risk-time,
html[data-theme="dark"] .weather-risk-point small { color:var(--dark-muted); }

html[data-theme="dark"] #tab-dashboard .kpi .num,
html[data-theme="dark"] #tab-dashboard .card h2,
html[data-theme="dark"] .card h2,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 { color:var(--dark-text); }

html[data-theme="dark"] label { color:#d9dddb; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  border-color:var(--dark-border-strong);
  color:#f4f5f4;
  background:#202422;
  box-shadow:none;
}

html[data-theme="dark"] input:hover,
html[data-theme="dark"] select:hover,
html[data-theme="dark"] textarea:hover { border-color:#69726d; }

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  border-color:#d57a35;
  box-shadow:0 0 0 3px rgba(213,122,53,.14);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color:#8f9893; }

html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td { border-color:#383e3b; }
html[data-theme="dark"] table { background:#252a28; }
html[data-theme="dark"] th { color:#eef1ef; background:#303532; }
html[data-theme="dark"] td { color:#e9ecea; background:#252a28; }
html[data-theme="dark"] tbody tr:hover td,
html[data-theme="dark"] tr:hover td,
html[data-theme="dark"] .emergency-table-wrap tbody tr:hover td { color:#f6f7f6; background:#303633; }

html[data-theme="dark"] details.section,
html[data-theme="dark"] .workspace-detail-fields,
html[data-theme="dark"] .settings-section {
  border-color:var(--dark-border);
  background:var(--dark-surface);
}

html[data-theme="dark"] details.section > summary,
html[data-theme="dark"] .workspace-detail-fields > summary {
  border-color:var(--dark-border);
  color:#eef1ef;
  background:var(--dark-surface-raised);
}

html[data-theme="dark"] .detail-form-layout { background:#202422; }
html[data-theme="dark"] .detail-form-group {
  border-color:var(--dark-border);
  background:#292e2b;
}
html[data-theme="dark"] .detail-form-group input,
html[data-theme="dark"] .detail-form-group select,
html[data-theme="dark"] .detail-form-group textarea {
  border-color:var(--dark-border-strong);
  color:#f1f3f2;
  background:#1f2321;
}
html[data-theme="dark"] .detail-risk-group .checkbox-group label {
  border-color:#484f4b;
  background:#232825;
}
html[data-theme="dark"] .checkbox-group label {
  border-color:#484f4b;
  color:#e1e5e2;
  background:#252a28;
}
html[data-theme="dark"] #risk-checkboxes label,
html[data-theme="dark"] #s-risk-checkboxes label,
html[data-theme="dark"] #j-risk-checkboxes label {
  border-color:#484f4b;
  color:#e1e5e2;
  background:#252a28;
}

/* 화면별 의미색은 면 전체가 아니라 얇은 테두리와 약한 색조로 구분합니다. */
html[data-theme="dark"] .journal-primary-fields {
  border-color:#77543c;
  background:#302924;
}
html[data-theme="dark"] .journal-subject-finder {
  border-color:#53684f;
  background:#272d28;
}
html[data-theme="dark"] .subject-primary-fields {
  border-color:#53684f;
  background:#272d28;
}
html[data-theme="dark"] .emergency-primary-fields {
  border-color:#76504d;
  background:#302727;
}
html[data-theme="dark"] .infection-primary-fields {
  border-color:#565d60;
  background:#292c2d;
}
html[data-theme="dark"] .medicine-primary-fields {
  border-color:#505b79;
  background:#282b34;
}

html[data-theme="dark"] .settings-dialog {
  border-color:#454c48;
  color:var(--dark-text);
  background:#202422;
  box-shadow:-18px 0 48px rgba(0,0,0,.34);
}
html[data-theme="dark"] .settings-dialog::backdrop { background:rgba(7,9,8,.34); }
html[data-theme="dark"] .settings-dialog-header {
  border-color:#454c48;
  background:linear-gradient(135deg,#292e2b,#272b29 62%,#332a25);
}
html[data-theme="dark"] .settings-dialog-body,
html[data-theme="dark"] .settings-dialog-footer {
  border-color:#414844;
  background:#1c201e;
}
html[data-theme="dark"] .settings-section {
  border-color:#505954;
  background:#272c29;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
}
html[data-theme="dark"] .settings-section:hover {
  border-color:#66716b;
  background:#2a2f2c;
  box-shadow:0 4px 13px rgba(0,0,0,.24);
}
html[data-theme="dark"] .settings-collapsible-section[open] {
  border-color:#748079;
  background:#2b302d;
  box-shadow:0 7px 17px rgba(0,0,0,.28);
}
html[data-theme="dark"] .settings-collapsible-section[open] > .settings-section-summary {
  border-color:#464e49;
}
html[data-theme="dark"] .settings-section-heading strong,
html[data-theme="dark"] .settings-license-copy strong,
html[data-theme="dark"] .settings-option-heading strong { color:#edf0ee; }
html[data-theme="dark"] .settings-section-heading span,
html[data-theme="dark"] .settings-license-copy span,
html[data-theme="dark"] .settings-option-heading span,
html[data-theme="dark"] .settings-field-help { color:var(--dark-muted); }
html[data-theme="dark"] .settings-license-current,
html[data-theme="dark"] .settings-api-subsection,
html[data-theme="dark"] .settings-weather-location,
html[data-theme="dark"] .settings-auto-backup {
  border-color:#464d49;
  color:#e9ecea;
  background:#222725;
}
html[data-theme="dark"] .settings-theme-options span {
  border-color:#515a55;
  color:#e9ecea;
  background:#202422;
}
html[data-theme="dark"] .settings-theme-options input:checked + span {
  border-color:#df8140;
  background:#352b25;
  box-shadow:inset 0 0 0 1px #df8140;
}
html[data-theme="dark"] .settings-suboption,
html[data-theme="dark"] .settings-auto-backup-location { border-color:#414844; }
html[data-theme="dark"] .settings-update-panel {
  border-color:#4b514e;
  background:linear-gradient(120deg,#282d2a,#302a26);
}
html[data-theme="dark"] .settings-update-result { border-color:#4b514e; background:#252a28; }
html[data-theme="dark"] .settings-region-status,
html[data-theme="dark"] .settings-security-note,
html[data-theme="dark"] .medicine-note,
html[data-theme="dark"] .settings-api-common-notice {
  border-color:#484f4b;
  color:#d1d6d3;
  background:#242927;
}

/* 홈 달력·메모는 라이트 전용 흰 배경이 남지 않도록 별도로 정리합니다. */
html[data-theme="dark"] #tab-dashboard .dashboard-planner-pane + .dashboard-planner-pane { border-color:#3f4542; }
html[data-theme="dark"] #tab-dashboard .dashboard-planner-pane-title { color:#e4e8e5; }
html[data-theme="dark"] .memo-calendar-panel {
  border-color:#414844;
  background:#212523;
}
html[data-theme="dark"] .memo-calendar-heading strong { color:#edf0ee; }
html[data-theme="dark"] .memo-calendar-nav {
  border-color:#4b534f;
  color:#dce1de;
  background:#292e2b;
}
html[data-theme="dark"] .memo-calendar-nav:hover { border-color:#6d766f; color:#fff; background:#343a36; }
html[data-theme="dark"] .memo-calendar-weekdays {
  border-color:#3d4340;
  background:#272c29;
}
html[data-theme="dark"] .memo-calendar-weekdays span { color:#aeb6b1; }
html[data-theme="dark"] .memo-calendar-weekdays span:first-child,
html[data-theme="dark"] .memo-calendar-day.is-sunday > .memo-calendar-day-number,
html[data-theme="dark"] .memo-calendar-day.is-holiday > .memo-calendar-day-number,
html[data-theme="dark"] .memo-calendar-holiday-name { color:#ffaaa2; }
html[data-theme="dark"] .memo-calendar-day.is-holiday { border-color:#61413d; background:#352b29; }
html[data-theme="dark"] .memo-calendar-day.is-holiday:hover { border-color:#85534c; background:#41312e; }
html[data-theme="dark"] .memo-calendar-day.is-holiday.is-selected { border-color:#6d9a63; background:#3b302c; }
html[data-theme="dark"] .memo-calendar-day.is-holiday.is-today { border-color:#dd823d; background:#3b302c; }
html[data-theme="dark"] .memo-calendar-day b { color:#c5dfbe; background:#344330; }
html[data-theme="dark"] .memo-calendar-holiday-status { color:#aeb6b1; }
html[data-theme="dark"] .memo-calendar-day {
  border-color:#353b38;
  color:#dfe3e1;
  background:#262b28;
}
html[data-theme="dark"] .memo-calendar-day:hover,
html[data-theme="dark"] .memo-calendar-day.has-memo { border-color:#58635d; background:#303632; }
html[data-theme="dark"] .memo-calendar-day.is-today {
  border-color:#dd823d;
  color:#ffd2ae;
  background:#362c26;
}
html[data-theme="dark"] .memo-calendar-day.is-selected {
  border-color:#6d9a63;
  color:#cde7c7;
  background:#293329;
}
html[data-theme="dark"] .memo-calendar-day.is-today.is-selected {
  border-color:#dd823d;
  background:#362c26;
}
html[data-theme="dark"] .memo-list {
  border-color:#3f4642;
  background:#202422;
}
html[data-theme="dark"] .memo-day {
  border-color:#3f4642;
  background:#272c29;
  box-shadow:none;
}
html[data-theme="dark"] .memo-day + .memo-day,
html[data-theme="dark"] .memo-day-header,
html[data-theme="dark"] .memo-item { border-color:#3d4440; }
html[data-theme="dark"] .memo-day-header { background:#2d322f; }
html[data-theme="dark"] .memo-day-header time,
html[data-theme="dark"] .memo-item-text { color:#e8ebe9; }
html[data-theme="dark"] .memo-item:hover { background:#303532; }
html[data-theme="dark"] .memo-day.is-today {
  border-color:#547f4d;
  background:#282f29;
  box-shadow:0 4px 14px rgba(0,0,0,.18);
}
html[data-theme="dark"] .memo-day.is-today .memo-day-header {
  border-left-color:#4d9a42;
  border-bottom-color:#4a5b4a;
  background:linear-gradient(90deg,#2c3a2d,#2b322d);
}
html[data-theme="dark"] .memo-day.is-today .memo-day-header time { color:#bfe0b8; }
html[data-theme="dark"] .memo-selected-date {
  border-color:#4b514e;
  color:#e5e9e6;
  background:#292e2b;
}
html[data-theme="dark"] .memo-input-row {
  border-color:#414844;
  background:#242927;
}

html[data-theme="dark"] .action-target-list { border-color:#414844; background:#202422; }
html[data-theme="dark"] .action-target { border-bottom-color:#3d4440; color:#e8ebe9; background:#282d2a; }
html[data-theme="dark"] .action-target.overdue { background:#382b2b; }
html[data-theme="dark"] .action-target.today { background:#373027; }
html[data-theme="dark"] .action-reason { border-color:#4a514d; color:#d9dddb; background:#303532; }
html[data-theme="dark"] .schedule { border-color:#444b47; color:#e8ebe9; }
html[data-theme="dark"] .schedule.overdue { background:#3a2c2c; }
html[data-theme="dark"] .schedule.today { background:#3a3228; }
html[data-theme="dark"] .schedule.upcoming { background:#29332b; }
html[data-theme="dark"] .schedule-heading-tools #dashboard-schedule-filter {
  border-color:#505854;
  color:#e9ecea;
  background-color:#222725;
}
html[data-theme="dark"] .action-target-empty { color:#aeb6b1; }
html[data-theme="dark"] .action-target-empty strong { color:#e5e9e6; }

html[data-theme="dark"] .journal-record-main,
html[data-theme="dark"] .journal-record-footer { background:#252a28; }
html[data-theme="dark"] .journal-record-content { border-color:#414844; background:#202422; }
html[data-theme="dark"] .bar-row:nth-child(odd) { background:#2d322f; }
html[data-theme="dark"] .bar-track { background:#1c201e; }
html[data-theme="dark"] .bar-row .count { color:#d5e8d1; background:#303b31; }
html[data-theme="dark"] .bar-row.is-zero .count { color:#c4cac7; background:#363c39; }

html[data-theme="dark"] .link-item,
html[data-theme="dark"] .site-add-panel { border-color:#424945; background:#282d2a; }
html[data-theme="dark"] .link-item:hover { border-color:#667060; background:#303632; }
html[data-theme="dark"] .site-add-content { border-color:#414844; background:#242927; }
html[data-theme="dark"] .site-add-panel summary,
html[data-theme="dark"] .site-add-panel summary:hover,
html[data-theme="dark"] .site-add-panel[open] summary {
  border-color:#444b47;
  color:#e8ebe9;
  background:#2d322f;
}

/* 약품 입력·검색·재고·이력의 라이트 배경 제거 */
html[data-theme="dark"] .journal-new-subject-card,
html[data-theme="dark"] .journal-care-card {
  border-color:#684d39;
  background:#302924;
}
html[data-theme="dark"] .journal-new-subject-icon { border-color:#684d39; background:#272c29; }
html[data-theme="dark"] .medicine-stock-overview-item { border-color:#424a46; background:#272c29; }
html[data-theme="dark"] .journal-medication-row,
html[data-theme="dark"] .journal-medication-empty {
  border-color:#424945;
  color:#e7eae8;
  background:#272c29;
}
html[data-theme="dark"] .journal-medication-unit {
  border-color:#4a524e;
  color:#dce1de;
  background:#202422;
}
html[data-theme="dark"] .journal-medication-stock-field > div {
  border-color:#4c6048;
  color:#bdddba;
  background:#29332a;
}
html[data-theme="dark"] .journal-medication-results {
  border-color:#4a524e;
  background:#222725;
  box-shadow:0 14px 34px rgba(0,0,0,.34);
}
html[data-theme="dark"] .journal-medication-results button {
  border-color:#393f3c;
  color:#e9ecea;
  background:#272c29;
}
html[data-theme="dark"] .journal-medication-results button strong { color:#f0f2f1; }
html[data-theme="dark"] .journal-medication-results button small { color:#aeb6b1; }
html[data-theme="dark"] .journal-medication-results button:hover,
html[data-theme="dark"] .journal-medication-results button:focus,
html[data-theme="dark"] .journal-medication-results button.is-keyboard-active { background:#313733; }
html[data-theme="dark"] .journal-medication-no-result { color:#b7beba; background:#242927; }
html[data-theme="dark"] .journal-record-medications { border-color:#3e4541; background:#2b2724; }
html[data-theme="dark"] .journal-record-medications span { border-color:#55483e; background:#272c29; }
html[data-theme="dark"] .medicine-unit-menu,
html[data-theme="dark"] .medicine-log-item-menu { border-color:#4b534f; background:#242927; }
html[data-theme="dark"] .medicine-unit-menu > button:hover,
html[data-theme="dark"] .medicine-log-item-menu > button:hover,
html[data-theme="dark"] .medicine-log-item-menu > button:focus-visible,
html[data-theme="dark"] .medicine-log-item-options > button:hover,
html[data-theme="dark"] .medicine-log-item-options > button:focus-visible { background:#303632; }

html[data-theme="dark"] #tab-subjects details.section,
html[data-theme="dark"] #tab-journal details.section { background:#242927; }
html[data-theme="dark"] #tab-subjects details.section > summary,
html[data-theme="dark"] #tab-subjects details.section[open] > summary {
  border-color:#50624e;
  color:#cbe4c5;
  background:#293029;
}
html[data-theme="dark"] #tab-journal details.section > summary,
html[data-theme="dark"] #tab-journal details.section[open] > summary {
  border-color:#71533e;
  color:#f1c6a3;
  background:#312a25;
}
html[data-theme="dark"] .medicine-form-card .workspace-detail-fields > summary,
html[data-theme="dark"] .medicine-form-card .workspace-detail-fields[open] > summary {
  border-color:#505a75;
  color:#d6def6;
  background:#30333d;
}

html[data-theme="dark"] .journal-form-card > .workspace-eyebrow,
html[data-theme="dark"] #tab-journal .workspace-eyebrow,
html[data-theme="dark"] #tab-journal .workspace-eyebrow i { color:#ed985b; }
html[data-theme="dark"] #subject-form-card > .workspace-eyebrow,
html[data-theme="dark"] #tab-subjects .workspace-eyebrow,
html[data-theme="dark"] #tab-subjects .workspace-eyebrow i { color:#8fc982; }
html[data-theme="dark"] #tab-emergency .workspace-eyebrow,
html[data-theme="dark"] #tab-emergency .workspace-eyebrow i { color:#e4817b; }
html[data-theme="dark"] #tab-infection .workspace-eyebrow,
html[data-theme="dark"] #tab-infection .workspace-eyebrow i { color:#b8c0c3; }
html[data-theme="dark"] #tab-medicine .workspace-eyebrow,
html[data-theme="dark"] #tab-medicine .workspace-eyebrow i { color:#93a9e2; }

html[data-theme="dark"] .excel-template-preview {
  border-color:#424945;
  background:#242927;
}
html[data-theme="dark"] .excel-template-preview > summary {
  border-color:#424945;
  color:#e7eae8;
  background:#2b302d;
}
html[data-theme="dark"] .excel-template-scroll,
html[data-theme="dark"] .excel-template-table { background:#202422; }
html[data-theme="dark"] .excel-template-table th,
html[data-theme="dark"] .excel-template-table td {
  border-color:#3c4340;
  color:#e4e8e5;
  background:#252a28;
}
html[data-theme="dark"] .excel-template-table .excel-column-letters th {
  color:#aeb6b1;
  background:#2d322f;
}
html[data-theme="dark"] .excel-template-table .excel-preview-title-row th {
  border-top-color:#df7d35;
  color:#edf0ee;
  background:#293229;
}
html[data-theme="dark"] .excel-template-table .excel-preview-title-row span { color:#b8c0bb; }
html[data-theme="dark"] .excel-template-table .excel-preview-guide-row th {
  color:#d8ddda;
  background:#302a26;
}
html[data-theme="dark"] .excel-template-table .excel-preview-hint-row th {
  color:#adb5b0;
  background:#2a2f2c;
}
html[data-theme="dark"] .excel-template-table tbody tr:last-child td {
  color:#dfb38e;
  background:#302923;
}
html[data-theme="dark"] .app-pagination { background:transparent !important; }
html[data-theme="dark"] .trash-note {
  border-color:#43566d;
  color:#c7d8ee;
  background:#252d38;
}

/* 날짜 선택기와 보조 팝업도 같은 명도로 맞춥니다. */
html[data-theme="dark"] .app-date-open { border-color:#4c544f; color:#f0a15f; background:#292e2b; }
html[data-theme="dark"] .app-date-picker {
  border-color:#625346;
  background:#242826;
  box-shadow:0 18px 42px rgba(0,0,0,.45);
}
html[data-theme="dark"] .app-date-picker-weekdays { border-color:#414844; background:#2c312e; }
html[data-theme="dark"] .app-date-picker-head > button,
html[data-theme="dark"] .app-date-picker-actions button,
html[data-theme="dark"] .app-date-picker-day { border-color:#474f4a; color:#e9ecea; background:#2b302d; }
html[data-theme="dark"] .app-date-picker-selectors input,
html[data-theme="dark"] .app-date-picker-selectors select,
html[data-theme="dark"] .app-date-picker-time input { border-color:#4b534f; color:#edf0ee; background:#1f2321; }

html[data-theme="dark"] .ai-preview-dialog,
html[data-theme="dark"] .ai-chat-panel {
  border-color:#454c48;
  color:#f0f2f1;
  background:#242927;
  box-shadow:0 24px 58px rgba(0,0,0,.42);
}
html[data-theme="dark"] .ai-preview-header,
html[data-theme="dark"] .ai-chat-header {
  border-color:#414844;
  background:linear-gradient(110deg,#2b302d,#2d2926);
}
html[data-theme="dark"] .ai-preview-close,
html[data-theme="dark"] .ai-chat-header-actions button { border-color:#4c544f; color:#e8ebe9; background:#303532; }
html[data-theme="dark"] .ai-chat-notice { border-color:#4d5b4a; color:#d1d6d3; background:#29312a; }
html[data-theme="dark"] .ai-chat-quick button { border-color:#594b40; color:#eee5dd; background:#332c27; }
html[data-theme="dark"] .ai-chat-messages { background:#1f2321; }
html[data-theme="dark"] .ai-chat-message-body { border-color:#424945; color:#eef1ef; background:#2b302d; }
html[data-theme="dark"] .ai-chat-message.is-user .ai-chat-message-body { border-color:#765642; color:#ffead9; background:#3b3028; }
html[data-theme="dark"] .ai-chat-composer { border-color:#414844; background:#242927; }
html[data-theme="dark"] .ai-chat-composer-shell { border-color:#4b534f; background:#1d211f; }
html[data-theme="dark"] .ai-chat-launcher {
  border-color:#514940;
  color:#e9ecea;
  background:rgba(38,42,40,.97);
  box-shadow:0 10px 26px rgba(0,0,0,.24);
}
html[data-theme="dark"] .ai-chat-launcher:hover { border-color:#8b6548; background:#302a26; }

html[data-theme="dark"] .schedule-reschedule-card {
  border-color:#484f4b;
  color:#eef1ef;
  background:#292e2b;
}
html[data-theme="dark"] .schedule-reschedule-card input { border-color:#505854; color:#f1f3f2; background:#1f2321; }

html[data-theme="dark"] ::selection { color:#fff; background:#ad5d25; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background:#1b1f1d; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { border-color:#1b1f1d; background:#4a514d; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background:#5b635e; }

/* 다크모드 버튼 대비 체계: 크기가 아니라 역할별로 글자색과 배경색을 결정합니다. */
html[data-theme="dark"] .btn.gray,
html[data-theme="dark"] .btn.gray:hover,
html[data-theme="dark"] .btn.gray:active {
  border-color:#5b645f;
  color:#edf1ef;
  background:#343a37;
}

html[data-theme="dark"] .btn.outline,
html[data-theme="dark"] .btn.outline:hover,
html[data-theme="dark"] .btn.outline:active {
  border-color:#60765c;
  color:#cfe8c9;
  background:#293329;
}

html[data-theme="dark"] .btn:disabled {
  opacity:.72;
}

html[data-theme="dark"] .schedule-actions .schedule-complete,
html[data-theme="dark"] .schedule-actions .schedule-complete:hover,
html[data-theme="dark"] .schedule-actions .schedule-complete:active {
  border-color:#617b5d;
  color:#d9efd4;
  background:#30432f;
}

html[data-theme="dark"] .schedule-actions .schedule-reschedule,
html[data-theme="dark"] .schedule-actions .schedule-reschedule:hover,
html[data-theme="dark"] .schedule-actions .schedule-reschedule:active {
  border-color:#77634e;
  color:#f5d6b7;
  background:#44362b;
}

html[data-theme="dark"] .collapse-card-toggle,
html[data-theme="dark"] .collapse-card-toggle:hover {
  border-color:#555e59;
  color:#e7ebe8;
  background:#303633;
}

html[data-theme="dark"] .dashboard-hero-arrow { color:#c5ccc8; }
html[data-theme="dark"] .dashboard-hero-arrow:hover,
html[data-theme="dark"] .dashboard-hero-arrow:focus-visible { color:#ffc18f; background:#34302c; }

html[data-theme="dark"] .settings-dialog-close,
html[data-theme="dark"] .settings-key-input button {
  border-color:#515a55;
  color:#dbe2de;
  background:#303633;
}

html[data-theme="dark"] .settings-dialog-close:hover,
html[data-theme="dark"] .settings-key-input button:hover { border-color:#806044; color:#ffc393; background:#3a3029; }

html[data-theme="dark"] .journal-period-open { border-color:#4e5752; color:#f2a468; background:#292e2b; }
html[data-theme="dark"] .journal-period-open:hover,
html[data-theme="dark"] .journal-period-open.is-active { border-color:#df7620; color:#fff; background:#c96820; }
html[data-theme="dark"] .journal-period-panel { border-color:#4d544f; color:#e9ecea; background:#252a28; }
html[data-theme="dark"] .journal-period-panel > strong { color:#f0f2f1; }

html[data-theme="dark"] .journal-subject-results { border-color:#49514c; background:#252a28; }
html[data-theme="dark"] .journal-subject-result { border-color:#3e4541; color:#c7cfca; background:#292e2b; }
html[data-theme="dark"] .journal-subject-result-name { color:#f0f2f1; }
html[data-theme="dark"] .journal-subject-result:hover,
html[data-theme="dark"] .journal-subject-result:focus-visible,
html[data-theme="dark"] .journal-subject-result.is-keyboard-active { color:#eef1ef; background:#333a36; }

html[data-theme="dark"] .medicine-bulk-card > .flex-between #medicine-quote-cancel,
html[data-theme="dark"] .medicine-bulk-card > .flex-between #medicine-quote-cancel:hover {
  border-color:#5b645f;
  color:#edf1ef;
  background:#343a37;
}

html[data-theme="dark"] .medicine-quote-count { border-color:#49536a; color:#e9ecea; background:#292e34; }
html[data-theme="dark"] .medicine-quote-count:nth-child(2) { border-color:#4e684b; background:#293329; }
html[data-theme="dark"] .medicine-quote-count:nth-child(3) { border-color:#74543d; background:#382e27; }
html[data-theme="dark"] .medicine-quote-count span { color:#c0c8c3; }
html[data-theme="dark"] .medicine-quote-count strong { color:#c5d0ee; }
html[data-theme="dark"] .medicine-quote-count:nth-child(2) strong { color:#a9d59f; }
html[data-theme="dark"] .medicine-quote-count:nth-child(3) strong { color:#f2b27d; }
html[data-theme="dark"] .medicine-quote-item,
html[data-theme="dark"] .medicine-quote-item.needs-check { border-color:#454d48; color:#e5e9e6; background:#292e2b; }
html[data-theme="dark"] .medicine-quote-item-title strong { color:#f0f2f1; }
html[data-theme="dark"] .medicine-quote-item-result { color:#c5d0ee; }
html[data-theme="dark"] .medicine-quote-item-meta,
html[data-theme="dark"] .medicine-quote-editor label { color:#b8c0bb; }
html[data-theme="dark"] .medicine-quote-arrow { color:#c5d0ee; background:#343b4a; }
html[data-theme="dark"] .medicine-quote-editor { border-color:#454d48; background:#242927; }
html[data-theme="dark"] .medicine-quote-edit-toggle { border-color:#59625d; color:#e4e9e6; background:#333936; }
html[data-theme="dark"] .medicine-quote-remove,
html[data-theme="dark"] .medicine-quote-remove:hover { border-color:#79514e; color:#f2b6b1; background:#3b2c2b; }

/* 개별 강조 버튼은 각 기능의 고유 색상을 유지합니다. */
html[data-theme="dark"] #medicine-quote-apply,
html[data-theme="dark"] #medicine-quote-apply:hover,
html[data-theme="dark"] #medicine-quote-apply:active {
  border-color:#657bb2;
  color:#fff;
  background:#40558d;
}

html[data-theme="dark"] .settings-update-check,
html[data-theme="dark"] .settings-update-check:hover,
html[data-theme="dark"] .settings-update-check:active {
  border-color:#626b66;
  color:#f1f4f2;
  background:#363c39;
}

html[data-theme="dark"] .settings-update-check:disabled {
  border-color:#515954;
  color:#cdd3d0;
  background:#303532;
  opacity:.82;
}

html[data-theme="dark"] #settings-update-download,
html[data-theme="dark"] #settings-update-download:hover,
html[data-theme="dark"] #settings-update-download:active {
  border-color:#e08a49;
  color:#fff;
  background:#c96b25;
}

/* API 설정은 제공처별로 구분하고, 공공데이터 서비스만 내부 아코디언으로 관리합니다. */
.settings-api-provider {
  position:relative;
  padding:14px;
  overflow:hidden;
}

.settings-api-provider-public {
  border-color:#ccd7e4;
  background:linear-gradient(145deg,#fbfcfe 0%,#f7faf8 100%);
  box-shadow:inset 3px 0 0 #29496f;
}

.settings-api-provider-ai {
  border-color:#d5e2d2;
  background:linear-gradient(145deg,#fbfdfb 0%,#f8fbf6 100%);
  box-shadow:inset 3px 0 0 #4b8f42;
}

.settings-api-provider-heading {
  align-items:center;
  margin-bottom:12px;
}

.settings-api-provider-heading > div { flex:1 1 auto; }
.settings-api-provider-heading > div > strong { font-size:12.5px; }
.settings-api-provider-heading > div > span { font-size:10.5px; }

.settings-api-provider-public > .settings-api-provider-heading > i {
  color:#29496f;
  background:#eaf0f7;
}

.settings-api-provider-ai > .settings-api-provider-heading > i {
  color:#3f8138;
  background:#eaf5e7;
}

.settings-api-provider-status {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  gap:4px;
  margin-left:auto;
  padding:4px 7px;
  border-radius:999px;
  font-size:9px;
  font-weight:800;
  line-height:1.2;
  white-space:nowrap;
}

.settings-api-provider-status.is-active {
  border:1px solid #c8dec3;
  color:#3e7d37;
  background:#eff7ed;
}

.settings-api-provider-status.is-optional {
  border:1px solid #d4e2d0;
  color:#477842;
  background:#f1f7ef;
}

.settings-public-data-help {
  margin-bottom:10px;
  box-shadow:none;
}

.settings-public-data-help .settings-api-help-summary { min-height:48px; }
.settings-public-data-help .settings-api-help-symbol { width:29px; height:29px; flex-basis:29px; }

.settings-public-data-key-panel {
  margin-bottom:10px;
  padding:11px 12px;
  border:1px solid #d7e0ea;
  border-radius:10px;
  background:#f7f9fc;
}

.settings-public-data-key-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:9px;
}

.settings-public-data-key-heading > div {
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:2px;
}

.settings-public-data-key-heading strong { color:#2a405d; font-size:11.5px; }
.settings-public-data-key-heading span { color:#72808d; font-size:10px; line-height:1.45; }
.settings-public-data-key-heading > a {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  gap:5px;
  padding:5px 7px;
  border:1px solid #b9c9dc;
  border-radius:7px;
  color:#29496f;
  background:#fff;
  font-size:9.5px;
  font-weight:800;
  line-height:1.3;
  text-decoration:none;
  white-space:nowrap;
}

.settings-public-data-key-heading > a:hover { border-color:#7890ae; background:#edf2f8; }
.settings-public-data-key-heading > a:focus-visible { outline:2px solid var(--of-orange); outline-offset:2px; }
.settings-public-data-key-panel .settings-api-field { margin:0; }
.settings-public-data-key-panel .settings-api-field > span { color:#556779; }

.settings-public-data-key-help {
  display:flex;
  align-items:flex-start;
  gap:6px;
  margin:8px 1px 0;
  color:#667682;
  font-size:10px;
  line-height:1.5;
}

.settings-public-data-key-help .bi { flex:0 0 auto; margin-top:1px; color:#4b8f42; }

.settings-public-api-accordion {
  display:grid;
  gap:7px;
}

.settings-public-api-item {
  overflow:hidden;
  border:1px solid #d6dfe8;
  border-radius:10px;
  background:#fff;
  transition:border-color .16s ease,background .16s ease,box-shadow .16s ease;
}

.settings-public-api-summary {
  display:grid;
  min-height:48px;
  grid-template-columns:30px minmax(0,1fr) auto 12px;
  align-items:center;
  gap:9px;
  padding:7px 10px;
  list-style:none;
  cursor:pointer;
  user-select:none;
}

.settings-public-api-summary::-webkit-details-marker { display:none; }
.settings-public-api-summary:hover { background:#f5f8fb; }
.settings-public-api-summary:focus-visible { outline:2px solid var(--of-green); outline-offset:-2px; }
.settings-public-api-item[open] { border-color:#aabbd0; background:#fbfcfe; box-shadow:0 4px 12px rgba(34,56,82,.06); }
.settings-public-api-item[open] > .settings-public-api-summary { background:#eef3f8; }

.settings-public-api-icon {
  display:grid;
  width:30px;
  height:30px;
  place-items:center;
  border-radius:8px;
  font-size:14px;
}

.settings-public-api-icon.is-weather { color:#31527c; background:#e7eef7; }
.settings-public-api-icon.is-medicine { color:#4f6792; background:#edf1f8; }
.settings-public-api-icon.is-disease { color:#6d7773; background:#eef1ef; }

.settings-public-api-heading {
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:2px;
}

.settings-public-api-heading strong { color:#2b405a; font-size:11px; line-height:1.35; word-break:keep-all; }
.settings-public-api-heading small { color:#778490; font-size:9.5px; line-height:1.4; word-break:keep-all; }

.settings-public-api-status {
  display:inline-flex;
  align-items:center;
  padding:4px 7px;
  border-radius:999px;
  font-size:9px;
  font-weight:800;
  line-height:1.2;
  white-space:nowrap;
}

.settings-public-api-status.is-available { color:#3c7936; background:#eaf5e7; }
.settings-public-api-status.is-coming-soon { color:#707a76; background:#edf0ee; }
.settings-public-api-chevron { color:#7c8893; font-size:10px; transition:transform .18s ease; }
.settings-public-api-item[open] > .settings-public-api-summary .settings-public-api-chevron { transform:rotate(180deg); }

.settings-public-api-content {
  padding:11px 12px 12px;
  border-top:1px solid #dce4ec;
}

.settings-public-api-content .settings-weather-location { margin:10px 0 0; }
.settings-public-api-content .settings-api-actions { margin-top:10px; }

.settings-public-api-apply-link {
  display:grid;
  min-height:46px;
  grid-template-columns:26px minmax(0,1fr) auto;
  align-items:center;
  gap:8px;
  padding:7px 9px;
  border:1px solid #bccbe0;
  border-radius:9px;
  color:#29496f;
  background:#f4f7fb;
  text-decoration:none;
}

.settings-public-api-apply-link > .bi:first-child { font-size:15px; }
.settings-public-api-apply-link > .bi:last-child { align-self:start; margin-top:2px; font-size:9px; opacity:.72; }
.settings-public-api-apply-link > span { display:flex; min-width:0; flex-direction:column; gap:1px; }
.settings-public-api-apply-link strong { font-size:10.5px; line-height:1.35; }
.settings-public-api-apply-link small { color:#6e7d8e; font-size:9.5px; line-height:1.4; }
.settings-public-api-apply-link:hover { border-color:#7f96b5; background:#eaf0f7; }
.settings-public-api-apply-link:focus-visible { outline:2px solid var(--of-orange); outline-offset:2px; }

.settings-public-api-coming-soon {
  display:flex;
  align-items:flex-start;
  gap:9px;
  padding:9px 10px;
  border:1px dashed #cfd7d3;
  border-radius:9px;
  color:#64716b;
  background:#f7f9f8;
}

.settings-public-api-coming-soon > .bi { flex:0 0 auto; margin-top:1px; color:#718079; }
.settings-public-api-coming-soon > span { display:flex; min-width:0; flex-direction:column; gap:2px; }
.settings-public-api-coming-soon strong { color:#46534d; font-size:10.5px; }
.settings-public-api-coming-soon small { font-size:10px; line-height:1.5; }

.settings-api-provider-ai .settings-api-guide {
  border-color:#d5e4d1;
  background:#f5faf3;
}

.settings-api-provider-ai .settings-api-guide-heading strong { color:#385f35; }
.settings-api-provider-ai .settings-api-guide-heading span,
.settings-api-provider-ai .settings-api-guide li { color:#647360; }
.settings-api-provider-ai .settings-api-guide-heading a { border-color:#b9d3b4; color:#3d7b37; }
.settings-api-provider-ai .settings-api-guide-heading a:hover { border-color:#7ead77; background:#edf7ea; }
.settings-api-provider-ai .settings-api-guide li > b { color:#397635; background:#dfeedd; }
.settings-api-provider-ai .settings-api-guide li span strong { color:#315f2d; }

html[data-theme="dark"] .settings-api-provider-public {
  border-color:#4d5b70;
  background:linear-gradient(145deg,#23292d 0%,#222825 100%);
  box-shadow:inset 3px 0 0 #7085a8;
}

html[data-theme="dark"] .settings-api-provider-ai {
  border-color:#4b5d4a;
  background:linear-gradient(145deg,#232925 0%,#252a27 100%);
  box-shadow:inset 3px 0 0 #6f9b68;
}

html[data-theme="dark"] .settings-api-provider-public > .settings-api-provider-heading > i { color:#d8e2f4; background:#34445f; }
html[data-theme="dark"] .settings-api-provider-ai > .settings-api-provider-heading > i { color:#d5ebd0; background:#344936; }
html[data-theme="dark"] .settings-api-provider-status.is-active { border-color:#536f50; color:#d0e9cb; background:#2c3f2e; }
html[data-theme="dark"] .settings-api-provider-status.is-optional { border-color:#536953; color:#d2e5ce; background:#2e3d30; }
html[data-theme="dark"] .settings-public-data-key-panel { border-color:#485563; background:#282f34; }
html[data-theme="dark"] .settings-public-data-key-heading strong { color:#edf2f7; }
html[data-theme="dark"] .settings-public-data-key-heading span,
html[data-theme="dark"] .settings-public-data-key-help { color:#c2cbd2; }
html[data-theme="dark"] .settings-public-data-key-heading > a { border-color:#607491; color:#dbe5f3; background:#303b48; }
html[data-theme="dark"] .settings-public-data-key-heading > a:hover { border-color:#8399b9; background:#384759; }
html[data-theme="dark"] .settings-public-data-key-panel .settings-api-field > span { color:#d7dee5; }
html[data-theme="dark"] .settings-public-data-key-help .bi { color:#9dca96; }
html[data-theme="dark"] .settings-public-api-item { border-color:#48545f; background:#282e31; }
html[data-theme="dark"] .settings-public-api-summary:hover { background:#30383d; }
html[data-theme="dark"] .settings-public-api-item[open] { border-color:#667991; background:#262d31; box-shadow:none; }
html[data-theme="dark"] .settings-public-api-item[open] > .settings-public-api-summary { background:#303a43; }
html[data-theme="dark"] .settings-public-api-icon.is-weather { color:#d9e4f5; background:#3a4b65; }
html[data-theme="dark"] .settings-public-api-icon.is-medicine { color:#ccd8ef; background:#3a4559; }
html[data-theme="dark"] .settings-public-api-icon.is-disease { color:#d2d9d5; background:#3b423f; }
html[data-theme="dark"] .settings-public-api-heading strong { color:#eef2f5; }
html[data-theme="dark"] .settings-public-api-heading small { color:#bbc5cc; }
html[data-theme="dark"] .settings-public-api-status.is-available { color:#cfebca; background:#354b36; }
html[data-theme="dark"] .settings-public-api-status.is-coming-soon { color:#c9d0cc; background:#3a403d; }
html[data-theme="dark"] .settings-public-api-chevron { color:#bdc6cc; }
html[data-theme="dark"] .settings-public-api-content { border-color:#48545f; }
html[data-theme="dark"] .settings-public-api-apply-link { border-color:#60738f; color:#e1e8f3; background:#303b49; }
html[data-theme="dark"] .settings-public-api-apply-link small { color:#c0cad7; }
html[data-theme="dark"] .settings-public-api-apply-link:hover { border-color:#8298b7; background:#394858; }
html[data-theme="dark"] .settings-public-api-coming-soon { border-color:#505b55; color:#c3ccc7; background:#292f2c; }
html[data-theme="dark"] .settings-public-api-coming-soon > .bi { color:#bbc5bf; }
html[data-theme="dark"] .settings-public-api-coming-soon strong { color:#e7ebe8; }
html[data-theme="dark"] .settings-api-provider-ai .settings-api-guide { border-color:#4e644b; background:#29332a; }
html[data-theme="dark"] .settings-api-provider-ai .settings-api-guide-heading strong { color:#dcebd8; }
html[data-theme="dark"] .settings-api-provider-ai .settings-api-guide-heading span,
html[data-theme="dark"] .settings-api-provider-ai .settings-api-guide li { color:#c6d1c3; }
html[data-theme="dark"] .settings-api-provider-ai .settings-api-guide-heading a { border-color:#5c7858; color:#d2ebcd; background:#334235; }
html[data-theme="dark"] .settings-api-provider-ai .settings-api-guide-heading a:hover { border-color:#7fa078; background:#3b4d3e; }
html[data-theme="dark"] .settings-api-provider-ai .settings-api-guide li > b { color:#d8efd3; background:#3b523d; }
html[data-theme="dark"] .settings-api-provider-ai .settings-api-guide li span strong { color:#d7ebd3; }

@media (max-width:620px) {
  .settings-api-provider { padding:12px; }
  .settings-api-provider-heading { align-items:flex-start; flex-wrap:wrap; }
  .settings-api-provider-status { margin-left:37px; }
  .settings-public-data-key-heading { align-items:stretch; flex-direction:column; }
  .settings-public-data-key-heading > a { width:max-content; max-width:100%; }
  .settings-public-api-summary { grid-template-columns:30px minmax(0,1fr) auto 12px; gap:7px; padding-right:8px; padding-left:8px; }
  .settings-public-api-heading small { display:none; }
}


/* Patch history uses the same card treatment as the update panel. */
.settings-patch-history { margin-top:10px; padding:13px; border:1px solid #dce5df; border-radius:10px; background:linear-gradient(120deg,#f8faf9 0%,#fffaf5 100%); }
.settings-patch-history-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; }
.settings-patch-history-heading h3 { margin:0; color:#34483f; font-size:12px; font-weight:800; line-height:1.45; }
.settings-patch-history-heading > span { padding:3px 7px; border-radius:999px; color:#4b7d42; background:#eef7eb; font-size:9px; font-weight:800; white-space:nowrap; }
.settings-patch-history-description { margin:5px 0 12px; color:#7a8780; font-size:10px; line-height:1.5; }
#settings-patch-history-list { display:grid; gap:8px; min-width:0; }
.settings-patch-history-empty { margin:0; padding:12px; border:1px solid #dce5df; border-radius:8px; color:#697970; background:#fff; font-size:11px; line-height:1.7; }
.settings-patch-entry { min-width:0; overflow:hidden; border:1px solid #dce5df; border-radius:8px; background:#fff; }
.settings-patch-entry > summary { display:flex; min-height:42px; align-items:center; flex-wrap:wrap; gap:7px; padding:10px; cursor:pointer; list-style:none; background:#f8faf9; }
.settings-patch-entry > summary::-webkit-details-marker { display:none; }
.settings-patch-entry > summary:focus-visible { outline:2px solid #e67a24; outline-offset:-3px; }
.settings-patch-entry > summary > strong { color:#2d453a; font-size:12px; overflow-wrap:anywhere; }
.settings-patch-badge { flex-shrink:0; padding:2px 6px; border-radius:999px; color:#4b7d42; background:#eef7eb; font-size:8px; font-weight:800; }
.settings-patch-entry time { margin-left:auto; color:#7a8780; font-size:9px; white-space:nowrap; }
.settings-patch-toggle { flex-shrink:0; color:#526d60; font-size:9px; font-weight:700; }
.settings-patch-collapse, .settings-patch-entry[open] .settings-patch-expand { display:none; }
.settings-patch-entry[open] .settings-patch-collapse { display:inline; }
.settings-patch-entry[open] > summary { border-bottom:1px solid #e1e7e3; }
.settings-patch-entry ul { display:grid; gap:7px; margin:0; padding:12px 14px 12px 26px; color:#34483f; font-size:11px; line-height:1.75; overflow-wrap:anywhere; }
.settings-patch-entry li::marker { color:#697970; }
html[data-theme="dark"] .settings-patch-history { border-color:#5f7168; background:linear-gradient(120deg,#36453e,#403a35); }
html[data-theme="dark"] .settings-patch-history-heading h3,
html[data-theme="dark"] .settings-patch-entry > summary > strong,
html[data-theme="dark"] .settings-patch-entry ul { color:#edf3ef; }
html[data-theme="dark"] .settings-patch-history-empty,
html[data-theme="dark"] .settings-patch-entry,
html[data-theme="dark"] .settings-patch-entry > summary { border-color:#5f7168; color:#c0ccc6; background:#37473f; }
html[data-theme="dark"] .settings-patch-history-description,
html[data-theme="dark"] .settings-patch-entry time,
html[data-theme="dark"] .settings-patch-toggle,
html[data-theme="dark"] .settings-patch-entry li::marker { color:#c0ccc6; }
html[data-theme="dark"] .settings-patch-history-heading > span,
html[data-theme="dark"] .settings-patch-badge { color:#ccebc4; background:#3d533c; }
@media (max-width:560px) {
  .settings-patch-entry > summary { gap:5px; }
  .settings-patch-entry ul { padding-left:24px; }
}
