:root {
    --sgrna-bg: #f3efe6;
    --sgrna-ink: #1d211d;
    --sgrna-muted: #677066;
    --sgrna-panel: rgba(255, 250, 241, 0.94);
    --sgrna-border: rgba(29, 33, 29, 0.12);
    --sgrna-accent: #8f5a23;
    --sgrna-accent-dark: #6f4314;
    --sgrna-surface: rgba(255, 255, 255, 0.84);
    --sgrna-track: #d8c2a7;
    --sgrna-marker: #2f684e;
    --sgrna-shadow: 0 18px 40px rgba(40, 32, 20, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body.sgrna-workbench {
    margin: 0;
    min-height: 100vh;
    font-family: "Outfit", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(143, 90, 35, 0.08), transparent 34%),
        linear-gradient(180deg, #fbf8f1 0%, var(--sgrna-bg) 100%);
    color: var(--sgrna-ink);
}

.sgrna-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.nav-site-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 245, 238, 0.86);
    border-bottom: 1px solid rgba(44, 35, 29, 0.11);
}

.nav-site-bar .nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 48px;
}

.nav-site-bar .nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--sgrna-ink);
    flex-shrink: 0;
}

.nav-site-bar .logo svg {
    width: 20px;
    height: 20px;
    color: var(--sgrna-accent);
}

.nav-site-bar .nav-platform-link {
    color: var(--sgrna-ink);
    text-decoration: none;
}

.nav-site-links {
    display: flex;
    gap: 2px;
}

.nav-site-link {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sgrna-muted);
    text-decoration: none;
    transition: all 0.15s;
}

.nav-site-link:hover {
    color: var(--sgrna-ink);
    background: rgba(255, 255, 255, 0.6);
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--sgrna-muted);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a0ab78;
}

.nav-account-slot .nav-tab {
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sgrna-accent);
    text-decoration: none;
    transition: background 0.15s;
}

.nav-account-slot .nav-tab:hover {
    background: rgba(255, 255, 255, 0.6);
}

.sgrna-nav-account {
    min-width: 0;
    display: flex;
    align-items: center;
}

.sgrna-nav-account .account-menu,
.nav-account-slot .account-menu {
    position: relative;
}

.sgrna-nav-account .account-menu-toggle {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px 5px 5px;
    border-radius: 999px;
    border: 1px solid var(--sgrna-border);
    background: rgba(255, 255, 255, 0.88);
    cursor: pointer;
}

.sgrna-nav-account .account-menu-toggle::-webkit-details-marker {
    display: none;
}

.sgrna-nav-account .account-menu-avatar {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sgrna-accent), var(--sgrna-accent-dark));
    color: #fff9f0;
    font-size: 0.85rem;
    font-weight: 700;
}

.sgrna-nav-account .account-menu-name,
.sgrna-nav-account .account-menu-caret {
    color: var(--sgrna-ink);
    font-size: 0.86rem;
    font-weight: 600;
}

.sgrna-nav-account .account-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 190px;
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid var(--sgrna-border);
    background: rgba(255, 250, 241, 0.98);
    box-shadow: var(--sgrna-shadow);
    z-index: 20;
}

.sgrna-nav-account .account-menu-link,
.sgrna-nav-account .account-menu-logout {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 11px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--sgrna-ink);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.sgrna-nav-account .account-menu-link:hover,
.sgrna-nav-account .account-menu-logout:hover {
    background: rgba(143, 90, 35, 0.08);
}

.sgrna-nav-account .account-menu-form {
    margin: 0;
}

.sgrna-shell {
    padding: 18px 0 48px;
}

.sgrna-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    gap: 20px;
    align-items: stretch;
}

.sgrna-hero-copy,
.sgrna-hero-panel,
.sgrna-panel,
.sgrna-results {
    background: var(--sgrna-panel);
    border: 1px solid var(--sgrna-border);
    border-radius: 24px;
    box-shadow: var(--sgrna-shadow);
}

