/*
 * Console pages — the shared look for list screens and record screens.
 *
 * Borrowed from Hearo Now: light Garant Pro headlines, white cards on the
 * canvas, uppercase column labels, one identity line per row, status said in
 * colored words, and a related rail on records so every linked thing is one
 * click away. Page markup opts in with .cc-page (lists) or .cc-record.
 */

@font-face { font-family: "Garant Pro"; src: url("/fonts/garantpro-light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Garant Pro"; src: url("/fonts/garantpro-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Garant Pro"; src: url("/fonts/garantpro-semilight.woff2") format("woff2"); font-weight: 350; font-display: swap; }
@font-face { font-family: "Garant Pro"; src: url("/fonts/garantpro-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Garant Pro"; src: url("/fonts/garantpro-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Garant Pro"; src: url("/fonts/garantpro-bold.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }

/*
 * One typeface everywhere. The cc-garant class on <html> (_Layout) swaps
 * every Lato rule for Garant Pro, the Hearo Now face, so pages never mix the
 * two. Remove the class to go back to Lato.
 */
html.cc-garant {
    --cc-body-font: "Garant Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --wa-font-family-body: var(--cc-body-font);
    --wa-font-family-heading: var(--cc-body-font);
    --wa-font-family-longform: var(--cc-body-font);
    --wa-input-font-family: var(--cc-body-font);
}
html.cc-garant body,
html.cc-garant body :where(:not(i):not([class*="fa-"]):not(code):not(pre):not(kbd):not(samp):not(.material-icons)) {
    font-family: var(--cc-body-font) !important;
}

:root {
    --cc-green: #3dba84;
    --cc-green-ink: #259761;
    --cc-green-20: #d8f1e6;
    --cc-mint: #dff0e5;
    --cc-slate: #576d6b;
    --cc-steel: #75959b;
    --cc-steel-ink: #3f7680;
    --cc-steel-20: #e3ecee;
    --cc-magenta: #ba3d73;
    --cc-magenta-ink: #b5345f;
    --cc-magenta-20: #f5e1ea;
    --cc-sun: #e8a838;
    --cc-sun-ink: #a8690f;
    --cc-sun-20: #fbefd9;

    --cc-text: #1d2624;
    --cc-text-2: #2f3d3a;
    --cc-text-3: #576d6b;
    --cc-text-4: #7c8d8a;

    --cc-hairline: #e3eae6;
    --cc-card-border: #e6ede9;
    --cc-pill-border: #cfdcd6;
    --cc-raised: #f3f7f4;
    --cc-card: #ffffff;
    --cc-shadow: 0 1px 2px rgba(22, 53, 42, .04), 0 4px 16px rgba(22, 53, 42, .05);

    --cc-display: "Garant Pro", "Lato", sans-serif;

    /* List and record helpers */
    --cc-width: min(1440px, calc(100vw - (2 * var(--hearo-page-gutter, 2.25rem))));
}

/* ------------------------------------------------------------ page frame */

.cc-page,
.cc-record {
    width: var(--cc-width);
    margin: 0 auto;
    padding: 26px 0 72px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: var(--cc-text);
    font-size: 15px;
}

.cc-page *,
.cc-record * {
    box-sizing: border-box;
}

.cc-head {
    display: flex;
    align-items: flex-end;
    gap: 16px 24px;
    flex-wrap: wrap;
}

.cc-page h1,
.cc-record h1 {
    margin: 0;
    font-family: var(--cc-display) !important;
    font-weight: 300 !important;
    font-size: 42px !important;
    line-height: 1.04;
    letter-spacing: -.5px;
    color: var(--cc-text);
}

.cc-head-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------ controls */

.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1.5px solid var(--cc-green);
    background: var(--cc-card);
    color: var(--cc-green-ink) !important;
    font: 600 15px/1.2 var(--cc-body-font, "Lato"), sans-serif;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background .12s;
}

.cc-btn:hover { background: var(--cc-green-20); }
.cc-btn[hidden] { display: none; }
.cc-btn.primary { background: var(--cc-green); color: #fff !important; }
.cc-btn.primary:hover { background: #33a674; }
.cc-btn.ghost { border-color: transparent; background: transparent; padding-inline: 10px; }
.cc-btn.ghost:hover { background: var(--cc-green-20); }
.cc-btn.quiet { border-color: var(--cc-pill-border); color: var(--cc-text-2) !important; }
.cc-btn.quiet:hover { background: var(--cc-raised); }
.cc-btn.danger { border-color: var(--cc-magenta); color: var(--cc-magenta-ink) !important; }
.cc-btn.danger:hover { background: var(--cc-magenta-20); }
.cc-btn.small { padding: 6px 13px; font-size: 14px; }
.cc-btn i { font-size: .92em; }

/* Search: a pill with a leading glass. Wraps the existing wa-input. */
.cc-search { width: 320px; max-width: 100%; }
.cc-search wa-input { width: 100%; }
.cc-search wa-input::part(base) {
    min-height: 44px;
    border-radius: 999px;
    border-color: var(--cc-card-border);
    background: var(--cc-card);
    box-shadow: var(--cc-shadow);
    padding-inline: 16px 14px;
}
.cc-search wa-input [slot="start"] { color: var(--cc-text-4); font-size: 14px; margin-right: 4px; }

.cc-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Status tabs with counts — the Hearo Now toolbar. */
.cc-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cc-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--cc-text-3);
    font: 600 14.5px/1.2 var(--cc-body-font, "Lato"), sans-serif;
    white-space: nowrap;
    cursor: pointer;
}
.cc-tab:hover { background: var(--cc-card); color: var(--cc-text); }
.cc-tab[aria-pressed="true"],
.cc-tab.active { background: var(--cc-text); color: #fff; }
.cc-tab .n { opacity: .6; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ tables */

.cc-table-wrap {
    overflow-x: auto;
    background: var(--cc-card);
    border: 1px solid var(--cc-card-border);
    border-radius: 20px;
    box-shadow: var(--cc-shadow);
}

.cc-page table.cc-table,
.cc-record table.cc-table {
    width: 100%;
    border-collapse: collapse;
    border: 0;
    clip-path: none;
    background: transparent;
    font-size: 15px;
}

.cc-page .cc-table thead th,
.cc-record .cc-table thead th {
    padding: 14px 20px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--cc-hairline);
    color: var(--cc-text-4);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

.cc-page .cc-table td,
.cc-record .cc-table td {
    padding: 12px 20px;
    border: 0;
    border-bottom: 1px solid var(--cc-hairline);
    color: var(--cc-text-2);
    font-size: 15px;
    line-height: 1.4;
    vertical-align: middle;
}

.cc-page .cc-table tbody tr:last-child td { border-bottom: 0; }
.cc-page .cc-table tbody tr.ac-row { cursor: pointer; }
.cc-page .cc-table tbody tr:hover td { background: var(--cc-raised); }
.cc-page .cc-table tbody tr:focus-visible { outline: 2px solid var(--cc-green); outline-offset: -2px; }

/* The identity cell: avatar, name, one quiet line under it. */
.cc-who { display: flex; align-items: center; gap: 14px; min-width: 240px; }
.cc-who-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.cc-who-text b { font-weight: 700; font-size: 15.5px; color: var(--cc-text); overflow: hidden; text-overflow: ellipsis; }
.cc-who-text span { font-size: 13.5px; color: var(--cc-text-4); overflow: hidden; text-overflow: ellipsis; }

.cc-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--cc-raised);
    color: var(--cc-text-3);
    font-weight: 700;
    font-size: 14px;
}
.cc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-avatar.square { border-radius: 12px; }
.cc-avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.cc-avatar.lg { width: 56px; height: 56px; font-size: 18px; }

.cc-link { color: var(--cc-text-2) !important; text-decoration: none !important; }
.cc-link:hover { color: var(--cc-green-ink) !important; text-decoration: underline !important; }
.cc-dim { color: var(--cc-text-4); }
.cc-num { font-variant-numeric: tabular-nums; }

/* Status said in a colored word with a dot. */
.cc-status { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--cc-status, var(--cc-text-3)); }
.cc-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.cc-status.good { --cc-status: var(--cc-green-ink); }
.cc-status.bad { --cc-status: var(--cc-magenta-ink); }
.cc-status.warn { --cc-status: var(--cc-sun-ink); }
.cc-status.info { --cc-status: var(--cc-steel-ink); }
.cc-status.off { --cc-status: var(--cc-text-4); }

/* Copy-ID and open cells stay quiet until the row is hovered. */
.cc-page .cc-table td.ac-col-copy,
.cc-page .cc-table th.ac-col-copy { width: 44px; padding-inline: 4px; }
.cc-page .cc-table td.ac-col-open,
.cc-page .cc-table th.ac-col-open { width: 40px; padding-left: 0; color: var(--cc-green); }
.cc-page .cc-table td.ac-col-copy .id-copy-icon { opacity: 0; transition: opacity .12s; }
.cc-page .cc-table tr:hover td.ac-col-copy .id-copy-icon,
.cc-page .cc-table td.ac-col-copy .id-copy-icon:focus-visible,
.cc-page .cc-table td.ac-col-copy .id-copy-icon.copied { opacity: 1; }

.cc-page .cc-table td.ac-empty {
    padding: 44px 20px;
    text-align: center;
    color: var(--cc-text-4);
    font-weight: 600;
}

.cc-table-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: -8px;
    padding: 0 6px;
    color: var(--cc-text-4);
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ records */

.cc-record { --type-accent: var(--cc-green); --type-ink: var(--cc-green-ink); --type-wash: var(--cc-mint); }
.cc-record[data-type="location"] { --type-accent: var(--cc-steel); --type-ink: var(--cc-steel-ink); --type-wash: var(--cc-steel-20); }
.cc-record[data-type="company"] { --type-accent: #2c3836; --type-ink: var(--cc-text-2); --type-wash: #e6eae9; }
.cc-record[data-type="user"] { --type-accent: var(--cc-slate); --type-ink: var(--cc-text-3); --type-wash: #e6eae9; }

.cc-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -6px;
    color: var(--type-ink) !important;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none !important;
}
.cc-back:hover { text-decoration: underline !important; }

.cc-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
    padding: 28px 30px;
    border: 1px solid var(--cc-card-border);
    border-radius: 28px;
    background: linear-gradient(180deg, var(--type-wash) 0%, var(--cc-card) 82%);
}

.cc-hero-avatar {
    width: 112px;
    height: 112px;
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    background: var(--cc-card);
    box-shadow: 0 0 0 3px var(--cc-card), 0 0 0 6px var(--type-accent);
    display: grid;
    place-items: center;
    color: var(--type-ink);
    font: 300 40px/1 var(--cc-display);
}
.cc-hero-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-hero-avatar.square { border-radius: 26px; }

.cc-hero-titles { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }

.cc-type-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 11px 4px;
    border-radius: 6px;
    background: var(--type-accent);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 2.2px;
    text-transform: uppercase;
}

.cc-record .cc-hero h1 { font-size: 44px !important; overflow-wrap: anywhere; }

.cc-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; color: var(--cc-text-3); font-size: 15.5px; }
.cc-fact { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.cc-fact > i { color: var(--type-ink); font-size: 14px; }
.cc-fact a { color: var(--cc-text-2) !important; font-weight: 600; text-decoration: none !important; }
.cc-fact a:hover { color: var(--type-ink) !important; text-decoration: underline !important; }

.cc-hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.cc-hero-photo {
    width: 280px;
    max-width: 100%;
    aspect-ratio: 16 / 10;
    flex: none;
    overflow: hidden;
    border-radius: 20px;
    background: var(--cc-raised);
}
.cc-hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}
.cc-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cc-rail { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

@media (max-width: 1180px) {
    .cc-layout { grid-template-columns: minmax(0, 1fr); }
}

.cc-panel {
    min-width: 0;
    padding: 24px 26px;
    border: 1px solid var(--cc-card-border);
    border-radius: 20px;
    background: var(--cc-card);
    box-shadow: var(--cc-shadow);
}
.cc-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cc-panel-title { margin: 0 !important; display: flex; align-items: center; gap: 10px; color: var(--cc-text) !important; font-size: 19px !important; font-weight: 700 !important; letter-spacing: 0 !important; text-transform: none !important; }
.cc-panel-title > i { color: var(--type-ink); font-size: 17px; }
.cc-panel-title .n { color: var(--cc-text-4); font-weight: 600; font-size: 15px; }

/* A settings section inside a panel: plain heading, fields, hairline between. */
.cc-section + .cc-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--cc-hairline); }
.cc-section-label { margin: 0 0 14px !important; color: var(--cc-text-4) !important; font-size: 11.5px !important; font-weight: 700 !important; letter-spacing: 1.6px !important; text-transform: uppercase !important; }

/* Related rail: one card per relationship, rows link to the record. */
.cc-rel {
    overflow: hidden;
    border: 1px solid var(--cc-card-border);
    border-radius: 18px;
    background: var(--cc-card);
    box-shadow: var(--cc-shadow);
}
.cc-rel > header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 15.5px;
    color: var(--cc-text);
}
.cc-rel > header > i:first-child { color: var(--type-ink); }
.cc-rel > header .n { margin-left: auto; color: var(--cc-text-4); font-weight: 600; }
.cc-rel > header .cc-rel-action { margin-left: auto; }
.cc-rel > header .n + .cc-rel-action { margin-left: 8px; }

