.cna-public-widget,
.cna-control {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

.cna-public-widget *,
.cna-control * {
    box-sizing: border-box;
}

.cna-status {
    width: 100%;
    text-align: center;
    padding: 12px 8px 18px;
    color: #222;
}

.cna-status-program {
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.cna-status-image {
    display: block;
    width: auto;
    max-width: min(250px, 80%);
    height: auto;
    max-height: 280px;
    margin: 0 auto 10px;
    object-fit: contain;
}

.cna-status-name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.cna-control {
    width: 100%;
    max-width: 980px;
    margin: 20px auto;
    color: #252525;
}

.cna-control h2,
.cna-control h3,
.cna-control p {
    margin-top: 0;
}

.cna-control-header,
.cna-section-title,
.cna-form-actions,
.cna-card-actions,
.cna-table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cna-control-header,
.cna-section-title {
    justify-content: space-between;
}

.cna-control-header {
    margin-bottom: 16px;
}

.cna-control-header h2 {
    margin-bottom: 4px;
}

.cna-control-header p {
    margin-bottom: 0;
    color: #666;
}

.cna-logout {
    color: #555;
}

.cna-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 1px solid #ddd;
}

.cna-tab {
    display: inline-block;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.cna-tab.is-active {
    color: #167344;
    border-bottom-color: #167344;
    font-weight: 700;
}

.cna-panel,
.cna-login-box {
    margin-bottom: 18px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.cna-notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-left: 4px solid;
    background: #fff;
}

.cna-notice-success {
    border-color: #198754;
    background: #edf8f1;
}

.cna-notice-error {
    border-color: #b42318;
    background: #fff0ef;
}

.cna-current-summary {
    display: flex;
    align-items: center;
    gap: 18px;
}

.cna-current-summary img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f3f3;
}

.cna-current-summary strong,
.cna-current-summary span,
.cna-current-summary small {
    display: block;
}

.cna-current-summary strong {
    margin-bottom: 5px;
    font-size: 20px;
}

.cna-current-summary span {
    margin-bottom: 5px;
    font-size: 17px;
}

.cna-current-summary small,
.cna-form small {
    color: #666;
}

.cna-form {
    max-width: 680px;
}

.cna-form label,
.cna-form legend {
    display: block;
    margin: 13px 0 6px;
    font-weight: 700;
}

.cna-form input[type="text"],
.cna-form input[type="time"],
.cna-form input[type="file"],
.cna-form select,
.cna-login-box input[type="text"],
.cna-login-box input[type="password"] {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #fff;
    font: inherit;
}

.cna-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.cna-fieldset {
    margin: 16px 0;
    padding: 0;
    border: 0;
}

.cna-day-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 14px;
}

.cna-day-grid label {
    margin: 0;
    font-weight: 400;
}

.cna-button,
.cna-login-box input[type="submit"] {
    display: inline-block;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    line-height: 20px;
    text-decoration: none;
}

.cna-button-primary,
.cna-login-box input[type="submit"] {
    color: #fff;
    background: #167344;
    border-color: #167344;
}

.cna-button-primary:hover,
.cna-login-box input[type="submit"]:hover {
    color: #fff;
    background: #105b35;
}

.cna-button-secondary {
    color: #333;
    background: #f4f4f4;
    border-color: #aaa;
}

.cna-form-actions {
    margin-top: 18px;
}

.cna-inline-form {
    margin-top: 14px;
}

.cna-host-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.cna-host-card {
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
}

.cna-host-card.is-inactive {
    background: #f5f5f5;
}

.cna-host-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #eee;
}

.cna-host-card-body {
    padding: 11px;
}

.cna-host-card-body strong {
    display: block;
    min-height: 40px;
}

.cna-status-pill {
    display: inline-block;
    margin: 7px 0;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.cna-status-pill.is-on {
    color: #12633b;
    background: #dbf3e5;
}

.cna-status-pill.is-off {
    color: #666;
    background: #e5e5e5;
}

.cna-card-actions form,
.cna-table-actions form {
    margin: 0;
}

.cna-link-button {
    padding: 0;
    color: #1769aa;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.cna-link-danger {
    color: #a51d1d;
}

.cna-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
}

.cna-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cna-table th,
.cna-table td {
    padding: 10px 9px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #ddd;
}

.cna-table th {
    background: #f3f3f3;
}

.cna-login-box {
    max-width: 430px;
}

.cna-login-box label {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

.cna-login-box .login-remember label {
    font-weight: 400;
}

@media (max-width: 700px) {
    .cna-host-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cna-section-title {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .cna-panel,
    .cna-login-box {
        padding: 15px;
    }

    .cna-host-grid,
    .cna-form-row,
    .cna-day-grid {
        grid-template-columns: 1fr;
    }

    .cna-current-summary {
        align-items: flex-start;
    }

    .cna-current-summary img {
        width: 76px;
        height: 76px;
    }
}
