:root {
  --bg: #edf2f6;
  --surface: #f8fafc;
  --card: rgba(255, 255, 255, 0.94);
  --card-soft: #f4f7fa;
  --text: #111827;
  --muted: #667085;
  --muted2: #98a2b3;
  --navy: #172033;
  --navy2: #253852;
  --blue: #46698d;
  --gold: #d6b56d;
  --gold-soft: #fff5da;
  --line: rgba(17, 24, 39, 0.08);
  --section-line: rgba(56, 87, 124, 0.12);
  --shadow: 0 16px 36px rgba(17, 24, 39, 0.09);
  --shadow-soft: 0 8px 18px rgba(17, 24, 39, 0.07);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 92px;
  background:
    radial-gradient(circle at 0% 0%, rgba(214, 181, 109, 0.14), transparent 30%),
    radial-gradient(circle at 100% 8%, rgba(70, 105, 141, 0.16), transparent 32%),
    linear-gradient(145deg, #eef3f7 0%, #f8fbfd 52%, #e8edf3 100%);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 14px 30px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: -20px -14px 16px;
  padding: 20px 14px 13px;
  background: linear-gradient(180deg, rgba(247,249,252,0.98), rgba(247,249,252,0.88));
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(17,24,39,0.06);
}

.topbar > div:first-child {
  min-width: 0;
}

.app-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.app-env-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.04);
  border: 1px solid rgba(17, 24, 39, 0.06);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.topbar,
.hero-top,
.section-head,
.tracked-law-head,
.law-category-title,
.law-nochange-category summary,
.bottom-nav {
  min-width: 0;
}

.eyebrow,
.section-label {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  color: var(--navy);
  font-size: 23px;
  letter-spacing: 0;
  line-height: 1.12;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

h2 {
  margin-bottom: 0;
  color: var(--navy);
  font-size: 26px;
  line-height: 1.24;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: normal;
  text-wrap: balance;
}

h3 {
  margin-bottom: 0;
  color: var(--navy2);
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1.22;
  word-break: keep-all;
  overflow-wrap: normal;
  text-wrap: balance;
}

.top-action {
  min-width: 58px;
  height: 42px;
  border: 1px solid rgba(17,24,39,0.06);
  border-radius: 999px;
  background: linear-gradient(180deg, #22314a, #172033);
  color: rgba(255,255,255,0.96);
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.top-action:active {
  transform: scale(0.95);
}

.top-action:hover {
  box-shadow: 0 10px 22px rgba(23, 32, 51, 0.14);
}

.admin-status-btn {
  min-width: 48px;
  height: 36px;
  background: #eef2f7;
  color: var(--navy);
  font-size: 12px;
  box-shadow: none;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

@keyframes weatherFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.weather-card,
.guide-card {
  animation: weatherFade 0.3s ease;
}

.hero-card,
.card {
  margin-bottom: 16px;
  border: 1px solid rgba(17, 24, 39, 0.09);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 25px 22px 22px;
  background:
    radial-gradient(circle at 92% 8%, rgba(216,180,106,0.24), transparent 32%),
    linear-gradient(145deg, #111827 0%, #22324b 58%, #324966 100%);
  color: white;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -58px;
  bottom: -74px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}

.hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.hero-top h2 {
  max-width: 300px;
  text-wrap: balance;
}

.date-text {
  margin-bottom: 11px;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  font-weight: 800;
}

.hero-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.88);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
}

.brief-text {
  position: relative;
  z-index: 1;
  margin: 17px 0 0;
  padding: 12px 13px;
  border-radius: 18px;
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  line-height: 1.6;
  word-break: keep-all;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.hero-stats-compact {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 14px;
}

.hero-stats div {
  min-height: 72px;
  padding: 12px 11px;
  border-radius: 18px;
  background: rgba(255,255,255,0.15);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.11);
}

.hero-stats span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.58);
  font-size: 12px;
  font-weight: 800;
}

.hero-stats strong {
  font-size: 20px;
  letter-spacing: 0;
}

.card {
  position: relative;
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(18px);
}

.card::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--section-line), transparent);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #786036;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.ghost-btn {
  height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: #edf2f7;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.search-row,
