/* =======================================
   CSS VARIABLES & MODERN RESET
======================================= */
:root {
    --hd-primary:      #225F75;
    --hd-primary-dark: #1b4e61;
    --hd-accent:       #e67e22;
    --hd-bg:           #f8fafc;
    --hd-card-bg:      #ffffff;
    --hd-text-main:    #334155;
    --hd-text-muted:   #64748b;
    --hd-border:       #e2e8f0;
    --hd-shadow:       0 10px 15px -3px rgba(0,0,0,.10), 0 4px 6px -2px rgba(0,0,0,.05);
    --hd-shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --hd-radius:       12px;
    --hd-radius-sm:    8px;
}
* { box-sizing: border-box; }

/* DASHBOARD */
.hd-dashboard {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--hd-text-main);
    background-color: var(--hd-bg);
}

/* USER INFO CARD */
.hd-user-info {
    background: var(--hd-card-bg);
    padding: 20px 28px;
    border-radius: var(--hd-radius);
    border: 1px solid var(--hd-border);
    box-shadow: var(--hd-shadow-sm);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: center;
}
.hd-user-info div { font-size: 15px; color: var(--hd-text-main); line-height: 1.5; }
.hd-user-info strong {
    color: var(--hd-primary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: block;
    margin-bottom: 2px;
}

/* TAB NAVIGATION */
.hd-tab-nav {
    display: flex;
    gap: 6px;
    background: #eef2f7;
    padding: 5px;
    border-radius: 10px;
    margin-bottom: 28px;
    width: fit-content;
}
.hd-tab-btn {
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    color: var(--hd-text-muted);
    border-radius: var(--hd-radius-sm);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.hd-tab-btn:hover { color: var(--hd-primary); background: rgba(255,255,255,0.6); }
.hd-tab-btn.active { background: #fff; color: var(--hd-primary); box-shadow: 0 2px 8px rgba(34,95,117,.15); }

/* LAYOUT — full width, no sidebar */
.hd-layout-container { display: block; width: 100%; }

/* SECTION CARDS */
.hd-section {
    background: var(--hd-card-bg);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    box-shadow: var(--hd-shadow-sm);
    padding: 28px;
    margin-bottom: 24px;
}
.hd-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--hd-primary);
    margin: 0 0 18px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--hd-border);
}

/* BODYGRAPH SVG */
.bodygraph-svg svg { width: 100%; max-width: 440px; display: block; margin: 0 auto; }

/* BASE TABLE STYLES */
.hd-fields-table, .hd-gates-table, .hd-channels-table,
.hd-centers-table, .hd-planets-table, .hd-business-table, .astro-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: var(--hd-text-main);
}
.hd-fields-table th, .hd-gates-table th, .hd-channels-table th,
.hd-centers-table th, .hd-planets-table th, .hd-business-table th, .astro-table th {
    background: #f1f5f9;
    color: var(--hd-text-muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--hd-border);
}
.hd-fields-table td, .hd-gates-table td, .hd-channels-table td,
.hd-centers-table td, .hd-planets-table td, .hd-business-table td, .astro-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--hd-border);
    vertical-align: middle;
    line-height: 1.5;
}
.hd-fields-table tbody tr:last-child td, .hd-gates-table tbody tr:last-child td,
.hd-channels-table tbody tr:last-child td, .hd-centers-table tbody tr:last-child td,
.hd-planets-table tbody tr:last-child td, .hd-business-table tbody tr:last-child td,
.astro-table tbody tr:last-child td { border-bottom: none; }

