:root {
  --bg: #eaf4e5;
  --bg-deep: #d7ead2;
  --ink: #163323;
  --muted: #5f7466;
  --line: rgba(38, 84, 58, 0.16);
  --panel: rgba(255, 255, 248, 0.92);
  --panel-solid: #fffef6;
  --green: #23633d;
  --green-2: #4f8a46;
  --mint: #d9f0d6;
  --amber: #bd7b21;
  --red: #b84d45;
  --blue: #286a82;
  --shadow: 0 18px 44px rgba(34, 78, 52, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,248,0.54), rgba(255,255,248,0) 340px),
    linear-gradient(135deg, #e5f2df 0%, #d8ead4 42%, #eef4dc 100%);
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(1440px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 248, 0.72);
  box-shadow: var(--shadow);
}

.eyebrow,
.section-heading p {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.nav-button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(35, 99, 61, 0.22);
  border-radius: 8px;
  color: var(--green);
  background: rgba(255, 255, 248, 0.78);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.nav-button:hover,
button:hover {
  transform: translateY(-1px);
  border-color: rgba(35, 99, 61, 0.44);
}

.nav-button-strong {
  color: white;
  background: linear-gradient(135deg, var(--green), var(--green-2));
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.status-strip div,
.summary-panel,
.hero-panel,
.control-panel,
.calendar-panel,
.week-panel,
.universe-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(34, 78, 52, 0.1);
}

.status-strip div {
  padding: 14px 16px;
}

.status-strip span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-strip strong {
  font-size: 16px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.9fr);
  gap: 18px;
}

.hero-panel,
.summary-panel,
.calendar-panel,
.week-panel,
.universe-panel {
  padding: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.25;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.highlight-card,
.event-row,
.company-card {
  border: 1px solid rgba(38, 84, 58, 0.13);
  border-radius: 8px;
  background: var(--panel-solid);
}

.highlight-card {
  min-height: 154px;
  padding: 15px;
  cursor: pointer;
}

.highlight-card:hover,
.event-row:hover,
.company-card:hover {
  border-color: rgba(35, 99, 61, 0.38);
}

.date-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.badge-high {
  background: #ffe8c8;
  color: var(--amber);
}

.badge-medium {
  background: #dcedd6;
  color: var(--green);
}

.badge-low {
  background: #e7edf0;
  color: var(--blue);
}

.highlight-card h3,
.event-row h3 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.45;
}

.highlight-card p,
.event-row p,
.panel-copy,
.source-notes {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
}

.kpi-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.kpi-card {
  padding: 15px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(217, 240, 214, 0.94), rgba(255, 255, 248, 0.9));
  border: 1px solid rgba(35, 99, 61, 0.12);
}

.kpi-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kpi-card strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  line-height: 1;
}

.source-notes {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(150px, 0.5fr));
  gap: 12px;
  margin: 18px 0;
  padding: 16px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-height: 43px;
  border: 1px solid rgba(38, 84, 58, 0.18);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fffef6;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(35, 99, 61, 0.54);
  box-shadow: 0 0 0 3px rgba(35, 99, 61, 0.12);
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.72fr);
  gap: 18px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.calendar-toolbar h2 {
  margin: 0;
  font-size: 24px;
}

.toolbar-right {
  display: inline-flex;
  gap: 8px;
}

.calendar-toolbar button {
  min-width: 44px;
  padding: 0 12px;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.calendar-grid {
  gap: 8px;
}

.day-cell {
  min-height: 138px;
  padding: 10px;
  border: 1px solid rgba(38, 84, 58, 0.13);
  border-radius: 8px;
  background: #fffef6;
}

.day-cell.outside {
  background: rgba(255, 254, 246, 0.48);
  color: rgba(22, 51, 35, 0.44);
}

.day-cell.today {
  border-color: rgba(189, 123, 33, 0.64);
  box-shadow: inset 0 0 0 2px rgba(189, 123, 33, 0.12);
}

.day-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 900;
}

.event-chip {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 7px 8px;
  border: 0;
  border-left: 4px solid var(--green);
  border-radius: 6px;
  color: var(--ink);
  background: #eef7e8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
}

.event-chip.high {
  border-left-color: var(--amber);
  background: #fff1dc;
}

.event-chip.low {
  border-left-color: var(--blue);
  background: #edf5f6;
}

.more-chip {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.week-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  max-height: 728px;
  overflow: auto;
  padding-right: 4px;
}

.event-row {
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.event-row p {
  margin-bottom: 0;
}

.universe-panel {
  margin-top: 18px;
}

.panel-copy {
  max-width: 820px;
  margin: 10px 0 18px;
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.company-card {
  min-height: 94px;
  padding: 13px;
}

.company-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.company-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  padding: 22px;
  border: 1px dashed rgba(38, 84, 58, 0.26);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 254, 246, 0.6);
  text-align: center;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.modal-root.active {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 34, 22, 0.54);
}

.modal-card {
  position: relative;
  width: min(720px, calc(100% - 28px));
  max-height: calc(100vh - 50px);
  margin: 25px auto;
  overflow: auto;
  border: 1px solid rgba(255, 255, 248, 0.34);
  border-radius: 8px;
  background: #fffef6;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 8px 0 0;
  font-size: 24px;
  line-height: 1.35;
}

.modal-close {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
}

.modal-body {
  display: grid;
  gap: 14px;
  padding: 22px;
}

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

.detail-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(217, 240, 214, 0.26);
}

.detail-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.link-button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 8px;
  color: white;
  background: var(--green);
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 1100px) {
  .hero-grid,
  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .company-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 24px, 720px);
    padding-top: 14px;
  }

  .site-header,
  .status-strip,
  .control-panel {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding: 20px;
  }

  .header-actions {
    justify-content: stretch;
  }

  .nav-button {
    flex: 1 1 160px;
  }

  .highlight-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .weekday-row {
    display: none;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .day-cell {
    min-height: 104px;
  }

  .company-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 34px;
  }

  .calendar-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .calendar-toolbar h2 {
    order: -1;
    width: 100%;
  }

  .company-grid {
    grid-template-columns: 1fr;
  }
}
