:root {
    --bg: #f5f7fa;
    --bg-strong: #e8edf3;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --surface-dark: #111827;
    --surface-dark-2: #1f2937;
    --line: rgba(17, 24, 39, 0.1);
    --line-strong: rgba(17, 24, 39, 0.18);
    --text: #111827;
    --muted: #6b7280;
    --brand: #0f6b7a;
    --brand-soft: rgba(15, 107, 122, 0.1);
    --accent: #9a5a1f;
    --accent-soft: rgba(154, 90, 31, 0.12);
    --ok: #0e9f6e;
    --warn: #c27803;
    --bad: #d14343;
    --shadow: 0 12px 32px rgba(17, 24, 39, 0.08);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --mono: "JetBrains Mono", monospace;
    --sans: "IBM Plex Sans", "PingFang SC", sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--sans);
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
}

button, input, textarea, select {
    font: inherit;
}

button {
    cursor: pointer;
}

input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.88);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: rgba(15, 124, 144, 0.56);
    box-shadow: 0 0 0 4px rgba(15, 124, 144, 0.14);
}

textarea {
    resize: vertical;
}

.mono {
    font-family: var(--mono);
}

.break-all {
    word-break: break-all;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.eyebrow--dark {
    color: rgba(27, 37, 48, 0.42);
}

.dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.42;
    display: inline-block;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    min-height: 38px;
    padding: 0 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.button--compact {
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.button--primary {
    color: #fff;
    background: #0f6b7a;
    box-shadow: none;
}

.button--accent {
    color: #fff;
    background: #9a5a1f;
    box-shadow: none;
}

.button--ghost {
    color: var(--text);
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid var(--line);
}

.icon-button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.78);
    font-size: 22px;
    line-height: 1;
}

.icon-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.badge--slate {
    color: #52616d;
    background: rgba(82, 97, 109, 0.12);
}

.badge--brand {
    color: #0c6b7b;
    background: rgba(15, 124, 144, 0.12);
}

.badge--ok {
    color: #0e8a60;
    background: rgba(14, 159, 110, 0.13);
}

.badge--warn {
    color: #a76600;
    background: rgba(194, 120, 3, 0.14);
}

.badge--bad {
    color: #c43737;
    background: rgba(209, 67, 67, 0.14);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.field > span:first-child {
    font-size: 14px;
    color: var(--muted);
}

.checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text);
}

.checkbox-field input,
.checkbox-card input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.field--full {
    grid-column: 1 / -1;
}

.splash {
    min-height: 100vh;
    display: grid;
    place-items: center;
    gap: 18px;
    color: var(--muted);
}

.spinner {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: 4px solid rgba(15, 124, 144, 0.16);
    border-top-color: var(--brand);
    animation: spin 0.95s linear infinite;
}

.toast-shell {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 40;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(17, 24, 39, 0.42);
    backdrop-filter: blur(8px);
}

.modal-card {
    width: min(520px, 100%);
    max-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.modal-card--wide {
    width: min(920px, 100%);
}

.modal-card__header,
.modal-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
}

.modal-card__header {
    border-bottom: 1px solid var(--line);
}

.modal-card__header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-card__body {
    min-height: 0;
    overflow: auto;
    padding: 16px 18px;
}

.modal-card__footer {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
}

.modal-card__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    font-size: 20px;
    background: rgba(17, 24, 39, 0.06);
}