.title-row {
  display: grid;
  grid-template-columns: 1fr 62px;
  gap: 8px;
  margin-bottom: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  outline: none;
  background: rgba(255,255,255,0.96);
  color: var(--text);
}

input,
select {
  height: 46px;
  border-radius: 17px;
  padding: 0 13px;
  font-size: 14px;
}

textarea {
  min-height: 112px;
  border-radius: 20px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(56,87,124,0.45);
  box-shadow: 0 0 0 4px rgba(56,87,124,0.1);
}

.search-row button,
.title-row button {
  height: 46px;
  border: 0;
  border-radius: 17px;
  background: var(--navy);
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.guide-grid {
  display: grid;
  gap: 11px;
}

.guide-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 11px;
  align-items: start;
  padding: 15px;
  border-radius: 20px;
  background: linear-gradient(145deg, #f8fafc, #eef3f8);
  box-shadow: inset 0 0 0 1px rgba(17,24,39,0.05);
}

.guide-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: white;
  color: var(--navy);
  font-size: 14px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px var(--line);
}

.guide-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 14px;
  letter-spacing: -0.02em;
}

.guide-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  word-break: keep-all;
}

.fold-card > summary,
.weather-fold > summary {
  list-style: none;
  cursor: pointer;
}

.fold-card > summary::-webkit-details-marker,
.weather-fold > summary::-webkit-details-marker {
  display: none;
}

.fold-card > summary {
  margin-bottom: 0;
}

.fold-summary-text,
.weather-summary-date {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.fold-summary-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fold-summary-icons .guide-icon {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.fold-body,
.weather-fold-body {
  margin-top: 14px;
}

.weather-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 8px 0 18px;
}

.weather-fold {
  display: block;
}

.weather-fold > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.weather-summary {
  margin-bottom: 0;
}

.location-name {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.weather-main h2 {
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 64px;
  line-height: 0.92;
  letter-spacing: -0.09em;
}

.weather-main p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.weather-visual {
  position: relative;
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 28% 26%, rgba(255,255,255,0.92), transparent 38%),
    linear-gradient(145deg, #fff7da, #dce9f8);
  box-shadow:
    inset 8px 10px 24px rgba(255,255,255,0.78),
    inset -10px -12px 28px rgba(56,87,124,0.12);
}

.sun {
  position: absolute;
  right: 24px;
  top: 24px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #f6c85d;
  box-shadow: 0 0 28px rgba(246,200,93,0.62);
}

.cloud {
  position: absolute;
  left: 20px;
  bottom: 24px;
  width: 56px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  box-shadow: 0 8px 18px rgba(17,24,39,0.08);
}

.cloud::before {
  content: "";
  position: absolute;
  left: 9px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: inherit;
}

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

.weather-metrics div {
  min-height: 74px;
  padding: 13px;
  border-radius: 18px;
  background: linear-gradient(145deg, #f8fafc, #eef3f8);
  box-shadow: inset 0 0 0 1px rgba(17,24,39,0.05);
}

.weather-metrics .rain-time-metric {
  grid-column: 1 / -1;
  min-height: auto;
  background: linear-gradient(145deg, #fffaf0, #eef5fb);
}

.weather-metrics span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.weather-metrics strong {
  color: var(--navy);
  font-size: 17px;
  letter-spacing: 0;
}

.rain-time-metric strong {
  display: block;
  line-height: 1.35;
  word-break: keep-all;
}

.schedule-composer {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.selected-time-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--navy), var(--blue));
  color: white;
}

.selected-time-card span {
  color: rgba(255,255,255,0.62);
  font-size: 12px;
  font-weight: 900;
}

.selected-time-card strong {
  font-size: 30px;
  letter-spacing: 0;
}

.time-select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.time-select-row label {
  display: grid;
  gap: 6px;
}

.time-select-row label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.time-select-row select {
  font-size: 17px;
  font-weight: 900;
}

.quick-time-wrap {
  padding: 12px;
  border-radius: 18px;
  background: var(--card-soft);
}

.quick-time-wrap p {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.quick-time-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.quick-time-btn {
  height: 36px;
  border: 1px solid rgba(17,24,39,0.06);
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,0.03);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.quick-time-btn.active {
  background: linear-gradient(180deg, #22314a, #172033);
  color: rgba(255,255,255,0.96);
}

.list {
  display: grid;
  gap: 9px;
}

.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px;
  border-radius: 18px;
  background: var(--card-soft);
  box-shadow: inset 0 0 0 1px rgba(17,24,39,0.04);
}

.item-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item-time {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--gold);
  font-weight: 900;
  white-space: nowrap;
}

.item-title {
  min-width: 0;
  color: var(--text);
  font-weight: 800;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.item.done .item-title {
  color: var(--muted2);
  text-decoration: line-through;
}

.item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.item-actions button {
  min-height: 32px;
  border: 1px solid rgba(17,24,39,0.06);
  border-radius: 12px;
  padding: 0 10px;
  background: rgba(255,255,255,0.9);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.note-box p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-list {
  display: grid;
  gap: 9px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--card-soft);
  box-shadow: inset 0 0 0 1px rgba(17,24,39,0.04);
}

.settings-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.settings-row strong {
  color: var(--navy);
  font-size: 13px;
  text-align: right;
}

.notification-top-card {
  margin-bottom: 12px;
}

.notification-top-wrap {
  margin-bottom: 12px;
}

.notification-fold > summary {
  list-style: none;
}

.notification-fold > summary::-webkit-details-marker {
  display: none;
}

.notification-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: var(--navy);
  box-shadow:
    0 8px 18px rgba(17, 24, 39, 0.08),
    inset 0 0 0 1px rgba(23, 32, 51, 0.07);
  cursor: pointer;
}

.notification-pill-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.notification-pill strong {
  font-size: 13px;
  font-weight: 900;
}

.notification-fold[open] .notification-pill {
  margin-bottom: 10px;
}

.notification-top-head {
  align-items: flex-start;
  margin-bottom: 10px;
}

.notification-settings-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.notification-settings-card > summary {
  list-style: none;
  cursor: pointer;
}

.notification-settings-card > summary::-webkit-details-marker {
  display: none;
}

.notification-settings-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(23, 32, 51, 0.04);
}

.notification-settings-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.notification-settings-summary strong {
  color: var(--navy);
  font-size: 14px;
}

.notification-time-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,0.05);
  white-space: nowrap;
}

