.wsb-app {
    --wsb-border: #b7bcc4;
    --wsb-soft: #f6f7f8;
    --wsb-text: #1f2937;
    color: var(--wsb-text);
    max-width: 1180px;
    margin: 1.5rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wsb-app .button {
    appearance: none;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    color: #1d2327;
    padding: .5rem .75rem;
    font: inherit;
    line-height: 1.2;
    cursor: pointer;
}
.wsb-app .button:hover { background: #f6f7f7; border-color: #646970; }
.wsb-app .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}
.wsb-app .button-primary:hover { background: #135e96; border-color: #135e96; }

.wsb-app .button:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.wsb-app .wsb-delete-selected:not(:disabled) {
    border-color: #b42318;
    color: #b42318;
}
.wsb-app .wsb-delete-selected:not(:disabled):hover {
    background: #fff1f0;
    border-color: #912018;
}
.wsb-selection-mode .wsb-schedule-table .wsb-editable-cell {
    cursor: crosshair;
}
.wsb-schedule-table .wsb-editable-cell.is-selected-block {
    outline: 4px solid #2271b1;
    outline-offset: -4px;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.85);
}
.wsb-schedule-table .wsb-editable-cell.is-selected-block::after {
    content: '\2713';
    position: absolute;
    top: 4px;
    right: 4px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #2271b1;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.wsb-toolbar,
.wsb-user-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    align-items: end;
    margin-bottom: 1rem;
}
.wsb-title-area { flex: 1 1 340px; }
.wsb-title-area label,
.wsb-setup label,
.wsb-field label {
    display: block;
    font-weight: 600;
    margin-bottom: .3rem;
}
.wsb-title-input,
.wsb-setup textarea,
.wsb-field textarea,
.wsb-field input[type="number"],
.wsb-field input[type="text"],
.wsb-field select,
.wsb-user-row select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: .55rem .65rem;
    background: #fff;
}
.wsb-title-input { font-size: 1.1rem; }
.wsb-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.wsb-user-row { align-items: center; }
.wsb-user-row label { font-weight: 600; }
.wsb-user-row select { width: auto; min-width: 240px; }
.wsb-status { font-size: .9rem; min-height: 1.2em; }
.wsb-status.is-error { color: #b42318; }
.wsb-status.is-ok { color: #067647; }
.wsb-login-note { display: inline-flex; gap: .5rem; flex-wrap: wrap; }
.wsb-setup {
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    padding: .75rem 1rem;
    background: #fafafa;
    margin-bottom: 1rem;
}
.wsb-setup summary { font-weight: 650; cursor: pointer; }
.wsb-setup-grid {
    display: grid;
    grid-template-columns: minmax(180px, .65fr) minmax(220px, 1fr) minmax(180px, .55fr);
    gap: 1rem;
    margin-top: 1rem;
}
.wsb-setup textarea { min-height: 180px; resize: vertical; }
.wsb-setup-actions { align-self: end; }
.wsb-help {
    background: #f0f6fc;
    border: 1px solid #c8ddf0;
    padding: .65rem .8rem;
    border-radius: 5px;
    margin-bottom: .8rem;
    font-size: .92rem;
}
.wsb-table-wrap {
    overflow-x: auto;
    border-radius: 4px;
    box-shadow: 0 0 0 1px var(--wsb-border);
    background: #fff;
}
.wsb-schedule-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 760px;
    table-layout: fixed;
    margin: 0;
    background: #fff;
}
.wsb-schedule-table th,
.wsb-schedule-table td {
    border: 1px solid #333;
    padding: 7px 8px;
    vertical-align: top;
    line-height: 1.25;
    box-sizing: border-box;
}
.wsb-schedule-table thead th {
    background: #f2f4f7;
    font-weight: 650;
    text-align: left;
}
.wsb-schedule-table .wsb-time-head,
.wsb-schedule-table .wsb-time-cell {
    width: 95px;
    background: #fff;
    color: #111;
    font-weight: 500;
}
.wsb-schedule-table .wsb-editable-cell {
    cursor: pointer;
    min-height: 42px;
    white-space: pre-wrap;
    word-break: break-word;
    position: relative;
}
.wsb-schedule-table .wsb-editable-cell:hover {
    outline: 3px solid rgba(34,113,177,.28);
    outline-offset: -3px;
}
.wsb-schedule-table .wsb-editable-cell:focus {
    outline: 3px solid rgba(34,113,177,.5);
    outline-offset: -3px;
}
.wsb-empty-cell { color: #667085; }
.wsb-modal[hidden] { display: none !important; }
.wsb-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.wsb-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17,24,39,.55);
}
.wsb-modal-card {
    position: relative;
    width: min(620px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 18px 55px rgba(0,0,0,.28);
    padding: 1rem;
}
.wsb-modal-head { display: flex; align-items: center; gap: 1rem; }
.wsb-modal-head h2 { margin: 0; font-size: 1.2rem; }
.wsb-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}
.wsb-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.wsb-field input[type="color"] { width: 100%; height: 42px; padding: 2px; }
.wsb-preset-label {
    margin-top: .55rem;
    font-size: .78rem;
    font-weight: 600;
    color: #475467;
}
.wsb-color-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
    gap: 6px;
    margin-top: .35rem;
}
.wsb-color-swatch {
    position: relative;
    width: 100%;
    min-width: 28px;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 1px solid #98a2b3;
    border-radius: 5px;
    background: var(--wsb-swatch-color);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}
