/* Apple Specs Database—shared styles (Take Control Books aesthetic) */
:root {
    --bg: #f0f0f0;
    --card: #fff;
    --text: #333333;
    --text2: #6d6d6d;
    --accent: #7f54b3;
    --accent-hover: #6b4599;
    --border: #d5d5d5;
    --tag-bg: #eee;
    --earliest-bg: #f3eef9;
    --earliest-border: #7f54b3;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Roboto', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 15px;
}
h1, h2, h3, h4, .header h1, .feature-name, .browse-section h2, .product-header h2 {
    font-family: 'Archivo Narrow', Arial, sans-serif;
}

/* Header / Nav */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.header h1 {
    font-size: 22px;
    font-weight: 700;
    white-space: nowrap;
}
.header h1 a { color: var(--text); text-decoration: none; }
.header h1 a:hover { color: var(--accent); }
.brand { display: flex; flex-direction: column; gap: 1px; }
.brand h1 { margin: 0; }
.site-subtitle { font-size: 12.5px; font-weight: 400; color: var(--text2); }
.header nav { display: flex; gap: 16px; align-items: center; }
.header nav a {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent !important;
    padding-bottom: 2px;
}
.header nav a:hover { color: var(--accent); border-bottom-color: var(--accent) !important; }
.header nav a.active {
    color: var(--accent);
    font-weight: 600;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2px;
}

/* Admin nav bar */
.admin-bar {
    background: #2c2c2e;
    padding: 6px 24px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.admin-bar span {
    color: #aaa;
    font-weight: 500;
}
.admin-bar a {
    color: #d4a5f5;
    text-decoration: none;
    font-weight: 500;
}
.admin-bar a:hover { color: #e8ccfa; border-bottom: 1px solid #e8ccfa !important; }

/* Global link style—accent bottom border instead of underline */
a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 0.5px;
    transition: color 0.2s, border-color 0.2s;
}
a:hover { color: var(--accent-hover); border-color: transparent; }
/* Exempt: pill-shaped links, chip links, book lozenges, nav, header */
.feature-links a, .feat-chip, .search-form button,
.header a, .header nav a, .admin-bar a, .tabs a, .action-links a {
    border-bottom: none;
    padding-bottom: 0;
}

/* Layout */
.container { max-width: 960px; margin: 0 auto; padding: 24px; }

/* Search */
.search-box {
    background: var(--card);
    border-radius: 3px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.search-form input[type="text"]:focus { border-color: var(--accent); }
.search-form select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    outline: none;
}
.search-form button {
    padding: 10px 24px;
    background: var(--text);
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}
.search-form button:hover { background: #1a1a1a; }
.stats {
    font-size: 13px;
    color: var(--text2);
    margin-top: 12px;
}

/* Feature results */
.feature-result {
    background: var(--card);
    border-radius: 3px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.feature-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}
.feature-meta {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 16px;
}
.feature-meta .tag {
    display: inline-block;
    background: var(--tag-bg);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

/* Earliest / series table */
.earliest-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 4px;
    font-family: 'Archivo Narrow', Arial, sans-serif;
}
.earliest-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--earliest-bg);
    border-left: 4px solid var(--earliest-border);
    border-radius: 3px;
    margin-bottom: 16px;
}
.earliest-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text2);
    padding: 6px 10px;
    border-bottom: 1px solid #ddd3e8;
}
.earliest-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #e8e0f0;
    vertical-align: middle;
}
.earliest-table tr:last-child td { border-bottom: none; }
.earliest-table tr:hover td { background: #ebe3f3; }
.earliest-series-cell {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Archivo Narrow', Arial, sans-serif;
    white-space: nowrap;
}

/* Tables */
.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.product-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text2);
    padding: 8px 10px;
    border-bottom: 2px solid var(--border);
}
.product-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}
.product-table tr:last-child td { border-bottom: none; }
.product-table tr:hover td { background: #fafafa; }

/* Browse sections */
.no-results {
    text-align: center;
    color: var(--text2);
    padding: 40px 20px;
}
.browse-section { margin-top: 32px; }
.browse-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}
.feature-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.feature-links a {
    display: inline-block;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}
.feature-links a:hover {
    border-color: var(--accent);
    background: #f3eef9;
}

