.page-branch-detail {
    --bg-pattern-primary: rgba(201, 169, 98, 0.07);
    --bg-pattern-secondary: rgba(201, 169, 98, 0.04);
    --grid-line-color: rgba(201, 169, 98, 0.025);
    --grid-size: 64px;
}

.branch-layout {
    position: relative;
    z-index: 10;
    min-height: calc(100vh - 7.5rem);
    max-width: 600px;
    margin-inline: auto;
    padding: 2rem 1rem 3rem;
}

.header,
.branch-hero,
.detail-card {
    opacity: 0;
    animation: fade-slide-up 0.8s ease-out forwards;
}

.branch-hero {
    animation-delay: 0.08s;
}

.detail-grid > .detail-card:nth-child(1) {
    animation-delay: 0.16s;
}

.detail-grid > .detail-card:nth-child(2) {
    animation-delay: 0.22s;
}

.detail-grid > .detail-card:nth-child(3) {
    animation-delay: 0.28s;
}

.detail-grid > .detail-card:nth-child(4) {
    animation-delay: 0.34s;
}

.header {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: start;
    justify-self: start;
    border-radius: 8px;
    padding: 0.5rem;
    color: var(--accent);
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.back-btn:hover,
.back-btn:focus-visible {
    background: rgba(201, 169, 98, 0.1);
}

.back-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.back-btn .icon {
    width: 20px;
    height: 20px;
}

.header-logo {
    width: 40px;
    height: 40px;
    justify-self: center;
}

.page-title {
    margin: 0;
    justify-self: end;
    text-align: end;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.branch-hero {
    min-width: 0;
    margin-bottom: 1rem;
}

.hero-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background:
        linear-gradient(180deg, var(--surface-soft), transparent 48%),
        linear-gradient(135deg, rgba(201, 169, 98, 0.1), var(--surface-panel-strong));
    padding: 1.2rem 1rem;
}

.hero-panel::before,
.detail-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(232, 212, 160, 0.55), transparent);
}

.hero-eyebrow,
.section-kicker {
    margin: 0 0 0.75rem;
    color: var(--accent-light);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.branch-title,
.section-title {
    margin: 0;
    line-height: 1.2;
}

.branch-title {
    font-size: clamp(2rem, 3vw, 3rem);
}

.branch-summary,
.notice-copy,
.detail-value,
.map-note,
.route-note {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.9;
}

.branch-summary {
    display: none;
    max-width: 62ch;
    margin-top: 0.9rem;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.2rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(201, 169, 98, 0.18);
    background: var(--surface-soft-strong);
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
    color: var(--fg);
}

.hero-badge.is-accent {
    border-color: rgba(201, 169, 98, 0.45);
    background: rgba(201, 169, 98, 0.12);
    color: var(--accent-light);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.detail-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background:
        linear-gradient(180deg, var(--surface-soft), transparent 46%),
        var(--surface-panel);
    padding: 1.5rem;
}

.detail-card--span-2 {
    grid-column: 1 / -1;
}

.detail-card[id] {
    scroll-margin-top: 1rem;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom:2rem;
}

.section-title {
    font-size: 1.35rem;
}

.notice-copy {
    max-width: 34ch;
    font-size: 0.92rem;
}

.detail-list {
    display: grid;
    gap: 1rem;
    margin: 0;
}

.detail-row {
    display: grid;
    grid-template-columns: minmax(132px, 172px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    padding-top: 1rem;
    border-top: 1px solid rgba(201, 169, 98, 0.12);
}

.detail-row:first-child {
    padding-top: 0;
    border-top: 0;
}

.detail-term {
    display: inline-flex;
    justify-self: start;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(201, 169, 98, 0.16);
    background: rgba(201, 169, 98, 0.08);
    padding: 0.42rem 0.78rem;
    color: var(--accent-light);
    font-size: 0.82rem;
}

.detail-value {
    min-width: 0;
}

.detail-value.is-ltr,
.channel-value {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.detail-value strong {
    color: var(--fg);
    font-weight: 700;
}

.detail-value-lines {
    display: grid;
    gap: 0.55rem;
}

.detail-value-lines span {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.detail-value-lines.is-ltr {
    justify-items: start;
}

.detail-value-lines.is-ltr span {
    justify-content: flex-start;
}

.detail-value-lines span::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(201, 169, 98, 0.08);
}

.channel-grid,
.route-grid {
    display: grid;
    gap: 0.75rem;
}

.channel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.channel-card {
    display: grid;
    gap: 0.35rem;
    border-radius: 12px;
    border: 1px solid rgba(201, 169, 98, 0.12);
    background: var(--surface-soft);
    padding: 1rem;
    transition:
        border-color 0.3s ease,
        background 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.channel-card:hover,
.channel-card:focus-visible {
    border-color: rgba(201, 169, 98, 0.42);
    background: rgba(201, 169, 98, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -26px var(--accent-glow);
}

.channel-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.channel-label {
    color: var(--muted);
    font-size: 0.8rem;
}

.channel-value {
    color: var(--fg);
    font-size: 0.98rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.map-shell {
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(201, 169, 98, 0.16);
    background: var(--surface-overlay);
}

.map-shell iframe {
    display: block;
    width: 100%;
    height: 360px;
    border: 0;
}

.map-note,
.route-note {
    margin-top: 0.9rem;
    font-size: 0.88rem;
}

.route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-button {
    display: grid;
    gap: 0.55rem;
    min-height: 118px;
    align-content: space-between;
    border-radius: 12px;
    border: 1px solid rgba(201, 169, 98, 0.12);
    background:
        linear-gradient(180deg, rgba(201, 169, 98, 0.08), transparent 55%),
        var(--surface-soft);
    padding: 1rem;
    transition:
        border-color 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease;
}

.route-button:hover,
.route-button:focus-visible {
    border-color: rgba(201, 169, 98, 0.46);
    background:
        linear-gradient(180deg, rgba(201, 169, 98, 0.14), transparent 55%),
        var(--surface-soft-strong);
    transform: translateY(-3px);
    box-shadow: 0 18px 32px -24px var(--accent-glow);
}

.route-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.route-button.is-disabled {
    opacity: 0.72;
    cursor: not-allowed;
    box-shadow: none;
}

.route-button.is-disabled:hover,
.route-button.is-disabled:focus-visible {
    border-color: rgba(201, 169, 98, 0.12);
    background:
        linear-gradient(180deg, rgba(201, 169, 98, 0.08), transparent 55%),
        var(--surface-soft);
    transform: none;
    box-shadow: none;
    outline: none;
}

.route-label {
    color: var(--fg);
    font-size: 1rem;
    font-weight: 700;
}

.route-app-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
}

.route-app-icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
}

.route-app-icon > svg {
    width: 100%;
    height: 100%;
    display: block;
}

.route-app-icon > img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.route-subtitle {
    color: var(--text-subtle);
    font-size: 0.82rem;
    line-height: 1.7;
}

.route-arrow {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.route-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

@keyframes fade-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .branch-layout {
        padding-inline: 0.9rem;
        padding-bottom: 3rem;
    }

    .page-title {
        font-size: 0.98rem;
    }

    .branch-title {
        font-size: 1.8rem;
    }

    .hero-panel,
    .detail-card {
        border-radius: 12px;
        padding: 1.2rem;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .channel-grid,
    .route-grid {
        grid-template-columns: 1fr;
    }

    .map-shell iframe {
        height: 300px;
    }
}