.hd-fields-table tbody tr:hover, .hd-gates-table tbody tr:hover,
.hd-channels-table tbody tr:hover, .hd-centers-table tbody tr:hover,
.hd-planets-table tbody tr:hover, .hd-business-table tbody tr:hover,
.astro-table tbody tr:hover { background-color: #f8fafc; }

/* TABLE COLUMN TREATMENTS */
.hd-fields-table td:first-child,
.hd-centers-table td:first-child { font-weight: 600; width: 42%; }

.hd-gates-table td:first-child { font-weight: 700; color: var(--hd-primary); width: 80px; font-size: 15px; }
.hd-channels-table td:first-child { font-weight: 700; color: var(--hd-primary); width: 100px; }

.hd-planets-table td:nth-child(2),
.hd-planets-table td:nth-child(3) {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 13px;
    color: #475569;
}
.hd-planets-table td:last-child {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--hd-text-muted);
}
.hd-business-table td:first-child { font-weight: 600; color: var(--hd-primary); width: 36%; }

/* REPORTS BUTTONS GRID */
.hd-section .hd-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 12px;
    margin-top: 0;
}
.hd-section .hd-buttons form { display: contents; }

.hd-btn {
    appearance: none;
    display: block;
    width: 100%;
    background-color: var(--hd-primary);
    border-radius: var(--hd-radius-sm);
    border: none;
    box-shadow: 0 2px 6px rgba(34,95,117,.18);
    color: #fff !important;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    outline: none;
    padding: 13px 14px;
    text-align: center;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}
.hd-btn:hover {
    background-color: var(--hd-primary-dark);
    box-shadow: 0 6px 16px rgba(34,95,117,.28);
    transform: translateY(-2px);
    color: #fff !important;
    text-decoration: none;
}
.hd-btn:active { box-shadow: none; transform: translateY(0); }

.hd-btn[style*="6200ea"] { box-shadow: rgba(98,0,234,.20) 0 4px 9px !important; }
.hd-btn[style*="6200ea"]:hover { background: #5000c8 !important; }

#ft-checkout-btn { background: var(--hd-accent) !important; box-shadow: rgba(230,126,34,.20) 0 4px 9px !important; }
#ft-checkout-btn:hover { background: #cf6d17 !important; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .hd-dashboard { padding: 0 12px; margin: 20px auto; }
    .hd-section { padding: 20px 16px; }
    .hd-user-info { gap: 16px; padding: 16px 20px; }
    .hd-tab-nav { width: 100%; overflow-x: auto; }
    .hd-section .hd-buttons { grid-template-columns: 1fr 1fr; }
    .hd-planets-table { font-size: 12px; }
    .hd-planets-table th, .hd-planets-table td { padding: 10px; }
}
@media (max-width: 480px) {
    .hd-user-info { flex-direction: column; align-items: flex-start; }
    .hd-section .hd-buttons { grid-template-columns: 1fr; }
    .hd-planets-table th:nth-child(3),
    .hd-planets-table td:nth-child(3) { display: none; }
}

/* FORM WRAPPER */
.hd-chart-form-wrapper {
    max-width: 650px;
    margin: 40px auto;
    background: #fff;
    padding: 40px;
    border-radius: var(--hd-radius);
    border: 1px solid var(--hd-border);
    box-shadow: var(--hd-shadow);
}
/* BIRTH TIME STEP (shown before the chart form) */
.hd-birth-time-step { text-align: center; }
.hd-bt-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--hd-primary);
    margin: 0 0 8px;
    line-height: 1.3;
}
.hd-bt-sub {
    font-size: 14px;
    color: var(--hd-text-muted);
    margin: 0 0 24px;
    line-height: 1.6;
}
.hd-bt-options { display: flex; flex-direction: column; gap: 12px; }
.hd-bt-option {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    color: var(--hd-text-main);
    background: #f8fafc;
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}
.hd-bt-option:hover,
.hd-bt-option:focus-visible {
    border-color: var(--hd-primary);
    background: #fff;
    color: var(--hd-primary);
    box-shadow: 0 0 0 4px rgba(34,95,117,.10);
    outline: none;
}
.hd-bt-option.is-selected {
    border-color: var(--hd-primary);
    background: #fff;
    color: var(--hd-primary);
}

