* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: #d9d4c7;
    background-image:
        linear-gradient(45deg, rgba(255,255,255,0.18) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.18) 75%, rgba(255,255,255,0.18)),
        linear-gradient(45deg, rgba(0,0,0,0.04) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.04) 75%, rgba(0,0,0,0.04));
    background-size: 24px 24px;
    background-position: 0 0, 12px 12px;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
}

.page-wrap {
    max-width: 700px;
    margin: 30px auto;
    padding: 28px 28px 48px;
    background: #fff;
    min-height: auto;
    font-size: 18px;
    line-height: 1.55;
    border: 6px solid #222;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

h1 {
    font-size: 2rem;
    line-height: 1.15;
    margin: 0 0 1rem;
}

h2 {
    font-size: 1.45rem;
    line-height: 1.25;
    margin: 1.4rem 0 0.7rem;
}

p {
    margin: 0 0 1rem;
}

ul {
    margin-top: 0;
    padding-left: 1.4rem;
}

li {
    margin-bottom: 0.45rem;
}

a {
    color: #0645ad;
}

.button,
button {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    background: #222;
    color: #fff;
    padding: 0.7rem 1rem;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
}

.notice {
    border: 1px solid #ddd;
    background: #fafafa;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.code-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 1rem 0;
}

.code-form input {
    flex: 1;
    min-width: 0;
    padding: 0.7rem;
    font-size: 1.1rem;
    border: 1px solid #bbb;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.small-note {
    font-size: 0.9rem;
    color: #666;
}

hr {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 1.5rem 0;
}

@media (max-width: 600px) {
    .page-wrap {
        margin: 12px;
        padding: 20px 14px 42px;
        font-size: 17px;
        border: 5px solid #222;
        border-radius: 8px;
    }

    h1 {
        font-size: 1.7rem;
    }

    .code-form {
        flex-direction: column;
        align-items: stretch;
    }

    .button,
    button {
        width: 100%;
        text-align: center;
    }
}

/* Admin form/table additions */
input[type="text"],
input[type="url"],
textarea {
    width: 100%;
    padding: 0.65rem;
    font: inherit;
    border: 1px solid #bbb;
    border-radius: 8px;
}

textarea {
    resize: vertical;
}

label {
    font-weight: bold;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    border: 1px solid #ddd;
    padding: 0.45rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f0f0f0;
}

/* Codes dashboard additions */
select {
    width: 100%;
    padding: 0.65rem;
    font: inherit;
    border: 1px solid #bbb;
    border-radius: 8px;
    background: #fff;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .filter-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Hits report additions */
.small-cell {
    font-size: 0.78rem;
    word-break: break-word;
}

.filter-form {
    margin: 1rem 0;
}

/* Card-style hits report */
.hits-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.hit-card {
    border: 2px solid #222;
    border-radius: 10px;
    background: #fff;
    padding: 0.9rem 1rem;
}

.hit-card-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #ddd;
}

.hit-time {
    font-size: 0.92rem;
    color: #555;
}

.hit-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.45rem 0.8rem;
}

.hit-label {
    font-weight: bold;
}

.hit-value {
    min-width: 0;
}

.breaky {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.small-cell {
    font-size: 0.85rem;
}

.filter-form {
    margin: 1rem 0;
}

@media (max-width: 600px) {
    .hit-card {
        padding: 0.8rem;
    }

    .hit-card-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .hit-grid {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .hit-label {
        margin-top: 0.35rem;
    }
}

/* Bad requests report additions */
.summary-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.8rem 0 1.2rem;
}

.pill {
    display: inline-block;
    padding: 0.35rem 0.55rem;
    border: 1px solid #222;
    border-radius: 999px;
    background: #fff;
    color: #222;
    text-decoration: none;
    font-size: 0.9rem;
}

.pill:hover {
    background: #f0f0f0;
}

.bad-card {
    border-style: dashed;
}

.admin-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem 0;
}

