/* =========================================================
   06-sheet-view.css
   Announcement/sheet view, sheet chips and sheet zoom UI.
   S2 owner cleanup: rules were regrouped by selector responsibility.
   Do not add late override dumps; keep future edits in this owner.
========================================================= */

#sheet-view-area {
display: none; flex: 1; overflow: hidden; position: relative;
    touch-action: none; background: var(--bg-body);
}

#sheet-view-area.active {
display: flex;
}

#sheet-view-area.active::after {
content: "";
    position: absolute;
    top: 48px;
    right: 0;
    bottom: 0;
    width: 24px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(238, 243, 241, 0), var(--bg-body));
    z-index: 2;
}

[data-theme="dark"] #sheet-view-area.active::after {
background: linear-gradient(90deg, rgba(15, 23, 42, 0), var(--bg-body));
}

#sheet-title-bar {
position: absolute; top: 0; left: 0; right: 0; z-index: 3;
    min-height: 52px; display: flex; align-items: center; gap: 9px;
    padding: 8px 14px; background: var(--app-surface);
    backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color);
    color: var(--text-main); font-weight: 700;
}

[data-theme="dark"] #sheet-title-bar {
background: rgba(30,41,59,0.92);
}

#sheet-room-name {
display: block;
    font-size: 0.94rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.2;
}

#sheet-room-name.is-placeholder {
color: var(--text-sub);
    font-weight: 650;
    opacity: 0.72;
}

#sheet-summary {
display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.sheet-summary-pill {
display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--sheet-header);
    color: var(--text-sub);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.1;
}

.sheet-summary-pill strong {
color: var(--text-main);
    font-size: 0.69rem;
    font-weight: 800;
}

#sheet-canvas {
position: absolute;
    top: 48px;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0;
    padding: 12px 12px 92px;
    min-width: max-content;
}

.sheet-car-col {
display: flex; flex-direction: column;
    border-right: 1px solid var(--sheet-grid);
    border-top: 1px solid var(--sheet-grid);
    border-bottom: 1px solid var(--sheet-grid);
    min-width: 136px; flex-shrink: 0;
}

.sheet-car-col:last-child {
border-right: none;
}

.sheet-car-header {
background: var(--sheet-header); color: var(--text-main);
    padding: 7px 10px; font-weight: 800; font-size: 0.78rem;
    text-align: center; position: sticky; top: 0; z-index: 2;
    border-bottom: 1px solid var(--sheet-grid);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sheet-driver-row {
padding: 6px 8px; border-bottom: 1px solid var(--sheet-grid);
    font-size: 0.75rem; background: var(--driver-bg);
    display: flex; align-items: center; gap: 4px;
}

.sheet-seat-row {
padding: 5px 8px; border-bottom: 1px solid var(--sheet-grid);
    font-size: 0.8rem; min-height: 36px; display: flex; align-items: center;
    background: var(--seat-slot-bg); gap: 4px; flex-wrap: wrap;
    color: var(--text-main);
}

.sheet-seat-row.empty {
color: var(--text-sub); font-style: italic; font-size: 0.72rem;
}

.sheet-cell-text {
white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sheet-dropzone,
.sheet-waiting-list {
width: 100%;
    min-height: 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.sheet-waiting-list {
justify-content: flex-start;
}

.sheet-chip {
display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 4px 6px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    line-height: 1.2;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.sheet-chip *,
.sheet-dropzone *,
.sheet-waiting-list * {
-webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

[data-theme="dark"] .sheet-chip {
background: rgba(15,23,42,0.35);
    border-color: rgba(255,255,255,0.08);
}

.sheet-chip.draggable {
cursor: grab;
    touch-action: none;
}

.sheet-chip.locked {
opacity: 0.72;
}

.sheet-chip-text {
white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sheet-chip-ghost {
opacity: 0.45;
}

.sheet-chip-drag {
box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.sheet-wait-block {
flex: 0 0 150px;
    width: 150px;
    margin-top: 0;
    border: 1px solid var(--sheet-grid);
    border-left: none;
    border-radius: 0;
    overflow: hidden;
    background: var(--bg-card);
}

.sheet-wait-header {
background: var(--sheet-header);
    color: var(--text-main);
    padding: 8px 12px;
    font-weight: 700;
    font-size: 0.85rem;
}

.sheet-wait-body {
display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: var(--bg-card);
}

.sheet-wait-item {
min-height: 38px;
    border: 0;
    border-bottom: 1px solid var(--sheet-grid);
    border-radius: 0;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--seat-slot-bg);
}

.sheet-wait-item.empty {
color: var(--text-sub);
    justify-content: center;
    font-size: 0.78rem;
}

.sheet-capacity-badge {
font-size: 0.65rem; padding: 1px 5px; border-radius: 3px;
    background: var(--bg-body); color: var(--text-sub); border: 1px solid var(--border-color);
}

#sheet-hint {
position: absolute; bottom: 78px; left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5); color: #fff;
    font-size: 0.7rem; padding: 6px 10px; border-radius: 999px;
    pointer-events: none; opacity: 0; transition: opacity 0.3s;
}

#sheet-hint.visible {
opacity: 1;
}

#sheet-bottom-controls {
position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: var(--radius-main);
    background: var(--app-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
    max-width: calc(100vw - 24px);
}

#zoom-controls {
display: flex; gap: 5px; flex-direction: row;
    padding: 0;
    flex-shrink: 0;
}

#zoom-controls button {
width: 34px; height: 34px; border-radius: 50%;
    background: transparent; border: 1px solid transparent;
    color: var(--text-main); font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

#zoom-controls button:active {
transform: scale(0.92);
}

#sheet-quick-edit-btn {
display: none;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: var(--radius-main);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: none;
    font-size: 0.78rem;
    font-weight: 800;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 104px;
    white-space: nowrap;
    flex-shrink: 0;
}

