/* =========================================================
   Personal Tax Hub Agent — Design System
   Teal accent (#0d9488) distinct from Tax Optimizer gold
   Prefix: pt- (personal tax)
   ========================================================= */

:root {
    --pt-white: #ffffff;
    --pt-light: #f0fdfa;
    --pt-bg: #f8fafb;
    --pt-gray-50: #f1f5f9;
    --pt-gray-100: #e2e8f0;
    --pt-gray-200: #cbd5e1;
    --pt-gray-400: #94a3b8;
    --pt-gray-600: #475569;
    --pt-gray-700: #334155;
    --pt-gray-800: #1e293b;
    --pt-navy: #0b1a2e;
    --pt-navy-light: #1a3c6e;
    --pt-teal: #0d9488;
    --pt-teal-light: #14b8a6;
    --pt-teal-dim: rgba(13, 148, 136, 0.08);
    --pt-teal-hover: #0f766e;
    --pt-border: #e2e8f0;
    --pt-success: #16a34a;
    --pt-warning: #d97706;
    --pt-danger: #dc2626;
    --pt-info: #2563eb;
}

/* --- Base --- */
.pt-body {
    background: var(--pt-bg);
    color: var(--pt-gray-800);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    margin: 0;
}

/* --- Top Nav --- */
.pt-nav {
    background: var(--pt-white);
    border-bottom: 1px solid var(--pt-border);
    padding: 0.75rem 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pt-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    overflow: hidden;
}

.pt-nav-brand img {
    height: 40px;
}

.pt-nav-brand span {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pt-navy);
    letter-spacing: 0.02em;
}

.pt-nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.pt-nav-links a {
    color: var(--pt-gray-600);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: color 0.2s;
}

.pt-nav-links a:hover {
    color: var(--pt-teal);
}

/* --- Progress Stepper --- */
.pt-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0 auto 2rem;
    max-width: 700px;
    padding: 0 1rem;
}

.pt-step {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    position: relative;
}

.pt-step:last-child {
    flex: 0;
}

.pt-step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--pt-gray-50);
    border: 2px solid var(--pt-gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--pt-gray-400);
    flex-shrink: 0;
    transition: all 0.3s;
    position: relative;
    z-index: 2;
}

.pt-step.active .pt-step-dot {
    background: var(--pt-teal);
    border-color: var(--pt-teal);
    color: white;
    box-shadow: 0 0 20px rgba(13, 148, 136, 0.25);
}

.pt-step.completed .pt-step-dot {
    background: var(--pt-success);
    border-color: var(--pt-success);
    color: white;
}

.pt-step-line {
    flex: 1;
    height: 2px;
    background: var(--pt-gray-200);
    margin: 0 -2px;
    z-index: 1;
}

.pt-step.completed .pt-step-line {
    background: var(--pt-success);
}

.pt-step-label {
    position: absolute;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--pt-gray-400);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.pt-step.active .pt-step-label {
    color: var(--pt-teal);
}

/* --- Container --- */
.pt-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 6rem 1.5rem 3rem;
}

.pt-container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 1.5rem 3rem;
}

/* --- Page Header --- */
.pt-page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.pt-page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--pt-navy);
    margin-bottom: 0.5rem;
}

.pt-page-header p {
    font-size: 0.95rem;
    color: var(--pt-gray-600);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Card --- */
.pt-card {
    background: var(--pt-white);
    border: 1px solid var(--pt-border);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pt-card-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pt-navy);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pt-card-header .icon {
    color: var(--pt-teal);
}

/* --- Form Controls --- */
.pt-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 640px) {
    .pt-form-grid {
        grid-template-columns: 1fr;
    }
}

.pt-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pt-form-group.full-width {
    grid-column: 1 / -1;
}

.pt-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--pt-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pt-input,
.pt-select,
.pt-textarea {
    background: var(--pt-white);
    border: 1px solid var(--pt-gray-200);
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    color: var(--pt-gray-800);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.pt-input:focus,
.pt-select:focus,
.pt-textarea:focus {
    outline: none;
    border-color: var(--pt-teal);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.pt-textarea {
    min-height: 80px;
    resize: vertical;
}

.pt-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.2rem;
    padding-right: 2rem;
}

/* --- Chips --- */
.pt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pt-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--pt-gray-200);
    background: var(--pt-white);
    color: var(--pt-gray-600);
    user-select: none;
}

