/*
 * 글꼴은 외부(Google Fonts 등)에서 불러오지 않고 이 서비스가 직접 제공한다(CSP default-src 'self').
 * 파일 출처·버전·SHA-256은 docs/design-product/customer-dashboard.md의 `화면 정보 구조와 디자인` 절에 있다.
 * Geist(라틴)가 영문·숫자를, Pretendard(한글)가 한글을 맡는다. 간체 중국어는 파일을 따로 묶지 않고 운영체제 CJK 글꼴로 폴백한다.
 * 글꼴 목록 순서대로 글리프가 있는 글꼴이 쓰인다.
 */
@font-face {
    font-family: "Geist";
    src: url("fonts/geist-variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Geist Mono";
    src: url("fonts/geist-mono-variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Pretendard";
    src: url("fonts/pretendard-variable.woff2") format("woff2-variations");
    font-weight: 45 920;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-sans: "Geist", "Pretendard", system-ui, sans-serif;
    --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 간체 중국어에는 번들에 없는 CJK 글리프를 운영체제 글꼴로 명시적으로 폴백한다. */
html[lang="zh-CN"] {
    --font-sans: "Geist", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.65;
    /* 한국어는 띄어쓰기 단위로 줄을 바꾸고, 너무 긴 토큰만 강제로 자른다. */
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 중국어는 띄어쓰기가 없어 keep-all이면 작은 화면에서 한 줄 전체가 최소 폭이 된다. */
html[lang="zh-CN"] body { word-break: normal; }

a { color: var(--text); text-underline-offset: .2em; }
code, kbd, samp, pre { font-family: var(--font-mono); font-size: .92em; }

/* ---------- 공통 틀: 사이드바와 본문 ---------- */
/* 로그인 전(data-shell="plain")은 상단 막대, 로그인 뒤(data-shell="sidebar")는 좌측 사이드바다. */
.dashboard-shell { display: flex; min-height: 100vh; }
.dashboard-shell[data-shell="plain"] { flex-direction: column; }
.main-column { flex: 1; min-width: 0; }
.page-content { max-width: 72rem; margin: 0 auto; padding: 2.5rem 2rem 4rem; }

.top-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-bottom: 1px solid var(--border); padding: .875rem 2rem; }

.brand { display: flex; align-items: center; gap: .65rem; border-radius: .5rem; padding: .25rem .5rem; color: var(--text); text-decoration: none; }
.brand-mark {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: .45rem;
    color: var(--on-primary);
    background: var(--primary);
    font-size: .8rem;
    font-weight: 600;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-name { font-weight: 600; }
.product-name { color: var(--text-muted); font-size: .8rem; }

.sidebar {
    display: flex;
    flex: 0 0 15rem;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--sidebar);
    padding: .875rem .75rem 1rem;
}
.sidebar-menu { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.sidebar-menu > summary {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 2.5rem;
    border-radius: .5rem;
    padding: 0 .5rem;
    cursor: pointer;
    list-style: none;
}
.sidebar-menu > summary::-webkit-details-marker { display: none; }
.sidebar-menu > summary:hover { background: var(--hover); }
.sidebar-menu-label { margin-left: auto; color: var(--text-muted); font-size: .85rem; }
.sidebar-menu-body { display: flex; flex: 1; flex-direction: column; gap: 1.1rem; padding-top: .75rem; }
.sidebar-placeholders { display: flex; flex-direction: column; gap: .5rem; }
.sidebar .placeholder-region { padding: .75rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: .125rem; }
.nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 2.25rem;
    border-radius: .5rem;
    padding: 0 .65rem;
    color: var(--text);
    text-decoration: none;
}
.nav-link:hover { background: var(--hover); }
.nav-link[aria-current="page"] { background: var(--selected); font-weight: 500; }
.nav-link svg { flex: none; width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-account { display: flex; flex-direction: column; gap: .125rem; margin-top: auto; border-top: 1px solid var(--border); padding-top: .75rem; }
.avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    font-size: .8rem;
    font-weight: 600;
}
/* 이니셜은 장식이다. 글자로 넣으면 보이는 글자("C")가 링크의 접근성 이름에 없어 음성 조작이 어긋나므로 CSS로 그린다. */
.avatar::before { content: attr(data-initial); }
.account-name { min-width: 0; overflow-wrap: anywhere; }
.sidebar-account form { margin: .5rem 0 0; }
.sidebar-account .button { width: 100%; }

/* 넓은 화면에서는 사이드바를 항상 펼쳐 보이고 상단 고정한다. details는 ::details-content를 지원하는 브라우저에서만
   항상 펼친 모양으로 만들 수 있다. 지원하지 않으면 "메뉴" 요약줄이 그대로 보여 직접 펼칠 수 있다. */
@media (width > 48rem) {
    .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
    @supports selector(::details-content) {
        .sidebar-menu > summary { display: none; }
        .sidebar-menu::details-content { content-visibility: visible; display: contents; }
        .sidebar-menu-body { padding-top: 0; }
    }
}

h1 { font-size: clamp(1.6rem, 3.2vw, 1.9rem); font-weight: 600; letter-spacing: -.01em; line-height: 1.3; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; font-weight: 600; line-height: 1.4; }
h3 { font-size: 1rem; font-weight: 600; line-height: 1.4; }
p { max-width: 44rem; color: var(--text-muted); }
.status { color: var(--text-muted); font-weight: 700; }
.notice { border-left: .3rem solid var(--text); color: var(--text); padding-left: .75rem; }
.design-pack-fallback {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .25rem .5rem;
    width: max-content;
    max-width: min(44rem, 100%);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: .75rem 1.5rem;
    color: var(--text);
    font-size: .9rem;
    line-height: 1.4;
}
.design-pack-fallback-host {
    position: sticky;
    z-index: 20;
    top: max(.75rem, env(safe-area-inset-top));
    width: max-content;
    max-width: calc(100% - 2rem);
    margin: .75rem auto 1rem;
}
@media (width > 48rem) {
    .design-pack-fallback-host.with-sidebar {
        width: calc(100% - 15rem);
        max-width: none;
        margin-inline-start: 15rem;
        margin-inline-end: 0;
    }
    .design-pack-fallback-host.with-sidebar .design-pack-fallback {
        max-width: calc(100% - 2rem);
        margin: 0 auto;
    }
}
.design-pack-fallback {
    position: relative;
    max-width: 100%;
    max-height: calc(100dvh - 1.5rem);
    overflow: auto;
    margin: 0;
    isolation: isolate;
    background: transparent;
    box-shadow: 0 .35rem 1.5rem var(--border);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}
.design-pack-fallback::before, .design-pack-fallback::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}
.design-pack-fallback::before { z-index: -1; background: var(--surface); opacity: .94; }
.design-pack-fallback::after { border: 1px solid var(--danger); opacity: .45; }
.design-pack-fallback a { color: inherit; font-weight: 600; text-underline-offset: .15em; }
.form-error { border-left: .3rem solid var(--danger); color: var(--danger); font-weight: 650; padding-left: .75rem; }
.success { margin: 1rem 0; }

/* ---------- 공통 컴포넌트: 버튼 ---------- */
/* 주 동작은 강조색이 아니라 흑백 대비(primary)다. 보조는 테두리, 위험은 danger 면이다. */
.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.25rem;
    border: 1px solid var(--primary);
    border-radius: .5rem;
    padding: .4rem .9rem;
    color: var(--on-primary);
    background: var(--primary);
    font: inherit;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
}

[hidden] { display: none !important; }

.button:hover, button:hover { opacity: .88; }
.button-secondary { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.button-secondary:hover { background: var(--hover); opacity: 1; }
.button-danger { border-color: var(--danger); color: var(--on-danger); background: var(--danger); }
button:disabled, .button[aria-disabled="true"] {
    border-color: var(--border-strong);
    color: var(--text-muted);
    background: var(--surface-muted);
    cursor: not-allowed;
    opacity: 1;
}

/* ---------- 공통 컴포넌트: 카드 ---------- */
.summary-card, .activity-summary, .app-item, .service-catalog-item {
    border: 1px solid var(--border);
    border-radius: .75rem;
    background: var(--surface);
    padding: 1.25rem;
}
.service-catalog-item { background: var(--surface-muted); }

/* ---------- 공통 컴포넌트: 입력 ---------- */
/* 입력창 경계는 장식이 아니라 컨트롤 경계라서 3:1 이상인 border-strong을 쓴다. */
input:not([type="hidden"], [type="radio"], [type="checkbox"]), select, textarea {
    max-width: 100%;
    min-width: 0;
    min-height: 2.25rem;
    border: 1px solid var(--border-strong);
    border-radius: .5rem;
    padding: .4rem .7rem;
    color: var(--text);
    background: var(--surface);
    font: inherit;
}
input[type="radio"], input[type="checkbox"] { accent-color: var(--primary); }
::placeholder { color: var(--text-muted); opacity: 1; }
label { color: var(--text); }
fieldset { border: 1px solid var(--border-strong); border-radius: .5rem; }

/* ---------- 공통 컴포넌트: 상태 점과 문구 ---------- */
/* 점은 장식이다. 상태는 문구가 전달하고, 점 색은 success·warning·danger 의미에만 쓴다. */
.status-indicator { display: inline-flex; min-width: 0; align-items: center; gap: .45rem; color: var(--text); }
.status-indicator > :last-child { min-width: 0; overflow-wrap: anywhere; }
.status-dot { flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--text-muted); }
.status-indicator[data-state="success"] .status-dot { background: var(--success); }
.status-indicator[data-state="warning"] .status-dot { background: var(--warning); }
.status-indicator[data-state="danger"] .status-dot { background: var(--danger); }

/* ---------- 공통 컴포넌트: 위험 영역(Danger zone) ---------- */
.danger-zone {
    border: 1px solid var(--danger);
    border-radius: .75rem;
    background: var(--surface);
    padding: 1.25rem;
}
.danger-zone > h2, .danger-zone > h3, .danger-zone > h4 { margin-top: 0; color: var(--danger); }
.danger-zone .app-delete-blocked-message { max-width: none; }
.app-delete-all-actions { display: flex; justify-content: flex-end; }

/* ---------- 공통 컴포넌트: 경로 표시 ---------- */
.breadcrumb { margin-bottom: 1rem; font-size: .9rem; }
.breadcrumb-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; color: var(--text-muted); }
.breadcrumb-list li + li::before { content: "/"; content: "/" / ""; margin-right: .5rem; }
.breadcrumb-list li[data-current="page"] { color: var(--text); font-weight: 500; }
.breadcrumb-list a { color: var(--text-muted); }
.breadcrumb-list span, .app-services-heading { overflow-wrap: anywhere; }