.cc-rel-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 9px 18px;
    border-top: 1px solid var(--cc-hairline);
    color: var(--cc-text) !important;
    text-decoration: none !important;
    background: none;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    width: 100%;
    text-align: left;
    font: inherit;
}
a.cc-rel-row:hover,
button.cc-rel-row:hover { background: var(--cc-raised); cursor: pointer; }
.cc-rel-row .primary { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cc-rel-row .primary b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 15px; }
.cc-rel-row .primary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cc-text-4); font-size: 13.5px; }
.cc-rel-row .trail { color: var(--cc-text-4); font-size: 13px; }
.cc-rel-row .icon-tile {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 12px;
    background: var(--type-wash);
    color: var(--type-ink);
    font-size: 15px;
}
.cc-rel-empty { padding: 12px 18px 16px; border-top: 1px solid var(--cc-hairline); color: var(--cc-text-4); font-size: 14px; }
.cc-rel-body { padding: 4px 18px 18px; border-top: 1px solid var(--cc-hairline); }

.cc-kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 14px; margin: 0; padding: 14px 18px 16px; border-top: 1px solid var(--cc-hairline); font-size: 14px; }
.cc-kv dt { color: var(--cc-text-4); font-weight: 600; }
.cc-kv dd { margin: 0; color: var(--cc-text-2); overflow-wrap: anywhere; }