.wsb-color-swatch:hover,
.wsb-color-swatch:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}
.wsb-color-swatch.is-selected::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 2px solid #111827;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.9);
}
.wsb-color-swatch.is-light.is-selected::after,
.wsb-color-swatch[data-color="#ffffff"].is-selected::after {
    border-color: #111827;
}
.wsb-text-swatches {
    grid-template-columns: repeat(2, 34px);
}
.wsb-field input[readonly] {
    background: #f6f7f8;
    color: #475467;
}
.wsb-span-help {
    margin: .35rem 0 0;
    font-size: .82rem;
    line-height: 1.3;
}
.wsb-modal-actions { display: flex; gap: .5rem; align-items: center; margin-top: 1.25rem; }
.wsb-spacer { flex: 1; }
@media (max-width: 760px) {
    .wsb-setup-grid { grid-template-columns: 1fr; }
    .wsb-modal-grid { grid-template-columns: 1fr; }
    .wsb-actions { width: 100%; }
    .wsb-actions .button { flex: 1 1 120px; }
}
@media print {
    body * { visibility: hidden !important; }
    .wsb-table-wrap,
    .wsb-table-wrap * { visibility: visible !important; }
    .wsb-editable-cell.is-selected-block::after { display: none !important; }
    .wsb-table-wrap {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        overflow: visible;
    }
}

.wsb-json-file { display: none !important; }


/* Campout planner */
.wsb-campout-details {
    border: 1px solid #b7c9ae;
    border-radius: 8px;
    padding: .85rem 1rem 1rem;
    background: #f7fbf5;
    margin-bottom: 1rem;
}
.wsb-campout-details[hidden],
.wsb-camp-only[hidden] { display: none !important; }
.wsb-campout-details-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem .8rem;
    margin-bottom: .75rem;
}
.wsb-campout-details-head strong { font-size: 1.02rem; }
.wsb-campout-details-head span { color: #52624d; font-size: .86rem; }
.wsb-campout-details-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}
.wsb-campout-details-grid input[type="text"],
.wsb-campout-details-grid input[type="date"],
.wsb-campout-details-grid textarea,
.wsb-camp-only select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: .55rem .65rem;
    background: #fff;
}
.wsb-camp-notes { grid-column: 1 / -1; }
@media (max-width: 780px) {
    .wsb-campout-details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .wsb-campout-details-grid { grid-template-columns: 1fr; }
    .wsb-camp-notes { grid-column: auto; }
}


/* Block moving */
.wsb-cell-label {
    min-height: 1.2em;
    padding-right: 3.35rem;
}
.wsb-move-handle {
    position: absolute;
    right: 4px;
    bottom: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid rgba(17,24,39,.35);
    border-radius: 4px;
    background: rgba(255,255,255,.86);
    color: #111827;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: grab;
    user-select: none;
    opacity: .72;
    box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.wsb-editable-cell:hover .wsb-move-handle,
.wsb-move-handle:focus-visible {
    opacity: 1;
}
.wsb-move-handle:active { cursor: grabbing; }
.wsb-dragging .wsb-schedule-table .wsb-editable-cell {
    outline: 2px dashed rgba(34,113,177,.32);
    outline-offset: -3px;
}
.wsb-schedule-table .wsb-editable-cell.is-drop-target {
    outline: 4px solid #067647;
    outline-offset: -4px;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.85);
}
.wsb-schedule-table .wsb-editable-cell.is-drop-invalid {
    outline: 4px solid #b42318;
    outline-offset: -4px;
}
@media (max-width: 760px) {
    .wsb-cell-label { padding-right: 0; padding-bottom: 1.7rem; }
    .wsb-move-handle { opacity: .9; }
}
@media print {
    .wsb-move-handle { display: none !important; }
    .wsb-cell-label { padding-right: 0; padding-bottom: 0; }
}


