/* Price Intel design tokens. Indigo is the primary; green and red mark price direction. */
:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --surface-3: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #172033;
  --text-2: #64748B;
  --muted: #64748B;
  --faint: #94A3B8;
  --ink: #172033;
  --ink-2: #172033;
  --brand: #2563EB;
  --brand-hover: #1D4ED8;
  --brand-deep: #1E40AF;
  --brand-grey: #64748B;
  --brand-soft: #EFF6FF;
  --brand-border: #BFDBFE;
  --gold: #2563EB;
  --gold-deep: #1D4ED8;
  --accent: #D97706;
  --accent-hover: #B45309;
  --accent-soft: #FFFBEB;
  --accent-border: #FDE68A;
  --red: #E11D48;
  --red-bg: #FFF1F2;
  --red-border: #FECDD3;
  --green: #059669;
  --green-bg: #ECFDF5;
  --green-border: #A7F3D0;
  --amber: #D97706;
  --amber-bg: #FFFBEB;
  --amber-border: #FDE68A;
  --promo: #C2410C;
  --promo-bg: #FFF7ED;
  --promo-border: #FED7AA;
  --dot-muted: #CBD5E1;
  --radius: 12px;
  --radius-sm: 8px;
  --focus-ring: 0 0 0 2px rgba(37, 99, 235, .2);
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 12px rgba(15, 23, 42, .04);
  --shadow-hover: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 20px rgba(15, 23, 42, .08);
}

/* Previous indigo light palette, kept for side-by-side comparison. */
[data-theme="classic"] {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --surface-3: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-2: #334155;
  --muted: #64748B;
  --faint: #94A3B8;
  --ink: #0F172A;
  --ink-2: #0F172A;
  --brand: #4F46E5;
  --brand-hover: #4338CA;
  --brand-deep: #3730A3;
  --brand-grey: #64748B;
  --brand-soft: #EEF2FF;
  --brand-border: #C7D2FE;
  --gold: #4F46E5;
  --gold-deep: #4338CA;
  --accent: #D97706;
  --accent-hover: #B45309;
  --accent-soft: #FEF3C7;
  --accent-border: #FDE68A;
  --red: #DC2626;
  --red-bg: #FEE2E2;
  --red-border: #FECACA;
  --green: #16A34A;
  --green-bg: #DCFCE7;
  --green-border: #BBF7D0;
  --amber: #D97706;
  --amber-bg: #FEF3C7;
  --amber-border: #FDE68A;
  --focus-ring: 0 0 0 2px rgba(79, 70, 229, .2);
}

/* Vercel Geist minimal light palette. Brief tokens are mapped onto the shared names so every component picks them up. */
[data-theme="geist"] {
  --font-sans: Geist, Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-2: #EBEBEB;
  --surface-3: #F5F5F5;
  --border: #E5E5E5;
  --border-strong: #D4D4D4;
  --text: #171717;
  --text-2: #4D4D4D;
  --muted: #6B6B6B;
  --faint: #8F8F8F;
  --ink: #171717;
  --ink-2: #171717;
  --brand: #171717;
  --brand-hover: #404040;
  --brand-deep: #000000;
  --brand-grey: #4D4D4D;
  --brand-soft: #F5F5F5;
  --brand-border: #D4D4D4;
  --gold: #171717;
  --gold-deep: #000000;
  --accent: #0070F3;
  --accent-hover: #0761D1;
  --accent-soft: #EFF6FF;
  --accent-border: #BFDBFE;
  --red: #DC2626;
  --red-bg: #FEF2F2;
  --red-border: #FECACA;
  --green: #16A34A;
  --green-bg: #F0FDF4;
  --green-border: #BBF7D0;
  --amber: #D97706;
  --amber-bg: #FFFBEB;
  --amber-border: #FDE68A;
  --radius: 8px;
  --radius-sm: 6px;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(0, 112, 243, .45);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-hover: 0 2px 8px rgba(0, 0, 0, .06);
}
[data-theme="geist"] .app-header::before { display: none; }

