/* 쇠스랑 상위 포털 — 밭의 이랑과 편집 지면에서 가져온 시각 언어. */

.portal-page,
.portal-policy-service {
  --portal-ink: #202522;
  --portal-paper: #ffffff;
  --portal-green: #168b52;
  --portal-green-deep: #0d6f40;
  --bg: var(--portal-paper);
  --surface: #ffffff;
  --surface-muted: #f5f8f6;
  --text: var(--portal-ink);
  --text-muted: #68716c;
  --line: #e7eae8;
  --line-strong: #d3d9d5;
  --accent: var(--portal-green);
  --accent-hover: var(--portal-green-deep);
  --accent-soft: #eaf7f0;
  min-height: 100dvh;
  background: var(--portal-paper);
  color: var(--portal-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", helvetica, "Apple SD Gothic Neo", sans-serif;
}

/* Home editorial split: weekly issues + daily briefing */
.portal-home .portal-main {
  padding-top: clamp(2.25rem, 3.5vw, 3.25rem);
}

.portal-home .portal-ai-entry {
  margin-bottom: clamp(2.5rem, 4vw, 3.25rem);
}

.portal-editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: start;
}

.portal-weekly-issues,
.portal-daily-briefing {
  min-width: 0;
  padding-top: 1.125rem;
  border-top: 1px solid var(--line-strong);
}

.portal-weekly-issues {
  padding-right: clamp(2rem, 4.5vw, 4.5rem);
}

.portal-daily-briefing {
  padding-left: clamp(2rem, 4.5vw, 4.5rem);
  border-left: 1px solid var(--line);
}

.portal-editorial-heading {
  display: flex;
  align-items: baseline;
  gap: 0.62rem;
  min-height: 1.75rem;
  margin-bottom: clamp(1.5rem, 2.8vw, 2.25rem);
}