.admin-buttons .button {
    margin: 0;
}

/* Hits business-context additions */
.section-label {
    margin-top: 0.65rem;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: #555;
}

.section-line {
    border-top: 1px solid #ddd;
    margin-top: 0.8rem;
    min-height: 1px;
}

/* Card-style codes dashboard additions */
.code-card .hit-card-top strong a {
    font-size: 1.35rem;
    letter-spacing: 0.06em;
    text-decoration: none;
}

.code-card .hit-card-top strong a:hover {
    text-decoration: underline;
}

.codes-cards {
    margin-top: 1rem;
}

/* Block page builder additions */
.builder-block {
    border: 2px solid #222;
    border-radius: 10px;
    padding: 0.8rem;
    margin: 0.9rem 0;
    background: #fff;
}

.builder-block-top {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.builder-block-top button {
    width: auto;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

.builder-block textarea {
    min-height: 7rem;
}

.contact-block {
    margin-top: 1rem;
}

.page-wrap ol,
.page-wrap ul {
    margin-left: 1.4rem;
    line-height: 1.45;
}

/* Contact/copyright block additions */
.contact-option {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.65rem;
    margin: 0.65rem 0;
    background: #fafafa;
}

.contact-option label {
    display: block;
    margin: 0.35rem 0;
}

.copyright-block {
    text-align: center;
    font-size: 0.85rem;
    color: #555;
    margin-top: 2rem;
}

/* Slip template management additions */
.slip-preview-box {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.75rem;
    background: #fafafa;
    margin: 0.75rem 0;
}

input::placeholder,
textarea::placeholder {
    color: #8a8a8a;
    opacity: 1;
    font-style: italic;
    font-weight: 300;
    font-size: 0.75em;
}

input:focus::placeholder,
textarea:focus::placeholder {
    color: #b0b0b0;
}

.image-block {
    margin: 1.25rem 0;
    text-align: center;
}

.image-block img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.image-block figcaption {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: #555;
    font-style: italic;
}

.hit-card-unknown {
    background: #ff0000;
    border-color: #ff0000;
}
/* Box251 Version 2 shared administration */
.admin-bar { display:flex; flex-wrap:wrap; gap:.45rem; padding:.65rem; margin:0 0 1rem; background:#17202a; border-radius:10px; }
.admin-bar a { color:#fff; text-decoration:none; padding:.38rem .62rem; border-radius:7px; font-size:.92rem; }
.admin-bar a:hover, .admin-bar a:focus { background:#34495e; }
.login-wrap { max-width:520px; }
input, select, textarea, button { max-width:100%; }
button, .button { cursor:pointer; }
@media (max-width:640px) { .page-wrap { padding:.85rem; } table { font-size:.88rem; } .admin-bar a { flex:1 1 auto; text-align:center; } }

/* Detailed one-hit code-chain display */
.code-chain { display: grid; gap: .45rem; }
.code-chain-step { border: 1px solid #cfd5dc; border-radius: 8px; padding: .7rem .8rem; background: #f8fafc; }
.code-chain-heading { font-size: 1.02rem; margin-bottom: .2rem; }
.code-chain-meta { font-size: .85rem; color: #4b5563; margin-bottom: .35rem; }
.code-chain-arrow { text-align: center; font-size: 1.15rem; line-height: 1; color: #4b5563; }
.code-chain-outreach { margin-top: .5rem; padding-top: .45rem; border-top: 1px dashed #c7cdd4; }

/* Outreach workflow upgrade */
.builder-section{margin:1.25rem 0;padding:1rem;border:1px solid #d7dde5;border-radius:12px;background:#fff}.selection-grid,.story-grid,.summary-cards{display:grid;gap:.8rem}.selection-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}.selection-card{display:block;padding:.8rem;border:1px solid #d9dee6;border-radius:10px;background:#f8fafc;cursor:pointer}.selection-card:hover{border-color:#8da2bd;background:#fff}.run-total{padding:.9rem 1rem;background:#eef6ff;border-left:5px solid #3d78b8;border-radius:7px;margin:1rem 0}.small-muted{font-size:.88rem;color:#667085}.notice-error{border-left-color:#b42318;background:#fff1f0}.button-primary{font-weight:700}.person-hero{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;margin:1rem 0;padding:1rem;border:1px solid #d7dde5;border-radius:12px;background:#fff}.person-hero h2{margin:0 0 .25rem}.summary-cards{grid-template-columns:repeat(auto-fit,minmax(125px,1fr));margin:1rem 0}.summary-card{padding:1rem;border:1px solid #d7dde5;border-radius:12px;background:#f6f7f9;text-align:center}.summary-card strong{display:block;font-size:1.65rem}.summary-card span{display:block;font-size:.88rem;margin-top:.2rem}.story-grid{grid-template-columns:repeat(auto-fit,minmax(245px,1fr));margin:.8rem 0 1.5rem}.story-card{padding:1rem;border:1px solid #d7dde5;border-left-width:6px;border-radius:12px;background:#fff;line-height:1.45}.story-card-top{display:flex;justify-content:space-between;gap:.75rem;margin-bottom:.5rem}.story-blue{border-left-color:#2e75b6;background:#f3f8fd}.story-purple{border-left-color:#7a4caf;background:#faf6ff}.story-green{border-left-color:#2e8b57;background:#f4fbf7}.story-gray{border-left-color:#8a929d;background:#f7f8f9}.story-orange{border-left-color:#cc7a00;background:#fff8eb}.story-red{border-left-color:#b42318;background:#fff4f2}@media(max-width:650px){.person-hero{display:block}.person-hero>div+div{margin-top:.75rem}.story-card-top{display:block}}
.audience-tools{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin:14px 0}.audience-tools>div{border:1px solid #d7dce3;border-radius:10px;padding:12px;background:#f8fafc}.compact-checks{max-height:360px;overflow:auto;border:1px solid #d7dce3;border-radius:10px;padding:10px}.compact-checks label{display:block;padding:7px;border-bottom:1px solid #edf0f3}.compact-checks label:last-child{border-bottom:0}


/* Mixed audience selector */
.audience-filter-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem;margin:1rem 0}.filter-checks{max-height:180px;overflow:auto;border:1px solid #ccd3db;border-radius:8px;padding:.6rem;background:#fff}.filter-checks label{display:block;margin:.25rem 0}.audience-selection-actions{margin:.75rem 0}.audience-person-list{max-height:360px;overflow:auto;border:1px solid #ccd3db;border-radius:8px;background:#fff}.audience-person-row{display:flex;gap:.45rem;align-items:center;padding:.55rem .7rem;border-bottom:1px solid #e6e9ed}.audience-person-row:last-child{border-bottom:0}.audience-person-row:hover{background:#f5f7fa}.selected-audience-box{margin-top:1rem;padding:.8rem;border:1px solid #9eb7d2;border-radius:8px;background:#eef6ff}.selected-audience-names{margin-top:.35rem;font-size:.92rem;line-height:1.4}.hit-value .button{margin-right:.45rem}

/* Ensure filtered audience rows actually disappear. */
.audience-person-row[hidden]{display:none;}

/* Searchable source and People List pickers */
.audience-picker{min-width:0}.picker-search-label{display:block;margin:.55rem 0}.picker-results{max-height:210px;overflow:auto;border:1px solid #ccd3db;border-radius:8px;background:#fff}.picker-row{display:flex;align-items:center;gap:.45rem;padding:.52rem .65rem;border-bottom:1px solid #e6e9ed}.picker-row:last-child{border-bottom:0}.picker-row:hover{background:#f5f7fa}.picker-row[hidden]{display:none}.picker-selected{margin:.55rem 0;padding:.55rem .65rem;border:1px solid #d6e1ec;border-radius:8px;background:#f7fbff;font-size:.9rem;line-height:1.35}