/* Collapsible browse categories (details/summary) */
.browse-cat { border-top: 1px solid var(--border); }
.browse-cat:last-of-type { border-bottom: 1px solid var(--border); }
.browse-cat summary {
    cursor: pointer;
    list-style: none;
    padding: 11px 2px;
    font-family: 'Archivo Narrow', Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 9px;
    user-select: none;
}
.browse-cat summary::-webkit-details-marker { display: none; }
.browse-cat summary::before {
    content: '\203A';                 /* › */
    color: var(--text2);
    font-size: 18px;
    line-height: 1;
    transition: transform 0.15s ease;
}
.browse-cat[open] summary::before { transform: rotate(90deg); }
.browse-cat summary:hover { color: var(--accent); }
.browse-cat .cat-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
    background: var(--tag-bg);
    border-radius: 9999px;
    padding: 1px 9px;
}
.browse-cat .feature-links { padding: 2px 0 14px 24px; }
.toggle-btn {
    font-size: 13px;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
}
.toggle-btn:hover { border-bottom: 1px dashed var(--accent); }
.hidden { display: none; }

/* Product links and detail */
.product-link { color: var(--text); }
.product-link:hover { color: var(--accent); }
.product-header {
    background: var(--card);
    border-radius: 3px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.product-header h2 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.product-header .meta { font-size: 14px; color: var(--text2); }
.product-header .meta a { color: var(--accent); }
.feat-group-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text2);
    margin: 20px 0 8px;
    font-family: 'Archivo Narrow', Arial, sans-serif;
}
.feat-group-title:first-child { margin-top: 0; }
.feat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.feat-chip {
    display: inline-block;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 3px;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}
.feat-chip:hover { border-color: var(--accent); background: #f3eef9; }
.feat-chip .detail { display: block; font-size: 12px; color: var(--text2); margin-top: 2px; }
.feat-table {
    width: auto;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 4px;
}
.feat-table td {
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.feat-table tr:last-child td { border-bottom: none; }
.feat-table tr:hover td { background: #fafafa; }
.feat-table-detail { font-size: 13px; color: var(--text2); }
.feat-table-cat td {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text2);
    padding: 16px 10px 4px !important;
    border-bottom: none !important;
    font-family: 'Archivo Narrow', Arial, sans-serif;
}
.feat-table-cat:first-child td { padding-top: 4px !important; }
.feat-table-cat:hover td { background: transparent !important; }

/* OS badges */
.os-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}
.os-badge.iOS { background: #007aff; }
.os-badge.iPadOS { background: #5856d6; }
.os-badge.macOS { background: #34c759; }
.os-badge.watchOS { background: #ff3b30; }
.os-badge.visionOS { background: #ff9500; }

/* Beta / upcoming (announced but not yet released) */
.beta-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #8a5a00;
    background: #ffe7b3;
    border: 1px solid #f0c453;
    vertical-align: middle;
    margin-left: 6px;
}

/* Take Control book recommendations */
.tc-books { margin-top: 20px; }
.tc-books-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text2); margin-bottom: 8px;
    font-family: 'Archivo Narrow', Arial, sans-serif;
}
.tc-books-table {
    width: 100%; border-collapse: collapse; font-size: 14px;
    background: #faf8fc; border: 1px solid #e0d6ec; border-radius: 3px;
}
.tc-books-table td {
    padding: 8px 10px; border-bottom: 1px solid #e0d6ec; vertical-align: middle;
}
.tc-books-table tr:last-child td { border-bottom: none; }
.tc-books-table tr:hover td { background: #f3eef9; }
td.tc-book-cover { width: 36px; padding-right: 0; }
td.tc-book-cover img {
    width: 36px; height: auto; border-radius: 2px; display: block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
td.tc-book-cover a { border-bottom: none; }
td.tc-book-title {
    font-size: 13px; font-weight: 600; white-space: nowrap;
    font-family: 'Archivo Narrow', Arial, sans-serif;
}
td.tc-book-desc { font-size: 12px; color: var(--text2); }

/* Report error link */
.report-link {
    font-size: 12px;
    color: var(--text2);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    padding: 0;
}
.report-link:hover { color: var(--accent); text-decoration: underline; }

/* Report modal */
.report-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.report-dialog {
    background: var(--card);
    border-radius: 3px;
    padding: 24px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.report-dialog h3 {
    font-family: 'Archivo Narrow', Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}
.report-submit-btn {
    padding: 8px 20px;
    background: var(--text);
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.report-submit-btn:hover { background: #1a1a1a; }
.report-submit-btn:disabled { background: #999; cursor: default; }

/* Footer */
.page-footer {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 24px 32px;
    text-align: center;
    font-size: 12px;
    color: var(--text2);
}
.page-footer a { color: var(--accent); }
.page-footer p { margin: 0 auto 8px; max-width: 760px; line-height: 1.5; }
.footer-disclaimer { color: var(--text2); opacity: 0.85; }
.footer-links { font-weight: 500; }

/* Cards (used in browse/admin) */
.card {
    background: var(--card);
    border-radius: 3px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card h2 { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