#sheet-quick-edit-btn.active {
background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.quick-edit-mode .sheet-dropzone,
.quick-edit-mode .sheet-waiting-list {
background: transparent;
    border: 0;
    padding: 0;
}

.quick-edit-mode .sheet-chip.draggable {
animation: sheetJiggle 0.24s ease-in-out infinite alternate;
    transform-origin: center center;
    will-change: transform;
}

.quick-edit-mode .sheet-chip.draggable:nth-child(2n) {
animation-delay: -0.12s;
}

.quick-edit-mode .sheet-chip.draggable:nth-child(3n) {
animation-duration: 0.27s;
}

.quick-edit-mode .sheet-chip-drag {
animation: none;
}

@media (prefers-reduced-motion: reduce) {
.quick-edit-mode .sheet-chip.draggable {
animation: none;
}
}

.quick-edit-mode #sheet-title-bar {
box-shadow: inset 0 -2px 0 var(--accent-color);
}

#sheet-quick-edit-btn i {
font-size: 0.95rem;
}

@media (max-width: 520px) {
#sheet-title-bar {
padding: 8px 12px;
}
}

@media (max-width: 520px) {
#sheet-canvas {
padding: 10px 10px 92px;
}
}

@media (max-width: 520px) {
.sheet-car-col {
min-width: 126px;
}
}

@media (max-width: 520px) {
#zoom-controls button {
width: 32px;
        height: 32px;
}
}

@media (max-width: 520px) {
#sheet-bottom-controls {
gap: 6px;
        padding: 5px;
}
}

@media (max-width: 520px) {
#sheet-quick-edit-btn {
padding: 8px 10px;
        min-width: 96px;
        font-size: 0.74rem;
}
}

.sheet-car-col {
background: var(--bg-card);
}

.sheet-car-col:first-child {
border-left: 1px solid var(--border-color);
}

.sheet-wait-block {
border-radius: 0;
            box-shadow: none;
}

#sheet-title-bar > .debug-tap-target {
color: var(--accent-color);
}

.sheet-chip,
.sheet-seat-row,
.sheet-driver-row {
font-weight: 500;
}

#sheet-title-bar {
grid-template-columns: auto minmax(0, 1fr);
    min-height: 48px;
}

.sheet-title-icon {
width: 28px;
    height: 28px;
    /* Use unified small radius for title icons */
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--accent-soft);
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex: 0 0 auto;
}

