.gb-page {
    --gb-ink: #15261a;
    --gb-green: #205A28;
    --gb-green-soft: #e7f0e4;
    --gb-line: #d5dfd2;
    --gb-paper: #f7f8f5;
    color: var(--gb-ink);
}

.gb-page .gb-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.gb-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5d6b60;
}

.gb-page h1 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: -0.03em;
}

.gb-page .gb-sub {
    margin: 0.35rem 0 0;
    color: #4d5c52;
}

.gb-admin-hint {
    margin: 0;
    max-width: 16rem;
    font-size: 0.85rem;
    color: #3d5a42;
}

.gb-banner {
    margin: 0 0 0.9rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    background: var(--gb-green-soft);
    color: var(--gb-green);
}

.gb-banner.is-error {
    background: #fdecea;
    color: #8a2b22;
}

.gb-drop,
.gb-login-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 148px;
    margin-bottom: 1rem;
    padding: 1.25rem;
    border: 1.5px dashed #b7c7b6;
    border-radius: 16px;
    background: #fff;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.gb-drop:hover,
.gb-drop.is-over,
.gb-login-drop:hover {
    border-color: var(--gb-green);
    background: #f3f8f2;
}

.gb-drop input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.gb-drop-icon {
    font-size: 1.6rem;
    color: var(--gb-green);
}

.gb-drop strong,
.gb-login-drop strong {
    font-size: 1.05rem;
}

.gb-drop p,
.gb-login-drop p,
.gb-upload-status {
    margin: 0;
    color: #5c6b61;
    font-size: 0.92rem;
}

.gb-login-drop {
    text-decoration: none;
    color: inherit;
}

.gb-fallback-submit {
    margin-top: 0.4rem;
}

.gb-progress {
    width: min(420px, 100%);
    height: 6px;
    margin-top: 0.35rem;
    border-radius: 99px;
    background: #e4ebe3;
    overflow: hidden;
}

.gb-progress > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--gb-green);
}

.gb-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.gb-search {
    display: flex;
    flex: 1 1 240px;
    gap: 0.4rem;
}

.gb-search input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--gb-line);
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    background: #fff;
}

.gb-search input:focus {
    outline: 2px solid #c5dcc4;
    border-color: var(--gb-green);
}

.gb-search button,
.gb-btn,
.gb-pager a,
.gb-clear {
    border: 0;
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    background: var(--gb-green);
    color: #fff;
    text-decoration: none;
    font-size: 0.92rem;
}

.gb-btn.is-quiet,
.gb-clear,
.gb-pager a {
    background: #fff;
    color: var(--gb-ink);
    border: 1px solid var(--gb-line);
}

.gb-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.8rem;
    padding: 0;
    list-style: none;
}

.gb-filters a {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    color: #3e5144;
    text-decoration: none;
    background: transparent;
}

.gb-filters a.is-on,
.gb-filters a:hover {
    background: var(--gb-green-soft);
    color: var(--gb-green);
}

.gb-count {
    margin: 0 0 0.45rem;
    color: #66756b;
    font-size: 0.88rem;
}

.gb-list {
    background: #fff;
    border: 1px solid var(--gb-line);
    border-radius: 14px;
    overflow: hidden;
}

.gb-item {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    border-top: 1px solid #edf1ea;
}

.gb-item:first-child {
    border-top: 0;
}

.gb-item.is-active {
    background: #f3f8f2;
    box-shadow: inset 3px 0 0 var(--gb-green);
}

.gb-item-link {
    flex: 1;
    min-width: 0;
    display: block;
    padding: 0.85rem 1rem;
    color: inherit;
    text-decoration: none;
}

.gb-item-link:hover .gb-title {
    color: var(--gb-green);
}

.gb-item-top {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
}

.gb-code {
    font-family: ui-monospace, "Cascadia Mono", "Source Code Pro", monospace;
    font-size: 0.82rem;
    color: var(--gb-green);
}

.gb-title {
    margin: 0.15rem 0 0;
    font-size: 1.02rem;
    font-weight: 600;
}

.gb-meta,
.gb-extra {
    margin: 0.28rem 0 0;
    color: #66756b;
    font-size: 0.82rem;
}