/* Light themes from the multi-theme brief. Each block maps the brief's palette onto the shared token names. */
[data-theme="linear"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #F8F9FC; --surface: #FFFFFF; --surface-2: #F1F2F7; --surface-3: #F1F2F7;
  --border: #E7E8EF; --border-strong: #D5D7E2;
  --text: #252533; --text-2: #66677A; --muted: #66677A; --faint: #9293A5;
  --ink: #252533; --ink-2: #252533;
  --brand: #5E6AD2; --brand-hover: #4F5BC4; --brand-deep: #3F4BA8; --brand-grey: #66677A;
  --brand-soft: #EEF0FB; --brand-border: #C9CDF2; --gold: #5E6AD2; --gold-deep: #4F5BC4;
  --accent: #7C73E6; --accent-hover: #6A61D4; --accent-soft: #F1F0FD; --accent-border: #D6D2F7;
  --red: #D95757; --red-bg: #FCEEEE; --red-border: #F3C7C7;
  --green: #16A36A; --green-bg: #E9F8F1; --green-border: #B7E8D0;
  --amber: #D69E36; --amber-bg: #FBF4E6; --amber-border: #F0DDB0;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(94, 106, 210, .4);
  --shadow: 0 1px 2px rgba(20, 20, 40, .05); --shadow-hover: 0 4px 12px rgba(20, 20, 40, .08);
}
[data-theme="stripe"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #F6F9FC; --surface: #FFFFFF; --surface-2: #F0F4F8; --surface-3: #F0F4F8;
  --border: #E3E8EE; --border-strong: #CDD6E0;
  --text: #1A1F36; --text-2: #525F7F; --muted: #525F7F; --faint: #8898AA;
  --ink: #1A1F36; --ink-2: #1A1F36;
  --brand: #635BFF; --brand-hover: #5249E6; --brand-deep: #4339CC; --brand-grey: #525F7F;
  --brand-soft: #F0EFFF; --brand-border: #C9C5FF; --gold: #635BFF; --gold-deep: #5249E6;
  --accent: #0070F3; --accent-hover: #0761D1; --accent-soft: #EAF3FF; --accent-border: #B8D7FB;
  --red: #DF1B41; --red-bg: #FDF0F3; --red-border: #F7C5D0;
  --green: #0E9F6E; --green-bg: #E8F8F1; --green-border: #B5E8D3;
  --amber: #D97706; --amber-bg: #FDF5EA; --amber-border: #F5DDB0;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(99, 91, 255, .4);
  --shadow: 0 1px 2px rgba(50, 50, 93, .06), 0 2px 5px rgba(50, 50, 93, .04); --shadow-hover: 0 4px 10px rgba(50, 50, 93, .1);
}
[data-theme="notion"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F7F6F3; --surface-3: #F7F6F3;
  --border: #E9E9E7; --border-strong: #D9D9D5;
  --text: #37352F; --text-2: #787774; --muted: #787774; --faint: #9B9A97;
  --ink: #37352F; --ink-2: #37352F;
  --brand: #37352F; --brand-hover: #2B2925; --brand-deep: #000000; --brand-grey: #787774;
  --brand-soft: #F7F6F3; --brand-border: #D9D9D5; --gold: #37352F; --gold-deep: #000000;
  --accent: #2383E2; --accent-hover: #1A6FC4; --accent-soft: #E7F3F8; --accent-border: #B9DBF2;
  --red: #D44C47; --red-bg: #FDEBEC; --red-border: #F5C2C0;
  --green: #448361; --green-bg: #EDF3EC; --green-border: #C1DCC9;
  --amber: #CB912F; --amber-bg: #FBF3DB; --amber-border: #EFD9A4;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(35, 131, 226, .4);
  --shadow: none; --shadow-hover: 0 1px 3px rgba(15, 15, 15, .08);
}
[data-theme="raycast"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #F7F7F8; --surface: #FFFFFF; --surface-2: #F0F0F2; --surface-3: #F0F0F2;
  --border: #E5E5E7; --border-strong: #D2D2D6;
  --text: #202020; --text-2: #66666D; --muted: #66666D; --faint: #99999F;
  --ink: #202020; --ink-2: #202020;
  --brand: #202020; --brand-hover: #3A3A3F; --brand-deep: #000000; --brand-grey: #66666D;
  --brand-soft: #F0F0F2; --brand-border: #D2D2D6; --gold: #202020; --gold-deep: #000000;
  --accent: #007AFF; --accent-hover: #0066D6; --accent-soft: #E8F2FF; --accent-border: #B7D7FF;
  --red: #E5484D; --red-bg: #FDEEEE; --red-border: #F5C4C5;
  --green: #16A36A; --green-bg: #E9F8F1; --green-border: #B7E8D0;
  --amber: #E5A000; --amber-bg: #FDF5E1; --amber-border: #F3DDA0;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(0, 122, 255, .4);
  --radius: 8px; --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05); --shadow-hover: 0 4px 12px rgba(0, 0, 0, .08);
}
[data-theme="apple"] {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  --bg: #F5F5F7; --surface: #FFFFFF; --surface-2: #EFEFF1; --surface-3: #EFEFF1;
  --border: #E5E5EA; --border-strong: #D1D1D6;
  --text: #1D1D1F; --text-2: #6E6E73; --muted: #6E6E73; --faint: #86868B;
  --ink: #1D1D1F; --ink-2: #1D1D1F;
  --brand: #007AFF; --brand-hover: #0066D6; --brand-deep: #0051A8; --brand-grey: #6E6E73;
  --brand-soft: #E8F2FF; --brand-border: #B7D7FF; --gold: #007AFF; --gold-deep: #0066D6;
  --accent: #007AFF; --accent-hover: #0066D6; --accent-soft: #E8F2FF; --accent-border: #B7D7FF;
  --red: #D70015; --red-bg: #FDECEE; --red-border: #F7C2C8;
  --green: #248A3D; --green-bg: #E9F6EC; --green-border: #B8E0C2;
  --amber: #C88800; --amber-bg: #FBF3E0; --amber-border: #EFDDAA;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(0, 122, 255, .4);
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 12px rgba(0, 0, 0, .04); --shadow-hover: 0 4px 16px rgba(0, 0, 0, .08);
}
[data-theme="mint"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #F3FBF6; --surface: #FFFFFF; --surface-2: #E9F6EE; --surface-3: #E9F6EE;
  --border: #D7EBDF; --border-strong: #B5D9C4;
  --text: #13261C; --text-2: #4B6657; --muted: #4B6657; --faint: #7D9A8A;
  --ink: #13261C; --ink-2: #13261C;
  --brand: #0F6B4A; --brand-hover: #0B5A3E; --brand-deep: #084631; --brand-grey: #4B6657;
  --brand-soft: #E3F4EA; --brand-border: #B5D9C4; --gold: #0F6B4A; --gold-deep: #084631;
  --accent: #0E7490; --accent-hover: #0B5C75; --accent-soft: #E0F4FA; --accent-border: #A5DCEB;
  --red: #DC2626; --red-bg: #FDEEEE; --red-border: #F5C4C5;
  --green: #15803D; --green-bg: #E6F7EC; --green-border: #B5E4C5;
  --amber: #B7791F; --amber-bg: #FBF3E0; --amber-border: #EFDDAA;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(14, 116, 144, .4);
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 107, 74, .06), 0 4px 12px rgba(15, 107, 74, .05);
  --shadow-hover: 0 4px 16px rgba(15, 107, 74, .12);
}
[data-theme="butter"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #FFFBEA; --surface: #FFFFFF; --surface-2: #FFF6CC; --surface-3: #FFF6CC;
  --border: #F1E6B5; --border-strong: #DCCB86;
  --text: #2B2506; --text-2: #6B5F2E; --muted: #6B5F2E; --faint: #9C914F;
  --ink: #2B2506; --ink-2: #2B2506;
  --brand: #5C4A00; --brand-hover: #473900; --brand-deep: #2F2600; --brand-grey: #6B5F2E;
  --brand-soft: #FFF3B8; --brand-border: #DCCB86; --gold: #5C4A00; --gold-deep: #2F2600;
  --accent: #2563EB; --accent-hover: #1D4ED8; --accent-soft: #E6EEFF; --accent-border: #B5C9FA;
  --red: #C81E1E; --red-bg: #FDEEEE; --red-border: #F5C4C5;
  --green: #15803D; --green-bg: #E6F7EC; --green-border: #B5E4C5;
  --amber: #B45309; --amber-bg: #FEF3C7; --amber-border: #F5D98A;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(37, 99, 235, .4);
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(92, 74, 0, .06), 0 4px 12px rgba(92, 74, 0, .05);
  --shadow-hover: 0 4px 16px rgba(92, 74, 0, .12);
}
[data-theme="sky"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #F0F9FF; --surface: #FFFFFF; --surface-2: #E0F2FE; --surface-3: #E0F2FE;
  --border: #BAE6FD; --border-strong: #7DD3FC;
  --text: #0C2D48; --text-2: #3B6A8C; --muted: #3B6A8C; --faint: #7AA3BE;
  --ink: #0C2D48; --ink-2: #0C2D48;
  --brand: #0369A1; --brand-hover: #075985; --brand-deep: #0C4A6E; --brand-grey: #3B6A8C;
  --brand-soft: #E0F2FE; --brand-border: #7DD3FC; --gold: #0369A1; --gold-deep: #0C4A6E;
  --accent: #6366F1; --accent-hover: #4F46E5; --accent-soft: #EEF2FF; --accent-border: #C7D2FE;
  --red: #DC2626; --red-bg: #FDEEEE; --red-border: #F5C4C5;
  --green: #15803D; --green-bg: #E6F7EC; --green-border: #B5E4C5;
  --amber: #B45309; --amber-bg: #FEF3C7; --amber-border: #F5D98A;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(3, 105, 161, .4);
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(3, 105, 161, .06), 0 4px 12px rgba(3, 105, 161, .05);
  --shadow-hover: 0 4px 16px rgba(3, 105, 161, .12);
}
[data-theme="blush"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #FFF5F7; --surface: #FFFFFF; --surface-2: #FDE8EE; --surface-3: #FDE8EE;
  --border: #F6D0DA; --border-strong: #EFADBE;
  --text: #3B1322; --text-2: #8A4A5C; --muted: #8A4A5C; --faint: #B08090;
  --ink: #3B1322; --ink-2: #3B1322;
  --brand: #BE185D; --brand-hover: #9D174D; --brand-deep: #831843; --brand-grey: #8A4A5C;
  --brand-soft: #FCE7F3; --brand-border: #F9A8D4; --gold: #BE185D; --gold-deep: #831843;
  --accent: #0F766E; --accent-hover: #115E59; --accent-soft: #CCFBF1; --accent-border: #99F6E4;
  --red: #DC2626; --red-bg: #FDEEEE; --red-border: #F5C4C5;
  --green: #15803D; --green-bg: #E6F7EC; --green-border: #B5E4C5;
  --amber: #B45309; --amber-bg: #FEF3C7; --amber-border: #F5D98A;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(190, 24, 93, .4);
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(190, 24, 93, .06), 0 4px 12px rgba(190, 24, 93, .05);
  --shadow-hover: 0 4px 16px rgba(190, 24, 93, .12);
}
[data-theme="lavender"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #F7F5FF; --surface: #FFFFFF; --surface-2: #EEEAFD; --surface-3: #EEEAFD;
  --border: #DDD6FE; --border-strong: #C4B5FD;
  --text: #24194A; --text-2: #5B4D8A; --muted: #5B4D8A; --faint: #9A8FC4;
  --ink: #24194A; --ink-2: #24194A;
  --brand: #6D28D9; --brand-hover: #5B21B6; --brand-deep: #4C1D95; --brand-grey: #5B4D8A;
  --brand-soft: #EDE9FE; --brand-border: #C4B5FD; --gold: #6D28D9; --gold-deep: #4C1D95;
  --accent: #0891B2; --accent-hover: #0E7490; --accent-soft: #CFFAFE; --accent-border: #A5F3FC;
  --red: #DC2626; --red-bg: #FDEEEE; --red-border: #F5C4C5;
  --green: #15803D; --green-bg: #E6F7EC; --green-border: #B5E4C5;
  --amber: #B45309; --amber-bg: #FEF3C7; --amber-border: #F5D98A;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(109, 40, 217, .4);
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(109, 40, 217, .06), 0 4px 12px rgba(109, 40, 217, .05);
  --shadow-hover: 0 4px 16px rgba(109, 40, 217, .12);
}
[data-theme="peach"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #FFF8F3; --surface: #FFFFFF; --surface-2: #FFEDE0; --surface-3: #FFEDE0;
  --border: #FBD9C2; --border-strong: #F6B994;
  --text: #3A1E0E; --text-2: #8A5A3C; --muted: #8A5A3C; --faint: #B8906F;
  --ink: #3A1E0E; --ink-2: #3A1E0E;
  --brand: #C2410C; --brand-hover: #9A3412; --brand-deep: #7C2D12; --brand-grey: #8A5A3C;
  --brand-soft: #FFEDD5; --brand-border: #FDBA74; --gold: #C2410C; --gold-deep: #7C2D12;
  --accent: #0F766E; --accent-hover: #115E59; --accent-soft: #CCFBF1; --accent-border: #99F6E4;
  --red: #DC2626; --red-bg: #FDEEEE; --red-border: #F5C4C5;
  --green: #15803D; --green-bg: #E6F7EC; --green-border: #B5E4C5;
  --amber: #B45309; --amber-bg: #FEF3C7; --amber-border: #F5D98A;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(194, 65, 12, .4);
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(194, 65, 12, .06), 0 4px 12px rgba(194, 65, 12, .05);
  --shadow-hover: 0 4px 16px rgba(194, 65, 12, .12);
}
[data-theme="sand"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #FAF7F0; --surface: #FFFFFF; --surface-2: #F2ECDF; --surface-3: #F2ECDF;
  --border: #E4DBC7; --border-strong: #CFC2A4;
  --text: #2A2418; --text-2: #6B5F48; --muted: #6B5F48; --faint: #9C9078;
  --ink: #2A2418; --ink-2: #2A2418;
  --brand: #7C5E2E; --brand-hover: #654B22; --brand-deep: #4D3819; --brand-grey: #6B5F48;
  --brand-soft: #F5EEDB; --brand-border: #D8C9A8; --gold: #7C5E2E; --gold-deep: #4D3819;
  --accent: #0F766E; --accent-hover: #115E59; --accent-soft: #CCFBF1; --accent-border: #99F6E4;
  --red: #DC2626; --red-bg: #FDEEEE; --red-border: #F5C4C5;
  --green: #15803D; --green-bg: #E6F7EC; --green-border: #B5E4C5;
  --amber: #B45309; --amber-bg: #FEF3C7; --amber-border: #F5D98A;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(124, 94, 46, .4);
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(77, 56, 25, .06), 0 4px 12px rgba(77, 56, 25, .05);
  --shadow-hover: 0 4px 16px rgba(77, 56, 25, .12);
}
[data-theme="graphite"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #F4F4F5; --surface: #FFFFFF; --surface-2: #E9E9EB; --surface-3: #E9E9EB;
  --border: #DCDCDF; --border-strong: #BDBDC2;
  --text: #18181B; --text-2: #52525B; --muted: #52525B; --faint: #8F8F97;
  --ink: #18181B; --ink-2: #18181B;
  --brand: #18181B; --brand-hover: #27272A; --brand-deep: #000000; --brand-grey: #52525B;
  --brand-soft: #EBEBEE; --brand-border: #BDBDC2; --gold: #18181B; --gold-deep: #000000;
  --accent: #2563EB; --accent-hover: #1D4ED8; --accent-soft: #DBEAFE; --accent-border: #BFDBFE;
  --red: #DC2626; --red-bg: #FDEEEE; --red-border: #F5C4C5;
  --green: #15803D; --green-bg: #E6F7EC; --green-border: #B5E4C5;
  --amber: #B45309; --amber-bg: #FEF3C7; --amber-border: #F5D98A;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(37, 99, 235, .4);
  --radius: 8px; --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05); --shadow-hover: 0 4px 12px rgba(0, 0, 0, .08);
}
[data-theme="midnight-teal"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #0B1F22; --surface: #12292D; --surface-2: #17343A; --surface-3: #17343A;
  --border: #24464D; --border-strong: #33606A;
  --text: #E6F4F2; --text-2: #9CC3BF; --muted: #9CC3BF; --faint: #5F8A86;
  --ink: #E6F4F2; --ink-2: #E6F4F2;
  --brand: #5EEAD4; --brand-hover: #99F6E4; --brand-deep: #2DD4BF; --brand-grey: #9CC3BF;
  --brand-soft: #123A3A; --brand-border: #2A5C60; --gold: #5EEAD4; --gold-deep: #2DD4BF;
  --accent: #38BDF8; --accent-hover: #7DD3FC; --accent-soft: #0C3346; --accent-border: #1E5A73;
  --red: #F87171; --red-bg: #3F1D1D; --red-border: #7F2D2D;
  --green: #34D399; --green-bg: #0F3A2E; --green-border: #1F6B52;
  --amber: #FBBF24; --amber-bg: #3D2F0C; --amber-border: #7A5E18;
  --focus-ring: 0 0 0 2px #0B1F22, 0 0 0 4px rgba(94, 234, 212, .4);
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-hover: 0 4px 16px rgba(0, 0, 0, .4);
}
[data-theme="ocean-deep"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #0A1628; --surface: #111F36; --surface-2: #172842; --surface-3: #172842;
  --border: #223A5C; --border-strong: #30507A;
  --text: #E2EEFF; --text-2: #9DB4D6; --muted: #9DB4D6; --faint: #5C7599;
  --ink: #E2EEFF; --ink-2: #E2EEFF;
  --brand: #60A5FA; --brand-hover: #93C5FD; --brand-deep: #3B82F6; --brand-grey: #9DB4D6;
  --brand-soft: #13305A; --brand-border: #26487A; --gold: #60A5FA; --gold-deep: #3B82F6;
  --accent: #22D3EE; --accent-hover: #67E8F9; --accent-soft: #0C3346; --accent-border: #1E5A73;
  --red: #F87171; --red-bg: #3F1D1D; --red-border: #7F2D2D;
  --green: #34D399; --green-bg: #0F3A2E; --green-border: #1F6B52;
  --amber: #FBBF24; --amber-bg: #3D2F0C; --amber-border: #7A5E18;
  --focus-ring: 0 0 0 2px #0A1628, 0 0 0 4px rgba(96, 165, 250, .4);
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-hover: 0 4px 16px rgba(0, 0, 0, .4);
}
[data-theme="lime"] {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #F8FCEB; --surface: #FFFFFF; --surface-2: #F0F8D6; --surface-3: #F0F8D6;
  --border: #DFEDB8; --border-strong: #C5DC8E;
  --text: #1A2A08; --text-2: #536B2A; --muted: #536B2A; --faint: #85A055;
  --ink: #1A2A08; --ink-2: #1A2A08;
  --brand: #3F6212; --brand-hover: #33500E; --brand-deep: #263D0A; --brand-grey: #536B2A;
  --brand-soft: #EAF5C9; --brand-border: #C5DC8E; --gold: #3F6212; --gold-deep: #263D0A;
  --accent: #0284C7; --accent-hover: #0369A1; --accent-soft: #E0F2FE; --accent-border: #A5D8F3;
  --red: #DC2626; --red-bg: #FDEEEE; --red-border: #F5C4C5;
  --green: #15803D; --green-bg: #E6F7EC; --green-border: #B5E4C5;
  --amber: #B45309; --amber-bg: #FEF3C7; --amber-border: #F5D98A;
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(2, 132, 199, .4);
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(63, 98, 18, .06), 0 4px 12px rgba(63, 98, 18, .05);
  --shadow-hover: 0 4px 16px rgba(63, 98, 18, .12);
}
[data-theme="linear"] .app-header::before, [data-theme="stripe"] .app-header::before,
[data-theme="notion"] .app-header::before, [data-theme="raycast"] .app-header::before,
[data-theme="apple"] .app-header::before, [data-theme="mint"] .app-header::before,
[data-theme="butter"] .app-header::before, [data-theme="lime"] .app-header::before,
[data-theme="sky"] .app-header::before, [data-theme="blush"] .app-header::before,
[data-theme="lavender"] .app-header::before, [data-theme="peach"] .app-header::before,
[data-theme="sand"] .app-header::before, [data-theme="graphite"] .app-header::before { display: none; }
[data-theme="geist"] table.summary td, [data-theme="geist"] .hist-table td { font-variant-numeric: tabular-nums; }