.sheet-empty-icon {
width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    /* Use unified large radius for empty state icons */
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--accent-soft);
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    opacity: 0.72;
}

#sheet-summary {
margin-top: 0;
    align-items: center;
}

#sheet-room-name {
display: none;
}

#sheet-view-area,
.sheet-empty {
min-width: 0;
}

#sheet-summary {
gap: 8px;
}

.sheet-summary-pill {
min-height: 30px;
    padding: 5px 9px;
}

[data-theme="dark"] #zoom-controls button,
[data-theme="dark"] #sheet-quick-edit-btn {
background: rgba(15, 23, 42, 0.68);
    border-color: rgba(148, 163, 184, 0.24);
    color: var(--text-main);
}

[data-theme="dark"] #zoom-controls button i,
[data-theme="dark"] #sheet-quick-edit-btn,
[data-theme="dark"] #sheet-quick-edit-btn i {
color: var(--text-main);
    opacity: 1;
}

[data-theme="dark"] #zoom-controls button:hover,
[data-theme="dark"] #sheet-quick-edit-btn:hover {
background: rgba(51, 65, 85, 0.92);
    color: #fff;
}

[data-theme="dark"] .sheet-summary-pill {
background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.24);
    color: #cbd5e1;
}

@media (max-width: 420px) {
.sheet-summary-pill {
padding: 5px 8px;
}
}

.sheet-empty-card {
width: min(520px, calc(100vw - 40px));
    margin: 32px auto;
    text-align: center;
    padding: 26px 18px;
    color: var(--text-sub);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-main);
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
}

.sheet-empty-title {
display: block;
    font-size: 0.95rem;
    font-weight: 850;
    color: var(--text-main);
    margin-bottom: 6px;
}

.sheet-empty-text {
display: block;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.mock-sheet-table {
display: grid;
    grid-template-columns: 1.3fr 0.7fr 0.8fr;
    border: 1px solid #dadce0;
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.68rem;
}

.mock-sheet-table > div {
padding: 6px;
    border-right: 1px solid #dadce0;
    border-bottom: 1px solid #dadce0;
}

.mock-sheet-table > div:nth-child(3n) {
border-right: 0;
}

.mock-sheet-table .head {
background: #f8fafd; font-weight: 800;
}

.guide-sheet-preview {
margin-top: 10px;
}

.guide-zoom-screen {
padding: 8px;
}

[data-theme="dark"] #sheet-title-bar,
[data-theme="dark"] #sheet-bottom-controls {
border-color: rgba(148, 163, 184, 0.18);
}

.sheet-empty-actions {
display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

@media (max-width: 640px) {
.sheet-empty-actions {
grid-template-columns: 1fr;
}
}

.sheet-chip.draggable {
touch-action: pan-x pan-y;
}

.mock-sheet-top {
min-height: 32px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid var(--border-color);
    background: var(--sheet-header);
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 900;
}

.mock-sheet-top .dot {
width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #16a34a;
}

.mock-sheet-toolbar {
display: flex;
    gap: 5px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-sub);
    font-size: 0.62rem;
    font-weight: 800;
    white-space: nowrap;
}

.mock-sheet-toolbar span {
padding: 3px 5px;
    border-radius: 5px;
}

.mock-sheet-toolbar .active {
background: #e8f0fe;
    color: #1967d2;
}

[data-theme="dark"] .mock-sheet-toolbar .active {
background: rgba(96,165,250,0.16);
    color: #bfdbfe;
}

.mock-sheet-table.realistic {
border: 0;
    border-radius: 0;
    font-size: 0.66rem;
}

.mock-sheet-table.realistic > div {
min-height: 28px;
    padding: 6px 7px;
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

.mock-sheet-table.realistic .head {
background: var(--sheet-header);
    color: var(--text-sub);
}

.mock-sheet-table.realistic .ok {
color: var(--accent-color);
    font-weight: 900;
}

@media (hover: none) and (pointer: coarse) {
#zoom-controls button {
min-height: 40px;
}
}

[data-theme="dark"] #sheet-quick-edit-btn.active {
border-radius: var(--radius-sm);
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--accent-color) 18%, transparent);
}