.pt-chip:hover {
    border-color: var(--pt-teal);
    color: var(--pt-teal);
}

.pt-chip.selected {
    background: var(--pt-teal);
    border-color: var(--pt-teal);
    color: white;
}

/* --- Radio --- */
.pt-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pt-radio {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--pt-gray-800);
    padding: 0.75rem 1rem;
    border: 1px solid var(--pt-gray-200);
    border-radius: 0.5rem;
    transition: all 0.2s;
    background: var(--pt-white);
}

.pt-radio:hover {
    border-color: var(--pt-teal);
}

.pt-radio.selected {
    border-color: var(--pt-teal);
    background: var(--pt-teal-dim);
}

.pt-radio input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--pt-gray-200);
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
}

.pt-radio input[type="radio"]:checked {
    border-color: var(--pt-teal);
}

.pt-radio input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    background: var(--pt-teal);
    border-radius: 50%;
}

/* --- Slider --- */
.pt-slider-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pt-slider-row label {
    font-size: 0.85rem;
    color: var(--pt-gray-800);
    min-width: 160px;
}

.pt-slider-row input[type="range"] {
    flex: 1;
    height: 6px;
    appearance: none;
    background: var(--pt-gray-100);
    border-radius: 3px;
    outline: none;
}

.pt-slider-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--pt-teal);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.pt-slider-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--pt-teal);
    min-width: 32px;
    text-align: center;
}

/* --- Buttons --- */
.pt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    border: none;
}

.pt-btn-primary {
    background: var(--pt-teal);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

.pt-btn-primary:hover {
    background: var(--pt-teal-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.pt-btn-secondary {
    background: var(--pt-white);
    color: var(--pt-gray-600);
    border: 1px solid var(--pt-gray-200);
}

.pt-btn-secondary:hover {
    border-color: var(--pt-gray-400);
    color: var(--pt-gray-800);
}

.pt-btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
}

.pt-button-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

/* --- KPI / Summary Cards --- */
.pt-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .pt-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.pt-kpi {
    background: var(--pt-white);
    border: 1px solid var(--pt-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pt-kpi .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--pt-gray-400);
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.pt-kpi .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--pt-navy);
}

.pt-kpi .value.teal {
    color: var(--pt-teal);
}

.pt-kpi .value.green {
    color: var(--pt-success);
}

.pt-kpi .value.amber {
    color: var(--pt-warning);
}

.pt-kpi .value.red {
    color: var(--pt-danger);
}

/* --- Data Table --- */
.pt-table-wrap {
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1px solid var(--pt-border);
    background: var(--pt-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.5rem;
}

.pt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.pt-table thead {
    background: var(--pt-gray-50);
    position: sticky;
    top: 0;
    z-index: 5;
}

.pt-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pt-gray-600);
    font-weight: 700;
    border-bottom: 1px solid var(--pt-border);
    white-space: nowrap;
}

.pt-table td {
    padding: 0.65rem 1rem;
    color: var(--pt-gray-800);
    border-bottom: 1px solid var(--pt-gray-50);
    white-space: nowrap;
}

.pt-table tbody tr {
    transition: background 0.15s;
    cursor: pointer;
}

.pt-table tbody tr:hover {
    background: var(--pt-light);
}

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

/* --- Badges --- */
.pt-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.pt-badge-success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--pt-success);
}

.pt-badge-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--pt-warning);
}

.pt-badge-danger {
    background: rgba(220, 38, 38, 0.08);
    color: var(--pt-danger);
}

.pt-badge-info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--pt-info);
}

.pt-badge-teal {
    background: var(--pt-teal-dim);
    color: var(--pt-teal);
}

.pt-badge-gray {
    background: var(--pt-gray-50);
    color: var(--pt-gray-600);
}

/* --- Status Dot --- */
.pt-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
}

.pt-status-dot.new {
    background: #d1d5db;
}

.pt-status-dot.pending {
    background: #fbbf24;
}

.pt-status-dot.parsed {
    background: #60a5fa;
}

.pt-status-dot.ready {
    background: #34d399;
}

.pt-status-dot.error {
    background: #f87171;
}

.pt-status-dot.review {
    background: #f59e0b;
}

/* --- Pipeline Flow Visualization --- */
.pt-pipeline {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--pt-white);
    border-radius: 1rem;
    border: 1px solid var(--pt-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
}