.sgrna-hero-copy {
    padding: 36px;
}

.sgrna-kicker,
.sgrna-panel-label,
.sgrna-panel-number {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sgrna-accent);
}

.sgrna-hero-copy h1 {
    margin: 14px 0 12px;
    font-size: clamp(2.2rem, 4vw, 4rem);
    line-height: 0.94;
}

.sgrna-hero-copy p,
.sgrna-hero-panel p {
    margin: 0;
    color: var(--sgrna-muted);
    line-height: 1.6;
}

.sgrna-hero-panel {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sgrna-workbench-brief {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.sgrna-stage-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.sgrna-stage-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 999px;
    border: 1px solid var(--sgrna-border);
    background: rgba(255, 250, 241, 0.78);
    color: var(--sgrna-muted);
    box-shadow: var(--sgrna-shadow);
}

.sgrna-stage-pill span {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(143, 90, 35, 0.08);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--sgrna-accent);
}

.sgrna-stage-pill strong {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--sgrna-ink);
}

.sgrna-stage-pill.is-active {
    border-color: rgba(143, 90, 35, 0.30);
}

.sgrna-workbench-brief-copy {
    padding: 20px 24px;
    border-radius: 24px;
    border: 1px solid var(--sgrna-border);
    background: rgba(255, 250, 241, 0.90);
    box-shadow: var(--sgrna-shadow);
}

.sgrna-workbench-brief-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--sgrna-ink);
}

.sgrna-workbench-brief-note,
.sgrna-panel-intro {
    margin: 8px 0 0;
    color: var(--sgrna-muted);
    line-height: 1.65;
}

.sgrna-auth-notice {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(143, 90, 35, 0.22);
    background: rgba(143, 90, 35, 0.08);
    color: var(--sgrna-ink);
    box-shadow: var(--sgrna-shadow);
}

.sgrna-auth-notice span {
    color: var(--sgrna-muted);
}

.sgrna-auth-notice a {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--sgrna-accent), var(--sgrna-accent-dark));
    color: #fff9f0;
    font-weight: 700;
    text-decoration: none;
}

.sgrna-workspace {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.sgrna-panel {
    padding: 26px;
}

.sgrna-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.sgrna-panel-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.sgrna-label {
    display: block;
    margin: 0 0 8px;
    font-weight: 600;
}

.sgrna-textarea,
.sgrna-select,
.sgrna-text-input,
.sgrna-file-input {
    width: 100%;
    border: 1px solid rgba(29, 33, 29, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    padding: 14px 16px;
    font: inherit;
    color: var(--sgrna-ink);
    margin-bottom: 18px;
}

.sgrna-textarea {
    min-height: 220px;
    resize: vertical;
}

.sgrna-text-input,
.sgrna-file-input {
    margin-bottom: 18px;
}

.sgrna-sequence-textarea {
    min-height: 210px;
}

.sgrna-alt-input-panel {
    padding-top: 6px;
}

.sgrna-helper-text {
    margin: -8px 0 0;
    color: var(--sgrna-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.sgrna-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 999px;
    padding: 15px 18px;
    font: inherit;
    font-weight: 700;
    color: #fff9f0;
    background: linear-gradient(135deg, var(--sgrna-accent) 0%, var(--sgrna-accent-dark) 100%);
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.sgrna-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(111, 67, 20, 0.22);
}

.sgrna-button:disabled {
    cursor: progress;
    opacity: 0.92;
}

.sgrna-button-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 249, 240, 0.45);
    border-top-color: #fff9f0;
    display: none;
}

.sgrna-button.is-loading .sgrna-button-spinner {
    display: inline-block;
    animation: sgrna-spin 0.8s linear infinite;
}

.sgrna-results {
    margin-top: 24px;
    padding: 24px;
}

.sgrna-results-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.sgrna-results-head h2 {
    margin: 8px 0 0;
}

.sgrna-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.sgrna-export-button {
    border: 1px solid rgba(29, 33, 29, 0.12);
    border-radius: 999px;
    padding: 11px 14px;
    font: inherit;
    font-weight: 600;
    background: #fffaf4;
    color: var(--sgrna-ink);
    cursor: pointer;
}

.sgrna-export-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sgrna-results-summary {
    margin-top: 18px;
    color: var(--sgrna-muted);
}

.sgrna-mode-fieldset {
    margin: 0 0 14px;
    padding: 0;
    border: 0;
}

.sgrna-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sgrna-mode-option {
    display: flex;
}

.sgrna-mode-card {
    flex: 1;
}

.sgrna-input-type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 10px;
}

