:root {
  --portal-bg: #f6f1e8;
  --portal-card: #ffffff;
  --portal-line: #e2d9c8;
  --portal-text: #1f1a15;
  --portal-subtle: #746757;
  --portal-blue: #0f5f5b;
  --portal-blue-soft: #e4f1ef;
  --portal-gold: #ca8b2c;
}

body.portal-body {
  background:
    radial-gradient(circle at top left, rgba(15, 95, 91, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(202, 139, 44, 0.12), transparent 24%),
    var(--portal-bg);
  color: var(--portal-text);
  font-family: "IBM Plex Sans JP", sans-serif;
}

.portal-frame {
  max-width: 100%;
}

.portal-sidebar {
  background: linear-gradient(180deg, #faf6ef 0%, #f1e9dc 100%);
  border-right: 1px solid var(--portal-line);
  transition: width 0.2s ease, flex-basis 0.2s ease, max-width 0.2s ease;
  z-index: 10;
}

.portal-main {
  min-height: 100vh;
  transition: width 0.2s ease, margin 0.2s ease;
}

.portal-sidebar-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.portal-main-inner {
  max-width: 1480px;
}

.portal-mobile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem 0;
}

.portal-icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--portal-line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--portal-blue);
}

body.sidebar-collapsed .portal-sidebar {
  max-width: 86px;
  flex: 0 0 86px;
}

body.sidebar-collapsed .portal-sidebar h1,
body.sidebar-collapsed .portal-sidebar p,
body.sidebar-collapsed .portal-sidebar .portal-user > div,
body.sidebar-collapsed .portal-sidebar .nav-link,
body.sidebar-collapsed .portal-sidebar .btn-sm {
  overflow: hidden;
}

body.sidebar-collapsed .portal-sidebar .nav-link {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .portal-sidebar h1,
body.sidebar-collapsed .portal-sidebar p,
body.sidebar-collapsed .portal-sidebar .portal-user > div {
  display: none;
}

body.sidebar-collapsed .portal-sidebar .small.text-uppercase {
  font-size: 0;
}

.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  color: var(--portal-text);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--portal-line);
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.portal-nav-icon {
  width: 18px;
  text-align: center;
  color: var(--portal-blue);
}

body.sidebar-collapsed .portal-sidebar .portal-nav-text {
  display: none;
}

body.sidebar-collapsed .portal-sidebar .portal-nav-icon {
  width: auto;
  margin: 0;
  font-size: 1rem;
}

.portal-nav-link:hover {
  background: var(--portal-blue-soft);
  color: var(--portal-blue);
  border-color: rgba(15, 95, 91, 0.3);
  box-shadow: 0 10px 24px rgba(15, 95, 91, 0.08);
  transform: translateX(2px);
}

.portal-nav-link.is-active {
  background: var(--portal-blue);
  color: #fff;
  border-color: var(--portal-blue);
  box-shadow: 0 10px 24px rgba(15, 95, 91, 0.18);
}

.portal-nav-link.is-active .portal-nav-icon {
  color: #fff;
}

.tiny-kicker {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--portal-blue);
  font-weight: 700;
}

.hero-title,
.section-hero,
.section-title {
  font-family: "Fraunces", serif;
  letter-spacing: -0.03em;
}

.hero-title {
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.02;
}

.section-hero {
  font-size: clamp(1.9rem, 3vw, 2.8rem);
}

.section-title {
  font-size: 1.5rem;
}

.hero-copy {
  font-size: 1.08rem;
  color: var(--portal-subtle);
  max-width: 44rem;
}

.portal-user {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--portal-line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.portal-user img {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
}

.portal-card {
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(19, 32, 51, 0.08);
}

.visual-grid {
  display: grid;
  gap: 16px;
}

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

.visual-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.visual-card {
  border: 1px solid var(--portal-line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(249,244,236,0.96));
  padding: 18px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.hover-lift:hover {
  border-color: rgba(15, 95, 91, 0.28);
  box-shadow: 0 12px 28px rgba(15, 95, 91, 0.1);
  transform: translateY(-2px);
}

a.visual-card:hover,
a.server-card:hover {
  border-color: rgba(15, 95, 91, 0.28);
  box-shadow: 0 12px 28px rgba(15, 95, 91, 0.1);
  transform: translateY(-2px);
}

.visual-card .badge {
  margin-bottom: 10px;
}

.visual-card h3,
.visual-card h4 {
  font-family: "Fraunces", serif;
  margin-bottom: 0.5rem;
}

.visual-card p {
  color: var(--portal-subtle);
  margin-bottom: 0;
}

.cta-meta {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 0.88rem;
  color: var(--portal-blue);
  font-weight: 600;
}

.cta-meta i {
  color: var(--portal-gold);
}

.cta-meta-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 95, 91, 0.08);
  color: var(--portal-blue);
  border: 1px solid rgba(15, 95, 91, 0.14);
  font-size: 0.78rem;
  font-weight: 700;
}

.journey-step {
  position: relative;
  padding-left: 68px;
  min-height: 56px;
}

.journey-step::before {
  content: attr(data-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--portal-blue-soft);
  color: var(--portal-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.journey-step + .journey-step {
  border-top: 1px dashed var(--portal-line);
  padding-top: 18px;
}

.comparison-table th {
  background: #fcf8f0;
  white-space: nowrap;
}

.comparison-row {
  transition: background 0.14s ease;
}

.comparison-row:hover td {
  background: rgba(15, 95, 91, 0.05);
}

.comparison-table td,
.comparison-table th {
  border-color: var(--portal-line);
  vertical-align: top;
}

.comparison-table td strong {
  display: block;
  margin-bottom: 0.35rem;
}

.accordion-item.portal-card {
  overflow: hidden;
}

.accordion-button {
  background: #fffaf2;
  color: var(--portal-text);
  box-shadow: none !important;
  font-weight: 700;
}

.accordion-button:not(.collapsed) {
  background: var(--portal-blue-soft);
  color: var(--portal-blue);
}

.comparison-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--portal-line);
  background: rgba(255,255,255,0.8);
  color: var(--portal-subtle);
  font-size: 0.9rem;
}