.pt-pipeline-node {
    text-align: center;
    min-width: 120px;
    flex-shrink: 0;
}

.pt-pipeline-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--pt-teal-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin: 0 auto 0.4rem;
    border: 2px solid var(--pt-teal);
    transition: all 0.3s;
}

.pt-pipeline-node.active .pt-pipeline-icon {
    background: var(--pt-teal);
    box-shadow: 0 0 16px rgba(13, 148, 136, 0.3);
}

.pt-pipeline-node.active .pt-pipeline-icon span {
    filter: brightness(10);
}

.pt-pipeline-node.done .pt-pipeline-icon {
    background: var(--pt-success);
    border-color: var(--pt-success);
}

.pt-pipeline-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--pt-gray-700);
    margin-bottom: 0.1rem;
}

.pt-pipeline-count {
    font-size: 0.6rem;
    color: var(--pt-gray-400);
}

.pt-pipeline-arrow {
    flex-shrink: 0;
    color: var(--pt-gray-200);
    font-size: 1.25rem;
    margin: 0 0.25rem;
}

.pt-pipeline-arrow.active {
    color: var(--pt-teal);
}

/* --- Agent Sub-cards --- */
.pt-agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pt-agent-card {
    background: var(--pt-white);
    border: 1px solid var(--pt-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.2s;
    cursor: default;
}

.pt-agent-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: var(--pt-teal);
}

.pt-agent-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pt-teal-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin: 0 auto 0.5rem;
}

.pt-agent-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--pt-navy);
    margin-bottom: 0.2rem;
}

.pt-agent-desc {
    font-size: 0.7rem;
    color: var(--pt-gray-400);
    line-height: 1.4;
}

/* --- Upload Drop Zone --- */
.pt-dropzone {
    border: 2px dashed var(--pt-gray-200);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--pt-gray-50);
}

.pt-dropzone:hover,
.pt-dropzone.dragover {
    border-color: var(--pt-teal);
    background: var(--pt-teal-dim);
}

.pt-dropzone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.pt-dropzone-text {
    font-size: 0.85rem;
    color: var(--pt-gray-600);
    font-weight: 500;
}

.pt-dropzone-hint {
    font-size: 0.7rem;
    color: var(--pt-gray-400);
    margin-top: 0.25rem;
}

/* --- Entity Table (Config) --- */
.pt-entity-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--pt-gray-50);
}

/* --- Heuristic Matrix (Rules) --- */
.pt-heuristic-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--pt-gray-50);
}

.pt-heuristic-source {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--pt-navy);
}

/* --- Review Card (Detail) --- */
.pt-review-card {
    background: var(--pt-white);
    border: 1px solid var(--pt-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.pt-review-card.highlighted {
    border-left: 3px solid var(--pt-warning);
}

.pt-review-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.pt-review-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.pt-review-option {
    padding: 0.35rem 0.75rem;
    border-radius: 0.4rem;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--pt-gray-200);
    background: var(--pt-white);
    color: var(--pt-gray-700);
    transition: all 0.15s;
}

.pt-review-option:hover {
    border-color: var(--pt-teal);
    color: var(--pt-teal);
}

.pt-review-option.selected {
    background: var(--pt-teal);
    border-color: var(--pt-teal);
    color: white;
}

/* --- TurboTax Checklist --- */
.pt-tt-section {
    background: var(--pt-white);
    border: 1px solid var(--pt-border);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.pt-tt-section-header {
    padding: 1rem 1.25rem;
    background: var(--pt-gray-50);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--pt-navy);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pt-tt-section-header .total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pt-teal);
}

.pt-tt-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.25rem;
    border-top: 1px solid var(--pt-gray-50);
    font-size: 0.82rem;
}

.pt-tt-line:hover {
    background: var(--pt-light);
}

.pt-tt-line .line-label {
    color: var(--pt-gray-700);
}

.pt-tt-line .line-code {
    font-size: 0.65rem;
    color: var(--pt-gray-400);
    margin-left: 0.5rem;
}

.pt-tt-line .line-amount {
    font-weight: 600;
    color: var(--pt-navy);
    font-variant-numeric: tabular-nums;
}

/* --- Filter Tabs --- */
.pt-filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    align-items: center;
}

.pt-filter-chip {
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--pt-border);
    background: var(--pt-white);
    color: var(--pt-gray-600);
    transition: all 0.15s;
}