[data-theme="dark"] #sheet-quick-edit-btn.active i {
color: #fff;
}

[data-theme="dark"] #sheet-quick-edit-btn.active:hover {
filter: brightness(0.98);
}

.sheet-zoom-reset-btn {
font-size: 0.7rem;
}

[data-theme="dark"] #sheet-quick-edit-btn.active {
background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

@media (max-width: 640px) {
#sheet-quick-edit-btn {
border-radius: 12px;
}
}

@media (max-width: 640px) {
.sheet-actions {
gap: 8px;
}
}

@media (max-width: 640px) {
#sheet-quick-edit-btn {
min-height: 40px;
        padding: 7px 9px;
        border-radius: 12px;
        line-height: 1.1;
}
}

#sheet-title-bar,
#sheet-canvas {
border-radius: var(--radius-main);
}

/* Sheet template classes: remove inline styles from generated HTML. */
.sheet-label-col {
  min-width: 60px;
}

.sheet-label-header,
.sheet-label-row {
  background: var(--sheet-header);
  color: var(--text-sub);
}

.sheet-label-row {
  font-weight: 700;
  font-size: 0.72rem;
}

.sheet-seat-disabled {
  background: var(--bg-body);
}

.sheet-driver-icon {
  font-size: 0.65rem;
  opacity: 0.6;
}

.sheet-driver-name {
  font-weight: 700;
}

.sheet-chip-lock {
  font-size: 0.62rem;
  opacity: 0.7;
}

.sheet-capacity-badge.is-over {
  color: #b91c1c;
}

.sheet-capacity-badge.is-full {
  color: var(--accent-color);
}

/* Modern announcement sheet refresh. */
#sheet-view-area {
    background: transparent;
}

#sheet-view-area.active::after {
    top: 58px;
    width: 34px;
}

#sheet-title-bar {
    top: 10px;
    left: 12px;
    right: 12px;
    min-height: 54px;
    padding: 10px 13px;
    border: 1px solid var(--hairline, var(--border-color));
    border-radius: var(--radius-lg);
    background: var(--app-surface);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px) saturate(1.08);
}

.sheet-title-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border-color: color-mix(in srgb, var(--accent-color) 22%, var(--border-color));
    background: color-mix(in srgb, var(--accent-color) 8%, var(--bg-card));
}

#sheet-summary {
    gap: 6px;
}

.sheet-summary-pill {
    min-height: 30px;
    padding: 5px 9px;
    border-color: var(--hairline, var(--border-color));
    background: color-mix(in srgb, var(--bg-card) 88%, var(--bg-body));
    font-weight: 850;
}

#sheet-canvas {
    top: 72px;
    padding: 14px 14px 104px;
}

.sheet-car-col,
.sheet-wait-block {
    min-width: 150px;
    border-color: var(--hairline, var(--border-color));
    border-radius: var(--radius-main);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
    margin-right: 8px;
}

.sheet-car-col:first-child {
    border-left: 1px solid var(--hairline, var(--border-color));
}

.sheet-car-col:last-child {
    border-right: 1px solid var(--hairline, var(--border-color));
}

.sheet-car-header,
.sheet-wait-header {
    padding: 9px 10px;
    border-bottom-color: var(--hairline, var(--border-color));
    background: linear-gradient(180deg, var(--sheet-header), color-mix(in srgb, var(--sheet-header) 82%, var(--bg-card)));
    font-size: 0.8rem;
    font-weight: 900;
}

.sheet-driver-row,
.sheet-seat-row,
.sheet-wait-item {
    border-bottom-color: var(--hairline, var(--border-color));
}

.sheet-driver-row {
    background: color-mix(in srgb, var(--accent-color) 6%, var(--bg-card));
    font-weight: 850;
}

.sheet-seat-row,
.sheet-wait-item {
    min-height: 40px;
    background: color-mix(in srgb, var(--bg-card) 92%, var(--bg-body));
}

.sheet-chip {
    border-color: var(--hairline, var(--border-color));
    border-radius: 999px;
    background: var(--bg-card);
    padding: 4px 7px;
    font-weight: 850;
}

