/* ============================================================
   Modules — Hub / Spoke / Assessment Specific Styles
   Azure Portal Fluent UI — Enterprise Edition
   ============================================================ */

/* ============================================================
   Tier Section (Hub / Spoke resource config block)
   ============================================================ */
/* Seamless Tier Section */
.tier-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 24px;
    background: var(--bg-card);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tier-section:hover {
    border-color: var(--gray-200);
    box-shadow: var(--shadow-md);
}

/* Left accent stripe for tier sections — Red */
.tier-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--brand-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.tier-section.active::before {
    opacity: 1;
}

.tier-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.tier-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

 /* ── Home Module Features ─────────────────────────────── */
.support-item-hover:hover {
    transform: translateY(-4px);
}

.upcoming-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 6px 14px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    letter-spacing: 0.5px;
    transition: all var(--transition-fast);
}

.upcoming-tag:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ── Profile Module Styles ─────────────────────────────── */
#module-profile .card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

#module-profile .card:hover {
    box-shadow: var(--shadow-md);
}

.user-avatar-circle {
    box-shadow: 0 2px 8px rgba(224, 40, 47, 0.2);
    transition: transform 0.2s ease;
}

.top-bar-user:hover .user-avatar-circle {
    transform: scale(1.05);
}

#profileAvatarLarge {
    background: linear-gradient(135deg, var(--color-primary) 0%, #ff4d4d 100%) !important;
}

#saveProfileBtn, #changePwdBtn {
    padding: 0.75rem 1.5rem;
    font-weight: 700;
}

/* Responsiveness for Profile Grid */
@media (max-width: 992px) {
    #module-profile > .container > div {
        grid-template-columns: 1fr !important;
    }
}

.tier-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

/* ── Feature Section (sub-config panel) ─────────────────────── */
.feature-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 12px;
    background: var(--bg-body);
    position: relative;
    border-left: 3px solid var(--color-secondary);
}

[data-theme="dark"] .feature-section {
    background: var(--bg-card-hover);
    border-color: var(--border-color);
}

[data-theme="light"] .feature-section {
    background: #faf9f8;
    border-color: var(--border-color);
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.feature-title {
    font-weight: 600;
    font-size: var(--font-size-md);
    color: var(--text-primary);
    margin: 0;
}

.feature-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.feature-title-group .feature-icon {
    flex-shrink: 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* ============================================================
   Section Divider (Azure Portal pivot-like section separators)
   ============================================================ */
/* Seamless Section Divider */
.section-divider {
    display: flex;
    align-items: center;
    margin: 40px 0 24px;
    gap: 16px;
}

.divider-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand-secondary);
    white-space: nowrap;
}

.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-primary);
    flex-shrink: 0;
}

/* ============================================================
   Step Section Header — 단계 구분 (중앙 정렬 + 그래디언트 라인)
   ============================================================ */
.step-section-header {
    display: flex;
    align-items: center;
    margin: 2.5rem 0 1.5rem;
    gap: 0;
}

.step-section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to var(--_dir, right), transparent, var(--border-strong));
}

.step-section-line:last-child {
    --_dir: left;
}

.step-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
}

.step-section-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary);
    flex-shrink: 0;
}

/* ============================================================
   Category Label — 카테고리 대제목 (아이콘 + 텍스트 한줄)
   ============================================================ */
.category-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb, 220,36,31), 0.06), transparent);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.category-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
}