/* Dark palette from the Price Intel spec. Indigo is lifted for contrast on dark surfaces. */
[data-theme="dark"] {
  --bg: #0B1120;
  --surface: #111827;
  --surface-2: #1F2937;
  --surface-3: #1F2937;
  --border: #263041;
  --border-strong: #334155;
  --text: #F1F5F9;
  --text-2: #CBD5E1;
  --muted: #94A3B8;
  --faint: #64748B;
  --ink: #F1F5F9;
  --ink-2: #F1F5F9;
  --brand: #818CF8;
  --brand-hover: #A5B4FC;
  --brand-deep: #4F46E5;
  --brand-grey: #475569;
  --brand-soft: rgba(129, 140, 248, .14);
  --brand-border: #3730A3;
  --gold: #818CF8;
  --gold-deep: #A5B4FC;
  --accent: #FBBF24;
  --accent-hover: #FCD34D;
  --accent-soft: rgba(251, 191, 36, .14);
  --accent-border: #78350F;
  --red: #F87171;
  --red-bg: rgba(248, 113, 113, .14);
  --red-border: #7F1D1D;
  --green: #4ADE80;
  --green-bg: rgba(74, 222, 128, .14);
  --green-border: #14532D;
  --amber: #FBBF24;
  --amber-bg: rgba(251, 191, 36, .14);
  --amber-border: #78350F;
  --promo: #FDBA74;
  --promo-bg: rgba(234, 88, 12, .16);
  --promo-border: #7C2D12;
  --dot-muted: #334155;
  --focus-ring: 0 0 0 2px rgba(129, 140, 248, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-hover: 0 8px 20px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* Filled indigo controls use dark text in dark mode for contrast. */
[data-theme="dark"] button,
[data-theme="dark"] .file-btn,
[data-theme="dark"] .seg button.on,
[data-theme="dark"] .details-link,
[data-theme="dark"] table.summary th.group.cooper {
  color: #0B1120;
}
[data-theme="dark"] button:hover,
[data-theme="dark"] .file-btn:hover,
[data-theme="dark"] .details-link:hover {
  color: #0B1120;
}
[data-theme="dark"] table.summary th.group.cooper { background: var(--brand); }
[data-theme="dark"] table.summary th.group { color: #F1F5F9; background: var(--brand-deep); border-left-color: rgba(255,255,255,.25); }
[data-theme="dark"] table.summary th.group.competitor { background: var(--brand-grey); }
[data-theme="dark"] table.summary thead tr:first-child th.sticky { background: var(--brand-deep); color: #F1F5F9; border-bottom-color: transparent; }
[data-theme="dark"] table.summary thead tr.sub th { color: var(--text-2); background: var(--surface-2); }
[data-theme="dark"] table.summary tr.sub th.cooper { color: var(--brand); }
[data-theme="dark"] details.advanced > summary { color: var(--brand); }
[data-theme="dark"] #cmp-fetch { background: var(--brand); box-shadow: 0 2px 8px rgba(129, 140, 248, .25); }

* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.6 var(--font-sans); background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11" 1; }
h1, h2, h3 { letter-spacing: -.02em; }

/* Header */
.app-header { display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 64px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: relative; }
.app-header::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--brand-deep), var(--brand) 45%, var(--gold)); }
.app-header h1 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.app-title { display: flex; flex-direction: column; gap: 2px; flex: none; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-row h1 { display: flex; align-items: center; gap: 10px; }
.title-row .title-icon { width: 28px; height: 28px; flex: none; color: var(--brand); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.title-row .title-icon .bar { stroke: none; }
.title-row .title-icon .bar-1 { fill: var(--green); }
.title-row .title-icon .bar-2 { fill: var(--accent); }
.title-row .title-icon .bar-3 { fill: var(--amber); }
.app-title .subtitle { color: var(--muted); font-size: 12px; white-space: normal; }
.app-header .subtitle { color: var(--muted); font-size: 12px; }
.app-header .nav { margin-left: auto; }
@media (max-width: 1280px) {
  .app-header { height: auto; flex-wrap: wrap; row-gap: 10px; padding: 12px 20px; }
  .app-header .nav { order: 5; margin-left: 0; flex-basis: 100%; align-self: auto; flex-wrap: wrap; row-gap: 6px; }
}
.auth-controls { position: relative; flex: none; margin-left: 12px; }
.auth-account { display: block; padding: 2px; border: 2px solid transparent; border-radius: 50%; cursor: pointer; list-style: none; }
.auth-account::-webkit-details-marker { display: none; }
.auth-account:hover { border-color: var(--border-strong); }
.auth-controls[open] .auth-account { border-color: var(--brand); }
.auth-account:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.auth-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
[data-theme="dark"] .auth-avatar, [data-theme="midnight-teal"] .auth-avatar, [data-theme="ocean-deep"] .auth-avatar { color: var(--bg); }
.auth-dropdown { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50;
  min-width: 200px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-hover); }
.auth-dropdown .auth-name { display: block; max-width: 260px; padding: 8px 12px 2px;
  color: var(--ink); font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-dropdown .auth-role { display: block; margin-bottom: 4px; padding: 0 12px 10px; border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 12px; }
.role-viewer .admin-only { display: none !important; }
.admin-table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.admin-table { font-size: 13px; }
.admin-table th { background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; padding: 10px 14px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover td { background: var(--surface-2); }
.admin-table tr.pending td { background: color-mix(in srgb, var(--promo-bg) 45%, transparent); }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .admin-actions { text-align: right; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 700; }
.admin-avatar.admin { background: var(--brand); color: #fff; }
.admin-name { font-weight: 600; color: var(--ink); }
.admin-email { font-size: 12px; color: var(--muted); }
.admin-table .role-select { width: auto; height: 32px; margin: 0; font-size: 13px; }
.admin-bar #admin-search { flex: 0 1 320px; width: auto; margin: 0; }
.admin-bar #admin-role { width: auto; margin: 0; }
.admin-roles { margin: 6px 0 0; padding-left: 18px; line-height: 1.7; }
.ins-tiles.admin-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.admin-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.admin-add label { font-weight: 600; }
.admin-add input { flex: 0 1 320px; width: auto; height: 38px; margin: 0; }
.admin-add select { width: auto; height: 38px; margin: 0; }
.auth-dropdown #auth-logout { display: block; width: 100%; margin: 0; padding: 10px 12px;
  border: 0; background: transparent; color: var(--text); text-align: left; }
.auth-dropdown #auth-logout:hover { background: var(--surface-2); transform: none; box-shadow: none; }
.auth-message { padding: 12px 20px; background: var(--red-bg); color: var(--text); border-bottom: 1px solid var(--red-border); }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-divider { width: 1px; height: 30px; background: var(--border-strong); }

/* Top navigation: underline tabs */
.nav { display: flex; gap: 16px; margin-left: 32px; align-self: stretch; flex: none; }
.nav a { display: flex; align-items: center; color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--brand); border-bottom-color: var(--gold); }

.page { max-width: none; margin: 0 auto; padding: 22px 20px 48px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); margin-bottom: 16px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar h2 { margin: 0 6px 0 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.toolbar-spacer { flex: 1; }

/* Buttons and inputs: 40px buttons, 44px inputs, 8px radius, 150ms transitions */
button, .file-btn { height: 40px; padding: 0 16px; border: 1px solid var(--brand); border-radius: var(--radius-sm); background: var(--brand); color: #fff;
  cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; transition: background .15s ease-out, border-color .15s ease-out, box-shadow .15s ease-out, transform .15s ease-out; }
button:hover, .file-btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); transform: translateY(-1px); box-shadow: 0 2px 6px rgba(37, 99, 235, .25); }
button:focus-visible, .file-btn:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
button.secondary, .file-btn.secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
button.secondary:hover, .file-btn.secondary:hover { background: var(--surface-2); border-color: var(--faint); box-shadow: none; }
button.danger { background: var(--surface); color: var(--red); border-color: var(--red-border); }
button.danger:hover { background: var(--red-bg); box-shadow: none; }
button.small { height: 32px; padding: 0 12px; font-size: 13px; }
button:disabled { opacity: .55; cursor: progress; transform: none; box-shadow: none; }
.file-btn { display: inline-block; margin: 0; line-height: 38px; }
#cmp-fetch { background: var(--brand); border-color: var(--brand); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
#cmp-fetch:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
label { display: block; margin-bottom: .7rem; font-size: 13px; font-weight: 600; color: var(--text-2); }
input, select, textarea { width: 100%; height: 44px; margin-top: 4px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 14px; background: var(--surface); color: var(--text); transition: border-color .15s ease-out, box-shadow .15s ease-out; }
select { -webkit-appearance: none; appearance: none; padding-right: 36px; cursor: pointer;
  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 d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
textarea { height: auto; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.msg { font-size: 13px; min-height: 1em; margin: 10px 0 0; color: var(--muted); }
.msg:empty { margin: 0; min-height: 0; }
.msg.error { color: var(--red); }
.load-msg { display: flex; align-items: center; gap: 12px; margin: 12px 0; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); border-left: 3px solid var(--brand); background: var(--surface-2); color: var(--text); font-family: Geist, var(--font-sans); font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.load-msg[hidden] { display: none; }
.load-msg:not(.error)::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--brand) 20%, transparent); border-top-color: var(--brand); animation: spin .75s linear infinite; flex: none; }
.load-msg.error { color: var(--red); border-left-color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .load-msg::before { animation-duration: 2s; } }
/* Buttons also use .small for size; keep their own text colour so it stays readable on the brand fill. */
.small:where(:not(button)) { color: var(--muted); font-size: 12px; }
.mono { font-family: var(--font-mono); }
.nav a svg { width: 15px; height: 15px; margin-right: 6px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.row { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.row[hidden] { display: none; }
.row h2 { margin: 0; flex: 1; }
.row input, .row select { width: auto; margin: 0; }
.pager { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: .75rem; }
.pager[hidden] { display: none; }
.pager-meta { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px; }
.pager-info { font-size: 13px; font-weight: 600; color: var(--text); }
.pager-meta label { display: flex; align-items: center; gap: 6px; }
.pager-meta select { width: auto; margin: 0; }
.pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pages button { min-width: 34px; height: 32px; padding: 0 8px; }
.pages button.current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pages span.gap { color: var(--muted); padding: 0 4px; }

/* Fetch status */
.fetch-retry { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.retry-btn { height: 28px; margin-left: .4rem; padding: 0 10px; font-size: 12px; white-space: nowrap; }
.fetch-info { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.fetch-line { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.fetch-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); cursor: default; }
.fetch-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.fetch-status.ok::before { background: var(--green); }
.fetch-status.warn::before { background: var(--accent); }
.fetch-status.running::before { background: var(--brand); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* KPI tiles */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 18px 0 14px; }
.tile { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; height: auto; line-height: 1.3;
  text-align: left; font-weight: 500; display: flex; flex-direction: row; align-items: center; gap: 10px; box-shadow: var(--shadow); transition: box-shadow .2s ease-out, border-color .2s ease-out; }
.tile:hover { border-color: var(--border-strong); background: var(--surface); box-shadow: var(--shadow-hover); transform: none; }
.tile b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.tile span { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.tile span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.tile.red span::before { background: var(--red); } .tile.green span::before { background: var(--green); } .tile.grey span::before { background: var(--dot-muted); }
.tile.amber span::before { background: var(--amber); }
.tile.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; background: var(--brand-soft); }

/* Filter bar */
.bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 0; background: transparent; border: 0; }
.bar input[type=search] { flex: 1 1 220px; min-width: 200px; margin: 0; }
.search-wrap { position: relative; flex: 1 1 260px; min-width: 200px; display: flex; align-items: center; margin: 0; }
.search-wrap input[type=search] { width: 100%; padding-left: 40px; padding-right: 44px; border-radius: 12px; }
.search-icon { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.skeleton-list { display: grid; gap: 12px; padding: 16px 0; }
.skeleton { height: 56px; border-radius: 12px; border-left: 4px solid var(--brand); background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--brand) 22%, var(--surface)) 50%, var(--surface-2) 75%) 0 0 / 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.bar select { width: auto; margin: 0; flex: none; }
.seg { display: inline-flex; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; flex: none; }
.seg button { border: 0; background: transparent; color: var(--muted); border-radius: 6px; padding: 5px 12px; font-weight: 600; font-size: 13px; height: auto; white-space: nowrap; }
.seg button:hover { color: var(--text); background: transparent; transform: none; box-shadow: none; }
.seg button.on { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }

/* Badges and tags: pill shape, soft background, strong text */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3);
  color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.b-red { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.b-green { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.b-grey { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.b-promo { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); font-weight: 500; white-space: normal; }
.b-bulk { background: var(--surface-3); color: var(--text-2); border-color: var(--border-strong); }
.badge.ready, .badge.ok { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.badge.failed, .badge.off, .badge.timed_out { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.badge.running, .badge.starting, .badge.building, .badge.scheduled, .badge.partial { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }

.tag { display: inline-block; padding: 0 6px; border-radius: 3px; font-size: 10px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; line-height: 16px; border: 1px solid; background: var(--surface); }
.tag.low { color: var(--green); border-color: var(--green-border); background: var(--green-bg); }
.tag.high { color: var(--amber); border-color: var(--amber-border); background: var(--amber-bg); }
.tag.promo { color: var(--promo); border-color: var(--promo-border); background: var(--promo-bg); cursor: help; }
.tag.stale { color: var(--amber); border-color: var(--amber-border); background: var(--amber-bg); cursor: help; }
.fresh { margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.mover { margin-top: 2px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mover.up, .digest-up { color: var(--red); }
.mover.down, .digest-down { color: var(--green); }

/* What changed digest */
.digest { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0; padding: 6px 12px; border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--radius-sm); background: var(--surface-2); }
.digest[hidden] { display: none; }
.fetch-group { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.digest-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.digest-head strong { font-size: 14px; color: var(--ink); }
.digest-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.digest-chip { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; font-weight: 600; color: var(--text-2); }
.digest-chip.strong { color: var(--ink); border-color: var(--border-strong); }
.digest-chip.bad { color: var(--red); background: var(--red-bg); border-color: var(--red-border); }
.digest-chip.good { color: var(--green); background: var(--green-bg); border-color: var(--green-border); }
.digest-details summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.digest-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: min(760px, 92vw); max-height: 60vh; overflow: auto; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-hover); }
.digest-pop > :first-child { margin-top: 0; }
.digest-line { margin-top: 6px; font-size: 13px; }
.digest-line.bad::before, .digest-line.good::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--red); }
.digest-line.good::before { background: var(--green); }
.digest-table { margin-top: 8px; font-size: 12.5px; }
.digest-table td, .digest-table th { padding: 6px 10px; text-align: left; }
.digest-table tbody tr { cursor: pointer; }
.digest-table tbody tr:hover { background: var(--surface-3); }
.digest-run { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--brand); cursor: help; }

/* Insights */
.toolbar select { width: auto; margin: 0; }
.ins-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ins-tiles .tile { cursor: default; }
.ins-tab[hidden] { display: none; }
.ins-note { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid var(--brand); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.ins-note strong { color: var(--ink); }
.ins-about { margin: 16px 0 12px; padding: 10px 14px; border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; line-height: 1.55; color: var(--text-2); }
.ins-about strong { color: var(--ink); }
/* Column help (help.js) */
button.info-tip, button.info-tip:hover { display: inline-grid; place-items: center; width: 15px; height: 15px; margin: 0 0 0 3px; padding: 0;
  border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--muted);
  font: italic 700 10px/1 Georgia, serif; text-transform: none; letter-spacing: 0; vertical-align: 1px;
  cursor: help; box-shadow: none; transform: none; }
button.info-tip:hover, button.info-tip:focus-visible { border-color: var(--brand); color: var(--brand); }
.info-pop { position: absolute; z-index: 1000; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-hover); font-size: 12.5px; font-weight: 400; line-height: 1.45;
  text-transform: none; letter-spacing: 0; white-space: normal; }
.info-pop[hidden] { display: none; }
.ins-h3 { margin: 18px 0 6px; font-size: 14px; font-weight: 700; color: var(--ink); }
.ins-bar { margin-top: 10px; }
.ins-bar .ins-h3 { margin: 0 8px 0 0; }
.ins-table td { vertical-align: middle; }
.ins-table tr.ins-alert td { background: var(--red-bg); }
.ins-bad { color: var(--red); font-weight: 600; }
.ins-warn { color: var(--amber); font-weight: 600; }
.ins-chips { display: flex; flex-wrap: wrap; gap: 4px; white-space: normal; }
.ins-chip { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: help; }
.ins-chip.good { color: var(--green); background: var(--green-bg); border-color: var(--green-border); }
.ins-chip.bad { color: var(--red); background: var(--red-bg); border-color: var(--red-border); }
a.ins-chip { cursor: pointer; text-decoration: none; color: var(--text); }
a.ins-chip:hover { border-color: var(--brand); }
.ext-link { font-weight: 600; color: var(--brand); text-decoration: none; white-space: nowrap; }
.ext-link:hover { text-decoration: underline; }
.ext-link.small { display: block; font-weight: 500; }
.ins-good { color: var(--green); font-weight: 600; }
.ins-strong { font-weight: 700; color: var(--ink); }
.inline-label { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.inline-label select, .inline-label input { width: auto; margin: 0; }
.target-input { width: 80px; height: 36px; }
.ins-chart { margin-top: 12px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.trend-svg { display: block; width: 100%; height: auto; }
.trend-svg .trend-grid { stroke: var(--border); stroke-dasharray: 3 3; }
.trend-svg .trend-zero { stroke: var(--text-2); stroke-width: 1.5; }
.trend-svg .trend-axis { font-size: 11px; fill: var(--muted); }
.ins-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.ins-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.ins-swatch { width: 12px; height: 12px; border-radius: 3px; }
.spend-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 6px 0 4px; }
.spend-bar > span { display: block; height: 100%; background: var(--brand); }
.spend-bar.warn > span { background: var(--amber); }
.spend-bar.over > span { background: var(--red); }
.spend-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.spend-grid table { font-size: 13px; }
.spend-grid td, .spend-grid th { padding: 4px 8px 4px 0; text-align: left; }
.spend-grid td.num, .spend-grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .spend-grid { grid-template-columns: 1fr; } }
.fetch-spend.warn { color: var(--amber); font-weight: 600; }
.digest-export { float: right; margin: 0 0 8px 8px; }

/* Summary: shorter tiles and every filter, plus Export, on one row (Insights tiles match) */
#tiles, .ins-tiles { margin: 14px 0 12px; }
#tiles .tile, .ins-tiles .tile { padding: 10px 14px; gap: 8px; min-height: 53px; }
#tiles .tile b, .ins-tiles .tile b { font-size: 21px; }
.cmp-bar { flex-wrap: nowrap; gap: 8px; }
.cmp-bar .search-wrap { flex: 0 1 280px; min-width: 130px; }
.cmp-bar .search-wrap input[type=search] { height: 38px; min-width: 0; font-size: 13px; padding-right: 12px; }
.cmp-bar select { height: 38px; font-size: 13px; padding: 0 26px 0 10px; }
.cmp-bar .seg button { padding: 5px 8px; font-size: 12.5px; }
#cmp-export, #h-export, .export-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 38px; margin-left: auto; padding: 0 14px;
  font-size: 13px; background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 35%, transparent); }