.modal-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.toast {
    min-width: 280px;
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.toast--success {
    border-color: rgba(14, 159, 110, 0.24);
}

.toast--error {
    border-color: rgba(209, 67, 67, 0.24);
}

.toast__title {
    font-weight: 700;
}

.toast__message {
    margin-top: 6px;
    font-size: 14px;
    color: var(--muted);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-card {
    width: min(1160px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    overflow: hidden;
    border-radius: 36px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.login-hero {
    padding: 54px;
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.15), transparent 30%),
        linear-gradient(135deg, #12344b 0%, #0f7c90 48%, #2a9d8f 100%);
}

.login-hero h1 {
    margin: 18px 0 16px;
    font-size: clamp(38px, 4vw, 56px);
    line-height: 1.02;
}

.login-hero p {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.8;
}

.reeman-mark {
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 34px 0 28px;
}

.reeman-mark__badge {
    position: relative;
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.reeman-mark__ring {
    position: absolute;
    inset: 14px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.reeman-mark__core {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    font-size: 34px;
    font-weight: 800;
    color: #13354d;
    background: linear-gradient(135deg, #fefae0 0%, #f4a261 100%);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.18);
}

.reeman-mark__title {
    font-size: clamp(30px, 4vw, 56px);
    font-weight: 800;
    letter-spacing: 0.16em;
}

.reeman-mark__subtitle {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.hero-points div {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.login-panel {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: rgba(255, 255, 255, 0.92);
}

.panel-heading h2 {
    margin: 12px 0 0;
    font-size: 32px;
}

.panel-heading p {
    margin: 0;
    color: var(--muted);
    display: none;
}

.session-hint,
.note-box,
.hint-card,
.progress-card,
.target-preview,
.info-card,
.empty-inline,
.code-block,
.list-card,
.package-card,
.log-card,
.stat-card,
.panel {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: none;
}

.session-hint,
.note-box,
.hint-card,
.progress-card,
.target-preview,
.info-card,
.empty-inline,
.code-block {
    padding: 18px;
}

.session-hint {
    background: rgba(15, 124, 144, 0.08);
    border-color: rgba(15, 124, 144, 0.18);
}

.session-hint__title {
    font-weight: 700;
}

.session-hint__meta,
.hint-card__meta,
.sidebar-user__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}

.session-hint__actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.note-box {
    background: rgba(188, 108, 37, 0.09);
    border-color: rgba(188, 108, 37, 0.18);
}

.inline-error {
    color: var(--bad);
    font-size: 14px;
}

.inline-success {
    color: var(--ok);
    font-size: 14px;
}

.workspace {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    padding: 16px;
}

.sidebar {
    position: sticky;
    top: 22px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px;
    border-radius: 12px;
    background: #111827;
    box-shadow: var(--shadow);
    color: #fff;
}

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

.brand__mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-weight: 800;
    color: #12344b;
    background: #f6bd60;
}

.brand__title {
    font-size: 16px;
    font-weight: 700;
}

.brand__subtitle {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 13px;
}

.sidebar-user {
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user__name {
    font-size: 15px;
    font-weight: 700;
}

.nav-list {
    display: grid;
    gap: 6px;
}

.nav-item {
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    text-align: left;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item--active {
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 3px 0 0 #f6bd60;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 22px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.workspace-header h1 {
    margin: 6px 0 0;
    font-size: 24px;
}

.workspace-header p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
    display: none;
}

.summary-strip,
.panel-grid {
    display: grid;
    gap: 18px;
}

.summary-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    padding: 14px 16px;
}

.stat-card__label {
    font-size: 13px;
    color: var(--muted);
}

.stat-card__value {
    margin-top: 8px;
    font-size: 24px;
    font-weight: 700;
}

.stat-card__detail {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
}

.page-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.section-head h2 {
    margin: 6px 0 0;
    font-size: 22px;
}

.section-head p,
.panel__header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    display: none;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.panel-grid--publish {
    grid-template-columns: 1.2fr 0.8fr;
}

.panel-grid--editor {
    grid-template-columns: 0.92fr 1.08fr;
}

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

.api-doc .section-head p,
.api-doc .panel__header p {
    display: block;
}

.api-doc .section-head .badge {
    display: none;
}

.api-doc__summary {
    display: grid;
    gap: 18px;
}

.api-doc__lead {
    font-size: 20px;
    font-weight: 700;
}

.api-step-list {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.api-step-list--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.api-step-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 124, 144, 0.07), rgba(255, 255, 255, 0.96));
}

.api-step-card__index {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--brand);
}

.api-step-card__title {
    font-size: 18px;
    font-weight: 700;
}

.api-step-card__text,
.api-rule-card__text,
.api-note,
.api-field-row__desc {
    line-height: 1.7;
}

.api-field-list {
    display: grid;
    gap: 12px;
}

.api-field-row {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
}

.api-field-row__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.api-field-row__name {
    font-size: 15px;
    font-weight: 700;
    word-break: break-all;
}

.api-field-row__meta {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
}

.api-code-title {
    margin: 16px 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.api-note {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(15, 124, 144, 0.16);
    background: rgba(15, 124, 144, 0.08);
}

.api-rule-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.api-rule-card {
    display: grid;
    gap: 12px;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
}

.api-rule-card__title {
    font-size: 20px;
    font-weight: 700;
}

.api-doc .code-block {
    white-space: pre-wrap;
    word-break: break-word;
}

.panel {
    padding: 16px;
    box-shadow: var(--shadow);
}

.panel__header {
    margin-bottom: 12px;
}

.panel__header h3 {
    margin: 0;
    font-size: 16px;
}

.stack {
    display: grid;
    gap: 12px;
}

.dropzone {
    display: grid;
    place-items: center;
    gap: 12px;
    padding: 34px 20px;
    text-align: center;
    border: 2px dashed rgba(15, 124, 144, 0.26);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(15, 124, 144, 0.06), rgba(255, 255, 255, 0.82));
}

.dropzone--dragging {
    border-color: rgba(15, 124, 144, 0.66);
    background: linear-gradient(180deg, rgba(15, 124, 144, 0.12), rgba(255, 255, 255, 0.92));
}

.dropzone--disabled {
    opacity: 0.58;
}

.hidden-input {
    display: none;
}

.dropzone__icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    font-size: 34px;
    color: var(--brand);
    background: rgba(255, 255, 255, 0.92);
}

.dropzone__title {
    font-size: 20px;
    font-weight: 700;
}

.dropzone__subtitle {
    max-width: 560px;
    color: var(--muted);
    line-height: 1.7;
    display: none;
}

.dropzone__actions,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.dropzone__file {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
}

.hint-card--ok {
    background: rgba(14, 159, 110, 0.08);
    border-color: rgba(14, 159, 110, 0.18);
}

.hint-card--error,
.progress-card--error {
    background: rgba(209, 67, 67, 0.07);
    border-color: rgba(209, 67, 67, 0.18);
}

.hint-card__title {
    margin-bottom: 6px;
    font-weight: 700;
}

.progress-card__message {
    font-weight: 600;
}

.progress-bar {
    margin-top: 14px;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(27, 37, 48, 0.1);
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #0f7c90 0%, #bc6c25 100%);
}

.progress-card__percent {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}

.target-preview {
    background: rgba(255, 255, 255, 0.72);
}

.target-preview__title {
    font-weight: 700;
}

.target-preview__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.target-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--brand);
    background: rgba(15, 124, 144, 0.1);
    border: 1px solid rgba(15, 124, 144, 0.18);
}