.cc-quiet-danger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 4px 6px;
    color: var(--cc-text-4);
    font-size: 14px;
}

@media (max-width: 720px) {
    .cc-page h1, .cc-record h1 { font-size: 34px !important; }
    .cc-hero { padding: 22px 20px; gap: 18px; }
    .cc-hero-avatar { width: 84px; height: 84px; font-size: 30px; }
    .cc-hero-photo { width: 100%; }
    .cc-search { width: 100%; }
    .cc-head-actions { margin-left: 0; width: 100%; }
}

/* ------------------------------------------------------------ record forms + legacy panels
 * The individual and location pages still carry entity-detail.css (green title
 * tabs, borderless inputs on paper panels). On a .cc-record those give way to
 * the plain panel look above.
 */

.cc-record .ac-label,
.cc-record .ac-field > label {
    display: block;
    margin-bottom: 6px;
    color: var(--cc-text-3);
    font-size: 13px;
    font-weight: 700;
}

.cc-record.ind-page .ac-input,
.cc-record.loc-page .ac-input,
.cc-record .ac-input {
    min-height: 44px;
    padding: 9px 13px;
    border: 1.5px solid var(--cc-pill-border);
    border-radius: 12px;
    background: var(--cc-card);
    box-shadow: none;
    color: var(--cc-text);
    font-size: 15px;
}
.cc-record .ac-input:focus {
    border-color: var(--cc-green);
    outline: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--cc-green) 18%, transparent);
}
.cc-record .ac-input[disabled],
.cc-record .ac-input[readonly] { background: var(--cc-raised); color: var(--cc-text-3); }
.cc-record textarea.ac-input { min-height: 72px; line-height: 1.45; }