#cmp-export:hover, #h-export:hover, .export-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
#cmp-export svg, #h-export svg, .export-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.export-btn.small { height: 32px; padding: 0 12px; }
@media (max-width: 1360px) { .cmp-bar { flex-wrap: wrap; } }

/* Multi-select dropdown with checkboxes (multiselect.js) */
.ms { position: relative; min-width: 0; }
.ms > select { display: none !important; }
.ms-button, .ms-button:hover { width: 100%; height: 44px; margin-top: 4px; padding: 0 34px 0 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background-color: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 400;
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform: none; box-shadow: 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 d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.ms-button:hover { border-color: var(--faint); }
.ms-button[aria-expanded="true"], .ms-button:focus-visible { border-color: var(--brand); box-shadow: var(--focus-ring); }
.ms-button.ms-active { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.ms-panel { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: 360px;
  padding: 6px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-hover); }
.ms-panel[hidden] { display: none; }
.ms-search { height: 34px !important; margin: 0 0 6px !important; font-size: 13px; }
.ms-list { max-height: 300px; overflow-y: auto; }
.ms .ms-opt { display: flex !important; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 400 !important; color: var(--text) !important; white-space: nowrap; }
.ms .ms-opt:hover { background: var(--surface-2); }
.ms .ms-opt[hidden] { display: none !important; }
.ms .ms-opt input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--brand); cursor: pointer; }
.ms .ms-opt.ms-all { border-bottom: 1px solid var(--border); border-radius: 6px 6px 0 0; margin-bottom: 4px; font-weight: 600 !important; }
.ms button.ms-add, .ms button.ms-add:hover { display: block; width: 100%; height: auto; margin: 4px 0 0; padding: 7px 8px; border: 1px dashed var(--brand);
  border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 600; text-align: left;
  box-shadow: none; transform: none; }
