:root {
  --ink: #10243e;
  --brand: #0d47a1;
  --brand-2: #1565c0;
  --accent: #e85d04;
  --mint: #0f766e;
  --bg: #eef3f9;
  --card: #ffffff;
  --line: #d7e2ef;
  --muted: #5c6b80;
  --ok: #0f766e;
  --warn: #b45309;
  --shadow: 0 18px 40px rgba(16, 36, 62, 0.08);
}

.portal {
  font-family: Manrope, Inter, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(232, 93, 4, 0.12), transparent 55%),
    radial-gradient(900px 380px at 100% 0%, rgba(13, 71, 161, 0.16), transparent 50%),
    var(--bg);
  min-height: 70vh;
}

.portal-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 20px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  align-items: center;
}

.portal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
  border-radius: 999px;
  padding: 6px 12px;
}

.portal-hero h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 620;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.08;
  margin: 14px 0 10px;
  color: var(--ink);
}

.portal-hero h1 span { color: var(--accent); }

.portal-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}

.portal-intro {
  padding-bottom: 18px;
}
.crumbs { margin: 0 0 10px; color: var(--muted); font-size: 14px; font-weight: 700; }
.crumbs a { color: #312E81; text-decoration: none; }
.crumbs span { margin: 0 6px; }
.crumbs { margin: 0 0 10px; color: var(--muted); font-size: 14px; font-weight: 700; }
.crumbs a { color: #312E81; text-decoration: none; }
.crumbs span { margin: 0 6px; }

.intro-copy h1 span {
  color: #4338CA;
}

.feature-marquee {
  max-width: 1180px;
  margin: 0 auto 8px;
  padding: 0 20px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.feature-track {
  display: flex;
  width: max-content;
  animation: feature-slide 42s linear infinite;
}

.feature-set {
  display: flex;
  gap: 12px;
  padding-right: 12px;
}

.feature-marquee:hover .feature-track,
.feature-marquee:focus-within .feature-track {
  animation-play-state: paused;
}

.seo-places {
  max-width: 1180px;
  margin: 4px auto 16px;
  padding: 0 20px;
}
.seo-places h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.seo-places ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.seo-places a { color: #312e81; font-weight: 700; }

.feature-track span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #DBEAFE;
  color: #312E81;
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(49, 46, 129, 0.06);
}

.feature-track span::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: #38BDF8;
  box-shadow: 0 0 0 4px #DBEAFE;
}

@keyframes feature-slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .feature-track { animation: none; flex-wrap: wrap; width: auto; }
  .feature-marquee { mask-image: none; }
  .feature-set[aria-hidden="true"] { display: none; }
}

.portal-app {
  max-width: 1180px;
  margin: 18px auto 40px;
  padding: 0 20px 20px;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 18px;
  align-items: start;
}

.portal-side,
.portal-work {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.portal-side { padding: 16px; position: sticky; top: 88px; }
.tool-btn { transition: background 0.2s ease, transform 0.2s ease; }
.tool-btn:hover { transform: translateX(3px); }
.hero-result, .portal-work, .portal-side { animation: riseIn 0.45s ease both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.portal-work { padding: 22px; min-height: 640px; }
html.is-pane .portal-hero,
html.is-pane .feature-marquee,
html.is-pane .seo-places,
html.is-pane #header,
html.is-pane #footer,
html.is-pane .portal-side { display: none !important; }
html.is-pane .portal-app { display: block; max-width: none; margin: 0; padding: 0; }
html.is-pane .portal-work { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
html.is-pane #slc-consent { display: none !important; }
body.is-board .portal-app { display: block; }
body.is-board .portal-side { display: none; }
body.is-board .portal-work { min-height: 0; }
.board-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 16px; }
.board-head h2 { margin: 0 0 6px; font-family: Fraunces, Georgia, serif; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.board-head p { margin: 0; color: var(--muted); }
.board-head input { min-width: min(280px, 100%); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font: inherit; }
.calc-fold { margin: 0 0 14px; padding: 14px; border: 1px solid hsl(var(--hue) 60% 88%); border-radius: 24px; background: linear-gradient(180deg, hsl(var(--hue) 90% 97%), #fff 70%); }
.calc-fold summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.calc-fold summary::-webkit-details-marker { display: none; }
.calc-fold summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid #4338ca; border-bottom: 2px solid #4338ca; transform: rotate(-45deg); }
.calc-fold[open] summary::after { transform: rotate(45deg); }
.calc-fold summary strong { display: block; }
.calc-fold summary small { color: var(--muted); }
.calc-fold summary b { background: #fff; border-radius: 999px; min-width: 28px; text-align: center; padding: 3px 8px; color: hsl(var(--hue) 50% 36%); }
.calc-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, hsl(var(--hue) 85% 58%), hsl(calc(var(--hue) + 24) 80% 46%)); }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 14px; }
.calc-card { position: relative; display: grid; gap: 8px; align-content: start; min-height: 176px; padding: 16px; border-radius: 22px; border: 1px solid hsl(var(--hue) 50% 88%); background: radial-gradient(140px 90px at 100% 0%, hsl(var(--hue) 95% 92%), transparent 70%), #fff; box-shadow: 0 14px 28px hsl(var(--hue) 40% 40% / 0.1); cursor: pointer; }
.calc-card:hover { transform: translateY(-4px); }
.calc-card strong { line-height: 1.3; }
.calc-card small { color: var(--muted); }
.calc-place { justify-self: start; font-style: normal; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: hsl(var(--hue) 45% 28%); background: hsl(var(--hue) 90% 94%); border-radius: 999px; padding: 4px 8px; }
.work-head .calc-place { margin-bottom: 8px; }
.board-glyph { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(145deg, hsl(var(--hue) 92% 64%), hsl(calc(var(--hue) + 32) 86% 46%)); box-shadow: 0 12px 22px hsl(var(--hue) 70% 42% / 0.3); }
.board-glyph img { width: 54px; height: 54px; object-fit: contain; }
.fav-star, .work-tools .fav-star { width: 40px; height: 40px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; color: #94a3b8; display: inline-grid; place-items: center; cursor: pointer; }
.calc-card .fav-star { position: absolute; top: 12px; right: 12px; }
.fav-star svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.fav-star.is-on { color: #f59e0b; background: #fffbeb; border-color: #fcd34d; }
.fav-star.is-on svg { fill: currentColor; }
.work-tools { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.board-back { border: 0; background: #eef2ff; color: #4338ca; font: inherit; font-weight: 800; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
@media (max-width: 720px) { .board-head { display: grid; } }

.portal-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: #f7fafc;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  margin-bottom: 12px;
}

.portal-search:focus { outline: 2px solid rgba(13, 71, 161, 0.25); border-color: var(--brand); }

#catalog {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding: 2px 4px 8px 0;
  scrollbar-width: thin;
}

.cat-card {
  border: 1px solid #6f74d4;
  border-radius: 18px;
  background: linear-gradient(145deg, #cac7f0 0%, #aaa8ea 48%, #8282e3 100%);
  color: #1e1b4b;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 24px rgba(67, 56, 202, 0.1);
  animation: catRise 0.5s ease both;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.cat-card:nth-child(2) { animation-delay: 0.05s; }
.cat-card:nth-child(3) { animation-delay: 0.1s; }
.cat-card:nth-child(4) { animation-delay: 0.15s; }
.cat-card:nth-child(5) { animation-delay: 0.2s; }
.cat-card:nth-child(6) { animation-delay: 0.25s; }
.cat-card:nth-child(7) { animation-delay: 0.3s; }
.cat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 46%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: translateX(-140%);
  pointer-events: none;
}
.cat-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -28px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 68%);
  pointer-events: none;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(67, 56, 202, 0.16); }
.cat-card:hover::before { animation: catSheen 0.75s ease; }
.cat-card.is-open { box-shadow: 0 14px 28px rgba(67, 56, 202, 0.14); }
@keyframes catRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes catSheen { from { transform: translateX(-140%); } to { transform: translateX(280%); } }

.cat-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 16px;
  gap: 10px;
  align-items: center;
  border: 0;
  background: transparent;
  color: #1e1b4b;
  font: inherit;
  text-align: left;
  padding: 12px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.cat-toggle:hover { background: rgba(255, 255, 255, 0.28); }
.cat-card.is-open .cat-toggle { background: rgba(255, 255, 255, 0.18); }

.cat-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #8f93e0;
  color: #312e81;
  font-size: 18px;
  transition: transform 0.35s ease;
}

.cat-card:hover .cat-mark,
.cat-card.is-open .cat-mark { transform: scale(1.08) rotate(-8deg); background: #e4e4fb; }
.cat-copy { min-width: 0; }
.cat-copy strong { display: block; font-size: 14.5px; letter-spacing: 0.01em; }
.cat-copy small { display: block; color: #312e81; font-size: 11px; line-height: 1.35; }

.cat-count {
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #8f93e0;
  color: #312e81;
  font-size: 12px;
  font-weight: 800;
}

.cat-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #312e81;
  border-bottom: 2px solid #312e81;
  transform: rotate(45deg);
  transition: transform 0.28s ease;
}

.cat-card.is-open .cat-chevron { transform: rotate(225deg); }

.cat-panel { display: none; }
.cat-card.is-open .cat-panel { display: block; }
.cat-panel-inner {
  display: grid;
  gap: 6px;
  margin: 0 8px 8px;
  padding: 8px;
  border-radius: 14px;
  background: #f8fafc;
  position: relative;
  z-index: 1;
}

.cat-card.is-open .tool-btn { animation: toolIn 0.35s ease both; }
@keyframes toolIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.tool-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink);
  font: inherit;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.tool-btn:hover { background: #fff; border-color: #c7d2fe; transform: translateX(4px); }
.tool-btn.active { background: #eef2ff; border-color: #6366f1; box-shadow: inset 3px 0 0 #4338ca; }
.tool-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eef4fb;
  flex: 0 0 auto;
  font-size: 16px;
}
.tool-btn strong { display: block; font-size: 13.5px; font-weight: 750; }
.tool-btn small { color: var(--muted); font-size: 12px; }
@media (prefers-reduced-motion: reduce) {
  .cat-card, .cat-card::before, .cat-mark, .tool-btn { animation: none; transition: none; }
}

.work-head h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 2rem;
  margin: 0 0 6px;
}
.work-head p { margin: 0 0 16px; color: var(--muted); }

.form-sections { display: grid; gap: 14px; }
.form-section {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 16px 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), #fff 42%),
    radial-gradient(420px 80px at 0% 0%, rgba(13, 71, 161, 0.08), transparent 60%);
  box-shadow: 0 10px 24px rgba(16, 36, 62, 0.05);
  animation: riseIn 0.5s ease both;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.form-section:hover {
  transform: translateY(-4px);
  border-color: #9eb6d6;
  box-shadow: 0 18px 36px rgba(16, 36, 62, 0.12);
}
.form-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.form-section-head h3 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.25rem;
}
.form-section-index {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: #0d47a1;
  flex: 0 0 auto;
}
.form-section:nth-child(3n+2) .form-section-index { background: #e85d04; }
.form-section:nth-child(3n) .form-section-index { background: #0f766e; }
.section-remove, .add-loan {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}
.section-remove {
  margin-left: auto;
  background: #fff1f2;
  color: #9f1239;
  border-radius: 999px;
  padding: 8px 12px;
}
.section-remove:hover { background: #ffe4e6; }
.add-loan {
  margin-top: 12px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  color: var(--brand);
  background: #fff;
  border: 1.5px dashed #9eb6d6;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.add-loan span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8f1fb;
}
.add-loan:hover { transform: translateY(-2px); background: #f4f8fc; border-color: var(--brand); }

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

.field { display: flex; flex-direction: column; gap: 6px; border-radius: 14px; padding: 8px; transition: transform 0.2s ease, background 0.2s ease; }
.field:hover { transform: translateY(-2px); background: rgba(232, 241, 251, 0.7); }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; color: #24364d; }
.field input, .field select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid rgba(13, 71, 161, 0.2); border-color: var(--brand); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
}
.choices input { display: none; }
.choices label:has(input:checked) {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn-main, .btn-ghost {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.btn-main { background: linear-gradient(135deg, var(--accent), #f48c06); color: #fff; }
.btn-ghost { background: #eef3f9; color: var(--ink); }

.results { margin-top: 18px; display: grid; gap: 12px; }
.hero-result {
  background: linear-gradient(135deg, #0d47a1, #16324f);
  color: #fff;
  border-radius: 18px;
  padding: 18px 18px 16px;
}
.hero-result span { opacity: 0.8; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.hero-result strong { display: block; font-size: clamp(1.6rem, 3vw, 2.3rem); margin-top: 4px; font-family: Fraunces, Georgia, serif; }

.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.result-card {
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.result-card b { display: block; font-size: 1.05rem; margin-top: 4px; }
.result-card span { color: var(--muted); font-size: 12px; font-weight: 700; }

.note {
  background: #fff8ef;
  border: 1px solid #f3d7b0;
  color: #7c4a12;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
}
.error {
  background: #fff1f1;
  border: 1px solid #fecaca;
  color: #9f1239;
  border-radius: 14px;
  padding: 12px 14px;
}

.table-wrap { overflow: auto; max-height: 360px; border: 1px solid var(--line); border-radius: 14px; }
.table-wrap.is-schedule { max-height: 520px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e8eef5; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { position: sticky; top: 0; background: #10243e; color: #fff; z-index: 1; }
tr.row-mora td { background: #e0f2fe; color: #0c4a6e; font-weight: 700; }
tr.row-mora-total td { background: #0369a1; color: #fff; font-weight: 800; }
tr.row-fy td { background: #ffedd5; color: #9a3412; font-weight: 800; }
tr.row-grand td { background: #0f766e; color: #fff; font-weight: 800; }

.welcome-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.welcome-tools div { background: #f7fafc; border-radius: 14px; padding: 12px; border: 1px solid var(--line); }
.welcome-tools strong { display: block; margin-bottom: 4px; }

.portal-band {
  max-width: 1180px;
  margin: 10px auto 10px;
  padding: 8px 20px 10px;
}
.portal-band-inner {
  background: linear-gradient(135deg, #10243e, #0d47a1 55%, #e85d04);
  color: #fff;
  border-radius: 22px;
  padding: 26px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: center;
}
.portal-band h2 { font-family: Fraunces, Georgia, serif; margin: 0 0 8px; font-size: 2rem; }
.portal-band p { margin: 0 0 14px; line-height: 1.55; }
.portal-band a.cta {
  display: inline-block;
  background: #fff;
  color: #10243e;
  text-decoration: none;
  font-weight: 800;
  border-radius: 12px;
  padding: 12px 16px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row a {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
}

.name-card {
  margin-bottom: 14px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #10243e, #0d47a1 62%, #e85d04);
  color: #fff;
  display: grid;
  gap: 6px;
  animation: riseIn 0.4s ease both;
}
.name-card label { font-weight: 800; font-size: 13px; letter-spacing: 0.03em; text-transform: uppercase; }
.name-card input {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.name-card input.need-name { outline: 3px solid #fecaca; }
.name-card small { color: rgba(255,255,255,0.82); font-size: 12px; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.4; }
.field input, .field select, .btn-main, .btn-ghost, .btn-pdf, .btn-xls { transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease; }
.field input:focus, .field select:focus { transform: translateY(-1px); }
.btn-main:hover, .btn-pdf:hover, .btn-xls:hover { transform: translateY(-2px); box-shadow: 0 10px 18px rgba(16, 36, 62, 0.16); }
.result-card { animation: riseIn 0.45s ease both; }
.schedule-head { margin-top: 6px; }
.schedule-head h3 { margin: 0 0 4px; font-family: Fraunces, Georgia, serif; font-size: 1.35rem; }
.schedule-head p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.report-box {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background:
    radial-gradient(420px 120px at 100% 0%, rgba(232, 93, 4, 0.18), transparent 60%),
    linear-gradient(180deg, #f8fbff, #fff);
  border: 1px solid var(--line);
  animation: riseIn 0.5s ease both;
}
.report-box h3 { margin: 0 0 4px; font-family: Fraunces, Georgia, serif; font-size: 1.35rem; }
.report-box p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 640px; }
.report-alert { color: #9f1239; font-weight: 800; min-height: 0; }
.report-alert:empty { display: none; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-pdf, .btn-xls {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
}
.btn-pdf { background: linear-gradient(135deg, #0d47a1, #16324f); }
.btn-xls { background: linear-gradient(135deg, #0f766e, #115e59); }

.result-panels { display: grid; gap: 14px; }
.result-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(16, 36, 62, 0.05);
  animation: riseIn 0.45s ease both;
}
.result-panel header { margin-bottom: 12px; }
.result-panel header small {
  display: inline-block;
  margin-bottom: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f1fb;
  color: #0d47a1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.result-panel h3 { margin: 0 0 8px; font-family: Fraunces, Georgia, serif; font-size: 1.45rem; }
.result-panel header span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.result-panel header strong { display: block; margin-top: 2px; color: #0d47a1; font-size: 1.35rem; }
.result-panel.is-summary {
  background:
    radial-gradient(420px 140px at 100% 0%, rgba(15, 118, 110, 0.16), transparent 55%),
    #f4fbfa;
  border-color: #b7e4df;
}
.result-panel.is-summary header small { background: #ccfbf1; color: #0f766e; }
.result-panel.is-summary header strong { color: #0f766e; }
.pie-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.pie-card {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
}
.pie-card svg { width: 148px; height: 148px; filter: drop-shadow(0 8px 14px rgba(13, 71, 161, 0.12)); animation: riseIn 0.55s ease both; }
.pie-card figcaption strong { display: block; margin-bottom: 8px; font-size: 14px; }
.pie-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pie-card li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; font-size: 13px; }
.pie-card li i { width: 12px; height: 12px; border-radius: 4px; grid-row: 1 / span 2; }
.pie-card li span { grid-column: 2; color: var(--muted); font-weight: 700; }
.pie-card li b { grid-column: 2; }
.pie-card li em { grid-column: 3; grid-row: 1 / span 2; font-style: normal; color: #0d47a1; font-weight: 800; }
@media (max-width: 640px) {
  .pie-card { grid-template-columns: 1fr; justify-items: center; }
}

.side-label { display: none; margin: 0 0 8px; color: #312E81; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
body.is-member .portal-hero,
body.is-member .feature-marquee,
body.is-member .seo-places { display: none; }
body.is-member .portal-side {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0 4px 8px 0;
  display: grid;
  gap: 12px;
  align-content: start;
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  scrollbar-width: thin;
}
body.is-member .side-label { display: block; }
body.is-member #tool-search,
body.is-member #catalog {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
body.is-member #tool-search { margin: 0; }
body.is-member #catalog {
  display: grid;
  gap: 10px;
  max-height: none;
  overflow: visible;
  padding: 8px;
}
.member-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(120px 80px at 100% 0%, rgba(56, 189, 248, 0.45), transparent 60%),
    linear-gradient(145deg, #312E81, #4338CA 62%, #6366F1);
  box-shadow: 0 16px 36px rgba(49, 46, 129, 0.28);
}
.member-badge {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-family: Fraunces, Georgia, serif;
  font-size: 22px;
}
.member-card strong { display: block; font-size: 1.05rem; }
.member-card small { display: block; margin-top: 2px; color: #DBEAFE; word-break: break-word; }
.member-card em {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  color: #312E81;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}
.member-nav { display: grid; gap: 6px; }
.member-nav a,
.member-nav button {
  width: 100%;
  border: 1px solid #DBEAFE;
  background: #fff;
  color: #312E81;
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.member-nav a:hover,
.member-nav button:hover { background: #EEF2FF; }
#member-home { background: #312E81; color: #fff; border-color: #312E81; }
#member-logout { color: #9F1239; border-color: #FBCFE8; }
.welcome-screen { display: grid; gap: 16px; }
.welcome-banner {
  padding: 28px 26px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(280px 140px at 100% 0%, rgba(56, 189, 248, 0.4), transparent 62%),
    linear-gradient(135deg, #1E1B4B, #4338CA 58%, #6366F1);
}
.welcome-banner h2 {
  margin: 12px 0 8px;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  font-weight: 620;
}
.welcome-banner p { margin: 0; max-width: 640px; color: #E0E7FF; line-height: 1.55; }
.welcome-banner .portal-kicker { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.24); }
.welcome-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.welcome-stat {
  padding: 16px;
  border-radius: 18px;
  background: #F8FAFC;
  border: 1px solid #DBEAFE;
}
.welcome-stat span { display: block; color: #64748B; font-size: 13px; font-weight: 800; }
.welcome-stat strong { display: block; margin-top: 6px; font-size: 1.25rem; color: #312E81; }
.welcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.welcome-card { padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.welcome-card h3, .welcome-jump h3 { margin: 0 0 10px; font-family: Fraunces, Georgia, serif; }
.welcome-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.welcome-card li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.welcome-card a { color: #312E81; font-weight: 800; text-decoration: none; }
.welcome-card time, .welcome-empty { color: #64748B; font-size: 13px; }
.welcome-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.welcome-chips a {
  text-decoration: none;
  color: #312E81;
  background: #EEF2FF;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
}
.welcome-jump p { margin: 12px 0 0; }
.welcome-jump a { color: #4338CA; font-weight: 800; }

@media (max-width: 900px) {
  .portal-app, .form-grid, .portal-band-inner, .welcome-tools, .welcome-stats, .welcome-grid, .report-box { grid-template-columns: 1fr; }
  .report-box { flex-direction: column; align-items: flex-start; }
  .portal-side, body.is-member .portal-side { position: static; max-height: none; overflow: visible; }
  #catalog, body.is-member #catalog { max-height: none; }
}

.work-head {
  position: relative;
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 28px;
  border: 1px solid #e4ecf6;
  background:
    radial-gradient(220px 120px at 0% 0%, rgba(232, 93, 4, 0.16), transparent 70%),
    radial-gradient(240px 140px at 100% 0%, rgba(79, 70, 229, 0.16), transparent 72%),
    linear-gradient(180deg, #fff, #f6f9ff);
  box-shadow: 0 18px 40px rgba(16, 36, 62, 0.07);
  animation: riseIn 0.45s ease both;
}
.work-head .fin-icon-work {
  border-radius: 26px;
  background: #fff;
  padding: 4px;
  filter: drop-shadow(0 14px 18px rgba(13, 71, 161, 0.18));
  animation: iconFloat 4.8s ease-in-out infinite;
}
@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.calc-sheet { display: grid; gap: 14px; }
.name-card {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(320px 140px at 100% 0%, rgba(251, 191, 36, 0.42), transparent 62%),
    linear-gradient(125deg, #0b1f3a, #0d47a1 48%, #3730a3);
  box-shadow: 0 18px 36px rgba(13, 71, 161, 0.28);
}
.name-card::before,
.name-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.name-card::before {
  width: 140px;
  height: 140px;
  right: -36px;
  top: -48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.name-card::after {
  inset: 0 auto 0 -45%;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  animation: cardSheen 5s ease-in-out infinite;
}
.name-card > * { position: relative; z-index: 1; }
@keyframes cardSheen {
  0% { transform: translateX(0); }
  55%, 100% { transform: translateX(420%); }
}
.name-card input {
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(8, 20, 40, 0.16);
}
.form-section {
  overflow: hidden;
  border: 1px solid #e5edf6;
  border-radius: 24px;
  padding: 16px 16px 14px 18px;
  background:
    radial-gradient(280px 90px at 100% 0%, rgba(99, 102, 241, 0.08), transparent 70%),
    linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 16px 34px rgba(16, 36, 62, 0.06);
}
.form-section::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #818cf8, #1d4ed8);
}
.form-section:nth-child(3n+2)::before { background: linear-gradient(180deg, #fdba74, #e85d04); }
.form-section:nth-child(3n)::before { background: linear-gradient(180deg, #5eead4, #0f766e); }
.form-section:hover { transform: translateY(-3px); border-color: #c7d7ea; }
.form-section-index {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(145deg, #6366f1, #1d4ed8);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.28);
  animation: badgePop 0.5s cubic-bezier(0.2, 1.35, 0.4, 1) both;
}
.form-section:nth-child(3n+2) .form-section-index { background: linear-gradient(145deg, #fb923c, #c2410c); box-shadow: 0 10px 18px rgba(232, 93, 4, 0.28); }
.form-section:nth-child(3n) .form-section-index { background: linear-gradient(145deg, #2dd4bf, #0f766e); box-shadow: 0 10px 18px rgba(15, 118, 110, 0.28); }
@keyframes badgePop {
  from { opacity: 0; transform: scale(0.72); }
  to { opacity: 1; transform: none; }
}
.field { padding: 4px 2px; }
.field:hover { transform: none; background: transparent; }
.field label { font-size: 12.5px; letter-spacing: 0.02em; color: #3b4d66; transition: color 0.2s ease; }
.field:focus-within label { color: #312e81; }
.field-box { position: relative; display: block; }
.field-box input,
.field-box select {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #d5e3f2;
  border-radius: 14px;
  padding: 13px 14px;
  background: #f7fbff;
  font-size: 1.02rem;
  font-weight: 750;
  box-shadow: inset 0 1px 0 #fff;
}
.field-box:focus-within input,
.field-box:focus-within select {
  background: #fff;
  border-color: #4f46e5;
  outline: none;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14), 0 12px 22px rgba(13, 71, 161, 0.08);
}
.field-hint { padding-left: 2px; }
.actions { margin-top: 2px; }
.btn-main, .btn-ghost { min-height: 54px; border-radius: 16px; }
.btn-main {
  position: relative;
  overflow: hidden;
  padding: 8px 22px 8px 10px;
  background: linear-gradient(135deg, #fb923c, #e85d04 48%, #c2410c);
  box-shadow: 0 14px 28px rgba(232, 93, 4, 0.34);
}
.btn-main::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -35%;
  width: 30%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: cardSheen 3.4s ease-in-out infinite;
}
.btn-ghost {
  background: #fff;
  color: #24364d;
  border: 1px solid #d7e2ef;
  box-shadow: 0 8px 16px rgba(16, 36, 62, 0.04);
}
.btn-ghost:hover { transform: translateY(-2px); background: #f8fafc; }
.add-loan {
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f5f8ff);
  border: 1.5px dashed #a5b4fc;
}
.hero-result {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(280px 140px at 100% 0%, rgba(56, 189, 248, 0.38), transparent 62%),
    linear-gradient(135deg, #0b1f3a, #0d47a1 58%, #312e81);
  box-shadow: 0 22px 40px rgba(13, 71, 161, 0.28);
}
.result-card {
  background: linear-gradient(180deg, #fff, #f7fbff);
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(16, 36, 62, 0.05);
}
@media (prefers-reduced-motion: reduce) {
  .work-head .fin-icon-work,
  .name-card::after,
  .btn-main::after,
  .form-section,
  .form-section-index,
  .result-card,
  .calc-wait span,
  .hero-result::after { animation: none; }
}

.results { display: grid; gap: 16px; margin-top: 8px; }
.calc-wait {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #e4ecf6;
  color: #312e81;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(16, 36, 62, 0.06);
}
.calc-wait span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #c7d2fe;
  border-top-color: #4f46e5;
  animation: spinWait 0.8s linear infinite;
}
@keyframes spinWait { to { transform: rotate(360deg); } }
.hero-result {
  padding: 22px 22px 20px;
  border-radius: 28px;
  box-shadow: 0 24px 48px rgba(13, 71, 161, 0.3);
}
.hero-result::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -40px;
  top: -60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}
.hero-result > div { position: relative; z-index: 1; }
.hero-result span { letter-spacing: 0.08em; }
.hero-result strong { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.03em; }
.hero-result .fin-icon-summary {
  position: relative;
  z-index: 1;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.14);
  padding: 6px;
}
.result-grid { gap: 12px; }
.result-card {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 14px;
  border: 1px solid #e5eef8;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 10px 22px rgba(16, 36, 62, 0.05);
}
.result-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
}
.result-card:nth-child(3n+2)::before { background: linear-gradient(90deg, #fb923c, #f59e0b); }
.result-card:nth-child(3n)::before { background: linear-gradient(90deg, #2dd4bf, #0f766e); }
.result-card span { letter-spacing: 0.04em; text-transform: uppercase; font-size: 11px; }
.result-card b { font-family: Fraunces, Georgia, serif; font-size: 1.35rem; font-weight: 620; color: #10243e; }
.result-panel {
  border-radius: 26px;
  padding: 18px;
  background:
    radial-gradient(320px 120px at 100% 0%, rgba(99, 102, 241, 0.1), transparent 60%),
    #fff;
  box-shadow: 0 16px 34px rgba(16, 36, 62, 0.06);
}
.result-panel header small { background: #eef2ff; color: #4338ca; }
.result-panel header strong { font-family: Fraunces, Georgia, serif; font-size: clamp(1.5rem, 2.4vw, 2rem); }
.breakdown-head, .schedule-head {
  padding: 14px 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #f7faff);
  border: 1px solid #e5eef8;
}
.table-wrap {
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(16, 36, 62, 0.06);
}
th { background: linear-gradient(180deg, #16324f, #0d47a1); letter-spacing: 0.03em; }
.report-box {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.8fr);
  gap: 22px;
  align-items: stretch;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid #dbe7f5;
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(99, 102, 241, 0.14), transparent 62%),
    radial-gradient(360px 160px at 100% 100%, rgba(15, 118, 110, 0.12), transparent 60%),
    linear-gradient(180deg, #fff, #f6f9ff);
  box-shadow: 0 22px 44px rgba(16, 36, 62, 0.08);
}
.report-kicker {
  margin: 0 0 6px;
  color: #4338ca;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.report-box h3 { font-size: 1.7rem; }
.report-marks .fin-icon {
  width: 72px;
  height: 72px;
  padding: 6px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(16, 36, 62, 0.08);
}
.report-actions { display: grid; gap: 10px; align-content: center; }
.btn-pdf, .btn-xls {
  position: relative;
  overflow: hidden;
  min-height: 64px;
  justify-content: flex-start;
  gap: 12px;
  padding: 8px 16px;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(16, 36, 62, 0.12);
}
.btn-pdf span, .btn-xls span { display: grid; text-align: left; line-height: 1.15; }
.btn-pdf small, .btn-xls small { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 800; opacity: 0.82; }
.btn-pdf { background: linear-gradient(135deg, #1d4ed8, #0b1f3a); }
.btn-xls { background: linear-gradient(135deg, #0f766e, #115e59); }
.save-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e4ecf6;
  box-shadow: 0 8px 18px rgba(16, 36, 62, 0.05);
}
.save-card label { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: #4338ca; }
.save-card input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #d5e3f2;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: #f8fbff;
}
.save-card button {
  border: 0;
  border-radius: 12px;
  min-height: 42px;
  background: #eef2ff;
  color: #312e81;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.save-card button:hover { background: #e0e7ff; }
@media (max-width: 900px) {
  .report-box { grid-template-columns: 1fr; }
}