/* Panels that predate .cc-panel: give them the same card. */
.cc-record.ind-page .ind-devices-wrap,
.cc-record.loc-page .devgrid-wrap,
.cc-record.loc-page .loc-ind-devices,
.cc-record.loc-page .loc-staffnote,
.cc-record.loc-page .bandwidth-panel {
    margin: 0;
    padding: 24px 26px;
    border: 1px solid var(--cc-card-border);
    border-radius: 20px;
    background: var(--cc-card);
    box-shadow: var(--cc-shadow);
}

/* Green attached title tabs become plain panel titles. */
.cc-record.ind-page .ind-device-heading h2,
.cc-record.loc-page .gridhead h3,
.cc-record.loc-page .loc-ind-devices > h3,
.cc-record.loc-page .loc-staffnote-head .ac-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    color: var(--cc-text);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}
.cc-record.ind-page .ind-device-heading h2 > i { color: var(--type-ink); font-size: 17px; }
.cc-record.ind-page .ind-device-heading h2 .n { color: var(--cc-text-4); font-weight: 600; font-size: 15px; }

.cc-record .ind-device-empty {
    padding: 16px 18px;
    border: 1.5px dashed var(--cc-pill-border);
    border-radius: 16px;
    background: transparent;
    color: var(--cc-text-4);
}

.cc-record .ind-form-actions {
    border-top: 1px solid var(--cc-hairline);
    background: rgba(255, 255, 255, .96);
}
.cc-record .ind-btn,
.cc-record .loc-btn {
    border-radius: 999px;
}
.cc-record .ind-btn.primary,
.cc-record .loc-btn-primary {
    border-color: var(--cc-green);
    background: var(--cc-green);
    color: #fff;
}
.cc-record .ind-btn.primary:hover,
.cc-record .loc-btn-primary:hover { border-color: #33a674; background: #33a674; }

.cc-record .ind-profile-upload {
    padding: 0;
    background: none;
}

.cc-record .ind-user-card {
    border: 1px solid var(--cc-hairline);
    background: var(--cc-card);
}
.cc-record .ind-empty {
    border: 0;
    background: none;
    padding: 6px 0 4px;
    color: var(--cc-text-4);
    text-align: left;
}

.cc-record .ind-flash { margin: 0; }

/* ------------------------------------------------------------ location record */

.cc-record.loc-page .loc-lower.cc-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    margin: 0;
}
@media (max-width: 1180px) {
    .cc-record.loc-page .loc-lower.cc-layout { grid-template-columns: minmax(0, 1fr); }
}

/* The rail's legacy panels (hub, connectivity, geofences, notes) as related cards. */
.cc-record.loc-page .loc-rail {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}
.cc-record.loc-page .loc-rail > .ac-form-section,
.cc-record.loc-page .loc-rail > section:not(.cc-rel) {
    margin: 0;
    padding: 14px 18px 16px;
    border: 1px solid var(--cc-card-border) !important;
    border-radius: 18px;
    background: var(--cc-card);
    box-shadow: var(--cc-shadow);
}
.cc-record.loc-page .loc-rail .ac-form-section + .ac-form-section { padding-top: 14px; margin-top: 0; }
.cc-record.loc-page .loc-rail .ac-section-title {
    margin: 0 0 8px;
    color: var(--cc-text) !important;
    font-size: 15.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}
.cc-record.loc-page .loc-rail p,
.cc-record.loc-page .loc-rail dt { color: var(--cc-text-4); }

/* Settings: every section open and flat, hairlines between. */
.cc-record.loc-page .loc-settings .loc-accordion { display: block; }
.cc-record.loc-page .loc-settings .loc-acc {
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
}
.cc-record.loc-page .loc-settings .loc-acc + .loc-acc { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--cc-hairline); }
.cc-record.loc-page .loc-settings .loc-acc-head { display: none; }
.cc-record.loc-page .loc-settings .loc-acc-body { display: block; padding: 0; }
.cc-record.loc-page .loc-settings .loc-acc-body .ac-section-title,
.cc-record.loc-page .loc-settings .loc-acc-body > h2 {
    margin: 18px 0 12px;
    color: var(--cc-text-4);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}
