/* Content pages: licence, footer, signed-out account pages, search, record details, account, tokens. */

/* Licence page */
.licence-section {
    margin-bottom: 1.5rem;
}

.licence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.licence-title {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.licence-subtitle {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.licence-muted {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.licence-note {
    margin-top: 1rem;
}

.licence-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 1.5rem;
    margin: 1.25rem 0 0;
    font-size: 0.875rem;
}

.licence-details dt {
    color: #6b7280;
    font-weight: 500;
}

.licence-details dd {
    margin: 0;
}

.licence-withdrawn {
    margin: 1.25rem 0;
    font-size: 0.875rem;
}

.licence-withdrawn summary {
    cursor: pointer;
    font-weight: 600;
}

.table-wrap {
    overflow-x: auto;
}

/* Paging under a table (_Pager.cshtml, table-pager.js) */
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
}

.pager__pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pager__btn {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border: 1px solid #d1d9e2;
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.pager__btn:hover:not(.is-disabled) {
    border-color: var(--brand-red);
    color: var(--brand-red);
}

.pager__btn.is-disabled {
    opacity: 0.45;
    cursor: default;
}

.pager__at {
    padding: 0 0.5rem;
}

.pager__sizes a,
.pager__size {
    padding: 0 0.25rem;
    border: 0;
    background: none;
    color: var(--brand-red);
    font: inherit;
    cursor: pointer;
}

.pager__sizes strong {
    padding: 0 0.25rem;
    color: #12243a;
}

/* Footer */
.footer {
    background: var(--dark);
    color: #9ca3af;
    padding: 2rem 0;
}

.footer__inner {
    font-size: 0.75rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
}

table th {
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Signed-out account pages (_AuthLayout) -- matches reports.mastdata.com */
.auth-body {
    background: var(--dark);
    background-image: linear-gradient(160deg, var(--dark) 0%, var(--dark-2) 55%, var(--dark-3) 100%);
    align-items: center;
    justify-content: center;
}

.auth-wrap {
    width: 100%;
    max-width: 420px;
    padding: 2rem 1.25rem;
}

.auth-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 2.25rem 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.auth-logo-block {
    background: var(--brand-red);
    display: flex;
    justify-content: center;
    margin: -2.25rem -2rem 1.5rem;
    padding: 1.5rem 2rem;
    border-radius: 14px 14px 0 0;
}

.auth-logo-img {
    height: 40px;
    width: auto;
}

.auth-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1.5rem;
}

.auth-content--center {
    text-align: center;
}

.auth-content .form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #4a5568;
}

.auth-content .form-group input:not([type="checkbox"]) {
    padding: 0.6rem 0.75rem;
    font-size: 0.92rem;
}

.auth-content .form-check label {
    font-size: 0.875rem;
    font-weight: 400;
}

.auth-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    margin-top: 1.25rem;
}

.auth-content > :last-child {
    margin-bottom: 0;
}

/* Search */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-form input {
    flex: 1;
    min-width: 0;
    max-width: 36rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
}

.search-form input:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(205, 35, 27, 0.2);
}

