.sh-controls,.sh-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:end}.sh-controls label{flex:1;min-width:140px}.sh-controls input,.sh-controls select,.sh-form-grid input,.sh-form-grid select{width:100%;min-width:0}.sh-entry{border:1px solid var(--line,#dfe5d8);border-radius:14px;padding:16px;margin:12px 0;overflow-wrap:anywhere}.sh-entry p{margin:8px 0}.sh-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.sh-form-grid label{min-width:0}.sh-calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;margin:16px 0}.sh-calendar label{padding:6px;border:1px solid #dfe5d8;border-radius:8px}.sh-calendar input{width:auto}.sh-matrix{max-width:100%;overflow:auto;max-height:650px}.sh-matrix th:first-child{position:sticky;left:0;background:#f7f9f2;z-index:1}.sh-matrix td{min-width:155px;vertical-align:top}.sh-cell{background:transparent;border:0;width:100%;text-align:left;white-space:normal;cursor:pointer;min-height:64px;color:inherit}.sh-entry pre{white-space:pre-wrap;overflow-wrap:anywhere}.sh-error{color:#a33;white-space:pre-wrap}.sh-cancelled{opacity:.7}.sh-actions .btn{margin:0}#sh-form label{display:block}#sh-form input[type=checkbox]{width:auto}#sh-form textarea{width:100%}@media(max-width:650px){.sh-form-grid{grid-template-columns:1fr}.sh-controls{align-items:stretch}.sh-controls>*{max-width:100%}.sh-calendar{grid-template-columns:repeat(4,1fr)}.sh-entry .section-head{align-items:start;gap:8px}.sh-actions .btn{flex:1;min-width:125px}.sh-matrix{max-height:450px}}

.sh-matrix td{padding:6px!important}.sh-cell{padding:0;display:flex;flex-direction:column;gap:6px}.sh-case{display:flex;flex-direction:column;gap:3px;box-sizing:border-box;width:100%;padding:10px;border-radius:7px;background:var(--sh-bg);color:var(--sh-fg);line-height:1.45;overflow-wrap:anywhere}.sh-case strong{font-weight:650}.sh-cell:focus-visible{outline:3px solid #527b31;outline-offset:2px}.sh-legend{margin:12px 0}.sh-legend>div{display:flex;flex-wrap:wrap;gap:6px;padding-top:8px}.sh-legend span{background:var(--sh-bg);color:var(--sh-fg);border-radius:5px;padding:5px 9px;font-size:12px}.sh-matrix thead th{position:sticky;top:0;background:#f7f9f2;z-index:2}.sh-matrix thead th:first-child{z-index:3}.sh-matrix th:first-child{min-width:85px}

/* Compact calendar and collision-free month controls. */
.sh-controls>*{box-sizing:border-box;min-width:0}.sh-controls input,.sh-controls select{box-sizing:border-box;max-width:100%}.sh-month-controls label{flex:1 1 220px;min-width:0}.sh-month-controls .btn{flex:0 0 auto}
.sh-own-days{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}.sh-own-days strong{font-size:24px}.sh-own-days small{color:#66705f}
.sh-matrix table{border-collapse:separate;border-spacing:0;table-layout:fixed;width:max-content}.sh-matrix td{width:118px;min-width:118px;max-width:118px}.sh-matrix th:first-child{width:82px;min-width:82px;max-width:82px;padding:6px;white-space:normal;overflow-wrap:anywhere;background:#f7f9f2}.sh-case{padding:6px;gap:2px;font-size:12px}.sh-cell{min-height:26px}.sh-matrix thead th{padding:6px}
@media(max-width:650px){.sh-month-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.sh-month-controls label{grid-column:1/-1}.sh-month-controls .btn{min-width:0;padding:10px 5px;font-size:12px}.sh-matrix{max-height:65vh}.sh-matrix td{width:96px;min-width:96px;max-width:96px;padding:3px!important}.sh-matrix th:first-child{width:60px;min-width:60px;max-width:60px;font-size:11px}.sh-case{font-size:11px;padding:5px;line-height:1.3}.sh-matrix th{font-size:11px}.sh-actions{gap:6px}.sh-actions .btn{min-width:0;font-size:12px}.shift-reminder,.sh-reminder{display:block}}

/* Native Safari month controls must shrink to the grid content box. */
.sh-controls label,.sh-form-grid>label{display:block;min-width:0;max-width:100%}
.sh-controls input[type=month],.sh-controls input[type=date],.sh-form-grid input[type=date],.sh-form-grid input[type=month]{display:block;box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-inline-size:0;max-inline-size:100%;appearance:none;-webkit-appearance:none}
.sh-controls input::-webkit-date-and-time-value,.sh-form-grid input::-webkit-date-and-time-value{min-width:0;text-align:left}
.sh-weekday{white-space:nowrap;font-weight:650}.sh-weekday-red{color:#a33737}.sh-weekday-blue{color:#285b94}
.sh-matrix thead th .sh-weekday{display:block;font-size:11px}