.ms button.ms-add[hidden] { display: none; }
.cmp-bar .ms { flex: 0 1 180px; }
.cmp-bar .ms-button { height: 38px; margin-top: 0; font-size: 13px; padding: 0 26px 0 10px; background-position: right 10px center; }
.toolbar .ms, .inline-label .ms { min-width: 170px; }
.master-bar { gap: 10px; }
.master-bar #master-search { flex: 0 1 420px; width: auto; min-width: 200px; margin: 0; }
.master-bar .ms { flex: 0 0 190px; }
.toolbar .ms-button, .inline-label .ms-button, .hist-fields .ms-button { margin-top: 0; }
.fetch-spend.over { color: var(--red); font-weight: 600; }
.map-input { width: 110px; height: 34px; margin: 0; }
@media (max-width: 900px) { .ins-tiles { grid-template-columns: 1fr 1fr; } }

/* Summary table */
table { width: 100%; border-collapse: collapse; }
.master-wrap { overflow-x: auto; margin-top: 12px; }
table.master th, table.master td { border-bottom: 1px solid var(--border); white-space: nowrap; }
table.master th { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
table.master td.master-comps { white-space: normal; overflow-wrap: anywhere; font-size: 12.5px; color: var(--text-2); min-width: 220px; }
table.master td.master-actions { white-space: nowrap; text-align: right; }
table.master td.master-actions button { margin-left: 6px; }
th, td { padding: 8px 10px; text-align: left; vertical-align: middle; }
#summary { overflow: auto; max-height: calc(100vh - 150px); margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
table.summary { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; }
table.summary th, table.summary td { border-bottom: 1px solid var(--border); overflow: hidden; }
table.summary th { background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
table.summary th.group { text-align: center; font-size: 11.5px; letter-spacing: .08em; color: var(--brand-deep); background: var(--brand-soft); border-left: 1px solid var(--brand-border); }
table.summary th.group.cooper { background: var(--brand); color: #fff; border-left-color: rgba(255,255,255,.25); }
table.summary th.group.competitor { background: var(--surface-3); color: var(--text-2); }
table.summary thead tr:first-child th.sticky { background: var(--surface); color: var(--brand-deep); border-bottom: 2px solid var(--brand); }
table.summary tr.sub th.cooper { background: var(--brand-soft); color: var(--brand-deep); }
table.summary tr.sub th { text-align: center; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--text-2);
  border-left: 1px solid var(--border); background: var(--surface-3); }
table.summary tr.item { cursor: pointer; }
table.summary tr.item td { background: var(--surface); height: 76px; vertical-align: top; }
table.summary tr.item td.sticky { vertical-align: middle; }
table.summary tr.item:hover td { background: var(--surface-2); }
table.summary tr.item.open td { background: var(--brand-soft); }
table.summary tr.item td.pricecell.cooper { background: var(--brand-soft); }
table.summary td.pricecell { text-align: center; border-left: 1px solid var(--border); padding: 12px 8px; }
table.summary td.pricecell.first-comp, table.summary th.first-comp { border-left: 2px solid var(--border-strong); }
table.summary thead th.first-comp.group { border-left: 2px solid var(--surface); }
table.summary .price { font-weight: 700; font-size: 14px; color: var(--ink); }
table.summary .none { color: var(--dot-muted); font-size: 16px; line-height: 1; }
table.summary td.nowrap, table.summary .badge { white-space: nowrap; }
.clamp, .clamp-sm { overflow-wrap: anywhere; white-space: normal; }

/* Stacked cell content */
.cell-stack { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cell-line { display: flex; justify-content: center; align-items: center; gap: 4px; max-width: 100%; line-height: 1.3; flex-wrap: wrap; }
.cell-line .clamp-sm { display: block; max-width: 100%; }
.comp-name { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.cheapest-note { font-size: 10.5px; color: var(--muted); font-style: italic; margin-top: -2px; }
.per-unit { color: var(--muted); }

/* Frozen header rows and left columns (#summary is the scroll container) */
table.summary thead th { position: sticky; top: 0; z-index: 3; }
table.summary thead tr:first-child th { height: 36px; }
table.summary thead tr.sub th { top: 36px; }
table.summary .sticky { position: sticky; z-index: 2; }
table.summary thead th.sticky { z-index: 5; }
table.summary .sticky-0 { left: 0; }
table.summary .sticky-1 { left: 112px; }
table.summary .sticky-2 { left: 372px; box-shadow: 4px 0 6px -4px rgba(16, 24, 40, .15); border-right: 1px solid var(--border); }
table.summary thead tr.sub th { box-shadow: 0 1px 0 var(--border-strong); color: var(--text-2); background: var(--surface-2); }
[data-theme="dark"] .brand-logo { background: #fff; border-radius: 6px; padding: 4px 8px; height: 40px; box-sizing: content-box; }

/* Summary column */
table.summary td.summary-cell { background: var(--surface-2); }
table.summary tr.item:hover td.summary-cell { background: var(--surface-3); }
.verdict { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .01em;
  text-transform: uppercase; border: 1px solid; }
.verdict.higher { color: var(--red); background: var(--red-bg); border-color: var(--red-border); }
.verdict.cheaper { color: var(--green); background: var(--green-bg); border-color: var(--green-border); }
.verdict.mixed { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-border); }
.verdict.same, .verdict.na { color: var(--muted); background: var(--surface-3); border-color: var(--border); }
.sum-head { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.sum-big { font-size: 18px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink); }
.sum-big.up { color: var(--red); }
.sum-big.down { color: var(--green); }
.sum-big-label { font-size: 11.5px; color: var(--muted); }
.sum-stores { margin-top: 8px; display: grid; gap: 4px; max-width: 260px; }
.sum-store { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 4px; align-items: center; font-size: 12.5px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.sum-store-name { color: var(--text-2); font-weight: 600; grid-column: 1; grid-row: 1; }
.sum-store-val { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; grid-column: 2; grid-row: 1; }
.sum-store-prices { grid-column: 1; grid-row: 2; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.spark-wrap { grid-column: 2; grid-row: 2; justify-self: end; position: relative; display: inline-flex; }
.sum-spark { width: 56px; height: 18px; overflow: visible; display: block; }
.spark-tip { position: fixed; left: 0; top: 0; z-index: 20; display: grid; gap: 2px; min-width: 200px; padding: 8px 10px; background: var(--surface); color: var(--text-2); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); font-size: 12px; font-weight: 400; white-space: nowrap; opacity: 0; visibility: hidden; pointer-events: none; transition: none; }
.spark-tip strong { color: var(--ink); font-weight: 600; }
.spark-wrap:hover .spark-tip, .spark-wrap:focus-within .spark-tip { opacity: 1; visibility: visible; }
.spark-line { fill: none; stroke: var(--brand); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--muted); }
.spark-dot.up { fill: var(--red); }
.spark-dot.down { fill: var(--green); }
.sum-store-val.up { color: var(--red); }
.sum-store-val.down { color: var(--green); }
.sum-store-val.same { color: var(--muted); font-weight: 500; }


/* Row actions */
.row-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.row-link { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: 84px; padding: 4px 0;
  border-radius: 6px; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); transition: background .12s, border-color .12s; }
.row-link:hover { background: var(--brand-soft); border-color: var(--brand-border); color: var(--brand); }
.details-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.details-link:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.details-link::after { content: "\203A"; font-size: 14px; line-height: 1; }
.hist-link::after { content: "\2197"; font-size: 10px; }
.prod-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.product-desc { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.prod-head b { font-size: 13.5px; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.family-pill { font-size: 10.5px; font-weight: 600; padding: 0 6px; border-radius: 3px; line-height: 17px;
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.btn-link { margin-right: auto; align-self: center; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--brand-hover); }
.empty { padding: 36px; text-align: center; color: var(--muted); }

/* Product detail cards */
.pcards { display: flex; gap: 12px; flex-wrap: nowrap; overflow-x: auto; padding: 6px 0 10px; }
.pcards > * { flex: 0 0 auto; }
.pcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; width: 300px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.pcard.cooper { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; background: var(--brand-soft); }
.pcard.missing { opacity: .7; border-style: dashed; box-shadow: none; }
.pcard-top { display: flex; gap: 10px; align-items: flex-start; }
.pcard-top img, .pcard-top .noimg { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: var(--surface);
  border: 1px solid var(--border); flex: none; }
.pcard-top .noimg { display: grid; place-items: center; font-size: 10px; color: var(--faint); }
.pcard .owner { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.pcard .owner.cooper { color: var(--brand); }
.pcard h4 { margin: 2px 0 0; font-size: 14px; color: var(--ink); }
.pcard .pcard-id { white-space: nowrap; font-size: 10.5px; letter-spacing: 0; }
.pcard .ptitle { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; line-height: 1.35; }
.price-row { display: flex; align-items: baseline; gap: 8px; }
.pcard .big { font-size: 20px; font-weight: 700; color: var(--ink); }
.pcard .was { color: var(--faint); text-decoration: line-through; }
.on-sale { color: var(--promo) !important; }
.cell-line .was, .was-inline { color: var(--faint); text-decoration: line-through; font-size: 12px; }
.cell-line .tag.promo { white-space: normal; text-align: center; }
.pricecell { cursor: pointer; }
.pricecell:hover { box-shadow: inset 0 0 0 2px var(--brand); }
.flash { animation: flash 1.8s ease-out; }
@keyframes flash {
  0%, 45% { box-shadow: 0 0 0 3px var(--brand); }
  100% { box-shadow: 0 0 0 3px transparent; }
}
.offer { color: var(--promo); }
.pcard .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pcard .rating { color: var(--text-2); font-weight: 600; font-size: 12px; }
.pcard .links { display: flex; flex-wrap: nowrap; gap: 4px; font-size: 11.5px; margin-top: auto; padding-top: 4px; min-width: 0; }
.pcard a { color: var(--brand); text-decoration: none; font-weight: 600; }
.pcard a:hover { color: var(--brand-hover); text-decoration: underline; }
.pcard .links a { display: inline-flex; align-items: center; gap: 3px; min-width: 0; max-width: 100%; padding: 3px 7px; white-space: nowrap; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); transition: background 150ms ease-out, border-color 150ms ease-out; }
.pcard .links a:first-child { flex: 0 1 auto; }
.pcard .links a:not(:first-child) { flex: 0 0 auto; }
.pcard .links a:hover { text-decoration: none; background: var(--brand-soft); border-color: var(--brand-border); }
.pcard .links a.pill-primary { background: var(--brand); border-color: var(--brand); color: var(--bg); }
.pcard .links a.pill-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--bg); }
.notfound { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.notfound .mono { background: var(--surface-3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; margin-left: 4px; }
.retailer-section h5 { margin: 4px 0 8px; font-size: 14px; color: var(--ink); display: flex; gap: 8px; align-items: center; }

/* Details drawer */
body.no-scroll { overflow: hidden; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(1080px, 92vw); background: var(--bg); z-index: 21;
  display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(16, 24, 40, .2); animation: slide-in .18s ease-out; }
.drawer[hidden], .drawer-backdrop[hidden] { display: none; }
@keyframes slide-in { from { transform: translateX(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border); border-top: 3px solid var(--brand); }
.drawer-head h3 { margin: 2px 0; font-size: 20px; letter-spacing: -.01em; color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 24px; }
.drawer-body .retailer-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px; }
.drawer-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surface); }

/* Price history page */
.hist-filters { display: grid; gap: 12px; margin-top: 4px; }
.hist-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 10px 14px 14px; margin: 0; min-width: 0; }
.hist-group-title { margin: 0 0 10px; font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; }
.hist-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.hist-fields label { display: grid; gap: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.hist-fields select, .hist-fields input { margin-top: 0; }
.hist-fields [hidden] { display: none; }
.hist-product { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--border-strong); font-size: 17px; }
.hist-product .small { font-weight: 500; }
.hist-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hist-foot button { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-strong); }
.hist-foot button:hover { background: var(--surface-3); color: var(--text); }
.hist-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-top: 14px; }
.hist-chart { width: 100%; max-width: 900px; height: auto; display: block; margin: 6px 0 10px; }
.hist-chart .grid { stroke: var(--border); stroke-width: 1; }
.hist-chart .axis { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.hist-table { font-size: 12.5px; margin-top: 4px; }
.hist-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); background: var(--surface-3); }
.hist-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.hist-table th.sortable:hover, .hist-table th.sortable:focus-visible { color: var(--text); outline: none; }
.hist-table td { border-bottom: 1px solid var(--border); }
.hist-table a { color: var(--brand); text-decoration: none; font-weight: 600; }