.search-hint {
    margin: -1rem 0 1.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.search-hint code {
    font-size: 0.75rem;
    background: #f3f4f6;
    padding: 0.05rem 0.3rem;
    border-radius: 0.25rem;
}

.search-form--inline {
    margin-bottom: 0;
}

.search-form--inline input {
    padding: 0.5rem 0.75rem;
    min-width: 16rem;
}

@media (max-width: 767px) {
    /* 16px stops phones zooming in on focus */
    .search-form input {
        font-size: 1rem;
    }

    .search-form--inline input {
        min-width: 0;
    }
}

.search-results {
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.search-results h2 {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.search-results__count {
    color: #6b7280;
    font-weight: 500;
    font-size: 0.875rem;
}

.search-results__icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* Google fallback on the Search page (wwwroot/js/search-geocode.js) */
.search-places {
    margin-bottom: 1.5rem;
}

.search-places p {
    margin: 0;
}

.search-places__btn {
    margin-left: 0.5rem;
}

.search-places__list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1rem;
}

.search-places__item {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.search-places__name {
    display: block;
    margin-bottom: 0.5rem;
}

/* Mast / planning application details */
.record-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.record-head__icon {
    width: 28px;
    height: 28px;
    vertical-align: middle;
}

.record-head__address {
    margin: 0.25rem 0 0;
    color: #4b5563;
}

.record-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 600;
    vertical-align: middle;
}

.record-badge--warn,
.record-badge--removed { background: #fee2e2; color: #991b1b; }
.record-badge--proposed { background: #dcfce7; color: #166534; }
.record-badge--retained { background: #e0e7ff; color: #3730a3; }

.record-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.record-actions a {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
}

.record-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .record-layout { grid-template-columns: 1fr; }
}

.record-facts table { width: 100%; border-collapse: collapse; }
.record-facts th, .record-facts td { padding: 0.375rem 0.5rem; border-bottom: 1px solid #f3f4f6; text-align: left; vertical-align: top; }
.record-facts th { width: 38%; color: #6b7280; font-weight: 500; }

.record-map {
    height: 420px;
    padding: 0;
    overflow: hidden;
}

.record-map__marker { width: 22px; height: 22px; }
.record-map__marker--current { width: 34px; height: 34px; }

.record-note {
    margin: 0.25rem 0 1.5rem;
    color: #6b7280;
    font-size: 0.8125rem;
}

.record-photos h2 { margin: 0 0 1rem; font-size: 1.125rem; font-weight: 700; }

.record-photos__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.record-photos__grid a { color: inherit; text-decoration: none; font-size: 0.75rem; }
.record-photos__grid img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 0.25rem; }

.record-bearing {
    display: inline-block;
    transform: rotate(var(--deg));
    font-weight: 700;
}

.record-pre { white-space: pre-wrap; }

/* The collapsible sections below the details (wwwroot/js/record-sections.js) */
.record-sections__tools {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.record-section > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.record-section > summary::-webkit-details-marker { display: none; }

.record-section > summary::before {
    content: "";
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: rotate(-45deg);
    transition: transform 0.15s;
}

.record-section[open] > summary::before { transform: rotate(45deg); }
.record-section > summary h2 { margin: 0; }
.record-section[open] > summary { margin-bottom: 1rem; }
.record-section:not([open]) { padding-top: 1rem; padding-bottom: 1rem; }

.record-filters,
.record-correction {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.record-filters label,
.record-correction label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: #4b5563;
}

.record-filters select,
.record-correction select,
.record-correction input {
    padding: 0.375rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    color: #111827;
}

.record-correction input { min-width: 18rem; }
.record-correction__status { flex-basis: 100%; margin: 0; font-size: 0.875rem; }

@media (max-width: 767px) {
    .record-correction label,
    .record-correction input { width: 100%; min-width: 0; }
    .record-filters select,
    .record-correction select,
    .record-correction input { font-size: 1rem; }
}

.record-transmission td, .record-transmission th { white-space: nowrap; }
.record-transmission__this { background: #f0fdf4; }
.record-transmission__signal { display: flex; gap: 0.25rem; }

/* Legacy's signal scale (IndexModel.SignalLevel): greens, ambers, red. */
.record-signal, .record-band { font-variant-numeric: tabular-nums; font-size: 0.8125rem; text-align: center; }
.record-signal { padding: 0.0625rem 0.375rem; border-radius: 4px; background: #f3f4f6; }
.record-band { min-width: 2.75rem; color: #9ca3af; border-left: 2px solid #fff; }
.record-transmission [data-level="9"] { background: #15803d; color: #fff; }
.record-transmission [data-level="8"] { background: #22c55e; color: #fff; }
.record-transmission [data-level="7"] { background: #86efac; color: #14532d; }
.record-transmission [data-level="6"] { background: #fde68a; color: #713f12; }
.record-transmission [data-level="5"] { background: #fcd34d; color: #713f12; }
.record-transmission [data-level="4"] { background: #fbbf24; color: #713f12; }
.record-transmission [data-level="3"] { background: #f59e0b; color: #fff; }
.record-transmission [data-level="2"] { background: #d97706; color: #fff; }
.record-transmission [data-level="1"] { background: #b45309; color: #fff; }
.record-transmission [data-level="0"] { background: #dc2626; color: #fff; }

/* The details map's layer picker (wwwroot/js/records.js), sized and shadowed as Google's own controls. */
.map-layers {
    position: relative;
    margin: 10px;
    font-family: inherit;
}

.map-layers__button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 40px;
    padding: 0 0.625rem 0 0.75rem;
    border: 0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    color: #1f2937;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.map-layers__button:hover { background: #f9fafb; }
.map-layers__button:focus-visible,
.map-layers__item:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }

.map-layers svg {
    width: 18px;
    height: 18px;
    fill: #e5e7eb;
    stroke: #374151;
    stroke-width: 1.75;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.map-layers__chevron { width: 16px !important; height: 16px !important; }
.map-layers__button[aria-expanded="true"] .map-layers__chevron { transform: rotate(180deg); }

.map-layers__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 12rem;
    padding: 0.375rem;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.map-layers__menu[hidden] { display: none; }

.map-layers__group {
    padding: 0.5rem 0.625rem 0.25rem;
    color: #6b7280;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.map-layers__group:not(:first-child) { margin-top: 0.25rem; border-top: 1px solid #f3f4f6; }

.map-layers__item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #1f2937;
    font: inherit;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
}

.map-layers__item:hover { background: #f3f4f6; }
.map-layers__item[aria-checked="true"] { font-weight: 600; color: var(--brand-red); }

.map-layers__item[aria-checked="true"]::after {
    content: "";
    margin-left: auto;
    width: 0.3rem;
    height: 0.6rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -1px);
}

.record-map__attribution { display: block; font-size: 0.75rem; }
.record-map__attribution a { color: inherit; }

/* Account settings */
.account-list { padding: 0; }
.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}
.account-row:last-child { border-bottom: 0; }
.account-row h2 { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 700; }
.account-row p { margin: 0; color: #6b7280; font-size: 0.875rem; word-break: break-word; }
.account-form { max-width: 32rem; }
.account-form > p { font-size: 0.875rem; color: #374151; }
.account-check { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem; font-size: 0.875rem; }
.account-status { color: #059669; font-size: 0.875rem; margin: 0 0 1rem; }
.account-note { color: #b45309; font-size: 0.875rem; }
.account-back { margin: 0 0 0.75rem; font-size: 0.875rem; }

/* Tokens page */
.tokens-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.tokens-figure { font-size: 1.75rem; font-weight: 700; margin: 0.25rem 0 0.5rem; }
.tokens-beta { border-left: 4px solid var(--brand-red); }
.tokens-message { padding: 0.6rem 0.9rem; border-radius: 6px; background: #eef6ee; margin-bottom: 1rem; }
.tokens-h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }
.tokens-packs { list-style: none; padding: 0; margin: 0 0 0.75rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tokens-pack { border: 1px solid #ddd; border-radius: 8px; padding: 0.6rem 1rem; display: flex; flex-direction: column; min-width: 140px; }
.tokens-pack__tokens { font-weight: 700; }
.tokens-pack__price { color: #666; font-size: 0.9rem; }
.tokens-cap { display: flex; gap: 0.4rem; align-items: center; }
.tokens-cap input { width: 7rem; }
.tokens-pack__buy { margin-top: 0.5rem; }
.receipt { max-width: 760px; }
.receipt-test { background: #fff3cd; border: 1px solid #e0c36c; padding: 0.5rem 0.75rem; border-radius: 6px; font-weight: 600; }
.receipt-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.receipt-title { margin: 0 0 0.5rem; font-size: 1.6rem; }
.receipt-seller, .receipt-to address { font-style: normal; line-height: 1.5; }
.receipt-seller { text-align: right; }
.receipt-to { margin-bottom: 1.25rem; }
.receipt-lines tfoot th { text-align: right; }
.receipt-lines tfoot th:last-child { text-align: left; }
@media print {
    .nav, .footer, .no-print { display: none !important; }
    .receipt { box-shadow: none; border: none; max-width: none; }
}

/* The record's title band (base.css .page-band). */
.page-band .record-head__address { color: #cbd5e1; }

.page-band .record-actions a {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.page-band .record-actions a:hover {
    background: var(--brand-red);
    border-color: var(--brand-red);
}

/* A cell (Pages/Search/Cell.cshtml, wwwroot/js/cell-map.js) */
.cell-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20rem;
    gap: 1.5rem;
}

@media (max-width: 899px) {
    .cell-layout { grid-template-columns: minmax(0, 1fr); }
}

.cell-map { height: 36rem; }

.cell-note {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.cell-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cell-card { padding: 1.25rem; }

.cell-mast {
    display: flex;
    gap: 0.625rem;
    align-items: center;
    margin: 0 0 0.75rem;
}

.cell-mast img { width: 28px; height: 28px; object-fit: contain; }
.cell-mast small { display: block; color: #6b7280; }
.cell-mast--unknown { color: #6b7280; }

.cell-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    margin: 0;
    font-size: 0.875rem;
}

.cell-facts dt { color: #6b7280; }
.cell-facts dd { margin: 0; }

.cell-key {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8125rem;
}

.cell-key i {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    margin-right: 0.5rem;
    border-radius: 50%;
    border: 1px solid rgba(17, 24, 39, 0.4);
    vertical-align: -1px;
}

/* Error pages (Pages/Error.cshtml) */
.error-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.error-ref { color: #6b7280; font-size: 0.875rem; }
