:root {
    /* Golden Amber Palette */
    --primary: #FDCB6E;
    --primary-hover: #e1b45f;
    --secondary: #FFEAA7;
    --accent: #00B894;
    --bg-dark: #1A160A;
    --bg-panel: rgba(255, 255, 255, 0.03);
    --bg-input: rgba(0, 0, 0, 0.3);
    --border: rgba(253, 203, 110, 0.15);
    --border-focus: rgba(253, 203, 110, 0.5);

    --text-main: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-dark: #1A160A;
    /* for buttons */

    --radius: 12px;
    --radius-sm: 8px;
    --transition: 250ms ease;

    --type-a: #74b9ff;
    --type-mx: #a29bfe;
    --type-txt: #55efc4;
    --type-cname: #ffeaa7;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    /* Subtle golden glow overlay */
    background-image:
        radial-gradient(circle at 15% 10%, rgba(253, 203, 110, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 85% 90%, rgba(0, 184, 148, 0.03) 0%, transparent 40%);
    background-attachment: fixed;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--bg-dark);
    background: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.2);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.app-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    align-items: start;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Panels */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    backdrop-filter: blur(10px);
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

/* Inputs */
.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--primary);
    padding: 1rem;
    font-family: ui-monospace, monospace;
    font-size: 1.5rem;
    font-weight: 700;
    transition: all var(--transition);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--border-focus);
}

/* Remove number spinner */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.icon-btn {
    position: absolute;
    right: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.human-readable {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2rem;
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
}

/* Presets */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.preset-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.preset-btn:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.preset-btn.active {
    background: rgba(253, 203, 110, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

/* Migration Planner */
.stepper {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1.5rem;
}

.step {
    display: flex;
    gap: 1rem;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    z-index: 2;
    position: relative;
}

.step.active .step-num {
    background: var(--accent);
    color: var(--bg-dark);
    border-color: var(--accent);
}

.step-connector {
    width: 2px;
    height: 20px;
    background: var(--border);
    margin: 4px 0 4px 15px;
}

.step-content {
    flex: 1;
    padding-bottom: 1rem;
}

.step-content h4 {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.step-content p.small {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.input-wrapper.mini input {
    font-size: 1.1rem;
    padding: 0.5rem;
    color: var(--text-main);
}

.input-wrapper.mini .unit {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.preset-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.alert-info {
    background: rgba(0, 184, 148, 0.1);
    border: 1px solid rgba(0, 184, 148, 0.3);
    color: var(--text-main);
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.alert-info .text-accent {
    font-weight: 600;
    color: var(--accent);
}

/* Impact Stats */
.impact-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.stat-value.highlight {
    color: var(--primary);
}

/* Timeline Viz */
.timeline-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.timeline-header,
.timeline-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-family: ui-monospace, monospace;
    color: var(--secondary);
    font-weight: 600;
}

.timeline-track {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

.timeline-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
    opacity: 0.8;
    animation: pulse 2s infinite alternate;
}

.timeline-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

@keyframes pulse {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

/* Recommended Records List */
.record-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.record-item {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.record-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--primary);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.record-type {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.record-val {
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 500;
}

.record-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.a-record {
    color: var(--type-a);
}

.mx-record {
    color: var(--type-mx);
}

.txt-record {
    color: var(--type-txt);
}

.cname-record {
    color: var(--type-cname);
}

/* Tooltip & Toast */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 5px;
    background: var(--text-main);
    color: var(--bg-dark);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    white-space: nowrap;
    pointer-events: none;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: var(--accent);
    color: var(--bg-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
    z-index: 100;
    transition: all 0.3s ease;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

/* Responsive */
@media (max-width: 900px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }

    .app-container {
        padding: 1rem;
    }
}