:root {
    color-scheme: dark;
    --ink: #f2efe8;
    --muted: #8c918f;
    --faint: #5f6462;
    --canvas: #090b0b;
    --surface: #101313;
    --surface-raised: #151918;
    --line: #252a28;
    --line-strong: #383e3b;
    --accent: #d8a84e;
    --accent-strong: #f0c66d;
    --accent-soft: rgba(216, 168, 78, 0.12);
    --danger: #db6a5d;
    --danger-soft: rgba(219, 106, 93, 0.12);
    --success: #6fbc8c;
    --success-soft: rgba(111, 188, 140, 0.12);
    --radius: 10px;
    --topbar-height: 72px;
    font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.muted {
    color: var(--muted);
}

.brand-sigil {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    color: var(--canvas);
    background: var(--accent);
    border-radius: 16px 4px 16px 4px;
    font-family: Georgia, serif;
    font-size: 34px;
    font-weight: 700;
    box-shadow: 0 16px 50px rgba(216, 168, 78, 0.16);
}

.brand-sigil.small {
    width: 38px;
    height: 38px;
    border-radius: 11px 3px 11px 3px;
    font-size: 23px;
}

.auth-stage {
    display: grid;
    min-height: 100svh;
    grid-template-columns: minmax(0, 1.25fr) minmax(390px, 0.75fr);
    background:
        linear-gradient(105deg, transparent 0 58%, rgba(216, 168, 78, 0.025) 58% 100%),
        radial-gradient(circle at 24% 18%, rgba(216, 168, 78, 0.08), transparent 34%),
        var(--canvas);
}

.auth-mark {
    display: flex;
    min-height: 100%;
    padding: clamp(40px, 7vw, 108px);
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--line);
    animation: stage-in 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand-lockup h1 {
    margin: 0;
    font-size: clamp(34px, 4.2vw, 68px);
    font-weight: 580;
    letter-spacing: -0.055em;
}

.auth-summary {
    max-width: 700px;
    margin: auto 0;
    color: #c8cbc7;
    font-family: Georgia, "Noto Serif SC", serif;
    font-size: clamp(24px, 3.3vw, 48px);
    line-height: 1.32;
    letter-spacing: -0.025em;
}

.auth-boundary {
    display: grid;
    max-width: 700px;
    grid-template-columns: 58px 1fr;
    gap: 12px 22px;
    color: var(--muted);
    font-size: 13px;
}

.auth-boundary span {
    color: var(--faint);
}

.auth-boundary strong {
    color: #b9bdb9;
    font-weight: 500;
}

.auth-form-wrap {
    display: grid;
    padding: clamp(32px, 6vw, 90px);
    place-items: center;
    background: rgba(16, 19, 19, 0.74);
}

.auth-form {
    display: grid;
    width: min(100%, 390px);
    gap: 24px;
    animation: form-in 480ms 100ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-form h2 {
    margin: 0 0 7px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.auth-form .muted {
    margin: 0;
    font-size: 13px;
}

.field {
    display: grid;
    gap: 9px;
}

.field > span:first-child {
    color: #b8bcb9;
    font-size: 12px;
    font-weight: 600;
}

.field input,
.search-form input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    color: var(--ink);
    background: #0d1010;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input:focus,
.search-form input:focus {
    background: #101413;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input::placeholder,
.search-form input::placeholder {
    color: #505653;
}

.field-error,
.validation-summary {
    color: #ef8b80;
    font-size: 12px;
}

.validation-summary:empty,
.field-error:empty {
    display: none;
}

.primary-button,
.danger-button {
    display: inline-grid;
    min-height: 48px;
    padding: 0 22px;
    place-items: center;
    color: #17130c;
    background: var(--accent);
    border: 0;
    border-radius: 7px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease, opacity 140ms ease;
}

.primary-button:hover:not(:disabled),
.danger-button:hover:not(:disabled) {
    background: var(--accent-strong);
    transform: translateY(-1px);
}

.primary-button:disabled,
.danger-button:disabled {
    cursor: not-allowed;
    opacity: 0.34;
}

.danger-button {
    width: 100%;
    color: #fff5f2;
    background: #a9493f;
}

.danger-button:hover:not(:disabled) {
    background: #c0594e;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    height: var(--topbar-height);
    padding: 0 26px;
    align-items: center;
    justify-content: space-between;
    background: rgba(9, 11, 11, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.compact-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}

.compact-brand > span:last-child {
    display: grid;
    gap: 1px;
}

.compact-brand strong {
    font-size: 14px;
    letter-spacing: 0.04em;
}

.compact-brand small {
    color: var(--muted);
    font-size: 11px;
}

.session-zone {
    display: flex;
    align-items: center;
    gap: 16px;
}

.workspace-nav {
    display: flex;
    height: 100%;
    margin: 0 auto 0 44px;
    align-items: stretch;
    gap: 24px;
}

.workspace-nav a {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
    transition: color 150ms ease;
}

.workspace-nav a:hover,
.workspace-nav a.is-active {
    color: var(--ink);
}

.workspace-nav a.is-active::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: var(--accent);
    content: "";
}

.safe-status {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #aeb4b0;
    font-size: 12px;
}

.safe-status i {
    width: 7px;
    height: 7px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 5px var(--success-soft);
}

.risk-status {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #d4a29b;
    font-size: 12px;
}

.risk-status i {
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 0 5px var(--danger-soft);
}

.operator {
    padding-left: 16px;
    color: var(--muted);
    border-left: 1px solid var(--line);
    font-size: 12px;
}

.quiet-button {
    min-height: 34px;
    padding: 0 12px;
    color: #b6bbb7;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    cursor: pointer;
    transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.quiet-button:hover {
    color: var(--ink);
    background: var(--surface-raised);
    border-color: #505752;
}

.workspace {
    display: grid;
    min-height: calc(100svh - var(--topbar-height));
    grid-template-columns: minmax(250px, 0.72fr) minmax(500px, 1.55fr) minmax(300px, 0.82fr);
    animation: stage-in 420ms ease-out both;
}

.account-rail,
.operation-surface,
.context-rail {
    min-width: 0;
    padding: 32px 26px;
}

.account-rail,
.operation-surface {
    border-right: 1px solid var(--line);
}

.account-rail,
.context-rail {
    background: #0c0f0f;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 24px;
}

.section-heading.wide {
    margin-bottom: 30px;
}

.section-heading h1,
.section-heading h2 {
    margin: 0 0 5px;
    font-size: 20px;
    font-weight: 620;
    letter-spacing: -0.025em;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.step-number {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--accent);
    border: 1px solid #594a2e;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.search-form input {
    height: 42px;
}

.search-form button {
    padding: 0 14px;
    color: var(--canvas);
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.search-state {
    min-height: 35px;
    padding: 12px 2px 8px;
    color: var(--faint);
    font-size: 11px;
}

.search-results {
    display: grid;
    max-height: 270px;
    overflow: auto;
    border-top: 1px solid var(--line);
}

.search-result {
    display: flex;
    min-height: 58px;
    padding: 10px 2px;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    opacity: 0;
    animation: result-in 240ms ease-out forwards;
}

.result-delay-1 { animation-delay: 35ms; }
.result-delay-2 { animation-delay: 70ms; }
.result-delay-3 { animation-delay: 105ms; }
.result-delay-4 { animation-delay: 140ms; }
.result-delay-5 { animation-delay: 175ms; }
.result-delay-6 { animation-delay: 210ms; }
.result-delay-7 { animation-delay: 245ms; }
.result-delay-8 { animation-delay: 280ms; }
.result-delay-9 { animation-delay: 315ms; }

.search-result:not(:disabled):hover .result-action {
    color: var(--accent-strong);
}

.search-result:disabled {
    cursor: default;
    opacity: 0.52 !important;
}

.search-result > span:first-child,
.selected-account-row > div,
.preview-row > div:first-child {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.search-result strong,
.selected-account-row strong,
.preview-row strong {
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result small,
.selected-account-row small,
.preview-row small {
    color: var(--muted);
    font-size: 10px;
}

.result-action,
.remove-account {
    color: var(--accent);
    font-size: 11px;
}

.selection-heading {
    display: flex;
    margin: 28px 0 10px;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.selection-heading strong {
    color: #b7bbb8;
}

.selected-accounts {
    display: grid;
    border-top: 1px solid var(--line);
}

.selected-account-row {
    display: flex;
    min-height: 58px;
    padding: 11px 0;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.remove-account {
    padding: 5px 0 5px 10px;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.empty-copy {
    margin: 18px 0;
    color: var(--faint);
    font-size: 12px;
}

.operation-surface {
    padding-inline: clamp(28px, 4vw, 60px);
}

.resource-groups {
    display: grid;
    gap: 28px;
}

.resource-group h3 {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.resource-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.resource-option {
    display: grid;
    min-height: 68px;
    padding: 13px 14px;
    align-content: center;
    gap: 5px;
    text-align: left;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.resource-option span {
    font-size: 13px;
    font-weight: 590;
}

.resource-option small {
    color: var(--faint);
    font-size: 10px;
}

.resource-option:hover {
    background: var(--surface);
}

.resource-option.is-selected {
    color: var(--accent-strong);
    background: var(--accent-soft);
    box-shadow: inset 3px 0 var(--accent);
}

.resource-option.is-selected small {
    color: #9f875c;
}

.operation-form {
    display: grid;
    margin-top: 34px;
    padding-top: 28px;
    grid-template-columns: auto minmax(130px, 0.62fr) minmax(220px, 1fr) auto;
    align-items: end;
    gap: 16px;
    border-top: 1px solid var(--line-strong);
}

.mode-switch {
    display: grid;
    height: 48px;
    grid-template-columns: 1fr 1fr;
    padding: 3px;
    background: #0d1010;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
}

.mode-switch label {
    display: grid;
    place-items: center;
    cursor: pointer;
}

.mode-switch input {
    position: absolute;
    opacity: 0;
}

.mode-switch span {
    display: grid;
    width: 100%;
    height: 100%;
    padding: 0 13px;
    place-items: center;
    color: var(--muted);
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    transition: color 140ms ease, background 140ms ease;
}

.mode-switch input:checked + span {
    color: var(--ink);
    background: #242927;
}

.compact-field,
.reason-field {
    gap: 7px;
}

.compact-field input,
.reason-field input {
    height: 48px;
}

.action-button {
    min-width: 116px;
}

.boundary-note {
    display: grid;
    margin-top: 28px;
    grid-template-columns: auto 1fr;
    gap: 18px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.boundary-note strong {
    color: #b9bdb9;
    font-size: 11px;
}

.boundary-note p {
    margin: 0;
}

.preview-placeholder {
    display: grid;
    min-height: 320px;
    padding: 40px 20px;
    place-content: center;
    justify-items: center;
    gap: 18px;
    color: var(--faint);
    text-align: center;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.preview-placeholder span {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    font-size: 19px;
}

.preview-placeholder p {
    max-width: 220px;
    margin: 0;
    font-size: 12px;
    line-height: 1.7;
}

.preview-title-row {
    display: flex;
    padding: 18px 0;
    align-items: flex-end;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.preview-title-row small {
    color: var(--muted);
    font-size: 10px;
}

.preview-title-row h3 {
    margin: 5px 0 0;
    font-size: 20px;
}

.preview-title-row > span {
    color: var(--accent);
    font-size: 11px;
}

.preview-items {
    display: grid;
    max-height: 420px;
    overflow: auto;
}

.preview-row {
    display: grid;
    min-height: 66px;
    padding: 12px 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--line);
}

.amount-change {
    display: flex;
    max-width: 170px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 5px 8px;
    color: var(--muted);
    font-size: 11px;
    text-align: right;
}

.amount-change i {
    color: var(--faint);
    font-style: normal;
}

.amount-change strong {
    color: var(--accent-strong);
}

.amount-change small {
    width: 100%;
    color: #9f875c;
}

.preview-row.has-error .amount-change,
.preview-row.has-error .amount-change strong {
    color: var(--danger);
}

.preview-row.is-success .amount-change strong {
    color: var(--success);
}

.offline-confirmation {
    display: flex;
    margin: 22px 0 14px;
    align-items: flex-start;
    gap: 10px;
    color: #c6cac6;
    font-size: 11px;
    line-height: 1.5;
    cursor: pointer;
}

.offline-confirmation input {
    width: 15px;
    height: 15px;
    margin: 1px 0 0;
    accent-color: var(--accent);
}

.audit-section {
    grid-column: 1 / -1;
    min-width: 0;
    padding: 34px clamp(26px, 4vw, 60px) 60px;
    background: #0b0e0e;
    border-top: 1px solid var(--line);
}

.audit-title-row {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-end;
    justify-content: space-between;
}

.audit-title-row h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.table-scroll {
    overflow-x: auto;
    border-top: 1px solid var(--line-strong);
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    white-space: nowrap;
}

.audit-table th,
.audit-table td {
    padding: 13px 14px 13px 0;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.audit-table th {
    color: var(--faint);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.audit-table td {
    max-width: 260px;
    overflow: hidden;
    color: #b7bbb7;
    text-overflow: ellipsis;
}

.table-empty {
    padding: 28px 0 !important;
    color: var(--faint) !important;
    text-align: center !important;
}

.status-badge {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 4px;
    font-size: 10px;
}

.status-succeeded {
    color: var(--success);
    background: var(--success-soft);
}

.status-failed {
    color: var(--danger);
    background: var(--danger-soft);
}

.status-pending {
    color: var(--accent);
    background: var(--accent-soft);
}

.toast {
    position: fixed;
    z-index: 50;
    right: 24px;
    bottom: 24px;
    max-width: min(390px, calc(100vw - 48px));
    padding: 14px 17px;
    color: #e8e9e6;
    background: #202523;
    border: 1px solid #3a413e;
    border-radius: 7px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
    font-size: 12px;
    animation: toast-in 220ms ease-out both;
}

.toast[data-kind="success"] {
    border-color: #315a40;
}

.toast[data-kind="error"] {
    border-color: #663d38;
}

.error-stage {
    display: grid;
    min-height: 100svh;
    padding: 32px;
    place-content: center;
    justify-items: start;
}

.error-stage h1 {
    margin: 0 0 12px;
    font-size: clamp(38px, 6vw, 72px);
}

.error-stage p:not(.eyebrow) {
    max-width: 520px;
    margin: 0 0 24px;
    color: var(--muted);
}

.clone-workspace {
    min-height: calc(100svh - var(--topbar-height));
    animation: stage-in 420ms ease-out both;
}

.clone-intro {
    display: flex;
    min-height: 210px;
    padding: 46px clamp(26px, 5vw, 76px);
    align-items: flex-end;
    justify-content: space-between;
    gap: 48px;
    background:
        radial-gradient(circle at 78% 35%, rgba(216, 168, 78, 0.07), transparent 28%),
        #0b0e0e;
    border-bottom: 1px solid var(--line);
}

.clone-intro h1 {
    margin: 0 0 12px;
    font-size: clamp(30px, 4vw, 54px);
    font-weight: 580;
    letter-spacing: -0.045em;
}

.clone-intro > div:first-child > p:last-child {
    max-width: 780px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.identity-boundary {
    display: grid;
    min-width: min(360px, 34vw);
    padding-left: 22px;
    gap: 7px;
    border-left: 1px solid #5b4a2c;
}

.identity-boundary span {
    color: var(--faint);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.identity-boundary strong {
    color: #c7c2b7;
    font-size: 13px;
    font-weight: 530;
    line-height: 1.55;
}

.clone-account-stage {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) 150px minmax(300px, 1fr);
    border-bottom: 1px solid var(--line);
}

.clone-account-column {
    min-width: 0;
    min-height: 420px;
    padding: 36px clamp(26px, 4vw, 58px);
}

.clone-account-column:first-child {
    border-right: 1px solid var(--line);
}

.clone-account-column:last-child {
    border-left: 1px solid var(--line);
}

.clone-account-column .search-results {
    max-height: 174px;
}

.handoff-mark {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    color: var(--faint);
    background: #0c0f0f;
    text-align: center;
}

.handoff-mark span {
    color: #948367;
    font-size: 10px;
    letter-spacing: 0.08em;
}

.handoff-mark i {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: var(--accent);
    border: 1px solid #594a2e;
    border-radius: 50%;
    font-size: 18px;
    font-style: normal;
}

.handoff-mark small {
    max-width: 90px;
    font-size: 9px;
    line-height: 1.5;
}

.clone-selection {
    min-height: 72px;
    margin-top: 22px;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line);
}

.clone-selected-account {
    display: grid;
    min-height: 72px;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 13px;
}

.clone-selected-account > div {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.clone-selected-account strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clone-selected-account small {
    color: var(--muted);
    font-size: 10px;
}

.selection-marker {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 50%;
    font-size: 10px;
}

.clone-account-column[data-role="target"] .selection-marker {
    color: #ee9085;
    background: var(--danger-soft);
}

.clone-review {
    padding: 42px clamp(26px, 5vw, 76px) 58px;
}

.clone-review-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.clone-review-heading .primary-button {
    min-height: 42px;
    font-size: 12px;
}

.clone-preview-placeholder {
    display: grid;
    min-height: 180px;
    place-content: center;
    justify-items: center;
    gap: 13px;
    color: var(--faint);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.clone-preview-placeholder span {
    color: #786743;
    font-size: 24px;
}

.clone-preview-placeholder p {
    margin: 0;
    font-size: 12px;
}

.clone-summary-strip {
    display: grid;
    min-height: 112px;
    padding: 22px 0;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 34px;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
}

.clone-summary-strip > div {
    display: grid;
    gap: 5px;
}

.clone-summary-strip > div:last-child {
    text-align: right;
}

.clone-summary-strip small,
.clone-summary-strip span {
    color: var(--muted);
    font-size: 10px;
}

.clone-summary-strip strong {
    font-size: 15px;
}

.clone-summary-strip > i {
    color: var(--accent);
    font-style: normal;
}

.clone-diff-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    gap: clamp(32px, 5vw, 74px);
    padding-top: 32px;
}

.diff-counts {
    display: flex;
    min-height: 32px;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 7px;
}

.diff-counts span,
.file-difference > span {
    display: inline-flex;
    padding: 4px 7px;
    color: var(--muted);
    background: var(--surface-raised);
    border-radius: 4px;
    font-size: 9px;
}

.diff-counts span[data-status="changed"],
.file-difference > span[data-status="changed"],
.diff-counts span[data-status="removed"],
.file-difference > span[data-status="removed"] {
    color: #e9988f;
    background: var(--danger-soft);
}

.diff-counts span[data-status="added"],
.file-difference > span[data-status="added"] {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.file-differences {
    display: grid;
    max-height: 430px;
    overflow: auto;
    border-top: 1px solid var(--line);
}

.file-difference {
    display: grid;
    min-height: 54px;
    padding: 10px 2px;
    grid-template-columns: minmax(150px, 1fr) minmax(120px, auto) auto;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--line);
}

.file-difference strong {
    overflow: hidden;
    font-size: 12px;
    font-weight: 570;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-difference small {
    color: var(--faint);
    font-size: 10px;
    text-align: right;
}

.clone-confirm-form {
    display: grid;
    align-content: start;
    gap: 18px;
    padding-left: clamp(24px, 4vw, 52px);
    border-left: 1px solid var(--line-strong);
}

.danger-copy {
    padding: 15px 16px;
    background: var(--danger-soft);
    border-left: 2px solid var(--danger);
}

.danger-copy strong {
    color: #f0c0ba;
    font-size: 12px;
}

.danger-copy p {
    margin: 7px 0 0;
    color: #b89590;
    font-size: 10px;
    line-height: 1.65;
}

.clone-check {
    margin: -2px 0;
}

.backup-note {
    margin: -8px 0 0;
    color: var(--faint);
    font-size: 10px;
    text-align: center;
}

.clone-apply-result {
    display: grid;
    padding: 13px 14px;
    gap: 5px;
    border: 1px solid var(--line-strong);
    font-size: 10px;
}

.clone-apply-result[data-kind="success"] {
    color: var(--success);
    background: var(--success-soft);
    border-color: #315a40;
}

.clone-apply-result[data-kind="error"] {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #663d38;
}

.clone-apply-result p {
    margin: 0;
    color: #b9bdb9;
    line-height: 1.5;
}

.clone-apply-result code {
    overflow-wrap: anywhere;
    color: #d5d8d4;
}

.clone-audit {
    border-bottom: 0;
}

@keyframes stage-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes form-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes result-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
    .workspace {
        grid-template-columns: minmax(240px, 0.7fr) minmax(500px, 1.3fr);
    }

    .context-rail {
        grid-column: 1 / -1;
        border-top: 1px solid var(--line);
    }

    .preview-items {
        max-height: 300px;
    }

    .operation-surface {
        border-right: 0;
    }
}

@media (max-width: 900px) {
    .auth-stage {
        grid-template-columns: 1fr;
    }

    .auth-mark {
        min-height: 46svh;
        gap: 48px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .auth-summary {
        margin: 0;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .account-rail,
    .operation-surface {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .operation-form {
        grid-template-columns: 1fr 1fr;
    }

    .action-button,
    .reason-field {
        grid-column: span 1;
    }

    .audit-section,
    .context-rail {
        grid-column: auto;
    }
}

@media (max-width: 600px) {
    :root {
        --topbar-height: 62px;
    }

    .topbar {
        padding: 0 15px;
    }

    .safe-status,
    .operator {
        display: none;
    }

    .account-rail,
    .operation-surface,
    .context-rail,
    .audit-section {
        padding: 26px 18px;
    }

    .operation-form {
        grid-template-columns: 1fr;
    }

    .action-button,
    .reason-field {
        grid-column: auto;
    }

    .boundary-note {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .auth-mark,
    .auth-form-wrap {
        padding: 30px 22px;
    }

    .auth-boundary {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .auth-boundary strong {
        margin-bottom: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 980px) {
    .clone-account-stage {
        grid-template-columns: 1fr;
    }

    .clone-account-column {
        min-height: auto;
    }

    .clone-account-column:first-child,
    .clone-account-column:last-child {
        border-right: 0;
        border-left: 0;
    }

    .handoff-mark {
        min-height: 92px;
        grid-template-columns: auto auto auto;
    }

    .handoff-mark i {
        transform: rotate(90deg);
    }

    .clone-account-column:last-child,
    .handoff-mark {
        border-top: 1px solid var(--line);
    }

    .clone-diff-layout {
        grid-template-columns: 1fr;
    }

    .clone-confirm-form {
        padding: 28px 0 0;
        border-top: 1px solid var(--line-strong);
        border-left: 0;
    }
}

@media (max-width: 760px) {
    .workspace-nav {
        margin-left: auto;
        gap: 14px;
    }

    .clone-intro {
        min-height: auto;
        padding: 34px 20px;
        align-items: flex-start;
        flex-direction: column;
        gap: 28px;
    }

    .identity-boundary {
        width: 100%;
        min-width: 0;
    }

    .clone-review,
    .clone-account-column {
        padding: 30px 20px;
    }

    .clone-review-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .clone-summary-strip {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .clone-summary-strip > div:last-child {
        text-align: left;
    }

    .clone-summary-strip > i {
        transform: rotate(90deg);
    }

    .file-difference {
        grid-template-columns: minmax(130px, 1fr) auto;
    }

    .file-difference small {
        display: none;
    }
}

@media (max-width: 520px) {
    .compact-brand small,
    .risk-status {
        display: none;
    }

    .workspace-nav {
        gap: 10px;
    }

    .workspace-nav a {
        font-size: 11px;
    }

    .session-zone {
        gap: 8px;
    }

    .handoff-mark small {
        display: none;
    }
}