.portal-briefing-date {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.portal-briefing-date[hidden] {
  display: none;
}

.portal-editorial-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.portal-editorial-heading h2 span {
  margin-left: 0.25rem;
  color: var(--accent);
  font-size: 0.72em;
  font-weight: 750;
  letter-spacing: 0;
}

.portal-weekly-issues .portal-policy-preview {
  min-height: 25rem;
  margin-top: 0;
  border-top: 0;
}

.portal-weekly-issues .portal-preview-list {
  margin: 0;
}

.portal-weekly-issues .portal-preview-item:first-child {
  border-top: 1px solid var(--line);
}

.portal-weekly-issues .portal-editorial-issue {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 1.05rem 0 1.1rem;
}

.portal-editorial-marker {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  padding-top: 0.08rem;
}

.portal-editorial-rank {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.portal-weekly-issues .portal-preview-status {
  color: var(--text-muted);
  font-size: 0.63rem;
  font-weight: 650;
}

.portal-weekly-issues .portal-preview-title {
  font-size: 0.92rem;
  line-height: 1.48;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.portal-weekly-issues .portal-preview-summary {
  margin-top: 0.42rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.58;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.portal-weekly-issues .portal-preview-copy {
  min-width: 0;
}

.portal-briefing-title {
  max-width: 19em;
  margin: 0 0 1.8rem;
  color: var(--text);
  font-size: clamp(1.45rem, 2.3vw, 2.05rem);
  font-weight: 760;
  line-height: 1.33;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.portal-briefing-skeleton {
  display: grid;
  max-width: 43rem;
  gap: 0.85rem;
  padding-top: 0.2rem;
}

.portal-briefing-skeleton span {
  height: 0.72rem;
  border-radius: 2px;
  background: linear-gradient(90deg, #f0f3f1 15%, #fafbfa 45%, #f0f3f1 75%) 0 0 / 220% 100%;
  animation: portal-skeleton 1.4s ease-in-out infinite;
}

.portal-briefing-skeleton span:first-child {
  width: 82%;
  height: 1.8rem;
  margin-bottom: 1.15rem;
}

.portal-briefing-skeleton span:nth-child(2) { width: 100%; }
.portal-briefing-skeleton span:nth-child(3) { width: 94%; }
.portal-briefing-skeleton span:nth-child(4) { width: 68%; }

.portal-briefing-skeleton[hidden],
.portal-briefing-title[hidden],
.portal-briefing-body[hidden] {
  display: none;
}

.portal-daily-briefing .portal-briefing-body {
  max-width: 43rem;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.9;
  letter-spacing: -0.015em;
}

.portal-daily-briefing .portal-briefing-body p {
  margin: 0;
}

.portal-daily-briefing .portal-briefing-body p + p {
  margin-top: 1.15rem;
}

@media (max-width: 880px) {
  .portal-editorial-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-weekly-issues {
    padding-right: 0;
  }

  .portal-daily-briefing {
    margin-top: 3.25rem;
    padding-left: 0;
    border-left: 0;
  }

  .portal-weekly-issues .portal-policy-preview {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .portal-home .portal-main {
    padding-top: 1.75rem;
  }

  .portal-home .portal-ai-entry {
    margin-bottom: 2.25rem;
  }

  .portal-editorial-heading {
    margin-bottom: 1.1rem;
  }

  .portal-weekly-issues .portal-editorial-issue {
    grid-template-columns: 1.9rem minmax(0, 1fr);
    gap: 0.72rem;
    padding: 0.9rem 0 0.95rem;
  }

  .portal-weekly-issues .portal-preview-summary {
    font-size: 0.74rem;
  }

  .portal-briefing-title {
    margin-bottom: 1.3rem;
    font-size: 1.38rem;
  }
}

.portal-page::before,
.portal-policy-service::before {
  display: none;
}

.portal-skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 9px 14px;
  transform: translateY(-160%);
  background: var(--portal-green-deep);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  transition: transform 180ms ease;
}

.portal-skip-link:focus { transform: translateY(0); }

.portal-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 0 38px 76px;
}

.portal-policy-service > .container {
  width: min(1280px, 100%);
  max-width: none;
  margin: 0 auto;
  padding: 0 38px 80px;
}

.portal-header {
  position: sticky;
  z-index: 8;
  top: 0;
  display: grid;
  min-height: 88px;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  column-gap: 24px;
  border-bottom: 1px solid var(--line-strong);
  background: #fff;
  isolation: isolate;
}

.portal-header.is-route-loading::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  transform: scaleX(0.12);
  transform-origin: left;
  animation: portal-route-progress 900ms cubic-bezier(0.2, 0.75, 0.25, 1) infinite alternate;
}

.portal-route-entering > :not(.portal-header) {
  animation: portal-route-enter 220ms ease-out both;
}

@keyframes portal-route-progress {
  to { transform: scaleX(0.78); }
}

@keyframes portal-route-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.portal-header-row {
  display: contents;
}

.portal-brand {
  display: inline-flex;
  grid-column: 1;
  grid-row: 1;
  align-items: center;
  gap: 13px;
  justify-self: start;
}

.portal-header-row .auth-controls {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.portal-brand-symbol {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid currentColor;
  color: var(--accent);
  font-family: inherit;
  font-size: 1.18rem;
  font-weight: 800;
  transform: rotate(-3deg);
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 240ms ease;
}

.portal-brand:hover .portal-brand-symbol,
.portal-brand:focus-visible .portal-brand-symbol {
  transform: rotate(0deg) translateY(-2px);
  background: rgb(22 139 82 / 0.07);
}

.portal-brand-copy { display: grid; gap: 3px; }

.portal-brand-copy strong {
  font-family: inherit;
  font-size: 1.48rem;
  line-height: 1;
  letter-spacing: -0.045em;
}

.portal-brand-copy small {
  color: var(--text-muted);
  font-size: 0.66rem;
  letter-spacing: 0.045em;
}

.portal-nav {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  justify-content: center;
  justify-self: center;
  gap: clamp(20px, 2.2vw, 32px);
  overflow-x: auto;
  scrollbar-width: none;
}

.portal-nav::-webkit-scrollbar { display: none; }

.portal-nav-link {
  position: relative;
  flex: 0 0 auto;
  padding: 34px 0 32px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 650;
  transition: color 180ms ease, transform 180ms ease;
}

.portal-nav-link:hover,
.portal-nav-link:focus-visible,
.portal-nav-link.active { color: var(--text); }
.portal-nav-link:active { transform: translateY(1px); }

.portal-nav-link.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
}

.portal-page :where(a, button):focus-visible,
.portal-policy-service :where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.portal-main { padding-top: clamp(48px, 6vw, 78px); }

/* 첫 화면 AI 진입 — 검색창의 익숙함과 쇠스랑의 편집 지면을 결합한다. */
.portal-ai-entry {
  max-width: 760px;
  margin: 0 auto clamp(64px, 8vw, 96px);
  text-align: center;
}

.portal-ai-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}


.portal-ai-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  padding: 5px 6px 5px 19px;
  border: 1.5px solid var(--accent);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 30px rgb(22 139 82 / 0.08);
  text-align: left;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.portal-ai-form:focus-within {
  box-shadow: 0 13px 36px rgb(22 139 82 / 0.13);
  transform: translateY(-1px);
}

.portal-ai-mark { display: grid; color: var(--accent); place-items: center; }

.portal-ai-form input {
  min-width: 0;
  padding: 11px 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: clamp(0.88rem, 1.1vw, 0.96rem);
  letter-spacing: -0.02em;
}

.portal-ai-form input::placeholder { color: #8a938e; opacity: 1; }

.portal-ai-form button[type="submit"] {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  gap: 8px;
  padding: 0 17px;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.portal-ai-form button[type="submit"]::before {
  position: absolute;
  z-index: -1;
  top: -55%;
  bottom: -55%;
  left: -45%;
  width: 34%;
  transform: translateX(0) rotate(14deg);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.38), transparent);
  content: "";
  animation: portal-ai-cta-highlight 3.8s ease-in-out infinite;
}

.portal-ai-form button[type="submit"]:hover {
  background: var(--accent-hover);
  box-shadow: 0 7px 18px rgb(13 111 64 / 0.2);
}

.portal-ai-form button[type="submit"]:active { transform: scale(0.98); }

@keyframes portal-ai-cta-highlight {
  0%, 48% { transform: translateX(0) rotate(14deg); opacity: 0; }
  56% { opacity: 1; }
  76% { transform: translateX(460%) rotate(14deg); opacity: 1; }
  77%, 100% { transform: translateX(460%) rotate(14deg); opacity: 0; }
}


.portal-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(270px, 0.5fr);
  align-items: end;
  gap: 48px;
  margin-bottom: clamp(42px, 6vw, 72px);
}

.portal-overview-title { min-width: 0; }

.portal-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.portal-overview h1 {
  max-width: 900px;
  margin: 0;
  font-family: inherit;
  font-size: clamp(1.95rem, 3.3vw, 3rem);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.portal-overview h1 em { color: var(--accent); font-style: normal; }
.portal-overview h1 span { display: inline; }

.portal-overview-note {
  padding: 18px 0 5px 20px;
  border-left: 1px solid var(--line-strong);
}

.portal-datestamp {
  display: grid;
  gap: 2px;
  margin: 0 0 28px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.portal-datestamp span { color: var(--text-muted); font-size: 0.66rem; font-weight: 500; }

.portal-overview-note > p:not(.portal-datestamp) {
  max-width: 34ch;
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.75;
  text-wrap: pretty;
}

.portal-overview-note > a {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
}

.portal-overview-note > a span,
.portal-feature-action span {
  display: inline-block;
  transition: transform 180ms ease;
}

.portal-overview-note > a:hover span,
.portal-overview-note > a:focus-visible span,
.portal-feature-action:hover span,
.portal-feature-action:focus-visible span { transform: translate(3px, -2px); }

.portal-briefing-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.45fr);
  gap: clamp(36px, 6vw, 78px);
  margin: -20px 0 clamp(54px, 7vw, 82px);
  padding: 30px 0 34px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.portal-briefing-copy[hidden] { display: none; }

.portal-briefing-body {
  max-width: 72ch;
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.9;
  letter-spacing: -0.018em;
}

.portal-briefing-body p { margin: 0 0 1.05em; text-wrap: pretty; }
.portal-briefing-body p:last-child { margin-bottom: 0; }

.portal-briefing-meta {
  align-self: start;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.69rem;
  line-height: 1.65;
}

.portal-briefing-meta > p { margin: 0 0 18px; }
.portal-briefing-sources { display: grid; gap: 9px; }
.portal-briefing-sources a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.portal-briefing-sources a:hover,
.portal-briefing-sources a:focus-visible { color: var(--accent); }

.portal-feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(280px, 0.72fr);
  column-gap: clamp(34px, 5vw, 68px);
  align-items: start;
}

.portal-feature {
  --feature-color: var(--accent);
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 24px 0 28px;
  border: 0;
  border-top: 1px solid var(--line-strong);
  background: transparent;
}

.portal-feature-policy {
  grid-row: 1 / span 3;
  padding: 29px clamp(12px, 2.5vw, 34px) 42px 0;
  border-top: 1px solid var(--line-strong);
}

.portal-feature-policy::after {
  position: absolute;
  right: 0;
  bottom: 5px;
  width: min(40vw, 410px);
  height: 150px;
  border: 1px solid rgb(22 139 82 / 0.13);
  border-radius: 50% 50% 0 0;
  content: "";
  clip-path: inset(0 0 58% 0);
  pointer-events: none;
}

.portal-feature-prices,
.portal-feature-land,
.portal-feature-weather { transition: padding-left 220ms ease, background-color 220ms ease; }

.portal-feature-prices:hover,
.portal-feature-land:hover,
.portal-feature-weather:hover {
  padding-left: 12px;
  background: linear-gradient(90deg, rgb(22 139 82 / 0.055), transparent 74%);
}

.portal-feature-heading {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.portal-feature-number {
  padding-top: 3px;
  color: var(--feature-color);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.portal-feature-label {
  margin: 0 0 5px;
  color: var(--feature-color);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.portal-feature h2 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(1.22rem, 1.8vw, 1.65rem);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.portal-feature-link,
.portal-feature-action {
  position: relative;
  z-index: 1;
  color: var(--feature-color);
  font-size: 0.77rem;
  font-weight: 750;
}

.portal-feature-link { padding-bottom: 3px; border-bottom: 1px solid currentColor; }

.portal-feature-description {
  position: relative;
  z-index: 1;
  max-width: 34ch;
  margin: 30px 0 22px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.portal-policy-preview {
  position: relative;
  z-index: 1;
  min-height: 228px;
  margin-top: 42px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.portal-preview-list { display: grid; width: 100%; margin: 0; padding: 0; list-style: none; }
.portal-preview-item { min-width: 0; padding: 0; border-bottom: 1px solid var(--line); }

.portal-preview-link {
  display: grid;
  grid-template-columns: minmax(112px, 0.24fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 22px;
  padding: 18px 6px 18px 0;
  transition: padding-left 180ms ease, color 180ms ease;
}

.portal-preview-link:hover,
.portal-preview-link:focus-visible { padding-left: 7px; }

.portal-preview-date {
  color: var(--text-muted);
  font-size: 0.69rem;
  font-variant-numeric: tabular-nums;
}

.portal-preview-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(0.93rem, 1.2vw, 1.07rem);
  line-height: 1.5;
  letter-spacing: -0.025em;
  text-wrap: pretty;
}

.portal-editorial-issue { align-items: start; }
.portal-editorial-issue-copy { min-width: 0; }
.portal-preview-summary {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.77rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.portal-preview-link:hover .portal-preview-title,
.portal-preview-link:focus-visible .portal-preview-title { color: var(--feature-color); }

.portal-preview-skeleton { display: grid; gap: 1px; }

.portal-preview-skeleton span {
  height: 73px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgb(22 139 82 / 0.04), rgb(255 255 255 / 0.42), rgb(22 139 82 / 0.04)) 0 50% / 210% 34px no-repeat;
  animation: portal-skeleton 1.4s ease-in-out infinite;
}

.portal-preview-state { display: grid; max-width: 460px; gap: 5px; padding: 30px 0; }
.portal-preview-state strong { color: var(--text); font-size: 0.95rem; }
.portal-preview-state span { line-height: 1.6; }
.portal-preview-state a { margin-top: 12px; justify-self: start; }
.portal-preview-state-error strong { color: #a23f3f; }

@keyframes portal-skeleton {
  from { background-position: 180% 50%; }
  to { background-position: -80% 50%; }
}

.portal-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 64px;
  padding-top: 21px;
  border-top: 1px solid var(--line-strong);
  color: var(--text-muted);
  font-size: 0.72rem;
}

.portal-footer p { margin: 0; }
.portal-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.portal-footer a { transition: color 180ms ease; }
.portal-footer a:hover, .portal-footer a:focus-visible { color: var(--accent); }

/* 농정모음 하위 서비스 */
.portal-policy-service .portal-header {
  margin-bottom: 14px;
}

/* Policy collection: neutral canvas outside, clear white cards inside. */
.policy-index-page {
  --policy-canvas: #f3f5f4;
  background: #fff;
}

.policy-index-page .portal-header {
  background: #fff;
  box-shadow: 0 0 0 100vmax #fff;
  clip-path: inset(0 -100vmax);
}

.policy-index-page .source-group {
  border-color: #dfe4e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(32 37 34 / 5%);
}

.policy-index-page .grouped-feed,
.policy-index-page .institution-grid {
  padding: 16px;
  border-radius: 10px;
  background: var(--policy-canvas);
}

@media (max-width: 640px) {
  .policy-index-page .grouped-feed,
  .policy-index-page .institution-grid {
    padding: 10px;
  }
}
.portal-policy-service .content-navigation { margin-top: 0; }

/* 데이터 연결 전인 하위 서비스 */
.portal-module-main { padding: clamp(48px, 6vw, 76px) 0 24px; }

.portal-module-header { display: grid; max-width: 800px; gap: 10px; }

.portal-module-header h1 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  font-weight: 750;
  line-height: 1.14;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.portal-module-header > p:last-child {
  max-width: 56ch;
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.75;
  text-wrap: pretty;
}

.portal-module-board {
  display: grid;
  grid-template-columns: 1.25fr 1fr 0.78fr;
  gap: clamp(18px, 3vw, 38px);
  margin-top: clamp(46px, 7vw, 82px);
}

.portal-module-panel {
  min-height: 175px;
  padding: 20px 0 26px;
  border: 0;
  border-top: 1px solid var(--line-strong);
  background: transparent;
}

.portal-module-panel strong {
  display: block;
  margin-bottom: 42px;
  color: var(--accent);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.portal-module-panel h2 {
  margin: 0 0 8px;
  font-family: inherit;
  font-size: 1.12rem;
  letter-spacing: -0.025em;
}

.portal-module-panel p {
  max-width: 31ch;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

/* AI 대화 화면 */
.ai-page { background: var(--portal-paper); }
.ai-shell { min-height: 100dvh; padding-bottom: 32px; }

.ai-main {
  display: grid;
  width: min(900px, 100%);
  min-height: calc(100dvh - 156px);
  margin: 0 auto;
  grid-template-rows: auto minmax(360px, 1fr) auto;
}

.ai-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 4px 16px;
}

.ai-heading h1 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.ai-home-link {
  flex: 0 0 auto;
  padding-bottom: 3px;
  border-bottom: 1px solid currentColor;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
}

.ai-conversation {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 28px;
  padding: 40px 0 34px;
}

.ai-welcome {
  width: min(680px, 100%);
  margin: auto;
  padding: 42px 0;
  text-align: center;
}

.ai-welcome-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 18px;
  color: var(--accent);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--accent-soft);
}

.ai-welcome h2 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 750;
  letter-spacing: -0.04em;
}

.ai-welcome > p {
  margin: 11px auto 30px;
  color: var(--text-muted);
  font-size: 0.83rem;
  line-height: 1.7;
}

.ai-welcome-suggestions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: left;
}

.ai-welcome-suggestions button {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.ai-welcome-suggestions button span { color: var(--accent); }
.ai-welcome-suggestions button:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
  color: var(--accent);
  transform: translateY(-2px);
}

.ai-message { display: grid; width: min(760px, 86%); gap: 6px; }
.ai-message-user { align-self: end; justify-items: end; }
.ai-message-assistant { width: min(820px, 100%); align-self: start; justify-items: start; }

.ai-message-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.67rem;
  font-weight: 750;
}

.ai-message-bubble {
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.ai-message-assistant .ai-message-bubble {
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ai-message-user .ai-message-bubble {
  border-color: var(--accent);
  border-radius: 20px 20px 6px 20px;
  background: var(--accent);
  color: #fff;
}

.ai-message-bubble p {
  margin: 0 0 0.8em;
  font-size: 0.9rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.ai-message-bubble > :first-child { margin-top: 0; }
.ai-message-bubble > :last-child { margin-bottom: 0; }
.ai-message-user .ai-message-bubble p { white-space: pre-wrap; }

.ai-message-bubble :where(h3, h4, h5, h6) {
  margin: 1.15em 0 0.48em;
  color: inherit;
  font-size: 1rem;
  line-height: 1.45;
  letter-spacing: -0.025em;
}

.ai-message-bubble :where(ul, ol) {
  margin: 0.55em 0 0.9em;
  padding-left: 1.35em;
  font-size: 0.9rem;
  line-height: 1.72;
}

.ai-message-bubble li + li { margin-top: 0.28em; }
.ai-message-bubble strong { font-weight: 800; }
.ai-message-bubble em { font-style: italic; }

.ai-message-bubble a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ai-message-bubble :not(pre) > code {
  padding: 0.12em 0.35em;
  background: var(--accent-soft);
  color: var(--portal-green-deep);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.86em;
}

.ai-message-bubble pre {
  max-width: 100%;
  margin: 0.8em 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: #17251d;
  color: #f5f4ed;
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: pre;
}

.ai-message-bubble pre code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

.ai-message-bubble blockquote {
  margin: 0.75em 0;
  padding: 0.2em 0 0.2em 0.9em;
  border-left: 2px solid var(--accent);
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.ai-message-provider {
  margin: 0;
  color: #818a85;
  font-size: 0.61rem;
}

.ai-answer-sources {
  width: 100%;
  margin-top: 8px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.ai-answer-sources-title {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.67rem;
  font-weight: 800;
}

.ai-answer-source-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: ai-source;
}

.ai-answer-source-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  align-items: baseline;
  counter-increment: ai-source;
  font-size: 0.75rem;
  line-height: 1.5;
}

.ai-answer-source-link {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-answer-source-link::before {
  content: counter(ai-source) ". ";
  color: var(--text-muted);
}

.ai-answer-source-link:hover { color: var(--accent); text-decoration: underline; }
.ai-answer-source-meta { color: var(--text-muted); font-size: 0.65rem; white-space: nowrap; }
.ai-google-search-entry { width: 100%; margin-top: 8px; overflow: hidden; }
.ai-web-search-state { margin: 2px 0 0; color: var(--text-muted); font-size: 0.62rem; }

.ai-thinking-dots { display: flex; gap: 5px; padding: 5px 2px; }
.ai-thinking-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: ai-thinking 1.1s ease-in-out infinite;
}
.ai-thinking-dots i:nth-child(2) { animation-delay: 120ms; }
.ai-thinking-dots i:nth-child(3) { animation-delay: 240ms; }

@keyframes ai-thinking {
  0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}

.ai-retry {
  margin-top: 13px;
  padding: 5px 0 2px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
}

.ai-composer-wrap {
  position: sticky;
  z-index: 2;
  bottom: 0;
  padding: 20px 0 3px;
  background: linear-gradient(transparent, var(--portal-paper) 28%);
}

.ai-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 62px;
  align-items: center;
  gap: 10px;
  padding: 8px 9px 8px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgb(22 139 82 / 0.1);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.ai-composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 10px 34px rgb(22 139 82 / 0.14);
}

.ai-composer textarea {
  display: block;
  width: 100%;
  height: 42px;
  min-height: 42px;
  max-height: 144px;
  padding: 10px 2px;
  resize: none;
  overflow-y: hidden;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  line-height: 22px;
}

.ai-composer textarea::placeholder { color: #89938e; opacity: 1; }

.ai-composer button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease;
}

.ai-composer button:hover { background: var(--accent-hover); }
.ai-composer button:active { transform: scale(0.94); }
.ai-composer button:disabled { cursor: wait; opacity: 0.52; }

.ai-disclaimer {
  margin: 8px 0 0;
  color: #7c8580;
  font-size: 0.62rem;
  text-align: center;
}

@media (max-width: 880px) {
  .portal-overview { grid-template-columns: 1fr; gap: 28px; }
  .portal-overview-note { max-width: 520px; }
  .portal-briefing-copy { grid-template-columns: 1fr; gap: 28px; }
  .portal-briefing-meta { max-width: 640px; padding: 18px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .portal-feature-grid { grid-template-columns: 1fr; }
  .portal-feature-policy { grid-row: auto; padding-right: 0; }
  .portal-feature-prices,
  .portal-feature-land,
  .portal-feature-weather { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; }
  .portal-feature-prices .portal-feature-heading,
  .portal-feature-land .portal-feature-heading,
  .portal-feature-weather .portal-feature-heading { grid-column: 1 / -1; }
  .portal-feature-description { margin: 12px 0 0 37px; }
  .portal-feature-action { align-self: end; }
}

@media (max-width: 1060px) {
  .portal-header {
    display: block;
    min-height: 0;
    padding-top: 14px;
    border-bottom: 0;
  }

  .portal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 14px;
  }

  .portal-nav {
    justify-content: flex-start;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
  }

  .portal-nav-link { padding: 15px 0 14px; }
}

@media (max-width: 720px) {
  .portal-shell { padding: 0 18px 54px; }
  .portal-policy-service > .container { padding: 0 18px 56px; }
  .portal-brand-symbol { width: 41px; height: 41px; }
  .portal-brand-copy strong { font-size: 1.34rem; }
  .portal-brand-copy small { display: none; }
  .portal-header-row .auth-controls { min-width: 0; margin-left: auto; }
  .portal-header-row .auth-login-button { padding: 7px 14px; }
  .portal-nav { gap: 22px; margin-right: -18px; margin-left: -18px; padding: 0 18px; }
  .portal-main { padding-top: 42px; }
  .portal-ai-entry { margin-bottom: 62px; text-align: left; }
  .portal-ai-form { min-height: 58px; gap: 7px; padding: 4px 5px 4px 14px; border-radius: 19px; }
  .portal-ai-mark svg { width: 20px; height: 20px; }
  .portal-ai-form input { padding: 11px 2px; font-size: 0.9rem; }
  .portal-ai-form button[type="submit"] { min-height: 48px; padding: 0 13px; border-radius: 14px; }
  .portal-ai-form button[type="submit"] span { display: inline; }
  .portal-overview { margin-bottom: 44px; }
  .portal-overview h1 { font-size: clamp(1.7rem, 7vw, 2.1rem); line-height: 1.2; overflow-wrap: anywhere; }
  .portal-overview h1 span,
  .portal-overview h1 em { display: block; }
  .portal-overview h1 br { display: none; }
  .portal-overview-note { padding-left: 15px; }
  .portal-datestamp { margin-bottom: 18px; }
  .portal-feature-policy { padding-bottom: 34px; }
  .portal-feature-heading { grid-template-columns: auto minmax(0, 1fr); }
  .portal-feature-link { grid-column: 2; justify-self: start; margin-top: 9px; }
  .portal-policy-preview { min-height: 216px; margin-top: 30px; }
  .portal-preview-link { grid-template-columns: 1fr; gap: 5px; padding: 15px 2px 16px 0; }
  .portal-preview-link:hover, .portal-preview-link:focus-visible { padding-left: 4px; }
  .portal-preview-title { font-size: 0.94rem; }
  .portal-feature-prices,
  .portal-feature-land,
  .portal-feature-weather { display: block; }
  .portal-feature-description { margin: 20px 0 18px 37px; }
  .portal-footer { flex-direction: column; margin-top: 50px; }
  .portal-module-board { grid-template-columns: 1fr; gap: 0; margin-top: 46px; }
  .portal-module-panel { min-height: 0; }
  .portal-module-panel strong { margin-bottom: 24px; }

  .ai-shell { padding-bottom: 16px; }
  .ai-main { min-height: calc(100dvh - 132px); grid-template-rows: auto minmax(300px, 1fr) auto; }
  .ai-heading { align-items: start; padding: 28px 0 15px; }
  .ai-heading h1 { font-size: 1.3rem; }
  .ai-conversation { gap: 22px; padding: 28px 0 24px; }
  .ai-welcome { padding: 22px 0; }
  .ai-welcome > p { max-width: 36ch; }
  .ai-welcome-suggestions { grid-template-columns: 1fr; }
  .ai-welcome-suggestions button { min-height: 56px; }
  .ai-message { width: 94%; }
  .ai-message-user .ai-message-bubble { padding: 14px 15px; }
  .ai-message-bubble p { font-size: 0.86rem; }
  .ai-composer { min-height: 58px; padding: 6px 7px 6px 16px; border-radius: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-preview-skeleton span,
  .portal-briefing-skeleton span { animation: none; }
  .ai-thinking-dots i { animation: none; opacity: 0.7; }
  .portal-ai-form { transition: none; }
  .portal-ai-form button[type="submit"]::before { animation: none; }
  .portal-header.is-route-loading::after,
  .portal-route-entering > :not(.portal-header) { animation: none; }
}