.comparison-chip.is-strong {
  background: var(--portal-blue-soft);
  color: var(--portal-blue);
  border-color: rgba(15, 95, 91, 0.2);
}

.comparison-help,
.info-tip {
  color: var(--portal-blue);
  opacity: 0.72;
  font-size: 0.95rem;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.visual-card:hover .info-tip,
.comparison-table th:hover .comparison-help {
  opacity: 1;
  transform: scale(1.05);
}

.tooltip.portal-tooltip .tooltip-inner {
  max-width: 280px;
  text-align: left;
  background: #1f1a15;
  color: #fff8f1;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  box-shadow: 0 14px 32px rgba(19, 32, 51, 0.16);
}

.tooltip.portal-tooltip .tooltip-arrow::before {
  border-top-color: #1f1a15;
}

.summary-band {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-card-lg {
  min-height: 100%;
  background:
    linear-gradient(135deg, rgba(15, 95, 91, 0.06), rgba(255, 255, 255, 0) 35%),
    linear-gradient(135deg, #ffffff 0%, #f8f5ef 100%);
}

.promo-card {
  background: linear-gradient(145deg, #fff8ea 0%, #f6ead5 100%);
}

.gold-wash {
  border: 1px solid rgba(202, 139, 44, 0.24) !important;
}

.hero-spotlight {
  position: relative;
  overflow: hidden;
}

.hero-spotlight::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -60px;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(202, 139, 44, 0.18), transparent 70%);
  pointer-events: none;
}

.callout-card {
  background: linear-gradient(180deg, #fffdf7 0%, #f9f3e7 100%);
}

.portal-btn-primary {
  background: var(--portal-blue);
  border-color: var(--portal-blue);
  color: #fff;
  border-radius: 999px;
  padding-inline: 1.4rem;
}

.portal-btn-primary:hover {
  background: #0b4f4c;
  border-color: #0b4f4c;
  color: #fff;
}

.portal-btn-secondary {
  border-radius: 999px;
  padding-inline: 1.4rem;
  border-color: rgba(15, 95, 91, 0.2);
  color: var(--portal-blue);
  background: rgba(255, 255, 255, 0.7);
}

.portal-list {
  display: grid;
  gap: 14px;
}

.portal-list > div,
.server-card,
.history-row,
.empty-state,
.step-pill,
.locked-row {
  border: 1px solid var(--portal-line);
  border-radius: 18px;
  background: #fff;
}

.portal-list > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.portal-list i {
  color: var(--portal-blue);
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.step-pill span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--portal-blue-soft);
  color: var(--portal-blue);
  font-weight: 700;
}

.step-pill.is-done span {
  background: #dff5e6;
  color: #157347;
}

.portal-stat {
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(19, 32, 51, 0.08);
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
}

.stat-label {
  color: var(--portal-subtle);
  font-size: 0.875rem;
}

.server-card {
  display: block;
  padding: 18px;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.server-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(36, 87, 255, 0.1);
}

.progress-note {
  color: var(--portal-blue);
  font-size: 0.9rem;
  font-weight: 600;
}

.empty-state {
  padding: 18px;
  color: var(--portal-subtle);
}

.locked-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.locked-row i {
  color: #a97700;
}

.unlocked-row i {
  color: var(--portal-blue);
}

.locked-feature {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(202, 139, 44, 0.35);
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdf7 0%, #f7ecd7 100%);
  padding: 15px 16px;
  display: grid;
  gap: 4px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.locked-feature:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(120, 91, 28, 0.12);
  border-color: rgba(202, 139, 44, 0.55);
}

.locked-feature span {
  font-weight: 700;
  color: var(--portal-text);
}

.locked-feature i {
  color: #a97700;
  margin-right: 0.35rem;
}

.locked-feature small {
  color: var(--portal-subtle);
}

.schedule-shell {
  border: 1px solid var(--portal-line);
  border-radius: 20px;
  padding: 18px;
  background: #fbfdff;
}

.template-area {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.preview-box {
  background: #f7f9fc;
  border: 1px dashed #bfd0e6;
  border-radius: 18px;
  padding: 16px;
  white-space: pre-wrap;
  margin: 0;
}

.history-row {
  padding: 14px 16px;
}

.portal-tabs {
  gap: 0.5rem;
  border-bottom: none;
}

.portal-tabs .nav-link {
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  color: var(--portal-subtle);
  background: #fff;
}

.portal-tabs .nav-link.active {
  background: var(--portal-blue);
  color: #fff;
  border-color: var(--portal-blue);
}

.info-strip {
  border: 1px solid var(--portal-line);
  border-radius: 18px;
  padding: 16px;
  background: #fbf8f1;
  color: var(--portal-subtle);
}

.pro-panel {
  display: grid;
  gap: 12px;
}

.portal-modal {
  border: 0;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(202, 139, 44, 0.18), transparent 30%),
    linear-gradient(180deg, #fffdf7 0%, #fbf4e7 100%);
  box-shadow: 0 22px 60px rgba(19, 32, 51, 0.16);
}

@media (max-width: 991px) {
  .portal-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--portal-line);
    position: static;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .portal-sidebar-inner {
    position: static;
    height: auto;
    overflow: visible;
  }

  .visual-grid.cols-3,
  .visual-grid.cols-4 {
    grid-template-columns: 1fr;
  }
}