/* ---------- 공통 컴포넌트: 자리 표시(기능이 아직 없는 UI) ---------- */
/* opacity로 흐리게 하지 않고 text-muted 글자·점선 border-strong·surface-muted 면으로 표현한다. 그래야 비활성이라 검사에서 빠져도 대비가 유지된다. */
.placeholder-note {
    flex: none;
    border: 1px dashed var(--border-strong);
    border-radius: 999px;
    padding: 0 .5rem;
    color: var(--text-muted);
    background: var(--surface-muted);
    font-size: .8rem;
    font-weight: 400;
    line-height: 1.5;
}
.placeholder-value { display: inline-flex; align-items: baseline; gap: .5rem; color: var(--text-muted); }
.placeholder-control, .placeholder-control:hover {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    width: 100%;
    border: 1px dashed var(--border-strong);
    color: var(--text-muted);
    background: var(--surface-muted);
    font-weight: 400;
    text-align: left;
    cursor: default;
    opacity: 1;
}
.placeholder-control .placeholder-label { flex: 1 1 auto; overflow-wrap: break-word; }
.placeholder-control kbd {
    border: 1px solid var(--border-strong);
    border-radius: .25rem;
    padding: 0 .35rem;
    color: var(--text-muted);
    background: var(--surface);
    font-size: .75rem;
}
.placeholder-region {
    border: 1px dashed var(--border-strong);
    border-radius: .75rem;
    background: var(--surface-muted);
    padding: 1.25rem;
}
.placeholder-region > h2 { margin: 0 0 .25rem; font-size: 1rem; }
.placeholder-region > p { margin: 0; }
.placeholder-region-label { color: var(--text); font-size: 1rem; font-weight: 600; }