.pt-filter-chip:hover {
    border-color: var(--pt-teal);
    color: var(--pt-teal);
}

.pt-filter-chip.active {
    background: var(--pt-teal);
    color: white;
    border-color: var(--pt-teal);
}

.pt-search {
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--pt-border);
    font-size: 0.82rem;
    min-width: 200px;
    margin-left: auto;
    font-family: 'Inter', sans-serif;
}

.pt-search:focus {
    outline: none;
    border-color: var(--pt-teal);
}

/* --- Toast --- */
.pt-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--pt-navy);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.35s;
}

.pt-toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .pt-container {
        padding: 5rem 1rem 2rem;
    }

    .pt-container-wide {
        padding: 5rem 1rem 2rem;
    }

    .pt-card {
        padding: 1.25rem;
    }

    .pt-page-header h1 {
        font-size: 1.35rem;
    }

    .pt-nav-brand span {
        font-size: 0.85rem;
    }

    .pt-entity-row {
        grid-template-columns: 1fr;
    }

    .pt-heuristic-row {
        grid-template-columns: 1fr;
    }

    .pt-agent-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Mobile table horizontal scroll --- */
@media (max-width: 768px) {
    .pt-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pt-table {
        min-width: 700px;
    }

    .pt-pipeline {
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Print --- */
@media print {

    .pt-nav,
    .pt-stepper,
    .pt-toast {
        display: none !important;
    }

    .pt-container,
    .pt-container-wide {
        padding: 0;
        max-width: 100%;
    }

    .pt-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .pt-table-wrap {
        overflow: visible !important;
    }

    .pt-btn {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   PASSWORD GATE OVERLAY
   ═══════════════════════════════════════════════════════════ */
.pt-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(11, 26, 46, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ptFadeIn 0.3s ease;
}

@keyframes ptFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pt-auth-card {
    background: var(--pt-white);
    border-radius: 1.25rem;
    padding: 2.5rem 2rem;
    width: 340px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    animation: ptSlideUp 0.35s ease;
}

@keyframes ptSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

.pt-auth-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.pt-auth-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--pt-navy);
    margin: 0 0 0.35rem;
}

.pt-auth-card p {
    font-size: 0.85rem;
    color: var(--pt-gray-600);
    margin: 0 0 1.25rem;
}

.pt-auth-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--pt-gray-200);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    text-align: center;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pt-auth-input:focus {
    outline: none;
    border-color: var(--pt-teal);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.pt-auth-error {
    font-size: 0.8rem;
    color: var(--pt-danger);
    min-height: 1.2em;
    margin-top: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════
   SAVE / LOAD TOOLBAR
   ═══════════════════════════════════════════════════════════ */
.pt-savebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--pt-white);
    border: 1px solid var(--pt-border);
    border-radius: 0.75rem;
    padding: 0.6rem 1.25rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pt-savebar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pt-savebar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pt-navy);
}

.pt-savebar-auto {
    font-size: 0.7rem;
    color: var(--pt-gray-400);
    font-style: italic;
}

.pt-savebar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pt-savebar-dropdown {
    position: relative;
}

.pt-savebar-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 280px;
    background: var(--pt-white);
    border: 1px solid var(--pt-border);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 50;
    overflow: hidden;
    animation: ptSlideUp 0.2s ease;
}

.pt-savebar-menu.show {
    display: block;
}

.pt-savebar-empty {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--pt-gray-400);
}

.pt-savebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--pt-gray-50);
}

.pt-savebar-item:last-child {
    border-bottom: none;
}

.pt-savebar-item:hover {
    background: var(--pt-light);
}

.pt-savebar-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pt-savebar-item-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--pt-navy);
}

.pt-savebar-item-meta {
    font-size: 0.68rem;
    color: var(--pt-gray-400);
}

.pt-savebar-delete {
    background: none;
    border: none;
    color: var(--pt-gray-400);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.4rem;
    border-radius: 0.25rem;
    transition: all 0.15s;
}

.pt-savebar-delete:hover {
    background: rgba(220, 38, 38, 0.08);
    color: var(--pt-danger);
}

@media (max-width: 640px) {
    .pt-savebar {
        flex-direction: column;
        align-items: stretch;
    }

    .pt-savebar-actions {
        justify-content: flex-end;
    }

    .pt-savebar-menu {
        right: auto;
        left: 0;
        min-width: auto;
        width: 100%;
    }
}