.category-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.category-hint {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

/* ============================================================
   Architecture Diagram (Mermaid container)
   ============================================================ */
/* Architecture Diagram — Seamless Style */
.diagram-container {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-top: 24px;
    overflow: auto;
    box-shadow: var(--shadow-sm);
}

/* Dark mode Mermaid override — Premium Dark */
[data-theme="dark"] .diagram-container {
    background: #1a1a1a;
    border-color: #333333;
}

/* 화살표 라인 — 밝게 */
[data-theme="dark"] .mermaid .edgePaths .path,
[data-theme="dark"] .mermaid path.path {
    stroke: #a0c4ff !important;
    stroke-width: 2px !important;
}

/* 화살표 머리 */
[data-theme="dark"] .mermaid marker path {
    fill: #a0c4ff !important;
    stroke: none !important;
}

/* 노드 상자 테두리 */
[data-theme="dark"] .mermaid .node rect,
[data-theme="dark"] .mermaid .node polygon,
[data-theme="dark"] .mermaid .node circle,
[data-theme="dark"] .mermaid .node rhombus {
    stroke: #5b7fae !important;
    stroke-width: 1.5px !important;
}

/* 노드 텍스트 */
[data-theme="dark"] .mermaid .node text,
[data-theme="dark"] .mermaid text {
    fill: #f0eeff !important;
    font-weight: 600 !important;
}

/* 엣지 라벨 배경 + 텍스트 */
[data-theme="dark"] .edgeLabel,
[data-theme="dark"] .edgeLabel rect {
    background-color: #1a1925 !important;
    fill: #1a1925 !important;
}

[data-theme="dark"] .edgeLabel span,
[data-theme="dark"] .edgeLabel p,
[data-theme="dark"] .edgeLabel div {
    color: #c8e6ff !important;
    background-color: #1a1925 !important;
    font-weight: 600 !important;
}

/* 서브그래프 클러스터 라벨 */
[data-theme="dark"] .mermaid .cluster rect {
    stroke: #3d3b52 !important;
    fill: rgba(42, 40, 56, 0.6) !important;
}

[data-theme="dark"] .mermaid .cluster text {
    fill: #a0c4ff !important;
    font-weight: 700 !important;
}

/* ── Light mode diagram: 흰 배경으로 Mermaid 색상 최대 시인성 ── */
[data-theme="light"] .diagram-container {
    background: #ffffff;
    border-color: var(--border-color);
    box-shadow: inset 0 0 0 1px var(--border-color);
}

/* Mermaid canvas text visibility */
[data-theme="light"] .mermaid .node text,
[data-theme="light"] .mermaid .edgeText,
[data-theme="light"] .mermaid .label text {
    fill: #111110 !important;
    font-weight: 700 !important;
}

[data-theme="light"] .mermaid .node rect,
[data-theme="light"] .mermaid .node polygon,
[data-theme="light"] .mermaid .node circle,
[data-theme="light"] .mermaid .node ellipse {
    stroke: #2a2928 !important;
    stroke-width: 2px !important;
}

/* Edge label visibility (light) */
[data-theme="light"] .edgeLabel,
[data-theme="light"] .edgeLabel rect {
    background-color: #fff !important;
    fill: #fff !important;
}

[data-theme="light"] .edgeLabel span,
[data-theme="light"] .edgeLabel p,
[data-theme="light"] .edgeLabel div {
    color: #111110 !important;
    background-color: #fff !important;
}

.edgeLabel,
.edgeLabel rect {
    background-color: var(--bg-card) !important;
    fill: var(--bg-card) !important;
    opacity: 0.95;
}

.edgeLabel span,
.edgeLabel p,
.edgeLabel div {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    background-color: var(--bg-card) !important;
    padding: 1px 4px !important;
    border-radius: 2px;
}

.node label,
.node text {
    font-weight: 600 !important;
}

.mermaid .edgePaths .path {
    stroke-width: 2px !important;
}

.mermaid [id$="-marker-end"],
.mermaid marker {
    fill: currentColor !important;
    stroke: none !important;
}

.mermaid .edgeLabels span {
    color: #e2e8f0 !important;
    font-weight: 600;
}

.architecture-diagram {
    padding: 20px;
    background: #1b1a19;
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

/* ── Diagram section title ──────────────────────────────────── */
.diagram-section-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    margin: 16px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.diagram-section-title:first-child {
    margin-top: 0;
}

/* ── Diagram legend ─────────────────────────────────────────── */
.diagram-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ============================================================
   Code Preview — Fluent Code Editor feel
   ============================================================ */
.code-preview {
    background-color: #1e1e2e;
    color: #eff1f5;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    tab-size: 2;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.5);
}

.code-block {
    background: #1e1e2e;
    color: #eff1f5;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.65;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================
   Excel Upload Module
   ============================================================ */
.excel-drop-zone {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    background: var(--bg-body);
    position: relative;
}

.excel-drop-zone:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.excel-drop-zone.drag-over {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.drop-zone-icon {
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.drop-zone-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Excel Steps Grid ───────────────────────────────────────── */
.excel-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.excel-step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.excel-step-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: 0 6px 12px rgba(220, 36, 31, 0.08); /* Primary color tint */
}

.excel-step-num {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 0 10px rgba(220, 36, 31, 0.4);
}

.excel-step-title {
    font-weight: 600;
    font-size: var(--font-size-md);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.excel-step-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Excel tabs ─────────────────────────────────────────────── */
.excel-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.excel-tab-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: 400;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    margin-bottom: -1px;
}

.excel-tab-btn:hover {
    color: var(--text-primary);
}

.excel-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

.excel-tab-content {
    display: none;
}

.excel-tab-content.active {
    display: block;
    animation: fadeIn 0.12s ease;
}

/* ── Data Preview Table ─────────────────────────────────────── */
.data-preview-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.preview-table thead th {
    background: var(--bg-body);
    padding: 8px 12px;
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.preview-table td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-color);
}

.td-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.td-value {
    color: var(--text-primary);
}

/* ============================================================
   Resource Preview List
   ============================================================ */
.resource-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.resource-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    margin-bottom: -1px;
    transition: background var(--transition-fast);
}

.resource-item:hover {
    background: var(--bg-card-hover);
    z-index: 1;
}

.resource-icon {
    width: 24px;
    height: 24px;
    background: transparent;
    border: 1.5px solid var(--text-muted);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    margin-right: 12px;
    flex-shrink: 0;
    color: var(--text-secondary);
    opacity: 0.8;
}

.resource-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.resource-type {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-left: 8px;
    background: var(--bg-body);
    padding: 1px 6px;
    border-radius: 100px;
}

/* ============================================================
   Success Banner
   ============================================================ */
.success-message {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--color-success);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    animation: slideInDown 0.12s ease;
    box-shadow: var(--shadow-sm);
}

.success-info-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.success-icon-bg {
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--color-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.success-text h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.success-text p {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.download-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-item {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* ============================================================
   Guide Tabs (Usage Guide / How-to)
   ============================================================ */
.usage-guide {
    padding: 4px 0;
}

.guide-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.guide-tab {
    padding: 8px 16px;
    border-radius: 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: 400;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: -1px;
    white-space: nowrap;
}

.guide-tab:hover {
    color: var(--text-primary);
}

.guide-tab.active {
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
}

.guide-content {
    display: none;
}

.guide-content.active {
    display: block;
    animation: fadeIn 0.12s ease;
}

.guide-section {
    margin-bottom: 20px;
}

.guide-section h4 {
    font-size: var(--font-size-md);
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.guide-section h5 {
    font-size: var(--font-size-md);
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================
   Upload progress overlay
   ============================================================ */
.upload-progress-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    z-index: 10;
}

[data-theme="dark"] .upload-progress-overlay {
    background: rgba(30, 28, 27, 0.9);
}

.upload-progress-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   Animations (used by modules)
   ============================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   Validation & Error States
   ============================================================ */
.form-input.error,
.form-select.error {
    border-color: var(--color-error);
    border-width: 2px;
}

.form-error-msg {
    font-size: var(--font-size-xs);
    color: var(--color-error);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.validation-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.validation-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.validation-item.error {
    background: rgba(164, 38, 44, 0.08);
    color: var(--color-error);
}

.validation-item.warning {
    background: rgba(216, 59, 1, 0.08);
    color: var(--color-warning);
}

.validation-item.success {
    background: rgba(16, 124, 16, 0.08);
    color: var(--color-success);
}

.validation-details {
    margin-top: 8px;
}

.validation-detail-row {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    margin-bottom: 4px;
}

.validation-detail-row.error {
    background: rgba(164, 38, 44, 0.05);
}

.validation-detail-row.warning {
    background: rgba(216, 59, 1, 0.05);
}

.validation-success-only .validation-item.success {
    background: rgba(16, 124, 16, 0.05);
}

/* ============================================================
   Parsed file info header
   ============================================================ */
.parsed-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.file-icon {
    font-size: 24px;
    line-height: 1;
}

/* ============================================================
   Issue 2 Fix: Hub / Spoke form layout
   ─ 한 줄에 하나씩, 세로로 긴 폼 레이아웃
   ============================================================ */

/* Hub/Spoke 안의 form-grid는 언제나 1열 */
#module-hub .form-grid,
#module-spoke .form-grid {
    grid-template-columns: 1fr !important;
    max-width: 640px;
    /* 넓은 화면에서 너무 퍼지지 않게 제한 */
}

/* 한 줄 폼 입력 스타일 */
#module-hub .form-input,
#module-hub .form-select,
#module-spoke .form-input,
#module-spoke .form-select {
    max-width: 480px;
    width: 100%;
}

/* tier-section 내의 폼 요소드 1열 */
.tier-section .form-grid {
    grid-template-columns: 1fr !important;
    max-width: 600px;
}

/* feature-section 내와 tier-section 내 폼 모두 단일 열 */
.feature-section .form-group,
.tier-section .form-group {
    max-width: 600px;
}

/* 폼 그룹 내 label 스타일: 더 명확한 계층성 */
.tier-section .form-label,
.feature-section .form-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* 입력 필드와 힌트 사이 간여보기 향상 */
.tier-section .form-group,
.feature-section .form-group {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.tier-section .form-group:last-child,
.feature-section .form-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* ============================================================
   Issue 1 Fix: Hub / Spoke Result — Full Width Layout
   다이어그램 + 코드 미리보기 전체 폭으로 세로 배치
   ============================================================ */
.hub-result-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    /* form-grid의 max-width 640px 제한 무시 */
    max-width: none !important;
}

/* 결과 페이지에서 form-grid 폭 제한 해제 */
#module-hub .hub-result-layout .form-grid,
#module-spoke .hub-result-layout .form-grid {
    max-width: none !important;
    grid-template-columns: 1fr !important;
}

/* 코드 미리보기 — 최소 높이 확보 + 스크롤 */
#hubCodePreview,
#codePreview {
    min-height: 420px;
    max-height: 72vh;
    overflow-y: auto;
    overflow-x: auto;
    white-space: pre;
    font-size: 13px;
    line-height: 1.7;
}

/* 다이어그램 컨테이너 — 결과 페이지에서 여백 제거 */
.hub-result-layout .diagram-container {
    margin-top: 0;
    min-height: 320px;
}

/* ============================================================
   Design Module (Home Grid/Cards)
   ============================================================ */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.home-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.home-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 6px 12px rgba(220, 36, 31, 0.1);
    transform: translateY(-4px);
}

.home-card .card-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.home-card h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.home-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ============================================================
   Design Table — History & Verification Table
   ============================================================ */
.design-table {
    width: 100%;
    border-collapse: collapse;
}

.design-table th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 14px 20px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.design-table td {
    padding: 16px 20px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.design-table tr:hover {
    background: var(--bg-hover);
}

.design-table tr:last-child td {
    border-bottom: none;
}