.notification-settings-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.notification-settings-body-top {
  padding: 0;
}

.notification-time-field {
  display: grid;
  gap: 8px;
}

.notification-time-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.notification-time-field input {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 0 14px;
  background: var(--card-soft);
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,0.06);
}

.notification-settings-note,
.notification-test-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.notification-save-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.notification-save-btn {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--navy);
  color: white;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.12);
}

.notification-test-hint {
  margin: 6px 4px 10px;
}

.notify-test-btn {
  width: 100%;
  min-height: 54px;
  margin: 2px 0 8px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--navy), var(--blue));
  color: white;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.notification-toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 160;
  min-width: 220px;
  max-width: calc(100% - 32px);
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.92);
  color: white;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.notification-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 390px) {
  .notification-settings-summary,
  .notification-save-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .notification-time-badge {
    white-space: normal;
  }
}

footer {
  color: var(--muted2);
  text-align: center;
  font-size: 12px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: min(410px, calc(100% - 24px));
  padding: 7px;
  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 24px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 16px 42px rgba(17,24,39,0.2);
  backdrop-filter: blur(20px);
  transform: translateX(-50%);
}

.bottom-nav-btn {
  min-height: 54px;
  min-width: 0;
  border: 1px solid rgba(17,24,39,0.06);
  border-radius: 18px;
  background: rgba(255,255,255,0.88);
  color: var(--muted);
  font-weight: 900;
  box-shadow:
    0 6px 18px rgba(17, 24, 39, 0.06),
    inset 0 0 0 1px rgba(255,255,255,0.45);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.bottom-nav-btn span {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1;
}

.bottom-nav-btn strong {
  display: block;
  font-size: 11.5px;
  line-height: 1.1;
  white-space: nowrap;
  word-break: keep-all;
}

.bottom-nav-btn.active {
  background: linear-gradient(180deg, #22314a, #172033);
  color: rgba(255,255,255,0.96);
  box-shadow: 0 10px 22px rgba(23,32,51,0.18);
}

#homeSection,
#notificationSection,
#guideSection,
#weatherSection,
#scheduleSection,
#workSection,
#settingsSection {
  scroll-margin-top: 92px;
}

@media (max-width: 360px) {
  .app {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hero-card,
  .card {
    border-radius: 22px;
  }

  .hero-card {
    padding: 22px 18px 20px;
  }

  .hero-top h2 {
    font-size: 24px;
  }

  h1 {
    font-size: 20px;
  }

  .quick-time-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .search-row,
  .title-row {
    grid-template-columns: 1fr;
  }

  .search-row button,
  .title-row button {
    width: 100%;
  }

  .weather-main h2 {
    font-size: 56px;
  }

  .weather-visual {
    width: 88px;
    height: 88px;
    border-radius: 28px;
  }

  .law-tabs {
    gap: 5px;
  }

  .law-tab-btn {
    font-size: 11px;
    padding-inline: 4px;
  }

  .bottom-nav {
    gap: 4px;
    width: calc(100% - 16px);
  }

  .bottom-nav-btn {
    padding-inline: 2px;
  }
}

@media (max-width: 390px) {
  h1 {
    font-size: 21px;
  }

  .hero-top h2 {
    font-size: 25px;
  }

  .section-head h3 {
    font-size: 18px;
  }

  .law-tab-btn {
    font-size: 12px;
  }

  .bottom-nav-btn strong {
    font-size: 10.5px;
  }
}


/* v0.5 오늘 시행 법령 변경 브리핑 */
.law-card {
  position: relative;
}

.law-brief-summary-card {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 22px;
  background: white;
  box-shadow:
    0 10px 26px rgba(17, 24, 39, 0.08),
    inset 0 0 0 1px rgba(23, 32, 51, 0.07);
}

.law-intro {
  margin-bottom: 12px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.law-intro p {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
  word-break: keep-all;
}

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

#lawMetaSummary {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
}

.law-action-box {
  display: none;
}

.law-action-box strong {
  display: block;
  margin-bottom: 6px;
  color: #8a651e;
  font-size: 13px;
  font-weight: 900;
}

.law-action-box p {
  margin-bottom: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  word-break: keep-all;
}

.law-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 0;
}

.law-summary-grid div {
  padding: 12px;
  border-radius: 18px;
  background: var(--card-soft);
  box-shadow: inset 0 0 0 1px rgba(23, 32, 51, 0.06);
}

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

.law-summary-grid strong {
  color: var(--navy);
  font-size: 18px;
  letter-spacing: -0.035em;
}

.tracked-law-box {
  display: none;
}

.tracked-law-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.tracked-law-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.tracked-law-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tracked-law-box.compact {
  gap: 6px;
}

.tracked-law-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tracked-law-list {
  display: grid;
  gap: 8px;
}

.tracked-law-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 0 0 1px rgba(17,24,39,0.04);
}