.sgrna-mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sgrna-mode-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    min-height: 88px;
    border-radius: 16px;
    border: 1px solid rgba(29, 33, 29, 0.1);
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    transition: border-color 140ms ease, transform 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}



.sgrna-mode-card strong {
    color: var(--sgrna-ink);
    font-size: 0.92rem;
}

.sgrna-mode-card span {
    color: var(--sgrna-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    flex: 1;
}

.sgrna-mode-option input:checked + .sgrna-mode-card {
    border-color: rgba(47, 104, 78, 0.28);
    background: rgba(47, 104, 78, 0.09);
    transform: translateY(-1px);
}

.sgrna-mode-option input:focus-visible + .sgrna-mode-card {
    outline: 2px solid rgba(47, 104, 78, 0.18);
    outline-offset: 2px;
}

.sgrna-mode-hint {
    margin: 0 0 14px;
    color: var(--sgrna-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.sgrna-results-table-shell {
    margin-top: 18px;
    opacity: 0.72;
}

.sgrna-loading-state {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.sgrna-loading-bar {
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(90deg, rgba(215, 203, 185, 0.45), rgba(255, 255, 255, 0.92), rgba(215, 203, 185, 0.45));
    background-size: 200% 100%;
    animation: sgrna-shimmer 1.4s ease-in-out infinite;
}

.sgrna-results-container {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.sgrna-gene-card {
    border: 1px solid rgba(29, 33, 29, 0.1);
    border-radius: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.82);
}

.sgrna-gene-card-missing p {
    color: var(--sgrna-muted);
    margin: 0;
}

.sgrna-gene-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.sgrna-gene-card h3,
.sgrna-gene-card-head h3 {
    margin: 0;
}

.sgrna-gene-card-head span,
.sgrna-track-meta span,
.sgrna-transcript-meta span,
.sgrna-sequence-window-meta span,
.sgrna-sequence-window-head span,
.sgrna-visual-panel-head span {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    color: var(--sgrna-muted);
}

.sgrna-gene-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.sgrna-table-wrap {
    overflow-x: auto;
}

.sgrna-guide-table {
    width: 100%;
    border-collapse: collapse;
}

.sgrna-guide-table thead th {
    padding: 12px 12px 14px;
    text-align: left;
    font-size: 0.84rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sgrna-muted);
    border-bottom: 1px solid rgba(29, 33, 29, 0.12);
}

.sgrna-guide-table tbody td {
    padding: 14px 12px;
    vertical-align: top;
    border-bottom: 1px solid rgba(29, 33, 29, 0.08);
}

.sgrna-guide-table tbody tr:last-child td {
    border-bottom: 0;
}

.sgrna-rank-cell {
    font-family: "JetBrains Mono", monospace;
    white-space: nowrap;
}

.sgrna-target-cell {
    min-width: 260px;
}

.sgrna-target-sequence,
.sgrna-oligo-row code,
.sgrna-sequence-window-seq {
    display: block;
    overflow-wrap: anywhere;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.84rem;
    line-height: 1.55;
}

.sgrna-target-submeta {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.sgrna-oligo-row {
    display: grid;
    gap: 4px;
}

.sgrna-oligo-row span {
    font-size: 0.78rem;
    color: var(--sgrna-muted);
}

.sgrna-transcript-meta {
    display: grid;
    gap: 6px;
}

.sgrna-visualization-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 18px;
}

.sgrna-visualization-shell {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(29, 33, 29, 0.08);
}

.sgrna-visual-panel {
    border: 1px solid rgba(29, 33, 29, 0.08);
    border-radius: 18px;
    background: var(--sgrna-surface);
    padding: 18px;
}

.sgrna-visual-panel-muted p {
    margin: 8px 0 0;
    color: var(--sgrna-muted);
}

.sgrna-visual-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.sgrna-visual-panel-head h4 {
    margin: 0;
    font-size: 1rem;
}

.sgrna-track-wrap {
    position: relative;
    min-height: 108px;
    margin-top: 8px;
}

.sgrna-track-line {
    position: absolute;
    top: 42px;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 999px;
    background: var(--sgrna-track);
}

.sgrna-track-exon,
.sgrna-track-marker {
    position: absolute;
    border-radius: 999px;
}

.sgrna-track-exon {
    top: 28px;
    min-width: 18px;
    height: 32px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0dcc3;
    color: var(--sgrna-accent-dark);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
}

.sgrna-track-marker {
    top: 66px;
    min-width: 18px;
    height: 14px;
    background: var(--sgrna-marker);
}

.sgrna-track-marker span {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--sgrna-marker);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    white-space: nowrap;
}

.sgrna-track-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.sgrna-track-guide-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.sgrna-genome-guide-item,
.sgrna-track-guide-item {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(29, 33, 29, 0.08);
}

.sgrna-genome-guide-head,
.sgrna-track-guide-item {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
}

.sgrna-genome-guide-item strong,
.sgrna-track-guide-item strong {
    font-size: 0.92rem;
}

.sgrna-genome-guide-head span,
.sgrna-genome-guide-meta span,
.sgrna-track-guide-item span {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    color: var(--sgrna-muted);
}

.sgrna-genome-ruler {
    position: relative;
    height: 22px;
}

.sgrna-genome-ruler-line {
    position: absolute;
    top: 9px;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 999px;
    background: var(--sgrna-track);
}

.sgrna-genome-ruler-marker {
    position: absolute;
    top: 4px;
    min-width: 12px;
    height: 14px;
    border-radius: 999px;
    background: var(--sgrna-marker);
}

.sgrna-genome-guide-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.sgrna-track-guide-item-muted strong {
    color: var(--sgrna-ink);
}

.sgrna-results-table-shell {
    display: none;
}

.sgrna-inline-notice {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(143, 90, 35, 0.08);
    color: var(--sgrna-ink);
}

.sgrna-inline-notice-error {
    background: rgba(143, 35, 35, 0.1);
    color: #7a271e;
}

.sgrna-summary-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.sgrna-summary-pill,
.sgrna-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(29, 33, 29, 0.08);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.76rem;
}

.sgrna-summary-pill strong {
    color: var(--sgrna-accent-dark);
    font-weight: 600;
}

.sgrna-gene-card {
    animation: sgrna-card-enter 280ms ease both;
}

.sgrna-guide-row {
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.sgrna-guide-row td {
    transition: background-color 140ms ease, border-color 140ms ease;
}

.sgrna-guide-row:hover td,
.sgrna-guide-row:focus-visible td {
    background: rgba(143, 90, 35, 0.06);
}

.sgrna-guide-row.is-selected td {
    background: rgba(47, 104, 78, 0.08);
    border-bottom-color: rgba(47, 104, 78, 0.18);
}

.sgrna-guide-row:focus-visible {
    outline: 2px solid rgba(47, 104, 78, 0.3);
    outline-offset: -2px;
}

.sgrna-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(143, 90, 35, 0.1);
    color: var(--sgrna-accent-dark);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    font-weight: 600;
}

.sgrna-guide-row.is-selected .sgrna-rank-badge {
    background: rgba(47, 104, 78, 0.14);
    color: var(--sgrna-marker);
}

.sgrna-cell-note {
    display: block;
    margin-top: 6px;
    color: var(--sgrna-muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.sgrna-copy-oligo-button {
    justify-self: flex-start;
    width: fit-content;
    border: 1px solid rgba(47, 104, 78, 0.18);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(47, 104, 78, 0.08);
    color: var(--sgrna-marker);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 140ms ease, transform 140ms ease;
}

.sgrna-copy-oligo-button:hover,
.sgrna-copy-oligo-button:focus-visible {
    background: rgba(47, 104, 78, 0.14);
    transform: translateY(-1px);
}

.sgrna-copy-oligo-button:focus-visible {
    outline: 2px solid rgba(47, 104, 78, 0.2);
    outline-offset: 2px;
}

.sgrna-visualization-toggle {
    border: 1px solid rgba(111, 67, 20, 0.14);
    border-radius: 999px;
    padding: 9px 14px;
    background: rgba(143, 90, 35, 0.08);
    color: var(--sgrna-accent-dark);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.sgrna-visualization-toggle:hover,
.sgrna-visualization-toggle:focus-visible {
    background: rgba(143, 90, 35, 0.14);
    border-color: rgba(111, 67, 20, 0.24);
    transform: translateY(-1px);
}

.sgrna-visualization-toggle:focus-visible {
    outline: 2px solid rgba(143, 90, 35, 0.16);
    outline-offset: 2px;
}

.sgrna-visualization-toggle.is-loading {
    color: var(--sgrna-marker);
    background: rgba(47, 104, 78, 0.08);
    border-color: rgba(47, 104, 78, 0.18);
}

.sgrna-inline-loader {
    display: grid;
    gap: 10px;
}

.sgrna-inline-loader span {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    color: var(--sgrna-muted);
}

.sgrna-inline-loader-bar {
    height: 46px;
    border-radius: 16px;
    background: linear-gradient(90deg, rgba(215, 203, 185, 0.42), rgba(255, 255, 255, 0.94), rgba(215, 203, 185, 0.42));
    background-size: 200% 100%;
    animation: sgrna-shimmer 1.2s ease-in-out infinite;
}

.sgrna-track-scale {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.76rem;
    color: var(--sgrna-muted);
}

.sgrna-feature-track {
    position: relative;
    --marker-stack-depth: 1;
    --track-offset-top: calc((var(--marker-stack-depth, 1) - 1) * 24px);
    min-height: calc(158px + var(--track-offset-top));
    margin-top: 12px;
}

.sgrna-feature-axis {
    position: absolute;
    top: calc(96px + var(--track-offset-top));
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(216, 194, 167, 0.45), rgba(216, 194, 167, 1), rgba(216, 194, 167, 0.45));
}

.sgrna-feature-exon {
    position: absolute;
    top: calc(76px + var(--track-offset-top));
    min-width: 22px;
    height: 40px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(143, 90, 35, 0.18);
    background: #f0dcc3;
    color: var(--sgrna-accent-dark);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    z-index: 2;
}

.sgrna-feature-exon-transcript {
    background: rgba(47, 104, 78, 0.12);
    border-color: rgba(47, 104, 78, 0.18);
    color: var(--sgrna-marker);
}

.sgrna-gene-direction {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    color: var(--sgrna-muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.74rem;
}

.sgrna-gene-direction-label {
    color: var(--sgrna-accent-dark);
    font-weight: 600;
}

.sgrna-gene-direction-arrow {
    position: relative;
    flex: 0 0 120px;
    height: 10px;
}

.sgrna-gene-direction-arrow::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 999px;
    background: rgba(111, 67, 20, 0.45);
}

.sgrna-gene-direction-arrow::after {
    content: "";
    position: absolute;
    top: 1px;
    right: 0;
    width: 8px;
    height: 8px;
    border-top: 2px solid rgba(111, 67, 20, 0.7);
    border-right: 2px solid rgba(111, 67, 20, 0.7);
    transform: rotate(45deg);
}

.sgrna-gene-direction.is-reverse .sgrna-gene-direction-arrow {
    transform: scaleX(-1);
}

.sgrna-guide-marker {
    position: absolute;
    top: calc(18px + var(--track-offset-top) - (var(--marker-lane, 0) * 24px));
    transform: translateX(-50%);
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    z-index: 3;
}

.sgrna-guide-marker::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 50%;
    width: 3px;
    height: calc(60px + (var(--marker-lane, 0) * 24px));
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(47, 104, 78, 0.22);
}

.sgrna-guide-marker:hover .sgrna-guide-marker-dot,
.sgrna-guide-marker:focus-visible .sgrna-guide-marker-dot {
    transform: scale(1.08);
}

.sgrna-guide-marker:focus-visible {
    outline: none;
}

.sgrna-guide-marker:focus-visible .sgrna-guide-marker-dot {
    box-shadow: 0 0 0 4px rgba(47, 104, 78, 0.16);
}

.sgrna-guide-marker.is-selected::after {
    background: rgba(111, 67, 20, 0.3);
}

.sgrna-guide-marker-label {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    color: var(--sgrna-marker);
}

.sgrna-guide-marker-dot {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--sgrna-marker);
    border: 2px solid rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 18px rgba(47, 104, 78, 0.18);
    transition: transform 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.sgrna-guide-marker.is-selected .sgrna-guide-marker-label {
    color: var(--sgrna-accent-dark);
    font-weight: 600;
}

.sgrna-guide-marker.is-selected .sgrna-guide-marker-dot {
    background: var(--sgrna-accent-dark);
    box-shadow: 0 12px 22px rgba(111, 67, 20, 0.2);
}

.sgrna-transcript-guide-marker {
    position: absolute;
    top: 18px;
    min-width: 42px;
    height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(47, 104, 78, 0.18);
    border: 1px solid rgba(47, 104, 78, 0.22);
    color: var(--sgrna-marker);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    z-index: 3;
}

.sgrna-transcript-guide-marker::after {
    content: "";
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    width: 3px;
    height: 46px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(47, 104, 78, 0.22);
}

.sgrna-guide-span {
    position: absolute;
    top: 56px;
    min-width: 24px;
    height: 28px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(47, 104, 78, 0.18);
    border: 1px solid rgba(47, 104, 78, 0.2);
    color: var(--sgrna-marker);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    z-index: 3;
}

.sgrna-track-caption {
    margin: 16px 0 0;
    color: var(--sgrna-muted);
    line-height: 1.5;
}

.sgrna-track-caption code {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(29, 33, 29, 0.08);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.76rem;
    overflow-wrap: anywhere;
}

@keyframes sgrna-card-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sgrna-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes sgrna-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@media (max-width: 980px) {
    .sgrna-hero,
    .sgrna-workspace,
    .sgrna-visualization-grid {
        grid-template-columns: 1fr;
    }

    .sgrna-stage-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sgrna-results-head,
    .sgrna-gene-card-head,
    .sgrna-visual-panel-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .sgrna-stage-strip,
    .sgrna-auth-notice {
        display: grid;
        grid-template-columns: 1fr;
    }

    .sgrna-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .sgrna-nav-links,
    .sgrna-export-actions,
    .sgrna-track-meta,
    .sgrna-summary-metrics {
        gap: 8px;
    }

    .sgrna-shell,
    .sgrna-nav {
        width: min(1180px, calc(100% - 20px));
    }

    .sgrna-nav-account .account-menu-name {
        display: none;
    }

    .sgrna-auth-notice a {
        margin-left: 0;
    }

    .sgrna-hero-copy,
    .sgrna-panel,
    .sgrna-results,
    .sgrna-visual-panel {
        padding: 18px;
    }

    .sgrna-mode-grid {
        grid-template-columns: 1fr;
    }

    .sgrna-feature-track {
        min-height: 148px;
    }
}

.sgrna-mode-option input:checked + .sgrna-mode-card {
    border-color: var(--sgrna-marker);
    background: rgba(47, 104, 78, 0.06);
    box-shadow: 0 0 0 1px var(--sgrna-marker);
}

.sgrna-mode-fieldset[hidden] {
    display: block !important;
    max-height: 600px;
    overflow: visible;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.25s ease;
}

.sgrna-mode-fieldset:not([hidden]) {
    max-height: 600px;
    opacity: 1;
}

.sgrna-inline-loader {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(215, 203, 185, 0.22);
}

.sgrna-inline-loader-bar {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(143, 90, 35, 0.12), rgba(204, 187, 148, 0.55), rgba(143, 90, 35, 0.12));
    background-size: 200% 100%;
    animation: sgrna-inline-loading 1.4s ease-in-out infinite;
}
.sgrna-inline-loader-bar:nth-child(2) { animation-delay: 0.15s; }
.sgrna-inline-loader-bar:nth-child(3) { animation-delay: 0.3s; }

@keyframes sgrna-inline-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 480px) {
    .sgrna-shell { width: calc(100% - 16px); }
    .sgrna-nav { gap: 0.5rem; padding: 0.65rem 0; }
    .sgrna-brand { font-size: 0.95rem; }
    .sgrna-nav-links { gap: 0.5rem; }
    .sgrna-nav-links a { font-size: 0.75rem; padding: 0.4rem 0.65rem; min-height: 38px; display: inline-flex; align-items: center; }
    .sgrna-hero { padding: 1rem 0.85rem; border-radius: 16px; }
    .sgrna-hero-copy h1 { font-size: clamp(1.5rem, 6vw, 2.2rem); line-height: 1.2; }
    .sgrna-hero-copy p { font-size: 0.82rem; }
    .sgrna-hero-panel { padding: 0.75rem; }
    .sgrna-workbench-brief { padding: 0.75rem 1rem; }
    .sgrna-stage-strip { gap: 0.35rem; }
    .sgrna-stage-pill { padding: 0.45rem 0.65rem; font-size: 0.75rem; }
    .sgrna-stage-pill span { width: 20px; height: 20px; font-size: 0.65rem; }
    .sgrna-panel { padding: 1rem 0.85rem; border-radius: 14px; }
    .sgrna-panel-head h2 { font-size: 1rem; }
    .sgrna-panel-intro { font-size: 0.82rem; }
    .sgrna-mode-grid { gap: 0.5rem; }
    .sgrna-mode-card { padding: 0.75rem; }
    .sgrna-mode-card strong { font-size: 0.9rem; }
    .sgrna-mode-card span { font-size: 0.75rem; }
    .sgrna-select, .sgrna-textarea, .sgrna-text-input { font-size: 0.85rem; min-height: 40px; }
    .sgrna-button { padding: 0.7rem 1rem; min-height: 44px; font-size: 0.9rem; width: 100%; justify-content: center; }
    .sgrna-results-head { gap: 0.5rem; }
    .sgrna-export-actions { gap: 0.35rem; }
    .sgrna-export-button { font-size: 0.75rem; padding: 0.45rem 0.75rem; min-height: 36px; }
    .sgrna-gene-card { padding: 0.85rem; }
    .sgrna-gene-card-head { gap: 0.4rem; }
    .sgrna-guide-table th, .sgrna-guide-table td { padding: 6px 8px; font-size: 0.72rem; }
    .sgrna-target-cell { min-width: 160px; }
    .sgrna-target-sequence { font-size: 0.7rem; }
    .sgrna-copy-oligo-button { font-size: 0.72rem; padding: 4px 8px; min-height: 32px; }
    .sgrna-visualization-grid { gap: 0.75rem; }
    .sgrna-visual-panel { border-radius: 12px; }
    .sgrna-visual-panel-head { gap: 0.4rem; }
    .sgrna-track-wrap { min-height: 80px; }
    .sgrna-inline-loader { padding: 10px 14px; }
    .sgrna-loading-bar { height: 42px; }
    .sgrna-auth-notice { gap: 0.5rem; padding: 0.75rem 1rem; font-size: 0.82rem; }
}