.setting-field { max-width: 34rem; margin: 1.25rem 0 0; }
.card-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.card-heading h2 { margin: 0 0 .5rem; }
.stacked-form { display: grid; gap: .7rem; max-width: 34rem; margin: 1.25rem 0; }
.stacked-form fieldset { display: grid; gap: .5rem; }
.stacked-form button { justify-self: start; }

.entry-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(17rem, .8fr); gap: 1rem; align-items: stretch; }
.entry-hero, .entry-preview { border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); padding: clamp(1.5rem, 4vw, 3rem); }
.entry-hero { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 30rem; }
.entry-hero .status { margin-bottom: .75rem; }
.entry-hero .button { margin-top: .75rem; }
.entry-preview { background: var(--surface-muted); }
.entry-preview > h2 { margin: .75rem 0 .5rem; }
.example-label { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: .1rem .55rem; color: var(--text-muted); font-size: .8rem; font-weight: 600; }
.journey-hierarchy, .journey-hierarchy ul { display: grid; gap: .75rem; list-style: none; margin: 0; padding: 0; }
.journey-hierarchy { margin-top: 1.5rem; }
.journey-hierarchy ul { position: relative; margin: .75rem 0 0 1rem; padding-left: 1.25rem; }
.journey-hierarchy ul::before { position: absolute; top: -.75rem; bottom: .9rem; left: 0; border-left: 1px solid var(--border-strong); content: ""; }
.journey-hierarchy li { position: relative; color: var(--text); font-weight: 600; }
.journey-hierarchy ul > li::before { position: absolute; top: .9rem; left: -1.25rem; width: .9rem; border-top: 1px solid var(--border-strong); content: ""; }