/* Chosen answer summary above the form */
.hd-bt-answer-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 24px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: var(--hd-radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--hd-text-muted);
}
.hd-bt-change { font-size: 13px; font-weight: 600; color: var(--hd-primary); text-decoration: underline; }
.hd-bt-change:hover { color: var(--hd-primary-dark); }

.hd-bt-field-note {
    margin: 0;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: var(--hd-radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--hd-text-muted);
    line-height: 1.5;
}

.hd-form { display: flex; flex-direction: column; gap: 20px; }
.hd-form label { display: block; font-size: 14px; font-weight: 600; color: var(--hd-text-main); margin-bottom: 8px; }
.hd-form input[type="text"],
.hd-form input[type="email"],
.hd-form input[type="time"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius-sm);
    background-color: #f8fafc;
    color: var(--hd-text-main);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* DATE DROPDOWNS */
.hd-inline-fields {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    gap: 10px;
    margin-top: 6px;
}
.hd-form select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius-sm);
    background-color: #f8fafc;
    color: var(--hd-text-main);
    transition: all 0.2s ease;
    box-sizing: border-box;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}
.hd-form select:focus {
    outline: none;
    border-color: var(--hd-primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(34,95,117,.10);
}

@media (max-width: 480px) {
    .hd-inline-fields {
        grid-template-columns: 1fr 1fr;
    }
    .hd-inline-fields select:last-child {
        grid-column: 1 / -1;
    }
}
.hd-form input:focus {
    outline: none;
    border-color: var(--hd-primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(34,95,117,.10);
}
.hd-confirm-label {
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: var(--hd-radius-sm);
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--hd-text-muted) !important;
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.hd-confirm-label:hover { background: #e2e8f0; }
.hd-confirm-label input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; cursor: pointer; accent-color: var(--hd-primary); }

label:has(#hd_location) { position: relative; }
.hd-suggestions {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--hd-border);
    border-top: none;
    border-radius: 0 0 var(--hd-radius-sm) var(--hd-radius-sm);
    box-shadow: 0 10px 25px rgba(0,0,0,.10);
    max-height: 250px;
    overflow-y: auto;
    z-index: 999;
}
.hd-suggestion-item { padding: 12px 16px; font-size: 14px; cursor: pointer; border-bottom: 1px solid #f1f5f9; transition: background 0.2s; }
.hd-suggestion-item:last-child { border-bottom: none; }
.hd-suggestion-item:hover { background: #f8fafc; color: var(--hd-primary); }

.hd-form button[type="submit"] {
    width: 100%;
    background-color: var(--hd-primary);
    color: #fff;
    padding: 16px;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: var(--hd-radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: rgba(34,95,117,.20) 0 4px 9px;
}
.hd-form button[type="submit"]:hover {
    background-color: var(--hd-primary-dark);
    transform: translateY(-2px);
    box-shadow: rgba(34,95,117,.30) 0 8px 15px;
}
.hd-form button[type="submit"]:active { transform: translateY(0); }

@media (max-width: 480px) {
    .hd-chart-form-wrapper { padding: 25px 20px; margin: 20px; }
    .hd-form button[type="submit"] { font-size: 16px; }
}
/* =======================================
   LOCATION SUGGESTION HINT
 
   Append to hd-form.css, near the existing
   .hd-suggestions / .hd-suggestion-item rules.
 
   Shown when the locations endpoint returns its full 10-result page,
   which means smaller places are being cut off by population ranking.
======================================= */
.hd-suggestion-hint {
    padding: 10px 16px;
    font-size: 12px;
    line-height: 1.45;
    color: #64748b;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    cursor: default;
    position: sticky;
    bottom: 0;
}
 
/* Not selectable — it is a note, not an option. Guards against the
   delegated .hd-suggestion-item mousedown handler ever matching it. */
.hd-suggestion-hint:hover {
    background: #f8fafc;
}