/* Product form */
.product-form { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-top: 14px; background: var(--surface-2); }
.product-form h3 { margin: 0 0 .6rem; font-size: 15px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.pf-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px 12px; margin: 12px 0 0; }
.pf-group legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 4px; }
.pf-group label { font-size: 13px; }
.pf-comp-row, .pf-comp-head { display: grid; grid-template-columns: minmax(0, 1.2fr) 52px minmax(0, 1.6fr) 84px; gap: 8px; }
.pf-comp-type { align-self: center; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pf-comp-row button { width: 100%; }
.pf-comp-row { margin-bottom: 8px; }
.pf-comp-head { margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pf-comp-row select, .pf-comp-row input { min-width: 0; }
.pf-upc-shared { display: grid; gap: 8px; margin-bottom: 10px; }
.pf-upc-shared > label { font-size: 13px; }

/* Advanced tools */
details.advanced > summary { cursor: pointer; font-weight: 600; color: var(--brand-deep); }
.advanced-grid { display: grid; grid-template-columns: minmax(300px, 1fr) 2fr; gap: 14px; margin-top: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; overflow-x: auto; }
.card.wide { grid-column: 1 / -1; }
.card h2 { margin: 0 0 .75rem; font-size: 15px; }
.collapsible > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; user-select: none;
  padding: 10px 14px; margin: -14px -14px 0; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, var(--surface-2), var(--surface)); border-radius: var(--radius) var(--radius) 0 0; transition: background .15s ease-out; }