.tracked-law-item strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  word-break: keep-all;
}

.tracked-law-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tracked-law-item em {
  flex: 0 0 auto;
  padding: 7px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.tracked-law-item.today-updated em {
  background: #fff3d2;
  color: #8a651e;
}

.tracked-law-item.no-update {
  opacity: 0.78;
}

.tracked-law-item.needs-review {
  background: #fff2f2;
  box-shadow: inset 0 0 0 1px rgba(163, 58, 58, 0.16);
}

.law-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
  padding: 6px;
  border-radius: 20px;
  background: var(--card-soft);
}

.law-tab-btn {
  height: 38px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  word-break: keep-all;
}

.law-tab-btn.active {
  background: var(--navy);
  color: white;
}

.law-panel {
  display: none;
}

.law-panel.active {
  display: block;
}

.law-list {
  display: grid;
  gap: 12px;
}

.law-item {
  padding: 16px;
  border-radius: 20px;
  background: white;
  box-shadow:
    0 10px 26px rgba(17, 24, 39, 0.08),
    inset 0 0 0 1px rgba(23, 32, 51, 0.07);
}

.law-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.law-name {
  display: block;
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.03em;
  word-break: keep-all;
}

.law-category {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.law-status {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: white;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px var(--line);
}

.law-status.changed {
  background: var(--gold-soft);
  color: #8a651e;
}

.law-summary {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  word-break: keep-all;
}

.law-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.law-meta div {
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--card-soft);
}