.cc-record.loc-page .loc-settings .loc-acc-body > .ac-section-title:first-child,
.cc-record.loc-page .loc-settings .loc-acc-body > h2:first-child { margin-top: 0; }
.cc-record.loc-page .loc-settings .loc-actions { margin: 22px -26px -24px; padding: 14px 26px; border-radius: 0 0 20px 20px; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--cc-hairline); }
.cc-record.loc-page .loc-cover-strip { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--cc-hairline); }

/* Personal devices: one quiet block per person. */
.cc-record.loc-page .loc-ind-device { margin-top: 14px; border: 1px solid var(--cc-hairline); border-radius: 16px; }
.cc-record.loc-page .ind-device-compact-heading { margin-bottom: 10px; }

.cc-record.loc-page .loc-staffnote { border-left: 1px solid var(--cc-card-border); }
.cc-record.loc-page .loc-panel-note { color: var(--cc-text-4); }

.cc-record.loc-page .bandwidth-head h2 { margin: 0 0 4px; color: var(--cc-text); font-size: 19px; font-weight: 700; letter-spacing: 0; }
.cc-record.loc-page .gridhead { margin-bottom: 12px; }

/* Per-person device blocks: name on the left, actions on the right, devices below. */
.cc-record.loc-page .loc-ind-device {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 16px;
    padding: 12px 16px;
    background: var(--cc-card);
}
.cc-record.loc-page .loc-ind-device-body,
.cc-record.loc-page .loc-ind-device-body > .ind-device-panel { display: contents; }
.cc-record.loc-page .loc-ind-device .ind-device-compact-heading { margin: 0; justify-content: flex-end; }
.cc-record.loc-page .loc-ind-device .ind-device-list { grid-column: 1 / -1; }
.cc-record.loc-page .loc-ind-device .ind-device-empty { display: none; }
.cc-record.loc-page .loc-ind-device-owner { margin: 0; }

.cc-record wa-button.ind-device-add::part(base) {
    border: 1.5px solid var(--cc-green) !important;
    border-radius: 999px;
    background: var(--cc-card) !important;
    color: var(--cc-green-ink) !important;
    box-shadow: none;
    font-weight: 600;
}
.cc-record wa-button.ind-device-add:hover::part(base) { background: var(--cc-green-20) !important; }
.cc-record .ind-device-profile-link { display: none; }

/* ------------------------------------------------------------ fleet pages (Hubs, Wearables) */

.cc-page.fh-page { width: min(1880px, calc(100vw - (2 * var(--hearo-page-gutter, 2.25rem)))); }
.cc-page .fh-card {
    border: 1px solid var(--cc-card-border);
    border-radius: 20px;
    box-shadow: var(--cc-shadow);
}
.cc-page .fh-table thead th {
    background: var(--cc-card);
    color: var(--cc-text-4);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
}
.cc-page .fh-table td { border-bottom-color: var(--cc-hairline); }
.cc-page .fh-table tbody tr:hover td { background: var(--cc-raised); }
.cc-page .fh-card-head .fh-head-title { font-size: 17px; }
.fh-tab-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.cc-tab[aria-pressed="true"] .fh-tab-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.cc-page .wf-migration-banner { border-radius: 16px; }

/* Company logos sit in a white tile so wide marks stay legible. */
.cc-avatar.logo { background: #fff; box-shadow: inset 0 0 0 1px var(--cc-card-border); border-radius: 10px; }
.cc-avatar.logo img { object-fit: contain; padding: 4px; }
.cc-co { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.cc-co .cc-avatar { width: 30px; height: 30px; font-size: 11px; }
.cc-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-when.fresh { color: var(--cc-green-ink); font-weight: 600; }

.cc-sort { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--cc-text-4); font-size: 13.5px; }
.cc-sort .cc-tab { padding: 6px 12px; font-size: 13.5px; }

/* ------------------------------------------------------------ overlays (console-overlays.js) */

html.cc-overlay-open { overflow: hidden; }

.cc-drawer,
.cc-modal { position: fixed; inset: 0; z-index: 10000; }
.cc-drawer[hidden],
.cc-modal[hidden] { display: none; }
.cc-drawer-scrim,
.cc-modal-scrim {
    position: absolute;
    inset: 0;
    background: rgba(18, 32, 28, .38);
    opacity: 0;
    transition: opacity .16s ease;
}
.cc-drawer.is-open .cc-drawer-scrim,
.cc-modal.is-open .cc-modal-scrim { opacity: 1; }

.cc-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(760px, 100vw);
    background: var(--cc-card);
    box-shadow: -18px 0 40px rgba(22, 53, 42, .16);
    transform: translateX(24px);
    opacity: 0;
    transition: transform .16s ease, opacity .16s ease;
}
.cc-drawer.is-open .cc-drawer-panel { transform: none; opacity: 1; }
.cc-drawer-head,
.cc-modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--cc-hairline);
}
.cc-drawer-head h2,
.cc-modal-head h2 {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-family: var(--cc-display);
    font-size: 26px;
    font-weight: 400;
    color: var(--cc-text);
}
.cc-modal-head h2 i { color: var(--cc-green-ink); font-size: 18px; }
.cc-drawer-body { flex: 1; overflow-y: auto; padding: 22px 26px 0; }
.cc-drawer-panel--narrow { width: min(440px, 100vw); }
.cc-drawer-panel--narrow .cc-drawer-head h2 { font-size: 22px; }