.collapsible > summary:hover { background: var(--brand-soft, #EFF6FF); }
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary::before { content: "\25B6"; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 10px; transition: transform 150ms ease-out; }
.collapsible[open] > summary::before { transform: rotate(90deg); }
.collapsible > summary::after { content: "Show"; margin-left: auto; font-size: 12px; font-weight: 600; color: var(--brand); padding: 3px 10px; border: 1px solid var(--brand); border-radius: 999px; }
.collapsible[open] > summary::after { content: "Hide"; }
.collapsible[open] > summary { margin-bottom: 14px; }
.collapsible > summary h2 { margin: 0; }
.collapsible[open] > summary h2 { margin-bottom: 0; }
.page > details.card + details.card { margin-top: 20px; }
.card table { font-size: 13px; }
.card th { color: var(--muted); font-size: 11.5px; border-bottom: 1px solid var(--border); }
.card td { border-bottom: 1px solid var(--border); vertical-align: top; }
.card tbody tr:hover { background: var(--surface-2); cursor: pointer; }
td.url { max-width: 320px; overflow-wrap: anywhere; white-space: normal; }
.detail-actions { display: flex; justify-content: flex-end; margin-bottom: 8px; }
pre { background: var(--ink-2); color: var(--surface); padding: 1rem; border-radius: var(--radius-sm); max-height: 400px; overflow: auto; font-size: 12px; }

@media (max-width: 900px) {
  .advanced-grid, .grid3, .tiles { grid-template-columns: 1fr; }
  .page { padding: 14px; }
  .nav { gap: 14px; margin-left: 16px; overflow-x: auto; scrollbar-width: none; }
}

/* Respect reduced motion: drop transitions, animations and transforms */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  button:hover, .file-btn:hover { transform: none; }
}

/* Drawer trend chart: Cooper per-piece price over the Graph duration. */
.pcard-trend { margin: 8px 0 4px; }
.pcard-trend .trend-chart { display: block; width: 100%; height: auto; margin-top: 2px; }
.trend-chart .trend-grid { stroke: var(--border); stroke-dasharray: 3 3; }
.trend-chart .trend-axis { font-size: 10px; fill: var(--muted); }
.trend-chart .trend-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; }
.trend-chart .trend-dot { fill: var(--brand); }
.trend-empty { margin: 6px 0; color: var(--muted); }