/* v1.7 UX refresh */
.wsb-planner-header {
    background: #ffffff;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: .75rem;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
.wsb-commandbar {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: stretch;
    margin-top: .8rem;
}
.wsb-action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    padding: .35rem .5rem;
    border: 1px solid #e4e7ec;
    border-radius: 7px;
    background: #f9fafb;
}
.wsb-action-label {
    color: #667085;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-right: .15rem;
}
.wsb-starter-button {
    border-color: #6b8e5a !important;
    background: #f4f8f1 !important;
    font-weight: 650 !important;
}
.wsb-action-menu {
    position: relative;
    align-self: center;
}
.wsb-action-menu > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.wsb-action-menu > summary::-webkit-details-marker { display: none; }
.wsb-action-menu > summary::after { content: '\25BE'; font-size: .75em; }
.wsb-action-menu[open] > summary { background: #f0f6fc; border-color: #72aee6; }
.wsb-action-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + .35rem);
    z-index: 30;
    display: grid;
    gap: .4rem;
    min-width: 180px;
    padding: .55rem;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(16,24,40,.15);
}
.wsb-action-menu-panel .button { width: 100%; text-align: left; }
.wsb-user-row {
    min-height: 34px;
    padding: .25rem .15rem;
    margin-bottom: .65rem;
    justify-content: space-between;
}
.wsb-saved-controls {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
}
.wsb-saved-controls label { margin: 0 .2rem 0 0; }
.wsb-status {
    margin-left: auto;
    padding: .25rem .45rem;
    border-radius: 4px;
}
.wsb-status.is-ok { background: #ecfdf3; }
.wsb-status.is-error { background: #fef3f2; }
.wsb-campout-details {
    padding: .75rem .9rem;
    margin-bottom: .65rem;
}
.wsb-campout-details-head { margin-bottom: .6rem; }
.wsb-campout-details-head > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem .75rem;
}
.wsb-notes-details {
    margin-top: .55rem;
    border-top: 1px solid #dbe7d5;
    padding-top: .45rem;
}
.wsb-notes-details summary {
    cursor: pointer;
    font-size: .86rem;
    font-weight: 650;
    color: #40543a;
}
.wsb-notes-details .wsb-field { margin-top: .5rem; }
.wsb-quick-help {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .9rem;
    align-items: center;
    margin: .55rem 0;
    padding: .45rem .65rem;
    border: 1px solid #c8ddf0;
    border-radius: 7px;
    background: #f7fbff;
    color: #344054;
    font-size: .84rem;
}
.wsb-table-wrap {
    position: relative;
    max-height: 72vh;
    overflow: auto;
    border-radius: 8px;
    box-shadow: 0 0 0 1px var(--wsb-border), 0 4px 14px rgba(16,24,40,.06);
}
.wsb-schedule-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: inset 0 -1px 0 #98a2b3;
}
.wsb-schedule-table .wsb-time-cell {
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: inset -1px 0 0 #98a2b3;
}
.wsb-schedule-table .wsb-time-head {
    position: sticky;
    left: 0;
    top: 0;
    z-index: 7;
}
.wsb-schedule-table tbody tr:hover .wsb-time-cell { background: #f8fafc; }
.wsb-schedule-table .wsb-editable-cell.is-empty-slot:hover::after,
.wsb-schedule-table .wsb-editable-cell.is-empty-slot:focus::after {
    content: '+ Add';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #667085;
    font-size: .78rem;
    font-weight: 650;
    background: rgba(240,246,252,.72);
    pointer-events: none;
}
.wsb-setup {
    margin-top: .9rem;
    background: #fff;
}
.wsb-setup-topline {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
    margin-top: .85rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #e4e7ec;
}
.screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
@media (max-width: 840px) {
    .wsb-commandbar { display: grid; grid-template-columns: 1fr 1fr; }
    .wsb-action-group { align-content: start; }
    .wsb-action-label { flex-basis: 100%; }
    .wsb-action-menu { align-self: stretch; }
    .wsb-action-menu > summary { width: 100%; justify-content: center; box-sizing: border-box; }
    .wsb-action-menu-panel { position: static; margin-top: .4rem; }
}
@media (max-width: 560px) {
    .wsb-planner-header { padding: .75rem; }
    .wsb-commandbar { grid-template-columns: 1fr; }
    .wsb-action-group .button { flex: 1 1 120px; }
    .wsb-user-row { align-items: stretch; }
    .wsb-status { margin-left: 0; width: 100%; }
    .wsb-saved-controls { width: 100%; }
    .wsb-saved-controls select { flex: 1 1 180px; min-width: 0; }
    .wsb-table-wrap { max-height: 68vh; }
}
@media print {
    .wsb-planner-header,
    .wsb-user-row,
    .wsb-campout-details,
    .wsb-quick-help,
    .wsb-setup { display: none !important; }
    .wsb-table-wrap { max-height: none !important; overflow: visible !important; }
    .wsb-schedule-table thead th,
    .wsb-schedule-table .wsb-time-cell,
    .wsb-schedule-table .wsb-time-head { position: static !important; }
    .wsb-schedule-table .wsb-editable-cell.is-empty-slot::after { display: none !important; }
}