.target-preview__empty {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.info-card--accent {
    background: #fff;
}

.info-card__title {
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 700;
}

.info-card__row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-top: 1px dashed var(--line);
    font-size: 13px;
}

.info-card__row span:first-child {
    color: var(--muted);
}

.info-card__row span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.info-card__row:first-of-type {
    border-top: 0;
}

.empty-inline,
.empty-state {
    text-align: center;
    color: var(--muted);
}

.empty-state {
    padding: 30px 18px;
}

.package-list {
    display: grid;
    gap: 10px;
}

.log-list {
    display: grid;
    gap: 14px;
}

.package-card,
.list-card,
.log-card {
    padding: 14px;
    text-align: left;
}

.list-card--clickable {
    cursor: pointer;
}

.list-card--clickable:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(15, 124, 144, 0.18);
}

.package-card__title,
.list-card__title,
.log-card__title {
    font-size: 15px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.package-card__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.package-card__meta,
.list-card__top,
.log-card__top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.log-card__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.log-card__time,
.log-card__meta {
    color: var(--muted);
    font-size: 13px;
}

.log-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
}

.log-card__detail {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    color: var(--text);
    background: rgba(15, 124, 144, 0.06);
}

.list-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.share-box {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(15, 124, 144, 0.06);
}

.share-box__title {
    font-weight: 700;
}

.share-box__meta {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
}

.share-link {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-top: 14px;
}

.share-link input {
    min-width: 0;
}

.share-link input.mono {
    font-size: 13px;
}

.panel-divider {
    height: 1px;
    margin: 22px 0;
    background: var(--line);
}

.package-card__grid,
.list-card__body {
    display: grid;
    gap: 7px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.project-key-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.project-key-input {
    min-width: 0;
    padding: 12px 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.92);
    cursor: text;
}

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

.package-card__foot {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.package-card__foot--download {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.package-card__foot--block {
    display: grid;
    gap: 8px;
}

.package-card__foot-label {
    font-size: 13px;
    color: var(--muted);
}

.markdown-body {
    color: var(--text);
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.markdown-body > *:first-child {
    margin-top: 0;
}

.markdown-body > *:last-child {
    margin-bottom: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin: 12px 0 8px;
    color: var(--text);
    font-weight: 700;
}

.markdown-body h1 {
    font-size: 18px;
}

.markdown-body h2,
.markdown-body h3 {
    font-size: 16px;
}

.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    font-size: 15px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre {
    margin: 0 0 10px;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 22px;
}

.markdown-body blockquote {
    padding-left: 12px;
    border-left: 3px solid rgba(15, 124, 144, 0.28);
    color: var(--muted);
}

.markdown-body a {
    color: #0f7c90;
    font-weight: 600;
}

.markdown-body code {
    font-family: var(--mono);
    font-size: 0.92em;
    padding: 2px 5px;
    border-radius: 8px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.08);
}

.markdown-body pre {
    padding: 12px 14px;
    border-radius: 14px;
    overflow-x: auto;
    background: rgba(15, 23, 42, 0.08);
}

.markdown-body pre code {
    display: block;
    padding: 0;
    border-radius: 0;
    white-space: pre;
    background: transparent;
}

.form-grid {
    display: grid;
    gap: 16px;
}

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

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

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
}

.stat-card__label {
    color: var(--muted);
    font-size: 13px;
}

.stat-card__value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
}

