:root {
  --bg: #e9eef3;
  --surface: #f7f8fa;
  --card: rgba(255, 255, 255, 0.92);
  --card-soft: #f1f4f7;
  --text: #111827;
  --muted: #6b7280;
  --muted2: #9ca3af;
  --navy: #172033;
  --navy2: #263852;
  --blue: #38577c;
  --gold: #d8b46a;
  --gold-soft: #fff4d8;
  --line: rgba(17, 24, 39, 0.08);
  --shadow: 0 18px 44px rgba(17, 24, 39, 0.12);
  --shadow-soft: 0 10px 26px rgba(17, 24, 39, 0.08);
}

* {
  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(216, 180, 106, 0.22), transparent 28%),
    radial-gradient(circle at 100% 8%, rgba(56, 87, 124, 0.2), transparent 30%),
    linear-gradient(145deg, #eef2f6 0%, #f8fafc 50%, #e6ecf2 100%);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

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

button {
  cursor: pointer;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: -18px -14px 14px;
  padding: 18px 14px 12px;
  background: linear-gradient(180deg, rgba(241,245,249,0.96), rgba(241,245,249,0.78));
  backdrop-filter: blur(18px);
}

.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;
  font-size: 24px;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: 27px;
  line-height: 1.18;
  letter-spacing: -0.055em;
}

h3 {
  margin-bottom: 0;
  font-size: 19px;
  letter-spacing: -0.045em;
}

.top-action {
  min-width: 58px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: white;
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}

.hero-card,
.card {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(circle at 92% 8%, rgba(216,180,106,0.22), transparent 32%),
    linear-gradient(145deg, #111827 0%, #263852 64%, #304866 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;
}

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

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

.brief-text {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  color: rgba(255,255,255,0.76);
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
}

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

.hero-stats div {
  min-height: 70px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.13);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.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.035em;
}

.card {
  padding: 18px;
  background: var(--card);
  backdrop-filter: blur(18px);
}

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

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #8a651e;
  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: 10px;
}

.guide-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 22px;
  background: var(--card-soft);
}

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

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

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

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

.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: 22px;
  background: var(--card-soft);
}

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

.weather-metrics strong {
  font-size: 17px;
  letter-spacing: -0.025em;
}

.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: 24px;
  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.05em;
}

.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: 22px;
  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: 0;
  border-radius: 14px;
  background: white;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px var(--line);
}

.quick-time-btn.active {
  background: var(--navy);
  color: white;
}

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

.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px;
  border-radius: 20px;
  background: var(--card-soft);
}

.item-main {
  min-width: 0;
}

.item-time {
  display: inline-flex;
  margin-right: 8px;
  color: var(--gold);
  font-weight: 900;
}

.item-title {
  color: var(--text);
  font-weight: 800;
  word-break: keep-all;
}

.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: 0;
  border-radius: 12px;
  padding: 0 10px;
  background: white;
  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: 18px;
  background: var(--card-soft);
}

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

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

.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);
}

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, 1fr);
  gap: 6px;
  width: min(410px, calc(100% - 24px));
  padding: 8px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 26px;
  background: rgba(255,255,255,0.88);
  box-shadow: 0 18px 48px rgba(17,24,39,0.18);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.bottom-nav-btn {
  min-height: 52px;
  border: 0;
  border-radius: 19px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.bottom-nav-btn span {
  display: block;
  margin-bottom: 3px;
  font-size: 17px;
}

.bottom-nav-btn strong {
  display: block;
  font-size: 11px;
}

.bottom-nav-btn.active {
  background: var(--navy);
  color: white;
}

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

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

  .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;
  }
}


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

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

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

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

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

.law-summary-grid div {
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(145deg, #f7f8fa, #edf2f7);
  box-shadow: inset 0 0 0 1px var(--line);
}

.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;
}

.law-tabs {
  display: grid;
  grid-template-columns: repeat(3, 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;
}

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

.law-panel {
  display: none;
}

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

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

.law-item {
  padding: 13px;
  border-radius: 20px;
  background: var(--card-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

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

.law-name {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.025em;
  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: 7px;
  margin-top: 10px;
}

.law-meta div {
  padding: 9px;
  border-radius: 14px;
  background: white;
}

.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(216, 180, 106, 0.42);
  background:
    linear-gradient(145deg, rgba(255, 244, 216, 0.78), rgba(247, 248, 250, 0.96));
}

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

.law-change-summary-box {
  margin-top: 12px;
  padding: 13px;
  border-radius: 17px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.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-next-step {
  margin-top: 9px;
  padding: 10px 12px;
  border-radius: 15px;
  background: rgba(23, 32, 51, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.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 span {
  margin-left: 5px;
  color: var(--muted2);
  font-size: 12px;
}


/* 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;
}