.sheet-chip.draggable:hover {
    border-color: color-mix(in srgb, var(--accent-color) 28%, var(--border-color));
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.sheet-capacity-badge {
    border-radius: 999px;
    padding: 2px 6px;
}

#sheet-bottom-controls {
    bottom: 18px;
    padding: 7px;
    border-color: var(--hairline, var(--border-color));
    border-radius: 999px;
    background: var(--app-surface);
    box-shadow: var(--shadow-float);
}

#zoom-controls button,
#sheet-quick-edit-btn {
    border-color: var(--hairline, var(--border-color));
    background: var(--bg-card);
    color: var(--text-main);
}

#zoom-controls button {
    border-radius: 999px;
}

#sheet-quick-edit-btn {
    border-radius: 999px;
}

#sheet-quick-edit-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.sheet-empty-card {
    border-color: var(--hairline, var(--border-color));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

[data-theme="dark"] #sheet-title-bar,
[data-theme="dark"] #sheet-bottom-controls,
[data-theme="dark"] .sheet-car-col,
[data-theme="dark"] .sheet-wait-block {
    background: color-mix(in srgb, var(--bg-card) 86%, transparent);
    border-color: var(--hairline, var(--border-color));
}

[data-theme="dark"] .sheet-seat-row,
[data-theme="dark"] .sheet-wait-item,
[data-theme="dark"] .sheet-chip {
    background: color-mix(in srgb, var(--bg-card) 84%, #020617);
    border-color: var(--hairline, var(--border-color));
}

[data-theme="dark"] .sheet-driver-row {
    background: color-mix(in srgb, var(--accent-color) 9%, var(--bg-card));
}

[data-theme="dark"] #sheet-quick-edit-btn.active {
    color: #00111a;
}

@media (max-width: 640px) {
    #sheet-title-bar {
        top: 8px;
        left: 8px;
        right: 8px;
        min-height: 52px;
        /* Use unified main radius for the title bar */
        border-radius: var(--radius-main);
    }

    #sheet-canvas {
        top: 70px;
        padding: 12px 10px 100px;
    }

    .sheet-car-col,
    .sheet-wait-block {
        min-width: 136px;
        margin-right: 7px;
        border-radius: 14px;
    }

    #sheet-bottom-controls {
        bottom: 14px;
        border-radius: 18px;
    }
}

/* 発表ビューは車割を上、班割を下に縦並びで表示する。 */
#sheet-canvas {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
}

.sheet-plan-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: max-content;
    max-width: none;
}

.sheet-plan-heading {
    margin: 0 0 6px 2px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 0.98rem;
    font-weight: 900;
    line-height: 1.2;
}

.sheet-plan-table {
    display: flex;
    align-items: stretch;
    width: max-content;
}

.sheet-plan-table .sheet-car-col:last-child {
    margin-right: 0;
}

.sheet-plan-section .sheet-wait-block {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 8px 0 0;
    flex: 0 0 auto;
    border-left: 1px solid var(--hairline, var(--border-color));
}

.sheet-plan-section .sheet-wait-body,
.sheet-plan-section .sheet-waiting-list {
    display: flex;
    flex-flow: row wrap;
    gap: 6px;
    padding: 8px;
}

.sheet-plan-section .sheet-wait-item {
    min-height: 32px;
    border: 1px solid var(--hairline, var(--border-color));
    border-radius: 999px;
    padding: 5px 8px;
}

.sheet-plan-empty {
    min-width: 280px;
    padding: 16px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-main);
    background: var(--bg-card);
    color: var(--text-sub);
    font-weight: 700;
}

@media (max-width: 640px) {
    #sheet-canvas {
        gap: 16px;
    }

    .sheet-plan-heading {
        font-size: 0.92rem;
    }
}

/* Keep names aligned even when grade is blank. */
.sheet-grade-placeholder,
.sheet-seat-row .grade-badge,
.sheet-wait-item .grade-badge,
.sheet-chip .grade-badge,
.sheet-driver-row .grade-badge {
    flex: 0 0 2.35em;
    width: 2.35em;
    min-width: 2.35em;
    justify-content: center;
    text-align: center;
}

