.branch-display {
    --bd-bg: #071a10;
    --bd-bg-soft: #0c2416;
    --bd-surface: #12301f;
    --bd-surface-raised: #183c28;
    --bd-border: #245537;
    --bd-border-strong: #2f6b45;
    --bd-text: #f3faf5;
    --bd-muted: #9bc4a8;
    --bd-muted-strong: #c5e0cf;
    --bd-accent: #f0d060;
    --bd-accent-bright: #ffe566;
    --bd-accent-deep: #d4a017;
    --bd-green: #3ecf7a;
    --bd-error-bg: #5c1a1a;
    --bd-error-text: #fecaca;

    position: relative;
    height: 100vh;
    width: 100%;
    box-sizing: border-box;
    padding: 1rem 1.5rem 1rem;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(62, 207, 122, 0.12), transparent 55%),
        radial-gradient(ellipse 60% 40% at 95% 5%, rgba(240, 208, 96, 0.1), transparent 50%),
        linear-gradient(165deg, var(--bd-bg-soft) 0%, var(--bd-bg) 55%, #05140c 100%);
    color: var(--bd-text);
    font-family: system-ui, -apple-system, Segoe UI, sans-serif;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.75rem;
    overflow: hidden;
}

.branch-display__sound-enable {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    border: 1px solid var(--bd-accent-deep);
    background: linear-gradient(180deg, var(--bd-accent-bright) 0%, var(--bd-accent) 100%);
    color: #1a2e14;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(240, 208, 96, 0.35);
}

.branch-display__header {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.branch-display__brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.branch-display__logo {
    height: clamp(2.5rem, 4.5vw, 3.5rem);
    width: auto;
    flex-shrink: 0;
    border-radius: 0.35rem;
    object-fit: contain;
    background: #fff;
}

.branch-display__eyebrow {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bd-accent);
    flex-shrink: 0;
}

.branch-display__title {
    margin: 0;
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--bd-text);
    line-height: 1.2;
}

.branch-display__error {
    margin: 0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.4rem;
    background: var(--bd-error-bg);
    color: var(--bd-error-text);
    font-size: 0.9rem;
}

.branch-display__main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 1.05fr);
    gap: 0.85rem;
    min-height: 0;
    overflow: hidden;
}

@media (max-width: 960px) {
    .branch-display {
        height: auto;
        min-height: 100vh;
        overflow: auto;
        grid-template-rows: auto;
    }

    .branch-display__main {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .branch-display__section--waiting {
        max-height: none;
    }

    .branch-display__section--gold {
        flex: none;
        min-height: 16rem;
    }
}

.branch-display__queue-column {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow: hidden;
}

.branch-display__section {
    margin: 0;
    min-height: 0;
}

.branch-display__section--waiting {
    flex: 0 1 auto;
    max-height: 28%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.branch-display__section--gold {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.branch-display__section-title {
    margin: 0 0 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bd-muted-strong);
}

.branch-display__stations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.55rem;
}

.branch-display__station-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.65rem 0.5rem;
    border-radius: 0.5rem;
    background: linear-gradient(160deg, var(--bd-surface-raised) 0%, var(--bd-surface) 100%);
    border: 1px solid var(--bd-border);
    box-shadow: inset 0 1px 0 rgba(62, 207, 122, 0.08);
    text-align: center;
}

.branch-display__station-name {
    margin: 0;
    font-size: 0.8rem;
    color: var(--bd-muted);
}

.branch-display__ticket-number {
    margin: 0;
    font-size: clamp(1.75rem, 3.2vw, 2.75rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--bd-accent-bright);
    text-shadow: 0 0 24px rgba(255, 229, 102, 0.25);
}

.branch-display__ticket-number--idle {
    color: #4a7a5c;
    text-shadow: none;
}

.branch-display__station-service {
    margin: 0;
    font-size: 0.75rem;
    color: var(--bd-muted-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-display__waiting-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
}

.branch-display__waiting-header .branch-display__section-title {
    margin-bottom: 0;
}

.branch-display__waiting-count {
    margin: 0;
    font-size: 0.85rem;
    color: var(--bd-accent);
}

.branch-display__empty {
    margin: 0;
    color: var(--bd-muted);
    font-size: 0.9rem;
}

.branch-display__waiting-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.branch-display__waiting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.7rem;
    border-radius: 0.4rem;
    background: var(--bd-surface);
    border: 1px solid var(--bd-border);
    border-left: 3px solid var(--bd-green);
    flex-shrink: 0;
}

.branch-display__waiting-number {
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--bd-accent);
}

.branch-display__waiting-service {
    font-size: 0.85rem;
    color: var(--bd-muted-strong);
}

.branch-display__ad-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 0.65rem;
    border-radius: 0.6rem;
    background: linear-gradient(160deg, var(--bd-surface-raised) 0%, var(--bd-surface) 100%);
    border: 1px solid var(--bd-border);
    box-shadow: inset 0 1px 0 rgba(240, 208, 96, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.branch-display__ad-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
}

.branch-display__ad-header .branch-display__section-title {
    margin-bottom: 0;
}

.branch-display__ad-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
    border-radius: 0.4rem;
    overflow: hidden;
    background: var(--bd-bg);
    border: 1px solid var(--bd-border);
}

.branch-display__ad-media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bd-bg);
}

.branch-display__ad-caption {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--bd-muted-strong);
    text-align: center;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-display__section--gold .branch-display__waiting-header {
    margin-bottom: 0.35rem;
}

.branch-display__gold-table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 0.5rem;
    border: 1px solid var(--bd-border);
    background: var(--bd-surface);
    scrollbar-width: none;
}

.branch-display__gold-table-wrap::-webkit-scrollbar {
    display: none;
}

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

.branch-display__gold-table th,
.branch-display__gold-table td {
    padding: 0.45rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--bd-border);
    line-height: 1.3;
}

.branch-display__gold-table th {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bd-accent);
    font-weight: 600;
    background: var(--bd-bg-soft);
    position: sticky;
    top: 0;
    z-index: 1;
}

.branch-display__gold-table td:nth-child(3) {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--bd-accent-bright);
    white-space: nowrap;
}

.branch-display__gold-table tbody tr:last-child td {
    border-bottom: none;
}

.branch-display__gold-table tbody tr:hover td {
    background: rgba(62, 207, 122, 0.06);
}