/* Activity Feed settings (Views/Home/Partials/_ActivityFeedSettings.cshtml) */
.feed-settings__intro { margin: 0 0 14px; color: var(--cc-text-2); font-size: 14px; }
.feed-settings { list-style: none; margin: 0; padding: 0; }
.feed-settings__row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 0;
    padding: 16px 0;
    border-top: 1px solid var(--cc-hairline);
}
.feed-settings__row:last-child { border-bottom: 1px solid var(--cc-hairline); }
.feed-settings__copy { flex: 1; min-width: 0; }
.feed-settings__label { display: block; font-weight: 600; color: var(--cc-text); cursor: pointer; }
.feed-settings__help { margin: 4px 0 0; color: var(--cc-text-2); font-size: 13.5px; line-height: 1.45; }
.feed-settings__row .hearo-toggle { margin-top: 2px; }
.feed-settings__note { margin: 18px 0 0; color: var(--cc-text-2); font-size: 13.5px; line-height: 1.45; }
.feed-settings__note i { color: var(--cc-green-ink); margin-right: 6px; }
.feed-settings__status { min-height: 1.4em; margin: 12px 0 22px; color: var(--cc-text-2); font-size: 13px; }

.cc-modal-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    border-radius: 22px;
    background: var(--cc-card);
    box-shadow: 0 18px 40px rgba(22, 53, 42, .18);
    transform: translate(-50%, -48%);
    opacity: 0;
    transition: transform .16s ease, opacity .16s ease;
    overflow: hidden;
}
.cc-modal.is-open .cc-modal-panel { transform: translate(-50%, -50%); opacity: 1; }
.cc-modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.cc-modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--cc-hairline); }
.cc-modal-foot .spacer { flex: 1; }
.cc-modal-panel--narrow { width: min(480px, calc(100vw - 32px)); }
.cc-modal-panel--narrow .cc-modal-head h2 { font-size: 22px; }
.cc-feed-question { margin: 0; color: var(--cc-text-2); font-size: 15.5px; line-height: 1.5; }

/* Activity Feed pin in a list row. */
.cc-feed-pin {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--cc-text-4);
    cursor: pointer;
}
.cc-feed-pin:hover { background: var(--cc-raised); color: var(--cc-text); }
.cc-feed-pin[aria-pressed="true"] { color: var(--cc-green-ink); }
.cc-feed-pin[aria-busy="true"] { opacity: .5; }


.cc-icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--cc-text-3);
    font-size: 18px;
    cursor: pointer;
}
.cc-icon-btn:hover { background: var(--cc-raised); color: var(--cc-text); }

/* Google's Places dropdown must clear the overlays. */
.pac-container { z-index: 10050 !important; border-radius: 12px; }

/* Side panels: related records open over the page, stacked, each one a frame
   of the record's own page with ?panel=1. Lower panels stay visible as strips. */
html.cc-panels-open, html.cc-panels-open body { overflow: hidden; }
.cc-panels { position: fixed; inset: 0; z-index: 10010; }
.cc-panels[hidden] { display: none; }
.cc-panels-scrim { position: absolute; inset: 0; background: rgba(18, 32, 28, .32); animation: cc-panel-fade .15s ease-out; }
.cc-sidepanel {
    --depth: 0;
    position: absolute;
    top: 0;
    bottom: 0;
    right: calc(var(--depth) * 56px);
    display: flex;
    flex-direction: column;
    width: min(1320px, calc(100vw - 120px - var(--depth) * 56px));
    background: var(--cc-raised);
    border-radius: 18px 0 0 18px;
    box-shadow: -18px 0 48px rgba(22, 53, 42, .18);
    overflow: hidden;
    animation: cc-panel-in .2s ease-out;
}
.cc-sidepanel:not([data-top]) { filter: brightness(.94); cursor: pointer; }
.cc-sidepanel-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 10px 24px;
    border-bottom: 1px solid var(--cc-hairline);
    background: var(--cc-card);
}
.cc-sidepanel-head b {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cc-text);
    font-family: var(--cc-display);
    font-size: 19px;
    font-weight: 500;
}
.cc-sidepanel-head .cc-btn { flex: none; }
.cc-sidepanel iframe { flex: 1; width: 100%; border: 0; background: var(--cc-raised); }
.cc-sidepanel-cover { position: absolute; inset: 0; }
@keyframes cc-panel-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes cc-panel-fade { from { opacity: 0; } }
@media (max-width: 900px) {
    .cc-sidepanel { right: 0; width: 100vw; border-radius: 0; }
    .cc-sidepanel:not([data-top]) { display: none; }
}