.law-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.law-meta strong {
  color: var(--text);
  font-size: 12px;
}

.law-empty {
  padding: 16px;
  border-radius: 20px;
  background: var(--card-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.law-memo-box {
  margin-top: 13px;
  padding: 13px;
  border-radius: 20px;
  background: var(--card-soft);
}

.law-memo-box summary {
  cursor: pointer;
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.law-memo-box textarea {
  margin-top: 12px;
  background: white;
}

@media (max-width: 360px) {
  .law-summary-grid {
    grid-template-columns: 1fr;
  }

  .law-meta {
    grid-template-columns: 1fr;
  }
}


/* v0.6 법령 브리핑 UI 개선 */
.law-item-changed {
  border: 1px solid rgba(70, 105, 141, 0.14);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.07);
}

.law-item-changed .law-name {
  color: var(--navy);
}

.law-detail-card {
  padding: 0;
  overflow: hidden;
}

.law-date-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.law-date-row::-webkit-scrollbar {
  display: none;
}

.law-date-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.08);
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.law-date-chip-shared {
  background: #eef5ff;
  color: #35507a;
}

.law-date-chip-effective {
  background: #eef7f1;
  color: #2f5f4c;
}

.law-date-chip-promulgation {
  background: #fff3ea;
  color: #8b6040;
}

.law-date-chip-deferment {
  background: #f4f1ff;
  color: #5c4b8a;
}

.law-date-chip-empty {
  color: var(--muted);
}

.law-detail-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 15px 14px;
  cursor: pointer;
  list-style: none;
}

.law-detail-summary::-webkit-details-marker {
  display: none;
}

.law-detail-summary-main {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 6px;
}

.law-ai-summary-box {
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(23, 32, 51, 0.035);
  box-shadow: inset 0 0 0 1px rgba(23, 32, 51, 0.055);
}

.law-ai-summary-label {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.law-ai-summary-headline {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
  word-break: keep-all;
}

.law-ai-summary-stack {
  display: grid;
  gap: 8px;
}

.law-ai-summary-item {
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px rgba(23, 32, 51, 0.05);
}

.law-ai-summary-item-label {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 6px;
  word-break: keep-all;
}

.law-ai-summary-item-text {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  word-break: keep-all;
  white-space: pre-wrap;
}

.law-keyword-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  width: fit-content;
  margin-top: -1px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.04);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
}

.law-date-row-preview {
  margin-top: 2px;
}

.law-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 0;
}

.law-section-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(23, 32, 51, 0.02);
}

.law-section-btn.is-active {
  background: rgba(23, 32, 51, 0.06);
  border-color: rgba(23, 32, 51, 0.16);
}

.law-card-panel {
  display: grid;
  gap: 8px;
}

.law-card-panel[hidden] {
  display: none !important;
}

.law-summary-panel-inner,
.law-original-panel-inner {
  width: 100%;
}