.sheet-grade-placeholder {
    display: inline-flex;
    height: 1.55em;
}


/* 2026-05 shared-view width alignment and lighter headings. */
.sheet-plan-section {
  width: var(--sheet-plan-width, max-content);
}

.sheet-plan-table {
  width: max-content;
}

.sheet-plan-section .sheet-wait-block {
  width: var(--sheet-plan-width, 100%);
  max-width: none;
  align-self: flex-start;
}

.sheet-plan-heading {
  font-weight: 650;
}

.sheet-plan-empty {
  font-weight: 500;
}

/* 2026-05 sheet summary: compact two-line car/team counts. */
#sheet-title-bar {
    min-height: 50px;
    align-items: flex-start;
    justify-content: flex-start;
}

#sheet-summary {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    align-items: stretch;
}

.sheet-summary-row {
    display: grid;
    grid-template-columns: 38px repeat(4, 50px) minmax(68px, auto);
    align-items: center;
    justify-content: start;
    column-gap: 5px;
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    line-height: 1.1;
}

.sheet-summary-row::-webkit-scrollbar {
    display: none;
}

.sheet-summary-plan-label {
    min-width: 0;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--text-main);
    color: var(--bg-card);
    font-size: 0.62rem;
    font-weight: 850;
    text-align: center;
    letter-spacing: 0;
}

.sheet-summary-row.is-team .sheet-summary-plan-label {
    background: color-mix(in srgb, var(--text-main) 86%, var(--accent-color));
}

.sheet-summary-stat,
.sheet-summary-updated {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 3px;
    min-width: 0;
    color: var(--text-sub);
    font-size: 0.64rem;
    font-weight: 760;
}

.sheet-summary-stat strong,
.sheet-summary-updated strong {
    color: var(--text-main);
    font-size: 0.68rem;
    font-weight: 900;
}

.sheet-summary-updated {
    margin-left: 2px;
    padding-left: 7px;
    border-left: 1px solid var(--hairline, var(--border-color));
    color: color-mix(in srgb, var(--text-sub) 82%, var(--text-main));
    justify-self: start;
}

#sheet-canvas {
    top: 88px;
    padding-bottom: 132px;
}

#sheet-view-area.active::after {
    top: 74px;
}

@media (max-width: 640px) {
    #sheet-title-bar {
        min-height: 48px;
        padding: 7px 9px;
        gap: 7px;
    }

    .sheet-title-icon {
        display: none;
    }

    #sheet-summary {
        gap: 2px;
    }

    .sheet-summary-row {
        grid-template-columns: 34px repeat(4, 43px) minmax(58px, auto);
        column-gap: 4px;
    }

    .sheet-summary-plan-label {
        padding: 2px 5px;
        font-size: 0.58rem;
    }

    .sheet-summary-stat,
    .sheet-summary-updated {
        gap: 2px;
        font-size: 0.58rem;
    }

    .sheet-summary-stat strong,
    .sheet-summary-updated strong {
        font-size: 0.63rem;
    }

    .sheet-summary-updated {
        padding-left: 5px;
    }

    #sheet-canvas {
        top: 70px;
        padding: 12px 10px 132px;
    }
}

/* Keep the announcement sheet readable while exposing more columns on phones. */
.sheet-label-col {
  min-width: 52px;
}

.sheet-car-col,
.sheet-wait-block {
  min-width: 142px;
}

#sheet-bottom-controls {
  opacity: 0.94;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

#sheet-bottom-controls:hover,
#sheet-bottom-controls:focus-within {
  opacity: 1;
}

@media (max-width: 640px) {
  .sheet-car-col,
  .sheet-wait-block {
    min-width: 124px;
  }

  .sheet-label-col {
    min-width: 48px;
  }

  .sheet-car-header,
  .sheet-wait-header {
    padding: 8px 8px;
    font-size: 0.74rem;
  }

  .sheet-driver-row,
  .sheet-seat-row,
  .sheet-wait-item {
    min-height: 36px;
    padding: 5px 7px;
  }

  #sheet-bottom-controls {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    transform: translateX(-50%) scale(0.94);
  }
}