.page-intro { margin-bottom: 2rem; }
.page-intro .status { display: block; margin-bottom: .5rem; }
.page-eyebrow { margin: 0 0 .5rem; color: var(--text-muted); font-size: .9rem; font-weight: 650; }
.management-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, .65fr); gap: 1rem; align-items: start; }
.management-card, .management-section { border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); padding: 1.25rem; }
.organization-team { min-width: 0; overflow-wrap: anywhere; }
.organization-team input, .organization-team select { max-width: 100%; min-width: 0; }
.management-card > h2, .management-section > h2 { margin-top: 0; }
.management-section { margin-top: 1rem; }
.app-item-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; }
.compact-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem .75rem; align-items: center; margin: 1rem 0; }
.compact-details dt { color: var(--text-muted); font-size: .9rem; }
.compact-details dd { margin: 0; }
.compact-details .placeholder-value { font-size: .9rem; }

/* ---------- App 범위 화면: 서비스·플레이어·저장 데이터 ---------- */
.app-scope-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, .7fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.app-scope-header > div > p:last-child { margin-bottom: 0; }
.app-scope-details { margin: 0; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface-muted); padding: 1rem; }
.app-scope-nav { margin: 1rem 0 2rem; }
.app-scope-nav ul { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.app-scope-nav a { display: inline-flex; min-height: 2.25rem; align-items: center; border: 1px solid var(--border-strong); border-radius: 999px; padding: .35rem .8rem; color: var(--text); background: var(--surface); text-decoration: none; }
.app-scope-nav a:hover { background: var(--hover); }
.app-scope-nav a[data-current="page"] { border-color: var(--primary); color: var(--on-primary); background: var(--primary); font-weight: 600; }
.directory-search, .storage-search { margin-bottom: 1rem; }
.directory-search .stacked-form, .storage-search .stacked-form { margin-bottom: 0; }
.player-directory-summary, .storage-account-summary { margin-bottom: 1rem; }
.storage-limits { margin: 1rem 0; }
.storage-limits > h2 { margin-top: 0; }
.storage-limits .compact-details { margin-bottom: 0; }
.storage-limit-value { font-family: var(--font-mono); overflow-wrap: anywhere; }
.key-value-storage-editor-placeholder { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: 1rem; }
.storage-value-card { min-width: 0; }
.app-deletion-layout { grid-template-columns: minmax(0, .85fr) minmax(18rem, 1.15fr); }
.app-deletion-layout .details-list { grid-template-columns: minmax(0, 1fr); }

.overview-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(15rem, 1fr); gap: 1.5rem; align-items: start; margin-top: 1.5rem; }
.overview-layout h2 { margin: 0 0 .75rem; }
.overview-apps, .overview-secondary { min-width: 0; }
.overview-secondary { border-inline-start: 1px solid var(--border); padding-inline-start: 1rem; }
.overview-secondary .service-overview { margin: 0 0 1.5rem; }
.overview-service-list { list-style: none; margin: 0; padding: 0; }
.overview-service-list li, .overview-app-list li { display: flex; justify-content: space-between; gap: .75rem; align-items: center; border-bottom: 1px solid var(--border); padding: .45rem 0; }
.overview-service-list li { flex-wrap: wrap; }
.overview-service-list .status-indicator { white-space: nowrap; }
.overview-activity { border: 0; border-radius: 0; padding: 0; background: transparent; }
.overview-activity .activity-list { gap: 0; margin-top: .5rem; }
.overview-activity .activity-item { padding: .45rem 0; border-top: 1px solid var(--border); }
.overview-activity .activity-item h3 { font-size: 1rem; }
.overview-activity .activity-item p { margin: .15rem 0; }
.summary-card h2, .activity-summary h2, .app-item h3, .service-catalog-item h3 { margin-top: 0; }
.local-fixture-list { display: grid; gap: 1rem; }
.local-fixture-item { border: 1px solid var(--border); border-radius: .65rem; padding: 1rem; }
.local-fixture-item h3 { margin-top: 0; }
.local-fixture-item form:not(.stacked-form) { margin: .75rem 0; }
.app-name { overflow-wrap: anywhere; }
.summary-value { color: var(--text); font-size: 1.25rem; font-weight: 700; overflow-wrap: anywhere; }
.overview-app-list { display: grid; gap: .5rem; list-style: none; margin: 1rem 0; padding: 0; }
.overview-app-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; }
.overview-app-list a { overflow-wrap: anywhere; }
.service-catalog { display: grid; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.service-catalog-notice { margin-bottom: 0; }
.app-item { margin-top: 1rem; }
.apps-selector, .apps-detail { min-width: 0; }
.apps-selector { position: relative; z-index: 2; border-bottom: 1px solid var(--border); padding-bottom: .5rem; margin-bottom: 1rem; }
.apps-selector-details { position: relative; }
.apps-selector summary { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; width: fit-content; max-width: 100%; min-width: 0; min-height: 2.75rem; cursor: pointer; font-weight: 700; }
.apps-selector-arrow { flex: none; }
.apps-selector details[open] .apps-selector-arrow { transform: rotate(90deg); }
.apps-selector-notice { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-height: 2.75rem; }
.apps-selector-heading { flex: none; }
.apps-selector summary .status-indicator { flex: none; }
/* 제목과 이름을 한 줄로 묶어 상태만 다음 줄로 옮긴다. 이름 전체가 상태와 함께
   들어가지 않으면 상태를 먼저 내리고, 이름은 첫 줄의 남은 공간에서만 줄인다. */
.apps-selector-identity { display: flex; align-items: center; gap: .4rem; min-width: 0; max-width: 100%; }
.apps-selector-current { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apps-selector-popup { position: absolute; top: calc(100% + .35rem); inset-inline-start: 0; width: min(28rem, 100%); max-height: min(24rem, 65vh); overflow: auto; border: 1px solid var(--border-strong); border-radius: .5rem; background: var(--surface); padding: .6rem; }
.apps-selector-popup p { margin: 0 0 .5rem; }
.apps-selector-list { list-style: none; margin: 0 0 .5rem; padding: 0; }
.apps-selector-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.apps-selector-list .status-indicator { white-space: nowrap; }
.apps-selector-list a { display: block; padding: .55rem .65rem; color: var(--text); overflow-wrap: anywhere; }
.apps-selector-list a[aria-current="true"] { background: var(--hover); font-weight: 700; }
.apps-detail .management-section { margin-top: 0; }

.key-value-storage-json {
    max-width: 100%;
    overflow-x: auto;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: var(--code-background);
    color: var(--text);
    font-family: var(--font-mono);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.key-value-storage-edit-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; margin-top: 1rem; }
.key-value-storage-edit-form label { overflow-wrap: anywhere; }
.key-value-storage-edit-form textarea { width: 100%; min-height: 12rem; box-sizing: border-box; padding: .75rem; border: 1px solid var(--border-strong); border-radius: .5rem; background: var(--surface); color: var(--text); font: .9rem/1.5 var(--font-mono); }
.key-value-storage-edit-form textarea:focus-visible { border-color: var(--focus); }
.hint { color: var(--text-muted); margin: 0; }
.activity-summary { margin: 0 0 2rem; }
.service-overview { margin: 2rem 0; }
.service-overview > h2 { margin-bottom: .25rem; }
.activity-list { display: grid; gap: 1rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.activity-item { border-top: 1px solid var(--border); padding-top: 1rem; }
.activity-item:first-child { border-top: 0; padding-top: 0; }
.activity-item h3, .activity-item p { margin: .25rem 0; }
.activity-scope { color: var(--text-muted); overflow-wrap: anywhere; }

.details-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .5rem 1rem; align-items: center; }
.details-list dt { font-weight: 700; }
.details-list dd { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0; }
.details-list code { overflow-wrap: anywhere; user-select: all; }
.identifier-description { font-size: .94rem; }

.skip-link { position: absolute; z-index: 21; top: -5rem; padding: .75rem; background: var(--surface); color: var(--text); }
.skip-link:focus { top: .5rem; }
.visually-hidden { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
/* 화면 이동 뒤 스크립트가 제목으로 옮기는 포커스는 읽기 위치용이라 외곽선을 그리지 않는다. 키보드로 도는 컨트롤의 외곽선은 그대로다. */
h1:focus-visible { outline: none; }

@media (max-width: 64rem) {
    .dashboard-shell[data-shell="sidebar"] .entry-layout, .management-grid, .app-scope-header { grid-template-columns: 1fr; }
    .overview-layout { grid-template-columns: 1fr; }
    .overview-secondary { border-inline-start: 0; padding-inline-start: 0; }
}

@media (max-width: 48rem) {
    .dashboard-shell[data-shell="sidebar"] { flex-direction: column; }
    .sidebar { flex: none; border-right: 0; border-bottom: 1px solid var(--border); padding: .5rem .75rem; }
    /* 접힌 요약줄이 이미 브랜드를 보여 주므로 펼친 본문 안의 브랜드는 숨긴다. */
    .sidebar-menu-body > .brand { display: none; }
    .top-bar { padding: .75rem 1rem; }
    .page-content { padding: 1.5rem 1rem 3rem; }
    .entry-layout { grid-template-columns: 1fr; }
    .entry-hero { min-height: 0; }
    .overview-layout { grid-template-columns: 1fr; }
    .overview-secondary { border-inline-start: 0; padding-inline-start: 0; }
}

@media (max-width: 32rem) {
    .details-list { grid-template-columns: 1fr; }
}

/* 구성 편집기는 같은 문서를 트리와 읽기 전용 JSON으로 보여 준다. */
#composition-editor section { margin-block: 1.5rem; }
#composition-editor label { display: block; margin-block: 0.75rem; }
#composition-editor label input, #composition-editor label select { display: block; max-width: 100%; }
#composition-editor button { margin: 0.25rem; }
.components-table-wrapper { max-width: 100%; overflow-x: auto; }
.components-table { width: 100%; border-spacing: 0; text-align: start; }
.components-table th, .components-table td { padding: .55rem; border-bottom: 1px solid var(--border); text-align: start; }
.components-table th, .components-table .component-type, .components-table .component-status { overflow-wrap: normal; }
.components-table td small { display: block; color: var(--text-muted); }
@media (max-width: 48rem) {
    .components-table, .components-table tbody, .components-table tr, .components-table td { display: block; }
    .components-table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
    .components-table tr { padding: .5rem 0; border-bottom: 1px solid var(--border); }
    .components-table td { display: grid; grid-template-columns: minmax(7rem, .7fr) minmax(0, 1.3fr); gap: .5rem; border: 0; padding: .25rem .5rem; overflow-wrap: anywhere; }
    .components-table td::before { content: attr(data-label); font-weight: 700; }
    .components-table .component-status { overflow-wrap: anywhere; }
}
.component-add-form { border: 1px solid var(--border); border-radius: .5rem; padding: 1rem; max-width: 32rem; margin-top: 1rem; }
#composition-editor #component-open-form { margin-top: 1rem; }
.component-add-form h3 { margin-top: 0; }
.component-add-form input:not([type="radio"]), .component-add-form select { width: 100%; box-sizing: border-box; }
.component-form-error { color: var(--danger); }
.component-scope-group { margin: 1rem 0; }
.component-scope-option { display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; align-items: baseline; margin: .5rem 0; }
.component-scope-option label { margin: 0; }
.component-scope-option p { grid-column: 2; margin: .15rem 0 0; color: var(--text-muted); }
#composition-editor [role="tree"], #composition-editor [role="group"] { list-style: none; padding-inline-start: 1.5rem; }
#composition-editor [role="treeitem"] { padding: 0.35rem; cursor: pointer; }
#composition-editor [role="treeitem"][aria-selected="true"] > .composition-tree-label { outline: 2px solid var(--focus); outline-offset: 2px; }
#composition-editor pre { max-width: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
#composition-data { min-width: 0; overflow-wrap: anywhere; }
#composition-data pre { max-width: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
#composition-data button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
#composition-data textarea { display: block; width: 100%; max-width: 100%; box-sizing: border-box; }
.composition-copy-helper { position: fixed; inset-inline-start: -10000px; }

.composition-data-layout { display: grid; grid-template-columns: minmax(15rem, 1fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.composition-data-list, .composition-data-detail { min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface-muted); }
.composition-data-list > ul { list-style: none; padding: 0; }
.composition-data-list li + li { margin-top: .4rem; }
.composition-data-list li button { width: 100%; text-align: start; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); }
.composition-data-detail ul { padding-inline-start: 1.25rem; }
.composition-data-detail > button, .composition-data-detail [role="group"] button { margin-block: .4rem; margin-inline-end: .4rem; }
.composition-data-detail > label { display: block; margin-top: .75rem; }
.composition-data-detail textarea { width: 100%; box-sizing: border-box; }
.composition-data-detail pre { overflow: auto; max-width: 100%; }
@media (max-width: 48rem) { .composition-data-layout { grid-template-columns: minmax(0, 1fr); } }