/* The page inside a panel: no site chrome, and the record fills the panel. */
html.cc-in-panel .site_header,
html.cc-in-panel .staging-outbound-banner,
html.cc-in-panel #emergencylist,
html.cc-in-panel #hearo-assist-app,
html.cc-in-panel .cc-back,
html.cc-in-panel .live-activity-back { display: none !important; }
html.cc-in-panel, html.cc-in-panel body { background: var(--cc-raised); }
html.cc-in-panel .cc-record,
html.cc-in-panel .cc-page { --cc-width: calc(100% - 52px); padding-top: 22px; }

/* Live activity embedded in the modal: no site chrome. */
html.activity-embed .site_header,
html.activity-embed #hearo_site_nav,
html.activity-embed #global_notifications_list,
html.activity-embed .live-activity-back,
html.activity-embed #hearo-assist-app { display: none !important; }

/* ------------------------------------------------------------ record pieces */

.cc-status-line {
    margin: 0;
    font-family: var(--cc-display);
    font-size: 24px;
    font-weight: 350;
    line-height: 1.25;
    color: var(--cc-green-ink);
}
.cc-status-line.bad { color: var(--cc-magenta-ink); }
.cc-status-line.warn { color: var(--cc-sun-ink); }
.cc-status-line.off { color: var(--cc-text-3); }

.cc-fact .cc-fact-logo { width: 24px; height: 24px; border-radius: 7px; }

/* A panel that folds: header is the summary, body below. */
details.cc-collapse > summary {
    display: flex;
    align-items: center;
    gap: 14px;
    list-style: none;
    cursor: pointer;
}
details.cc-collapse > summary::-webkit-details-marker { display: none; }
.cc-collapse-hint { color: var(--cc-text-4); font-size: 14px; }
.cc-collapse-caret { margin-left: auto; color: var(--cc-text-4); transition: transform .15s; }
details.cc-collapse[open] > summary { margin-bottom: 18px; }
details.cc-collapse[open] .cc-collapse-caret { transform: rotate(180deg); }

/* Location: people, notes, network, bandwidth */
.cc-record.loc-page .loc-people .loc-ind-device { margin-top: 10px; }
.cc-record.loc-page .loc-people .loc-ind-device:first-of-type { margin-top: 0; }
.cc-record.loc-page .loc-ind-device-owner { display: flex; align-items: center; gap: 14px; }
.cc-record.loc-page .loc-ind-device-owner h4 { margin: 0; font-size: 16px; font-weight: 700; }
.cc-record.loc-page .loc-ind-device-owner span { color: var(--cc-text-4); font-size: 13.5px; }
.loc-person-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 52px;
    height: 52px;
    overflow: hidden;
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--cc-card), 0 0 0 5px var(--cc-mint);
    color: #fff;
    font-weight: 700;
    text-decoration: none !important;
}
.loc-person-avatar img { width: 100%; height: 100%; object-fit: cover; }

.cc-record.loc-page .loc-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.cc-record.loc-page .loc-notes > * { margin: 0; }
/* While a note is being edited it takes the full width, and the other sits under it. */
.cc-record.loc-page .loc-notes:has(.loc-staffnote-edit:not([hidden])) { grid-template-columns: minmax(0, 1fr); }

.cc-record.loc-page .loc-bandwidth .bandwidth-panel { padding: 0; border: 0; box-shadow: none; }
.cc-record.loc-page .loc-bandwidth .bandwidth-head h2 { display: none; }

.cc-record.loc-page .loc-network .cc-rel-row .cc-status { font-size: 13px; text-transform: capitalize; }
.loc-network-more { border-top: 1px solid var(--cc-hairline); }
.loc-network-more > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    list-style: none;
    cursor: pointer;
    color: var(--cc-green-ink);
    font-weight: 600;
    font-size: 14px;
}
.loc-network-more > summary::-webkit-details-marker { display: none; }
.loc-network-more > summary::after,
details.cc-collapse > summary::after { display: none !important; }
.loc-network-more[open] > summary i { transform: rotate(180deg); }
.cc-record.loc-page .loc-rail .loc-network-more > .ac-form-section {
    margin: 0;
    padding: 4px 18px 14px;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
}

/* Settings live in the edit drawer. */
.cc-record.loc-page .cc-drawer .loc-settings .loc-actions,
.cc-record.loc-page .cc-drawer .loc-actions {
    position: sticky;
    bottom: 0;
    display: flex !important;
    margin: 24px -26px 0;
    padding: 14px 26px;
    border-top: 1px solid var(--cc-hairline);
    border-radius: 0;
    background: rgba(255, 255, 255, .97);
}
.cc-record.loc-page .cc-drawer .loc-cover-strip { display: block; }