.stat-card__meta,
.stat-card__hint,
.muted-text {
    color: var(--muted);
    font-size: 13px;
}

.download-policy {
    display: grid;
    gap: 14px;
    padding-top: 4px;
}

.download-stat-line {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
}

.dependency-editor {
    display: grid;
    gap: 10px;
}

.dependency-editor__row {
    display: grid;
    grid-template-columns: minmax(150px, 1.1fr) minmax(130px, 0.8fr) minmax(120px, 1fr) minmax(120px, 1fr) 34px;
    gap: 10px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fafb;
}

.dependency-editor__row .field {
    gap: 6px;
}

.dependency-editor__row .field > span:first-child {
    font-size: 12px;
}

.dependency-editor__any {
    min-height: 38px;
    display: flex;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
}

.dependency-editor__remove {
    align-self: end;
}

.code-block {
    font-size: 14px;
    line-height: 1.7;
    overflow-x: auto;
}

.dependency-list {
    display: grid;
    gap: 6px;
}

.dependency-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.9fr) minmax(120px, 0.8fr) max-content minmax(120px, 1fr);
    gap: 8px;
    align-items: center;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
}

.dependency-row > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dependency-row > .mono {
    font-size: 12px;
}

.dependency-row .badge {
    justify-self: start;
}

.dependency-match {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dependency-release {
    position: relative;
    display: inline-flex;
}

.dependency-release__trigger {
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--brand);
    background: var(--brand-soft);
    font-size: 12px;
    white-space: nowrap;
}

.dependency-release__popover {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    width: min(360px, 80vw);
    display: none;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow);
}

.dependency-release:hover .dependency-release__popover,
.dependency-release:focus-within .dependency-release__popover {
    display: grid;
    gap: 10px;
}

.dependency-release__title {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.dependency-release__grid {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 6px 10px;
    color: var(--muted);
    font-size: 12px;
}

.dependency-release__grid span:nth-child(even) {
    color: var(--text);
    overflow-wrap: anywhere;
}

.dependency-release__note {
    max-height: 180px;
    overflow: auto;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 12px;
}

.relation-table {
    display: grid;
    gap: 10px;
}

.relation-row {
    display: grid;
    grid-template-columns: minmax(190px, 0.75fr) minmax(360px, 1.4fr) max-content;
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.relation-row__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.relation-row__meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.dependency-tree__node {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.dependency-tree__node--repeated {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.08);
}

.dependency-tree__title,
.dependency-tree__edge-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.dependency-tree__file,
.dependency-tree__missing {
    color: var(--muted);
    font-size: 13px;
}

.dependency-tree__children {
    display: grid;
    gap: 10px;
    margin-left: 18px;
    padding-left: 14px;
    border-left: 2px solid var(--line);
}

.dependency-tree__edge {
    display: grid;
    gap: 8px;
}

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

@media (max-width: 1200px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

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

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

    .panel-grid--publish,
    .panel-grid--editor,
    .panel-grid--api {
        grid-template-columns: 1fr;
    }

    .api-step-list,
    .api-step-list--compact,
    .api-rule-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .login-card {
        grid-template-columns: 1fr;
    }

    .login-hero,
    .login-panel,
    .workspace-header,
    .panel {
        padding: 22px;
    }

    .reeman-mark {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-head,
    .workspace-header {
        flex-direction: column;
    }

    .summary-strip,
    .stats-grid,
    .form-grid--two,
    .checkbox-grid,
    .package-card__top,
    .package-card__grid,
    .dependency-editor__row,
    .dependency-row,
    .relation-row,
    .share-link {
        grid-template-columns: 1fr;
    }

    .api-step-list,
    .api-step-list--compact,
    .api-rule-grid {
        grid-template-columns: 1fr;
    }

    .api-field-row__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .workspace {
        padding: 14px;
    }
}