.law-change-summary-title {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.law-original-text {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: keep-all;
}

.law-date-row-preview {
  margin-top: 10px;
}

.law-toggle-indicator {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(23, 32, 51, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.law-detail-card[open] .law-toggle-indicator {
  color: var(--navy);
}

.law-detail-card[open] .law-toggle-indicator::before {
  content: "닫기";
}

.law-detail-card:not([open]) .law-toggle-indicator::before {
  content: "열기";
}

.law-toggle-indicator {
  font-size: 0;
}

.law-detail-body {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.law-card-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 0;
}

.law-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #22314a, #172033);
  color: rgba(255,255,255,0.96);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.12);
}

.law-link-btn:hover,
.law-link-btn:focus-visible {
  color: white;
}

.law-change-summary-box {
  padding: 13px;
  border-radius: 17px;
  background: var(--card-soft);
  box-shadow: inset 0 0 0 1px rgba(23, 32, 51, 0.055);
}

.law-change-summary-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.law-change-summary-box p {
  margin-bottom: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  word-break: keep-all;
}

.law-change-summary-box-fallback p {
  color: var(--muted);
}

.law-change-summary-box-articles {
  display: grid;
  gap: 10px;
}

.law-article-list {
  display: grid;
  gap: 10px;
}

.law-article-item {
  padding: 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(23, 32, 51, 0.07);
}

.law-article-title {
  display: block;
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
  word-break: keep-all;
}

.law-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.law-article-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.law-article-content-box {
  margin-top: 10px;
  background: white;
}

.law-change-summary-text.is-collapsed {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.law-more-btn {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.law-original-fold {
  margin-top: 0;
}

.law-original-fold .law-more-btn {
  margin-top: 8px;
}

.law-detail-meta,
.law-relevance-note,
.law-next-step,
.law-status {
  display: none;
}

.law-nochange-box {
  margin-top: 10px;
  border-radius: 18px;
  background: var(--card-soft);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.law-nochange-box summary {
  cursor: pointer;
  padding: 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  list-style-position: inside;
}

.law-nochange-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 13px 13px 28px;
  color: var(--muted);
  font-size: 13px;
}

.law-nochange-list li {
  line-height: 1.35;
}

.law-nochange-list strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.law-nochange-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted2);
  font-size: 12px;
  line-height: 1.4;
}


/* v0.7 iOS 홈화면 앱 마감 */
body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.app {
  padding-bottom: calc(26px + env(safe-area-inset-bottom));
}

.topbar {
  padding-top: calc(18px + env(safe-area-inset-top));
}

.bottom-nav {
  bottom: calc(12px + env(safe-area-inset-bottom));
}

@media (display-mode: standalone) {
  body {
    background-color: #e9eef3;
  }

  .topbar {
    top: 0;
  }
}


/* v0.8 sync time visibility */
#lawCheckedAt {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
  word-break: keep-all;
}


/* v0.9 law category grouping */
.law-category-group {
  display: grid;
  gap: 9px;
  margin-bottom: 11px;
}

.law-category-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 17px;
  background: rgba(23, 32, 51, 0.06);
}

.law-category-title strong {
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.law-category-title span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: white;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px var(--line);
}

.law-category-body {
  display: grid;
  gap: 9px;
}

.law-nochange-categories {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.law-nochange-category {
  border-radius: 15px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.law-nochange-category summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  list-style-position: inside;
}

.law-nochange-category summary strong {
  color: var(--text);
  font-size: 13px;
}

.law-nochange-category summary span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.law-nochange-category .law-nochange-list {
  padding: 0 13px 13px 28px;
}

.law-nochange-category .law-nochange-list li {
  margin-bottom: 6px;
}

#workSection .section-head > div {
  min-width: 0;
  flex: 1 1 auto;
}

#workSection .section-head {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

#workSection .section-head h3 {
  max-width: 100%;
  font-size: 15px;
  line-height: 1.24;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: keep-all;
  overflow-wrap: normal;
  max-width: 16ch;
}

#workSection .section-head .status-chip {
  margin-left: auto;
}

.law-empty-status {
  font-weight: 900;
}

.law-empty-status.success {
  background: #eef7f0;
  color: #1d6b38;
}

.law-empty-status.error {
  background: #fff2f2;
  color: #a33a3a;
}

.law-category-group,
.tracked-law-group {
  display: block;
  margin-bottom: 11px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.law-category-group > summary,
.tracked-law-group > summary {
  list-style: none;
  cursor: pointer;
}

.law-category-group > summary::-webkit-details-marker,
.tracked-law-group > summary::-webkit-details-marker {
  display: none;
}

.law-category-title,
.tracked-law-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  background: rgba(23, 32, 51, 0.05);
}

.law-category-title strong,
.tracked-law-title strong {
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.law-category-title span,
.tracked-law-title span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: white;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px var(--line);
  white-space: nowrap;
}

.law-category-body {
  display: grid;
  gap: 9px;
  padding: 10px;
}

.tracked-law-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.tracked-law-item {
  margin-bottom: 0;
}

@media (max-width: 390px) {
  #workSection .section-head {
    gap: 10px;
  }

  #workSection .section-head .status-chip {
    margin-left: 0;
    order: 3;
  }

  #workSection .section-head h3 {
    font-size: 15px;
    max-width: 100%;
  }

  .law-category-title strong,
  .tracked-law-title strong {
    font-size: 12.5px;
  }

  .law-category-title span,
  .tracked-law-title span {
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  .law-category-title,
  .tracked-law-title {
    padding: 10px 11px;
  }

  .law-category-body,
  .tracked-law-list {
    padding: 9px;
  }
}