/* Geofence editor */
.cc-modal--geofence .cc-modal-panel { width: min(760px, calc(100vw - 32px)); }
.cc-modal--geofence .geofence-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.cc-modal--geofence .geofence-field > label { color: var(--cc-text-3); font-size: 13px; font-weight: 700; }
.cc-modal--geofence .ac-input { min-height: 44px; padding: 9px 13px; border: 1.5px solid var(--cc-pill-border); border-radius: 12px; font-size: 15px; }
.geofence-search { position: relative; }
.geofence-search > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--cc-text-4); pointer-events: none; }
.cc-modal--geofence .geofence-search .ac-input { width: 100%; padding-left: 42px; border-radius: 999px; }
.geofence-map { height: 340px; border-radius: 16px; background: var(--cc-raised); overflow: hidden; }
.geofence-map.is-unavailable::after { content: "Map unavailable. Enter coordinates below."; display: grid; place-items: center; height: 100%; color: var(--cc-text-4); }
.geofence-map-hint { margin: 8px 2px 14px; color: var(--cc-text-4); font-size: 13px; }
.cc-modal--geofence .geofence-coordinates { display: grid; grid-template-columns: 120px 1fr 1fr; gap: 12px; }
.cc-modal--geofence .geofence-coordinates .geofence-field { margin-bottom: 0; }
.cc-modal--geofence .geofence-status { margin: 10px 0 0; color: var(--cc-text-3); }

/* Home hardware: compact row tiles instead of tall product cards. */
.cc-record.loc-page .devgrid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 10px !important;
}
.cc-record.loc-page .devgrid .tile:not(.is-action) {
    display: grid !important;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 0 !important;
    height: auto !important;
    padding: 10px 12px !important;
    border: 1px solid var(--cc-hairline) !important;
    border-radius: 16px !important;
    background: var(--cc-card) !important;
    box-shadow: none !important;
    text-align: left;
}
.cc-record.loc-page .devgrid .tile:not(.is-action):hover { border-color: var(--cc-pill-border) !important; background: var(--cc-raised) !important; }
/* Thumbnail: a soft category tile with the device photo or icon, nothing laid over it. */
.cc-record.loc-page .devgrid .tile .device-feature {
    position: relative;
    display: grid !important;
    place-items: center;
    width: 56px !important;
    height: 56px !important;
    min-height: 0 !important;
    flex: 0 0 56px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 14px !important;
    overflow: visible !important;
}
.cc-record.loc-page .devgrid .tile .device-feature::after,
.cc-record.loc-page .devgrid .tile .device-feature .owner { display: none !important; }
.cc-record.loc-page .devgrid .tile .device-feature .ico {
    display: grid !important;
    place-items: center;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden;
    font-size: 22px !important;
}
.cc-record.loc-page .devgrid .tile .device-feature .ico > i { font-size: 22px !important; }
.cc-record.loc-page .devgrid .tile .device-feature .ico.has-img > img {
    width: 100% !important;
    height: 100% !important;
    padding: 4px !important;
    object-fit: contain;
    transform: none !important;
    filter: none !important;
}
/* Status shows only when it needs a look: a dot on the thumbnail's corner. */
.cc-record.loc-page .devgrid .tile .device-confidence {
    position: absolute !important;
    z-index: 2;
    top: auto !important;
    left: auto !important;
    right: -4px;
    bottom: -4px;
    display: block !important;
    width: 14px;
    height: 14px;
    min-height: 0 !important;
    padding: 0 !important;
    border: 2.5px solid var(--cc-card);
    border-radius: 50%;
    box-shadow: none !important;
    backdrop-filter: none !important;
    font-size: 0 !important;
}
.cc-record.loc-page .devgrid .tile .device-confidence > i { display: block; width: 100%; height: 100%; }
.cc-record.loc-page .devgrid .tile .device-confidence span,
.cc-record.loc-page .devgrid .tile .device-confidence.tone-good,
.cc-record.loc-page .devgrid .tile .device-confidence.tone-info,
.cc-record.loc-page .devgrid .tile .device-confidence.tone-unknown { display: none !important; }
.cc-record.loc-page .devgrid .tile .device-card-body { padding: 0 !important; min-width: 0; }
.cc-record.loc-page .devgrid .tile .device-card-heading { align-items: flex-start; gap: 6px; }
.cc-record.loc-page .devgrid .tile h4 { margin: 0 !important; font-size: 15px !important; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-record.loc-page .devgrid .tile .tags { margin-top: 2px !important; gap: 4px; }
.cc-record.loc-page .devgrid .tile .tags .tag { padding: 0 !important; background: none !important; color: var(--cc-text-4) !important; font-size: 12.5px !important; text-transform: none; letter-spacing: 0; }
.cc-record.loc-page .devgrid .tile .tags .tag + .tag::before { content: "· "; }
.cc-record.loc-page .devgrid .tile .val { margin: 4px 0 0 !important; padding: 0 !important; background: none !important; }
.cc-record.loc-page .devgrid .tile .val > span { display: none; }
.cc-record.loc-page .devgrid .tile .val strong { font-size: 14px !important; font-weight: 600; color: var(--cc-text-2); }
.cc-record.loc-page .devgrid .tile .device-confidence-detail { display: none !important; }
.cc-record.loc-page .devgrid .tile .device-recency { margin-top: 2px !important; font-size: 12.5px !important; color: var(--cc-text-4); }
.cc-record.loc-page .devgrid .tile .pen { width: 28px; height: 28px; opacity: .55; }
.cc-record.loc-page .devgrid .tile:hover .pen { opacity: 1; }