.gb-status {
    flex: none;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: #eef2ee;
    color: #526258;
    font-size: 0.75rem;
}

.gb-status[data-status="CURRENT"] { background: #e5f4e6; color: #1d6b32; }
.gb-status[data-status="UPCOMING"] { background: #e7f0fb; color: #1d4f91; }
.gb-status[data-status="ABOLISHED"] { background: #f1f1f1; color: #666; }
.gb-status[data-status="REPLACED"] { background: #fbf1e4; color: #8a5a12; }
.gb-status:empty { display: none; }

.gb-item-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    padding-right: 0.75rem;
}

.gb-item-actions button,
.gb-viewer-bar button,
.gb-viewer-bar a,
.gb-dialog-actions button {
    border: 1px solid var(--gb-line);
    background: #fff;
    color: var(--gb-ink);
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    font-size: 0.82rem;
    text-decoration: none;
}

.gb-item-actions .gb-delete,
#gbViewerDelete {
    color: #8a2b22;
}

.gb-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #66756b;
    background: #fff;
    border: 1px dashed var(--gb-line);
    border-radius: 14px;
}

.gb-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.9rem;
}

.gb-workspace.is-split {
    display: grid;
    grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
}

.gb-viewer {
    display: none;
    position: sticky;
    top: 0.75rem;
    height: calc(100vh - 5.5rem);
    min-height: 420px;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--gb-line);
    border-radius: 14px;
    overflow: hidden;
}

.gb-workspace.is-split .gb-viewer {
    display: flex;
}

.gb-viewer-bar {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--gb-line);
    background: var(--gb-paper);
}

.gb-viewer-bar .gb-spacer {
    flex: 1;
}

.gb-viewer-head {
    padding: 0.75rem 0.9rem 0.55rem;
}

.gb-viewer-head h2 {
    margin: 0.15rem 0 0;
    font-size: 1.15rem;
}

.gb-viewer-summary {
    margin: 0.45rem 0 0;
    white-space: pre-wrap;
    color: #3e4d44;
    font-size: 0.9rem;
}

.gb-viewer-summary:empty,
.gb-viewer-extra:empty,
.gb-code:empty {
    display: none;
}

.gb-viewer-stage {
    flex: 1;
    min-height: 0;
    background: #e7ece4;
}

.gb-viewer-stage iframe,
.gb-viewer-stage img {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
    object-fit: contain;
}

.gb-download-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1.5rem;
    text-align: center;
    color: #4d5c52;
}

.gb-download-card a {
    background: var(--gb-green);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    padding: 0.5rem 1rem;
}

#gbMetaDialog {
    border: 0;
    border-radius: 16px;
    padding: 0;
    width: min(560px, calc(100vw - 1.5rem));
    box-shadow: 0 24px 60px rgba(21, 38, 26, 0.22);
}

#gbMetaDialog::backdrop {
    background: rgba(21, 38, 26, 0.45);
}

.gb-dialog-body {
    padding: 1.1rem 1.15rem 1.2rem;
}

.gb-dialog-body h2 {
    margin: 0 0 0.8rem;
    font-size: 1.15rem;
}

.gb-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}

.gb-form-grid label,
.gb-form-span {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.82rem;
    color: #4d5c52;
}

.gb-form-span {
    grid-column: 1 / -1;
}

.gb-form-grid input,
.gb-form-grid select,
.gb-form-grid textarea {
    border: 1px solid var(--gb-line);
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    color: var(--gb-ink);
    font: inherit;
}

.gb-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-top: 0.9rem;
}

.gb-dialog-actions .is-primary {
    background: var(--gb-green);
    color: #fff;
    border-color: var(--gb-green);
}

.gb-form-error {
    margin: 0.6rem 0 0;
    color: #8a2b22;
    font-size: 0.88rem;
}

@media (max-width: 960px) {
    .gb-page .gb-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .gb-workspace.is-split {
        display: block;
    }

    .gb-workspace.is-split .gb-viewer {
        position: fixed;
        inset: 0;
        z-index: 1080;
        height: 100%;
        min-height: 0;
        border-radius: 0;
    }

    .gb-form-grid {
        grid-template-columns: 1fr;
    }
}