.pcard .links .trend-expand { padding: 3px 7px; font: inherit; white-space: nowrap; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: inherit; cursor: pointer; }
.pcard .links .trend-expand:hover:not(:disabled) { border-color: var(--accent); }
.pcard .links .trend-expand:disabled { opacity: 0.45; cursor: default; }
.trend-dialog { width: min(820px, 92vw); max-height: 90vh; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; padding: 18px 20px; }
.trend-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.trend-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.trend-dialog .trend-chart { display: block; width: 100%; height: auto; margin: 4px 0 0; }
.trend-close { padding: 4px 12px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: inherit; cursor: pointer; }

/* Schedules calendar */
.sched-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.sched-cal .dow { padding: 8px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-3); border-bottom: 1px solid var(--border); }
.sched-cal .day { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 112px; padding: 6px 8px; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; }
.sched-cal .day:nth-child(7n) { border-right: 0; }
.sched-cal .day:nth-last-child(-n+7) { border-bottom: 0; }
.sched-cal .day:not(.past):hover { background: var(--brand-soft); }
.sched-cal .day:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.sched-cal .day.out { background: var(--surface-2); }
.sched-cal .day.out .num { color: var(--faint); }
.sched-cal .day.past { cursor: default; }
.sched-cal .num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.sched-cal .day.today .num { background: var(--brand); color: #fff; }
.sched-ev { display: block; width: 100%; height: auto; padding: 2px 6px; border: 0; border-left: 3px solid var(--brand); border-radius: 5px; background: var(--brand-soft); color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.5; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-ev:hover { transform: none; box-shadow: none; background: var(--brand-border); }
.sched-ev.off { border-left-color: var(--faint); background: var(--surface-3); color: var(--muted); text-decoration: line-through; }
.sched-ev.run { background: var(--surface-3); }
.sched-ev.run.ok { border-left-color: var(--green); background: var(--green-bg); }
.sched-ev.run.running, .sched-ev.run.partial { border-left-color: var(--amber); background: var(--amber-bg); }
.sched-ev.run.failed { border-left-color: var(--red); background: var(--red-bg); }
.sched-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.sched-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; }
.sched-legend .sched-ev { display: inline-block; width: auto; cursor: default; }
.sched-days { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.sched-days[hidden] { display: none; }
.sched-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; cursor: pointer; }
.grid3 .sched-check { align-self: end; height: 44px; }
.sched-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
label[hidden] { display: none; }
@media (max-width: 900px) { .sched-cal .day { min-height: 80px; padding: 4px; } .sched-ev { font-size: 11px; padding: 1px 4px; } }
