:root {
  --ink: #1d2a27;
  --muted: #63716c;
  --line: #ccd8d4;
  --surface: #ffffff;
  --canvas: #edf3f0;
  --sidebar: #111827;
  --sidebar-soft: rgba(255, 255, 255, .10);
  --accent: #287467;
  --accent-soft: #deece7;
  --success: #167346;
  --danger: #b42318;
  --danger-soft: #fff7f6;
  --danger-line: #f3b6af;
  --modal-overlay: rgba(15, 23, 42, .48);
  --modal-shadow: 0 24px 70px rgba(15, 23, 42, .28);
  --shadow: none;
}

body[data-theme="clean"] {
  --ink: #172033; --muted: #5b6878; --line: #c6ced7; --surface: #f8f9fb;
  --canvas: #e4e8ec; --sidebar: #f1f3f5; --sidebar-soft: #dce6ef; --accent: #326b9f;
  --accent-soft: #dce9f4; --success: #167346; --danger: #a83b32; --danger-soft: #faecea; --danger-line: #dfa7a2;
  --shadow: 0 2px 8px rgba(30, 50, 75, .08);
}
body[data-theme="dark"] {
  --ink: #d4d4d4; --muted: #a0a0a0; --line: #454547; --surface: #2a2a2b;
  --canvas: #1f1f1f; --sidebar: #252526; --sidebar-soft: #37373d; --accent: #3794ff;
  --accent-soft: #263d57; --success: #4ec97a; --danger: #f48771; --danger-soft: #4b2424; --danger-line: #8f4b46;
  --modal-overlay: rgba(0, 0, 0, .62); --modal-shadow: 0 24px 70px rgba(0, 0, 0, .46);
  --shadow: 0 2px 8px rgba(0, 0, 0, .18);
  color-scheme: dark;
}
body[data-theme="warm"] {
  --ink: #292524; --muted: #726a63; --line: #d0c4b5; --surface: #f5f0e8;
  --canvas: #e7ded2; --sidebar: #715b4c; --sidebar-soft: rgba(255, 246, 236, .15); --accent: #9a5938;
  --accent-soft: #efe2d5; --shadow: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Arial, "Malgun Gothic", sans-serif; line-height: 1.45; }
body.corporate-scroll-enabled { overflow-y: auto !important; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
input[type="checkbox"], input[type="radio"] { width: 16px; min-width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; accent-color: var(--accent); }

body[data-theme="default"] { --sidebar: #356157; --sidebar-soft: rgba(255, 255, 255, .15); }
body[data-theme="default"] .sidebar { color: #ffffff; border-right: 1px solid #294f47; }
body[data-theme="default"] .sidebar > .brand { color: #ffffff; border-bottom-color: rgba(255, 255, 255, .18); }
body[data-theme="default"] .brand small,
body[data-theme="default"] .menu-label { color: #c9ded8; }
body[data-theme="default"] .menu-label { border-bottom-color: rgba(201, 222, 216, .24); }
body[data-theme="default"] .menu-link { color: #e6f1ee; }
body[data-theme="default"] .menu-link:hover,
body[data-theme="default"] .menu-link.active { color: #ffffff; background: var(--sidebar-soft); }
body[data-theme="default"] .menu-icon { color: #e5f4f0; border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .10); }
body[data-theme="default"] .sidebar-footer { color: #e4f0ed; border-top-color: rgba(255, 255, 255, .18); }
body[data-theme="default"] .text-button { color: #d5e8e3; }

body[data-theme="clean"] .sidebar { color: #26384b; border-right: 1px solid var(--line); }
body[data-theme="clean"] .brand,
body[data-theme="clean"] .menu-link,
body[data-theme="clean"] .sidebar-footer { color: #26384b; }
body[data-theme="clean"] .brand small,
body[data-theme="clean"] .text-button { color: #627487; }
body[data-theme="clean"] .menu-label { color: #405a72; }
body[data-theme="clean"] .menu-label { border-bottom-color: #c8d1da; }
body[data-theme="clean"] .sidebar > .brand { border-bottom-color: #c6ced7; }
body[data-theme="clean"] .menu-link { color: #31475b; }
body[data-theme="clean"] .menu-link:hover,
body[data-theme="clean"] .menu-link.active { color: #174f7d; background: var(--sidebar-soft); }
body[data-theme="clean"] .menu-icon { border-color: #bdc8d3; background: #f8fafb; color: #35698f; }
body[data-theme="clean"] .sidebar-footer { border-top-color: #c6ced7; }
body[data-theme="clean"] .topbar { background: #f2f4f6; box-shadow: 0 1px 5px rgba(30, 50, 75, .08); }
body[data-theme="clean"] .panel,
body[data-theme="clean"] .metric-card { border-color: #c8d2de; border-radius: 8px; box-shadow: var(--shadow); }
body[data-theme="clean"] .panel-heading { background: #f0f2f4; }
body[data-theme="clean"] th { color: #34445a; border-color: #c6ced7; background: #e5e9ed; }
body[data-theme="clean"] input,
body[data-theme="clean"] select,
body[data-theme="clean"] textarea { border-color: #b8c3ce; background: #ffffff; }
body[data-theme="clean"] .button:not(.button-primary) { border-color: #b8c3ce; background: #f8f9fb; }
body[data-theme="clean"] .button:not(.button-primary):hover { border-color: #8fa1b6; background: #edf3f9; }
body[data-theme="clean"] .metric-accent { color: #ffffff; border-color: #36546d; background: #36546d; }
body[data-theme="clean"] .metric-accent span,
body[data-theme="clean"] .metric-accent small { color: #d4e0e8; }
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] th { color: var(--ink); border-color: var(--line); background: #313133; }
body[data-theme="dark"] .topbar { background: #252526; box-shadow: 0 1px 0 rgba(255, 255, 255, .04); }
body[data-theme="dark"] .button { color: var(--ink); border-color: #505052; background: #333334; }
body[data-theme="dark"] .button:hover { border-color: #6a6a6d; background: #3c3c3d; }
body[data-theme="dark"] .button-primary { color: #ffffff; border-color: #3794ff; background: #0e639c; }
body[data-theme="dark"] .button-primary:hover { border-color: #55a5ff; background: #1177bb; }
body[data-theme="dark"] .panel-heading { background: #2d2d2e; }
body[data-theme="dark"] .menu-label { color: #b1b1b5; }
body[data-theme="dark"] .menu-label { border-bottom-color: #414145; }
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea { background: #303031; }
body[data-theme="warm"] .sidebar { color: #fffaf5; border-right: 1px solid #5f4b3f; }
body[data-theme="warm"] .sidebar > .brand { color: #fffaf5; border-bottom-color: rgba(255, 255, 255, .18); }
body[data-theme="warm"] .brand small,
body[data-theme="warm"] .menu-label,
body[data-theme="warm"] .text-button { color: #e6d5c7; }
body[data-theme="warm"] .menu-label { border-bottom-color: rgba(230, 213, 199, .24); }
body[data-theme="warm"] .menu-link { color: #f7eee7; }
body[data-theme="warm"] .menu-link:hover,
body[data-theme="warm"] .menu-link.active { color: #ffffff; background: var(--sidebar-soft); }
body[data-theme="warm"] .menu-icon { color: #fff1e4; border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .10); }
body[data-theme="warm"] .sidebar-footer { color: #f4e8df; border-top-color: rgba(255, 255, 255, .18); }

.loading-screen, .auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.loading-screen { align-content: center; color: var(--muted); }
.loading-logo { width: 70px; height: 70px; margin: 0 auto 10px; border-radius: 20px; object-fit: cover; }

.auth-screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(91, 137, 126, .52) 0, rgba(49, 85, 79, .24) 24%, transparent 48%),
    radial-gradient(circle at 82% 82%, rgba(182, 106, 60, .18) 0, transparent 38%),
    linear-gradient(145deg, #173733 0%, #102a27 48%, #0b201e 100%);
}
.auth-screen::before,
.auth-screen::after {
  position: absolute;
  z-index: -1;
  content: "";
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
}
.auth-screen::before { width: 540px; height: 540px; top: -250px; right: -120px; }
.auth-screen::after { width: 380px; height: 380px; bottom: -210px; left: -90px; }
.login-card {
  position: relative;
  width: min(100%, 540px);
  padding: 34px 42px 38px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 24px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 30px 90px rgba(3, 17, 16, .38), 0 2px 8px rgba(3, 17, 16, .18);
}
.login-card::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 118px;
  height: 4px;
  content: "";
  transform: translateX(-50%);
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #d7a83d, #b66a3c);
}
.brand { display: flex; align-items: center; gap: 12px; color: white; }
.brand-mark-shell { width: 42px; height: 42px; flex: 0 0 auto; overflow: hidden; border-radius: 12px; background: white; }
.brand-mark-image { width: 100%; height: 100%; object-fit: cover; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .02em; }
.brand small { margin-top: 2px; color: #aebfbc; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.auth-logo { display: block; width: min(300px, 82%); height: auto; margin: -2px auto 8px; }
.auth-title { margin-bottom: 24px; text-align: center; }
.auth-title h1 { margin: 0; color: #102a4e; font-size: 27px; letter-spacing: -.035em; }
.auth-title p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 10px; }
.login-form label { margin-top: 7px; color: #34433f; font-size: 13px; font-weight: 800; }
.login-form input { min-height: 47px; padding-inline: 14px; border-color: #d5ddda; background: #f8faf9; }
.login-form .remember-identifier { width: fit-content; display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-weight: 700; cursor: pointer; }
.login-form .remember-identifier input { width: 17px; min-height: 17px; height: 17px; margin: 0; padding: 0; accent-color: var(--accent); }
input, select, textarea { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); }
input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(182,106,60,.16); border-color: var(--accent); }
.form-error, .global-message { color: var(--danger); }
.form-error { margin: 5px 0 0; font-size: 13px; }

.entry-screen { min-height: 100vh; padding: 28px; background: var(--canvas); }
.entry-shell { width: min(1160px, 100%); min-height: calc(100vh - 56px); display: flex; flex-direction: column; margin: 0 auto; }
.entry-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 2px 24px; border-bottom: 1px solid var(--line); }
.entry-brand { display: flex; align-items: center; gap: 12px; }
.entry-brand img { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 14px; object-fit: cover; }
.entry-brand strong, .entry-brand small { display: block; }
.entry-brand strong { color: var(--ink); letter-spacing: .04em; }
.entry-brand small { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.entry-tools { display: flex; align-items: center; gap: 12px; }
.entry-user { color: var(--muted); font-size: 13px; font-weight: 700; }
.theme-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 800; }
.theme-control select { width: auto; min-width: 82px; min-height: 36px; padding: 6px 28px 6px 9px; }
.entry-content { width: 100%; margin: auto 0; padding: 60px 0 80px; }
.entry-content > h1 { max-width: 720px; margin: 8px 0 10px; font-size: clamp(30px, 4.1vw, 48px); letter-spacing: -.045em; }
.entry-description { margin: 0; color: var(--muted); line-height: 1.7; }
.workspace-picker { display: grid; grid-template-columns: minmax(260px, 360px) minmax(220px, 1fr); align-items: end; gap: 18px; width: min(760px, 100%); margin-top: 28px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.workspace-picker label { display: grid; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 800; }
.workspace-picker select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); }
.workspace-picker p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.program-selection-message { min-height: 20px; margin: 18px 0 -20px; color: var(--muted); font-size: 13px; }
.program-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 38px; }
.program-card { position: relative; min-height: 288px; display: flex; flex-direction: column; padding: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.program-card::after { position: absolute; width: 190px; height: 190px; right: -75px; bottom: -90px; content: ""; border-radius: 50%; background: var(--program-glow, var(--accent-soft)); opacity: .72; }
.program-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 22px 46px rgba(23,33,43,.12); }
.program-card.trading { --program-glow: #dbeafe; }
body[data-theme="dark"] .program-card.trading { --program-glow: #1e3a5f; }
.program-card.management { --program-glow: #f3e8ff; }
body[data-theme="dark"] .program-card.management { --program-glow: #4c2b63; }
.program-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.program-card-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 17px; color: white; background: linear-gradient(145deg, #183f3a, #2e7469); font-family: Georgia, serif; font-size: 26px; font-weight: 700; }
.program-card.trading .program-card-icon { background: linear-gradient(145deg, #132f5f, #3269a8); }
.program-card.teslamate .program-card-icon { background: #e82127; }
.program-card.teslamate .program-card-icon img { display: block; width: 30px; height: 30px; }
.program-card.management .program-card-icon { background: linear-gradient(145deg, #4c1d75, #7e4aa8); }
.program-status { padding: 6px 10px; border-radius: 99px; color: var(--success); background: #e7f3ee; font-size: 11px; font-weight: 800; }
body[data-theme="dark"] .program-status { background: #064e3b; }
.program-card h2 { margin: 29px 0 9px; font-size: 24px; letter-spacing: -.035em; }
.program-card p { max-width: 430px; margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; }
.program-card-action { z-index: 1; display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 24px; color: var(--accent); font-size: 13px; font-weight: 900; }
.no-program { max-width: 720px; text-align: center; align-self: center; }
.no-program .entry-description { margin-bottom: 28px; }
.no-program-icon { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 22px; border-radius: 22px; color: var(--danger); background: #feeceb; font-size: 30px; font-weight: 900; }
.no-program > h1 { margin-inline: auto; }
.trading-hero { position: relative; min-height: 560px; display: grid; align-content: center; justify-items: start; margin: auto 0; padding: 64px; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); }
.trading-hero h1 { margin: 9px 0 13px; font-size: clamp(36px, 5vw, 62px); letter-spacing: -.05em; }
.trading-hero > p:not(.eyebrow) { max-width: 610px; margin: 0; color: var(--muted); line-height: 1.8; }
.status-pill { position: absolute; top: 28px; right: 28px; padding: 7px 11px; border-radius: 99px; color: var(--success); background: #e7f3ee; font-size: 11px; font-weight: 900; }
.trading-actions { margin-top: 30px; }
.trading-visual { position: absolute; right: 7%; bottom: 14%; width: 320px; height: 220px; opacity: .22; transform: skewY(-5deg); }
.trading-visual::before { position: absolute; inset: 0; content: ""; background: linear-gradient(transparent 49%, var(--line) 50%, transparent 51%), linear-gradient(90deg, transparent 49%, var(--line) 50%, transparent 51%); background-size: 48px 48px; }
.trading-visual span { position: absolute; bottom: 0; width: 34px; border-radius: 8px 8px 0 0; background: var(--accent); }
.trading-visual span:nth-child(1) { left: 18px; height: 34%; }.trading-visual span:nth-child(2) { left: 86px; height: 58%; }.trading-visual span:nth-child(3) { left: 154px; height: 46%; }.trading-visual span:nth-child(4) { left: 222px; height: 82%; }

.button { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 12px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.button:hover { border-color: #98a2b3; background: color-mix(in srgb, var(--surface) 92%, var(--accent)); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { color: white; border-color: var(--accent); background: var(--accent); }
.button-primary:hover { border-color: color-mix(in srgb, var(--accent) 80%, #000); background: color-mix(in srgb, var(--accent) 88%, #000); }
.button-wide { width: 100%; margin-top: 8px; min-height: 48px; box-shadow: none; }
.text-button { padding: 0; color: #c8d7d4; border: 0; background: transparent; font-size: 12px; }

.app-shell { width: 100%; min-width: 800px; max-width: 1920px; min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); margin: 0 auto; transition: grid-template-columns .2s ease; }
.sidebar { position: sticky; top: 0; min-width: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px 14px; color: white; background: var(--sidebar); overflow-y: auto; transition: opacity .16s ease, transform .2s ease; }
.sidebar > .brand { padding: 0 8px 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.app-menu { display: grid; gap: 20px; padding-top: 18px; }
.menu-group { display: grid; gap: 6px; }
.menu-label { min-height: 28px; display: flex; align-items: center; padding: 0 5px 6px; border-bottom: 1px solid rgba(255,255,255,.14); color: #8fa6a2; font-size: 14px; font-weight: 700; line-height: 1.35; letter-spacing: .015em; }
.menu-link { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; color: #d1d5db; text-decoration: none; font-size: 13px; }
.menu-link:hover, .menu-link.active { color: white; background: var(--sidebar-soft); }
.menu-icon { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.13); border-radius: 7px; font-size: 11px; font-weight: 800; }
.sidebar-footer { margin-top: auto; display: flex; justify-content: space-between; gap: 12px; padding: 18px 9px 2px; border-top: 1px solid rgba(255,255,255,.12); color: #f0f5f4; font-size: 13px; }

.workspace { min-width: 0; }
.topbar { position: sticky; z-index: 4; top: 0; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar h1 { display: none; }
.topbar-left { min-width: 0; display: flex; align-items: center; gap: 12px; }
.topbar-logo { width: 40px; height: 40px; flex: 0 0 auto; object-fit: contain; }
.breadcrumb { margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.top-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-left: auto; flex-wrap: nowrap; }
.topbar-control { min-width: 0; display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.topbar-control > span { flex: 0 0 auto; font: inherit; }
.corporation-switcher { width: auto; }
.corporation-switcher select { width: min(280px, 31vw); }
.theme-select { width: auto; }
.theme-select select { width: 104px; }
.topbar-control select { min-height: 36px; font-size: 13px; font-weight: 400; }
.mobile-menu-button { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 20px; cursor: pointer; }
.app-theme-control { margin: 0; }
.global-message { margin: 16px 24px 0; padding: 11px 13px; border: 1px solid #efc7c4; border-radius: 6px; background: #fff1f0; font-size: 13px; }
.global-message[data-tone="success"] { color: var(--success); border-color: #b9decf; background: #edf8f3; }
#global-message { position: fixed; z-index: 40; top: 50%; left: 50%; width: min(720px, calc(100vw - 48px)); margin: 0; padding: 16px 18px 16px 44px; box-shadow: 0 14px 36px rgba(15, 23, 42, .2); transform: translate(-50%, -50%); }
.global-message-close { position: absolute; top: 7px; left: 8px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; color: currentColor; border: 0; border-radius: 5px; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; }
.global-message-close:hover { background: color-mix(in srgb, currentColor 10%, transparent); }

.page-content { width: 100%; display: grid; gap: 18px; padding: 24px; }
.filter-bar { display: flex; align-items: end; gap: 24px; }
.filter-bar h2, .panel h2 { margin: 3px 0 0; letter-spacing: -.025em; }
.filter-bar h2 { font-size: 24px; }
.page-intro { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 0 6px; border-bottom: 2px solid var(--ink); }
.page-intro h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
.page-intro p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.status-badge { padding: 7px 11px; border-radius: 99px; color: var(--muted); background: var(--line); font-size: 12px; font-weight: 800; }
.status-badge.saved { color: var(--success); background: #e7f3ee; }
.status-badge.danger { color: var(--danger); background: #feeceb; }
.panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.panel-actions-inset { padding:16px; border-top:1px solid var(--line); }
.action-divider { width: 1px; height: 22px; margin: 0 2px; background: var(--line); }
.updated-note { color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 0; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface); }
.form-grid > .form-field { position: relative; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.form-grid > .form-field:not(.form-field-wide)::after { position: absolute; z-index: 1; right: -300%; bottom: -1px; left: -300%; content: ""; border-bottom: 1px solid var(--line); pointer-events: none; }
.form-grid > .form-field-wide { border-right: 0; }
.form-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; }
.record-search-grid { padding: 16px; }
.record-search-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.record-search-fields .form-field-wide { grid-column: span 2; }
.pagination-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pagination-actions { display: flex; align-items: center; gap: 6px; }
.pagination-actions select { min-height: 32px; padding: 5px 28px 5px 8px; }
.table-check { width: 42px; text-align: center; }
.record-link { color: var(--accent); font-weight: 800; }
.record-form-section { grid-column: 1 / -1; margin: 4px -22px -2px; padding: 16px 22px 0; border-top: 1px solid var(--line); }
.record-form-section h3 { margin: 0; font-size: 14px; }
.profile-form-body { display: grid; gap: 18px; padding: 20px; background: color-mix(in srgb, var(--canvas) 45%, var(--surface)); }
.profile-section { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 1px 3px rgba(15, 23, 42, .04); }
.profile-section-heading { min-height: 66px; display: flex; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, var(--canvas)); }
.profile-section-heading h3 { margin: 0; font-size: 15px; }
.profile-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; font-weight: 400; }
.profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; padding: 18px; background: var(--surface); }
.profile-fields .form-field { min-height: 68px; display: flex; flex-direction: column; gap: 7px; background: transparent; }
.profile-fields .form-field-caption { min-height: auto; justify-content: flex-start; padding: 0; border: 0; background: transparent; }
.profile-fields .form-field > input { min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.profile-fields .form-field > input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 18%, transparent); outline-offset: 0; }
.profile-fields .form-field > input[readonly] { color: var(--muted); border-color: color-mix(in srgb, var(--line) 82%, var(--canvas)); background: color-mix(in srgb, var(--canvas) 62%, var(--surface)); }
.profile-fields .form-field-wide { grid-column: 1 / -1; }
.permission-field { grid-column: 1 / -1; background: var(--surface); }
.permission-field-head { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.permission-field-head h3 { margin: 0; font-size: 15px; }
.permission-tree { display: grid; gap: 14px; padding: 14px; }
.permission-program { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.permission-summary { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 84%, var(--accent-soft)); font-size: 13px; font-weight: 800; }
.permission-summary small { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 700; }
.permission-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; }
.permission-group { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.permission-group-head { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--line); background: var(--canvas); font-size: 12px; font-weight: 800; }
.permission-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding: 11px; }
.permission-item { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 12px; line-height: 1.35; cursor: pointer; }
.permission-item span { overflow-wrap: anywhere; }
.menu-permission-table { min-width: 900px; table-layout: fixed; }
.menu-permission-table .record-column-username { width: 150px; }
.menu-permission-table .record-column-display-name { width: 190px; }
.menu-permission-table .record-column-menu-names { width: auto; }
.menu-permission-table .record-column-valid-from { width: 190px; }
.menu-permission-table .record-actions-column { width: 76px; }
.menu-permission-table td { vertical-align: top; }
.menu-permission-table td.record-column-menu-names { padding: 8px 12px; white-space: normal; }
.menu-permission-overview { min-width: 0; display: grid; gap: 7px; }
.menu-permission-programs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.menu-program-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); border-radius: 99px; color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface)); line-height: 1.2; }
.menu-program-chip strong { font-size: 11px; }
.menu-program-chip small { color: var(--muted); font-size: 10px; }
.menu-permission-total { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 800; }
.menu-permission-details { border-top: 1px dashed var(--line); }
.menu-permission-details summary { width: fit-content; padding-top: 6px; color: var(--accent); font-size: 11px; font-weight: 800; cursor: pointer; }
.menu-permission-groups { display: grid; gap: 8px; padding-top: 9px; }
.menu-permission-groups section { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; align-items: start; }
.menu-permission-groups section > strong { padding-top: 3px; color: var(--ink); font-size: 11px; }
.menu-permission-groups section > div { display: flex; gap: 5px; flex-wrap: wrap; }
.menu-permission-groups section span { padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: color-mix(in srgb, var(--surface) 82%, var(--canvas)); font-size: 10px; line-height: 1.35; }
.permission-period { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; color: var(--ink); font-size: 11px; }
.permission-period small { color: var(--muted); }
.permission-period.permanent { padding: 4px 9px; border-radius: 99px; color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface)); font-weight: 800; }
.record-attachment-section { margin: 20px 22px 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.record-attachment-section .panel-heading { border-bottom: 1px solid var(--line); }
.app-shell .record-attachment-section .table-wrap { border-top: 0; border-left: 0; }
.app-shell .record-attachment-section .table-wrap tbody tr:last-child td { border-bottom: 0; }
.form-field { min-width: 0; min-height: 40px; display: grid; grid-template-columns: 132px minmax(0, 1fr); align-content: stretch; gap: 0; color: var(--ink); background: var(--surface); font-size: 12px; font-weight: 400; }
.form-field-caption { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 10px; border-right: 1px solid var(--line); background: var(--canvas); font-weight: 800; }
.form-field-title { min-width: 0; display: inline-flex; align-items: center; gap: 3px; }
.form-field-caption small { color: var(--accent); font-size: 10px; font-weight: 700; white-space: nowrap; }
.form-field-caption .required-mark { color: var(--danger); font-size: 15px; font-weight: 900; line-height: 1; }
.form-field > input, .form-field > select, .form-field > textarea { min-height: 40px; border: 0; border-radius: 0; background: var(--surface); }
.form-field > input[readonly] { color: var(--muted); background: var(--canvas); }
.form-field > textarea { min-height: 88px; }
.form-field > input[type="checkbox"], .form-field > input[type="radio"] { align-self: center; margin-left: 12px; }
.multi-checkbox { min-height: 40px; display: flex; align-items: center; gap: 18px; padding: 7px 12px; background: var(--surface); }
.multi-checkbox label { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; cursor: pointer; }
.multi-checkbox input { width: 17px; min-height: 17px; margin: 0; accent-color: var(--accent); }
.multi-select { position: relative; min-width: 0; background: var(--surface); }
.multi-select summary { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 34px 8px 12px; overflow: hidden; cursor: pointer; list-style: none; }
.multi-select summary::-webkit-details-marker { display: none; }
.multi-select summary::after { position: absolute; right: 13px; content: "⌄"; color: var(--muted); font-size: 15px; transform: translateY(-1px); }
.multi-select[open] summary::after { transform: rotate(180deg) translateY(-1px); }
.multi-select summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-select-options { position: absolute; z-index: 12; top: calc(100% + 4px); right: 0; left: 0; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--modal-shadow); }
.multi-select-options label { min-height: 34px; display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 4px; font-weight: 700; cursor: pointer; }
.multi-select-options label:hover { background: var(--accent-soft); }
.multi-select-options input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--accent); }
.form-field-wide { grid-column: 1 / -1; }
.business-kind-group { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; padding: 38px 0 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); }
.business-kind-group legend { position: absolute; top: 0; left: 0; width: 100%; min-height: 38px; display: flex; align-items: center; padding: 0 12px; color: var(--ink); border-bottom: 1px solid var(--line); background: var(--canvas); font-size: 13px; font-weight: 900; }
.business-kind-group legend span { margin-left: 8px; color: var(--muted); font-size: 10px; font-weight: 600; }
.business-kind-group .form-field { border-right: 1px solid var(--line); }
.business-kind-group .form-field:last-child { border-right: 0; }
.business-kind-group .form-field > textarea { height: 70px; min-height: 70px; resize: vertical; }
.form-section-title { margin: 0 22px; padding: 22px 0 5px; border-top: 1px solid var(--line); }
.form-section-title h3 { margin: 0; font-size: 16px; }
.readonly-note { margin: 0 22px 22px; padding: 12px 14px; border-radius: 9px; color: var(--muted); background: var(--canvas); font-size: 13px; }
.member-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.member-metrics article { min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.member-metrics span { color: var(--muted); font-size: 12px; font-weight: 700; }
.member-metrics strong { font-size: 24px; letter-spacing: -.035em; }
.row-actions { display: flex; gap: 6px; }
.button-small { min-height: 28px; padding: 4px 8px; font-size: 11px; }
.button-danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.button-danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger-soft) 90%, var(--danger)); }
.member-name { font-weight: 800; }
.status-chip { display: inline-block; min-width: 42px; padding: 4px 9px; border: 1px solid color-mix(in srgb, var(--muted) 28%, var(--line)); border-radius: 99px; color: var(--ink); background: color-mix(in srgb, var(--canvas) 70%, var(--surface)); font-size: 11px; font-weight: 900; text-align: center; }
.status-chip.active { color: var(--success); border-color: color-mix(in srgb, var(--success) 38%, var(--line)); background: color-mix(in srgb, var(--success) 14%, var(--surface)); }
.status-chip.left { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 38%, var(--line)); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.equity-bars { padding: 20px; }
.equity-stack { width: 100%; min-height: 24px; display: flex; overflow: hidden; border-radius: 6px; background: var(--line); }
.equity-stack-segment { min-width: 0; min-height: 24px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; }
.equity-stack-segment > span { overflow: hidden; padding: 0 6px; text-overflow: ellipsis; }
.equity-stack-segment.blue { background: #3b82f6; }.equity-stack-segment.gold { background: #d7a83d; }.equity-stack-segment.green { background: #2e7d61; }.equity-stack-segment.violet { background: #8b5cf6; }.equity-stack-segment.coral { background: #d76b5d; }
.panel-help { margin: 0; padding: 13px 20px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--canvas); font-size: 12px; }
.role-permission-guide { display: grid; gap: 10px; color: var(--ink); }
.role-permission-guide h3 { margin: 0; font-size: 13px; }
.role-permission-guide .table-wrap { overflow-x: hidden; border: 1px solid var(--line); background: var(--surface); }
.role-permission-guide table { width: 100%; min-width: 0; table-layout: fixed; }
.role-permission-guide th, .role-permission-guide td { height: 34px; padding: 7px 9px; font-size: 11px; }
.role-permission-guide td:not(:last-child) { text-align: center; }
.role-permission-guide th:first-child { width: 68px; }
.role-permission-guide th:nth-child(2) { width: 48px; }
.role-permission-guide th:nth-child(3) { width: 98px; }
.role-permission-guide th:nth-child(4) { width: 48px; }
.role-permission-guide th:nth-child(5) { width: 108px; }
.role-permission-guide th:nth-child(6) { width: 78px; }
.role-permission-guide th:last-child,
.role-permission-guide td:last-child,
.app-shell .table-wrap td[data-label="설명"],
.app-shell .table-wrap td[data-label="권한 설명"] {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.role-permission-guide .permission-allowed { color: var(--success); font-weight: 800; }
.role-permission-guide .permission-denied { color: var(--muted); }
.role-permission-guide p { margin: 0; color: var(--muted); }
.system-role-guide td:nth-child(3), .system-role-guide td:nth-child(4) { text-align: left; }
.editor-actions { display: flex; justify-content: flex-end; gap: 9px; margin: 0 22px 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.editor-help { margin: 0 22px 20px; color: var(--muted); font-size: 12px; }
.eyebrow { margin: 0; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.date-filter { display: flex; align-items: end; gap: 9px; margin-left: auto; }
.date-filter label { color: var(--muted); font-size: 11px; font-weight: 700; }
.date-filter input { display: block; margin-top: 4px; }
.dashboard-search-grid { display: grid; grid-template-columns: minmax(180px, 260px) 18px minmax(180px, 260px); align-items: end; gap: 10px; padding: 16px; }
.dashboard-search-grid label { color: var(--muted); font-size: 12px; font-weight: 700; }
.dashboard-search-grid input { display: block; margin-top: 5px; }
.dashboard-search-grid > span { align-self: center; margin-top: 20px; color: var(--muted); text-align: center; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.dashboard-metric-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 16px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, var(--page)); }
.metric-card, .panel { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); box-shadow: none; }
.metric-card { min-height: 142px; display: flex; flex-direction: column; padding: 21px; }
.metric-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card strong { margin: auto 0 6px; font-size: clamp(22px, 2.3vw, 32px); letter-spacing: -.04em; }
.metric-card small { color: var(--muted); }
.metric-accent { color: white; border-color: var(--sidebar); background: var(--sidebar); }
.metric-accent span, .metric-accent small { color: #b9cac7; }
.metric-cumulative { border-color: color-mix(in srgb, var(--success) 35%, var(--line)); background: color-mix(in srgb, var(--success) 10%, var(--surface)); }
.metric-cumulative strong { color: var(--success); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.funding-source-layout { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(620px, 1.8fr); min-height: 300px; }
.funding-source-chart-wrap { display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px; border-right: 1px solid var(--line); }
.funding-source-chart { position: relative; width: 210px; aspect-ratio: 1; border-radius: 50%; background: var(--line); }
.funding-source-chart::after { position: absolute; inset: 24%; border-radius: 50%; background: var(--surface); content: ""; }
.funding-source-chart-center { position: absolute; z-index: 1; inset: 30%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.funding-source-chart-center small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.funding-source-chart-center strong { margin-top: 4px; font-size: 15px; white-space: nowrap; }
.funding-source-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; font-size: 12px; }
.funding-source-legend span { display: inline-flex; align-items: center; gap: 6px; }
.funding-source-legend i { width: 9px; height: 9px; border-radius: 50%; }
.funding-source-tables { display: grid; align-content: center; gap: 14px; padding: 18px; }
.funding-source-table-section { overflow: hidden; border: 1px solid var(--line); border-radius: 4px; }
.funding-source-table-section h3 { margin: 0; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--page); font-size: 13px; }
.funding-source-table-wrap { width: 100%; min-width: 0; align-self: stretch; }
.app-shell .funding-source-table-wrap table { width: 100%; min-width: 0 !important; table-layout: fixed; }
.app-shell .funding-source-table-wrap .funding-loan-table { width: 100%; min-width: 0 !important; }
.funding-currency-col { width: 9%; }
.funding-count-col { width: 11%; }
.funding-balance-col { width: 23%; }
.funding-ratio-col { width: 14%; }
.funding-capital-count-col,
.funding-capital-ratio-col { width: 188px; }
.funding-amount-col { width: 16%; }
.app-shell .funding-source-table-wrap th,
.app-shell .funding-source-table-wrap td { height: 34px; padding: 6px; overflow: hidden; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .funding-source-table-wrap .funding-count-column { padding-right: 4px; padding-left: 4px; text-align: center; }
.app-shell .funding-source-table-wrap td.funding-count-column { color: var(--muted); font-variant-numeric: tabular-nums; }
.app-shell .funding-source-table-wrap td.funding-aggregate-column { background: var(--surface); font-weight: 400; vertical-align: middle; }
.funding-source-note { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.panel { min-width: 0; overflow: hidden; }
#records-search-panel { position: relative; z-index: 4; overflow: visible; }
.panel-heading { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.panel h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; letter-spacing: 0; }
.panel-heading h2::before { width: 3px; height: 16px; flex: 0 0 auto; border-radius: 2px; background: var(--accent); content: ""; }
#member-editor-mode, #record-editor-mode { display: none; }
.count-badge { min-width: 44px; padding: 5px 11px; border: 1px solid color-mix(in srgb, var(--success) 38%, var(--line)); border-radius: 99px; color: var(--success); background: color-mix(in srgb, var(--success) 15%, var(--surface)); font-size: 12px; font-weight: 900; line-height: 1.25; text-align: center; }
.composition-list, .compact-list { padding: 4px 20px 8px; }
.composition-row, .compact-row { display: grid; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #edf0f1; line-height: 1.3; }
.composition-row { grid-template-columns: 1fr auto; }
.compact-row { grid-template-columns: minmax(0, 1fr) auto; }
.composition-row:last-child, .compact-row:last-child { border-bottom: 0; }
.row-title { font-size: 14px; font-weight: 700; }
.row-subtitle { margin-top: 2px; color: var(--muted); font-size: 12px; }
.row-amount { text-align: right; font-weight: 800; }
.empty-inline { padding: 28px 0; color: var(--muted); text-align: center; font-size: 13px; }

.table-wrap { max-width: 100%; overflow-x: auto; }
.app-shell .table-wrap.funding-source-table-wrap { overflow-x: clip; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 12px; }
th { color: var(--muted); background: color-mix(in srgb, var(--surface) 88%, var(--canvas)); font-size: 11px; font-weight: 700; letter-spacing: 0; text-align: center; }
tbody tr:last-child td { border-bottom: 0; }
.selectable-record-row { cursor: pointer; }
.selectable-record-row:hover td { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.selected-record-row td { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.number { text-align: right; }
.cell-center { text-align: center; }
.cell-center input[type="checkbox"] { width: 17px; min-height: 17px; accent-color: var(--accent); }

/* Corporate list tables follow the bordered, centered prototype pattern. */
.app-shell .table-wrap {
  width: 100%;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
}
.app-shell .table-wrap table { min-width: 680px; }
.app-shell .table-wrap th,
.app-shell .table-wrap td {
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: center;
  font-size: 13px;
}
.app-shell .table-wrap td.record-column-description { text-align: left; white-space: normal; line-height: 1.5; }
.app-shell .table-wrap thead th {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 5%, var(--surface));
  font-weight: 800;
  box-shadow: inset 0 -1px color-mix(in srgb, var(--ink) 10%, var(--line));
}
.app-shell .table-wrap tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--canvas) 34%, var(--surface));
}
.app-shell .table-wrap tbody tr:hover td { background: var(--accent-soft); }
.app-shell .table-wrap tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.app-shell .table-wrap td.number,
.app-shell .table-wrap td.cell-right { text-align: right; font-variant-numeric: tabular-nums; }
.app-shell .table-wrap td.cell-left { text-align: left; }
.app-shell .table-wrap td.record-amount-column { text-align: right; font-variant-numeric: tabular-nums; }
.app-shell .table-wrap .row-actions { justify-content: center; }
.mobile-record-summary { display: none; }
.mobile-total-summary { display: none; }
.app-shell .record-account-column { width: 250px; max-width: 250px; padding-top: 6px; padding-bottom: 6px; white-space: normal; }
.app-shell .cash-record-table { min-width: 1180px; table-layout: fixed; }
.app-shell .cash-record-table th,
.app-shell .cash-record-table td { overflow: hidden; text-overflow: ellipsis; }
.app-shell .cash-record-table .record-column-transaction-date { width: 88px; }
.app-shell .cash-record-table .record-column-direction-code { width: 60px; }
.app-shell .cash-record-table .record-column-transaction-nature-code { width: 92px; }
.app-shell .cash-record-table .record-column-cash-effect-name { width: 112px; }
.app-shell .cash-record-table .record-account-column { width: 250px; }
.app-shell .cash-record-table .record-column-currency { width: 58px; }
.app-shell .cash-record-table .record-column-amount,
.app-shell .cash-record-table .record-column-converted-krw-amount { width: 96px; }
.app-shell .cash-record-table .record-actions-column { width: 148px; }
.app-shell .loan-record-table { width: 100% !important; min-width: 1100px; table-layout: fixed; }
.app-shell .loan-record-table .record-column-received-at,
.app-shell .loan-record-table .record-column-repaid-at { width: 104px; }
.app-shell .loan-record-table .record-column-occurrence-type-name,
.app-shell .loan-record-table .record-column-repayment-type { width: 150px; }
.app-shell .loan-record-table .record-column-lender-name { width: 125px; }
.app-shell .loan-record-table .record-column-received-account-id,
.app-shell .loan-record-table .record-column-paid-account-id { width: 260px; max-width: 260px; }
.app-shell .loan-record-table .record-column-currency { width: 54px; }
.app-shell .loan-record-table .record-column-principal-amount,
.app-shell .loan-record-table .record-column-principal-krw-amount,
.app-shell .loan-record-table .record-column-repayment-amount,
.app-shell .loan-record-table .record-column-repayment-krw-amount { width: 126px; }
.app-shell .loan-record-table .record-actions-column { width: 150px; }
.record-total-row td { height: 48px; border-top: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line)); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.record-total-row td:first-child { text-align: left; }
.record-total-row td:first-child strong { margin-right: 10px; }
.record-total-row td:first-child span { color: var(--ink); font-size: inherit; font-weight: 400; }
.loan-list-total-label { display: inline-flex; align-items: center; gap: 10px; }
.loan-currency-totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 18px; }
.loan-currency-totals > span { display: grid; grid-template-columns: 34px minmax(74px, 1fr); align-items: baseline; gap: 6px; white-space: nowrap; }
.loan-currency-totals small { color: var(--muted); font-size: 11px; font-weight: 700; }
.loan-currency-amount { text-align: right; font-variant-numeric: tabular-nums; }
.loan-currency-totals-stacked { flex-direction: column; flex-wrap: nowrap; align-items: flex-end; gap: 2px; }
.loan-currency-counts-stacked { min-width: 40px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.loan-currency-counts-stacked > span { width: 100%; min-height: 17px; text-align: right; white-space: nowrap; }
.cash-direction-counts { align-items: stretch; }
.cash-direction-counts > span { display: grid; grid-template-columns: 28px 34px; align-items: baseline; gap: 6px; }
.cash-direction-counts > span > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.financial-total-stack { display: flex; min-height: 17px; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; font-variant-numeric: tabular-nums; }
.financial-total-stack > span { min-height: 17px; white-space: nowrap; }
.financial-total-currencies { align-items: center; color: var(--ink); }
.loan-total-empty { color: var(--muted); }
.loan-summary-table { min-width: 1040px; table-layout: fixed; }
.loan-summary-table td:nth-child(1),
.loan-summary-table td:nth-child(2) { width: 37%; }
.loan-summary-table td:nth-child(3) { width: 26%; }
.loan-summary-table tbody td { height: 70px; padding: 10px 14px; background: var(--accent-soft); }
.loan-summary-item { display: flex; align-items: center; justify-content: flex-start; gap: 10px; white-space: nowrap; }
.loan-summary-item > strong { min-width: 34px; }
.loan-summary-item > span:not(.number) { color: var(--muted); font-size: 12px; }
.loan-summary-item .loan-currency-counts-stacked { flex: 0 0 30px; }
.loan-summary-item .loan-currency-totals { flex: 0 0 126px; min-width: 126px; justify-content: flex-start; }
.loan-summary-item .loan-currency-totals-stacked { align-items: flex-start; }
.loan-summary-item > .number { margin-left: 28px; }
.loan-summary-balance { background: var(--accent-soft) !important; }
.loan-summary-balance .loan-summary-item { justify-content: space-between; }
.loan-summary-balance .loan-summary-item > .number { margin-left: auto; }
.loan-summary-balance-amount { font-size: 16px; font-weight: 800; }
.loan-summary-help { margin: 0; border-top: 1px solid var(--line); }
.loan-record-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.loan-record-tabs[hidden] { display: none; }
.loan-record-tab {
  min-width: 150px;
  padding: 12px 18px 11px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  background: color-mix(in srgb, var(--canvas) 70%, var(--surface));
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.loan-record-tab.active {
  position: relative;
  bottom: -1px;
  color: var(--accent);
  background: var(--surface);
}
.loan-record-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.account-summary { min-width: 0; display: grid; gap: 2px; text-align: left; cursor: help; }
.account-summary-primary,
.account-summary-secondary { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary-secondary { color: var(--muted); font-size: 11px; }
.document-search-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 14px; padding: 16px; }
.record-search-fields .form-field, .document-search-grid .form-field { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.record-search-fields .form-field-multi-select { position: relative; z-index: 3; overflow: visible; }
.record-search-fields .form-field { grid-template-columns: 165px minmax(0, 1fr); }
.record-search-fields .form-field-caption { white-space: nowrap; }
.document-search-actions { display: flex; justify-content: flex-end; gap: 8px; grid-column: 1 / -1; }
.direction { display: inline-block; min-width: 38px; padding: 3px 7px; border-radius: 99px; text-align: center; font-size: 11px; font-weight: 800; }
.direction-in { color: #20684f; background: #e6f3ee; }
.direction-out { color: #9b4f29; background: #f8eadd; }
.empty-page { min-height: calc(100vh - 92px); place-content: center; justify-items: center; text-align: center; }
.empty-page h2 { margin: 8px 0; font-size: 28px; }
.empty-page > p:not(.eyebrow) { max-width: 520px; margin: 0 0 22px; color: var(--muted); line-height: 1.7; }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 18px; color: var(--accent); background: var(--accent-soft); font-size: 25px; }
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--modal-overlay); }
.source-detail-modal { width: min(820px, 100%); max-height: min(760px, calc(100vh - 48px)); overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--modal-shadow); }
.document-preview-modal { width: min(1040px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--modal-shadow); }
.document-preview-file-name { max-width: min(620px, 60vw); margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.document-preview-stage { min-height: 240px; display: grid; flex: 1; place-items: center; overflow: auto; padding: 20px; border-top: 1px solid var(--line); background: var(--canvas); }
.document-preview-stage img { display: block; max-width: 100%; max-height: calc(100vh - 170px); width: auto; height: auto; object-fit: contain; border: 1px solid var(--line); background: #fff; }
.document-preview-stage iframe { display: block; width: 100%; height: calc(100vh - 170px); min-height: 520px; border: 1px solid var(--line); background: #fff; }
.document-preview-stage [hidden] { display: none; }
.source-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.source-detail-item { min-width: 0; display: grid; grid-template-columns: 132px minmax(0, 1fr); min-height: 44px; background: var(--surface); }
.source-detail-item-wide { grid-column: 1 / -1; }
.source-detail-item > span { display: flex; align-items: center; padding: 10px 12px; border-right: 1px solid var(--line); background: var(--canvas); font-size: 12px; font-weight: 800; }
.source-detail-item > strong { min-width: 0; padding: 10px 12px; overflow-wrap: anywhere; font-size: 13px; font-weight: 400; }

@media (min-width: 1025px) {
  .app-shell.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
  .app-shell.sidebar-collapsed .sidebar { width: 0; padding-right: 0; padding-left: 0; overflow: hidden; opacity: 0; transform: translateX(-100%); pointer-events: none; }
}

@media (max-width: 1050px) {
  .program-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .funding-source-layout { grid-template-columns: 1fr; }
  .funding-source-chart-wrap { border-right: 0; border-bottom: 1px solid var(--line); }
  .form-grid-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-search-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .permission-groups { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .app-shell { min-width: 0; display: block; }
  .sidebar { position: fixed; z-index: 20; width: 248px; transform: translateX(-100%); transition: transform .2s ease; }
  .app-shell.menu-open .sidebar { transform: translateX(0); }
  .page-content { width: 100%; }
  .topbar { padding: 12px 18px; }
  .top-actions { gap: 10px; }
  .corporation-switcher select { width: min(260px, 32vw); }
  .app-theme-control { display: none; }
  .app-shell .funding-source-table-wrap {
    overflow-x: hidden;
  }
  .app-shell .funding-source-table-wrap table,
  .app-shell .funding-source-table-wrap .funding-loan-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
  .funding-currency-col { width: 46px; }
  .funding-count-col { width: 70px; }
  .funding-balance-col { width: 108px; }
  .funding-ratio-col { width: 48px; }
  .funding-capital-count-col,
  .funding-capital-ratio-col { width: 84px; }
  .app-shell .funding-source-table-wrap th,
  .app-shell .funding-source-table-wrap td {
    padding: 6px 4px;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 11px;
  }
  .app-shell .member-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
  .app-shell .member-table th,
  .app-shell .member-table td {
    padding: 7px 4px;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 10px;
  }
  .member-table th:nth-child(1) { width: 11%; }
  .member-table th:nth-child(2) { width: 16%; }
  .member-table th:nth-child(3) { width: 9%; }
  .member-table th:nth-child(4) { width: 13%; }
  .member-table th:nth-child(5) { width: 11%; }
  .member-table th:nth-child(6) { width: 9%; }
  .member-table th:nth-child(7) { width: 8%; }
  .member-table th:nth-child(8) { width: 9%; }
  .member-table th:nth-child(9) { width: 14%; }
  .member-table .row-actions { gap: 4px; flex-wrap: wrap; }
  .member-table .button-small { min-height: 28px; padding: 4px 6px; }
}

@media (max-width: 1024px) {
  .entry-screen { padding: 18px; }
  .entry-header { align-items: flex-start; }
  .entry-tools { justify-content: flex-end; flex-wrap: wrap; }
  .entry-user { width: 100%; text-align: right; }
  .workspace-picker { grid-template-columns: 1fr; align-items: stretch; }
  .program-grid { grid-template-columns: 1fr; }
  .trading-hero { min-height: 520px; padding: 36px 28px; }
  .trading-visual { right: -80px; opacity: .1; }
  .mobile-menu-button { display: grid; }
  .topbar { min-width: 0; align-items: flex-start; flex-wrap: wrap; }
  .topbar-left { flex: 1 1 100%; }
  .top-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .topbar h1 { font-size: 18px; }
  .corporation-switcher { width: auto; }
  .corporation-switcher select { width: min(260px, 42vw); }
  .page-content { padding: 22px 18px 36px; }
  .dashboard-search-grid { grid-template-columns: 1fr; }
  .dashboard-search-grid > span { display: none; }
  .filter-bar, .date-filter { align-items: stretch; }
  .filter-bar { display: grid; }
  .date-filter { margin-left: 0; flex-wrap: wrap; }
  .date-filter label { flex: 1 1 120px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .member-metrics { grid-template-columns: 1fr; }
  .page-intro { align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .record-search-fields { grid-template-columns: 1fr; }
  .record-search-fields .form-field-wide { grid-column: auto; }
  .pagination-bar { align-items: flex-start; flex-direction: column; }
  .business-kind-group, .document-search-grid { grid-template-columns: 1fr; }
  .business-kind-group .form-field { border-right: 0; border-bottom: 1px solid var(--line); }
  .business-kind-group .form-field:last-child { border-bottom: 0; }
  .permission-items { grid-template-columns: 1fr; }
  .form-field-wide { grid-column: auto; }
  .profile-fields { grid-template-columns: 1fr; padding: 15px; }
  .profile-fields .form-field-wide { grid-column: auto; }
  .profile-form-body { padding: 14px; }
  .global-message { margin-left: 18px; margin-right: 18px; }
  #global-message { width: calc(100vw - 36px); margin: 0; }
  .source-detail-grid { grid-template-columns: 1fr; }
  .source-detail-item-wide { grid-column: auto; }
  .form-field, .source-detail-item { grid-template-columns: minmax(104px, 36%) minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .app-shell .table-wrap:has(.records-card-table) { overflow: visible; border: 0; background: transparent; }
  .app-shell .records-card-table { width: 100% !important; min-width: 0 !important; display: block; border-collapse: separate; }
  .app-shell .records-card-table thead { display: none; }
  .app-shell .records-card-table tbody { display: grid; gap: 10px; padding: 10px; }
  .app-shell .records-card-table tbody tr[data-record-id] {
    min-width: 0;
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--ink) 5%, transparent);
  }
  .app-shell .records-card-table tbody tr[data-record-id] > td {
    display: none;
    min-width: 0;
    width: auto;
    max-width: none;
    min-height: 42px;
    padding: 9px 11px;
    border: 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
    background: var(--surface);
  }
  .app-shell .records-card-table tbody tr[data-record-id] > .mobile-record-summary {
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
  }
  .mobile-record-toggle {
    position: relative;
    width: 100%;
    min-width: 0;
    display: grid;
    gap: 4px;
    padding: 12px 38px 12px 13px;
    border: 0;
    color: var(--ink);
    background: transparent;
    text-align: left;
    cursor: pointer;
  }
  .mobile-record-summary-top,
  .mobile-record-summary-bottom { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .mobile-record-summary-top { color: var(--muted); font-size: 11px; }
  .mobile-record-toggle > strong { min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-record-summary-bottom { color: var(--muted); font-size: 11px; }
  .mobile-record-summary-bottom > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-record-summary-bottom b { flex: none; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
  .mobile-record-chevron { position: absolute; top: 50%; right: 14px; font-size: 19px; transform: translateY(-50%); transition: transform .18s ease; }
  .mobile-record-expanded .mobile-record-chevron { transform: translateY(-50%) rotate(180deg); }
  .app-shell .records-card-table tbody tr.mobile-record-expanded > td:not(.mobile-record-summary) {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }
  .app-shell .records-card-table tbody tr.mobile-record-expanded > td:not(.mobile-record-summary)::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    content: attr(data-label);
  }
  .app-shell .records-card-table tbody tr.mobile-record-expanded > td.record-actions-column {
    display: block;
    padding: 10px;
    border-bottom: 0;
  }
  .app-shell .records-card-table tbody tr.mobile-record-expanded > td.record-actions-column::before { display: none; }
  .app-shell .records-card-table .row-actions { justify-content: flex-end; flex-wrap: wrap; }
  .app-shell .records-card-table tbody tr:not([data-record-id]) { display: block; }
  .app-shell .records-card-table tbody tr:not([data-record-id]) > td {
    display: block;
    width: auto;
    min-height: 0;
    padding: 12px;
    border: 1px solid var(--line);
    white-space: normal;
    background: var(--surface);
  }
  .app-shell .records-card-table .record-total-row > td { border-radius: 8px; }
  .app-shell .records-card-table .record-total-row > td:not(.mobile-total-summary) { display: none; }
  .app-shell .records-card-table .record-total-row > .mobile-total-summary {
    display: block;
    height: auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
    border-radius: 10px;
    background: var(--surface);
  }
  .mobile-total-card { display: grid; gap: 10px; padding: 13px; }
  .mobile-total-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .mobile-total-head > strong { font-size: 14px; }
  .mobile-total-head > span { color: var(--muted); font-size: 11px; }
  .mobile-total-currencies { display: grid; gap: 5px; }
  .mobile-total-currencies > span {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 8px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--canvas) 58%, var(--surface));
  }
  .mobile-total-currencies small { color: var(--muted); font-weight: 800; }
  .mobile-total-currencies strong { font-size: 13px; font-variant-numeric: tabular-nums; }
  .mobile-total-converted {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .mobile-total-converted > span { color: var(--muted); font-size: 11px; font-weight: 800; }
  .mobile-total-converted > strong { font-size: 15px; font-variant-numeric: tabular-nums; }
  .mobile-total-card.positive .mobile-total-converted > strong { color: var(--success); }
  .mobile-total-card.negative .mobile-total-converted > strong { color: var(--danger); }
  .mobile-total-empty { color: var(--muted); font-size: 11px; }
}

@media (max-width: 1024px) {
  .app-shell .funding-source-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .app-shell .funding-source-table-wrap table {
    width: 100%;
    min-width: 0 !important;
    display: block;
  }
  .funding-source-table-wrap thead { display: none; }
  .funding-source-table-wrap tbody { display: grid; gap: 8px; }
  .funding-source-table-wrap tbody tr {
    min-width: 0;
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }
  .funding-capital-table tbody tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .funding-loan-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell .funding-source-table-wrap tbody td {
    min-width: 0;
    width: auto;
    height: auto;
    display: grid;
    gap: 4px;
    padding: 9px 10px;
    border: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: right;
    background: var(--surface);
  }
  .funding-source-table-wrap tbody td::before {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-align: left;
    content: attr(data-label);
  }
  .app-shell .funding-capital-table tbody td { text-align: center; }
  .funding-capital-table tbody td::before { text-align: center; }
  .app-shell .funding-loan-table tbody td:first-child {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: right;
    font-size: 13px;
    font-weight: 900;
    background: color-mix(in srgb, var(--canvas) 58%, var(--surface));
  }
  .app-shell .funding-source-table-wrap tbody td.empty-inline {
    grid-column: 1 / -1;
    display: block;
    text-align: center;
  }
  .funding-source-table-wrap tbody td.empty-inline::before { display: none; }
}

@media (max-width: 520px) {
  .auth-screen { padding: 14px; }
  .login-card { width: 100%; min-width: 0; padding: 26px 22px 28px; border-radius: 20px; }
  .auth-logo { width: min(260px, 84%); }
  .entry-header { display: grid; }
  .entry-tools { justify-content: flex-start; }
  .entry-user { display: none; }
  .entry-content { padding-top: 38px; }
  .program-card { min-height: 260px; padding: 23px; }
  .metric-grid { grid-template-columns: 1fr; }
  .corporation-switcher label { display: none; }
  .corporation-switcher { width: 100%; }
  .corporation-switcher select { width: 100%; }
  .date-filter > span { display: none; }
  .page-intro-actions { display: grid; }
  .page-intro-actions .button { width: 100%; }
  .panel-actions { align-items: flex-end; flex-direction: column; }
  .action-divider { display: none; }
  .updated-note { display: none; }
  .app-shell .role-permission-guide .table-wrap { overflow: visible; border: 0; background: transparent; }
  .app-shell .role-permission-guide table { min-width: 0 !important; display: block; }
  .role-permission-guide thead { display: none; }
  .role-permission-guide tbody { display: grid; gap: 8px; }
  .role-permission-guide tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }
  .app-shell .role-permission-guide tbody td {
    min-width: 0;
    width: auto;
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    text-align: right;
  }
  .role-permission-guide tbody td::before {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-align: left;
    content: attr(data-label);
  }
  .app-shell .role-permission-guide tbody td:first-child {
    grid-column: 1 / -1;
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 900;
    background: color-mix(in srgb, var(--canvas) 58%, var(--surface));
  }
  .role-permission-guide tbody td:first-child::before { display: none; }
  .app-shell .role-permission-guide tbody td:last-child {
    grid-column: 1 / -1;
    display: block;
    padding: 10px;
    text-align: left;
  }
  .role-permission-guide tbody td:last-child::before {
    display: block;
    margin-bottom: 4px;
  }
  .app-shell .table-wrap:has(.member-table) { overflow: visible; border: 0; background: transparent; }
  .app-shell .member-table { min-width: 0 !important; display: block; }
  .member-table thead { display: none; }
  .member-table tbody { display: grid; gap: 8px; padding: 8px; }
  .member-table tbody tr[data-member-id] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }
  .app-shell .member-table tbody tr[data-member-id] td {
    min-width: 0;
    width: auto;
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    text-align: right;
  }
  .member-table tbody tr[data-member-id] td::before {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-align: left;
    content: attr(data-label);
  }
  .app-shell .member-table tbody tr[data-member-id] td:first-child {
    grid-column: 1 / -1;
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 900;
    background: color-mix(in srgb, var(--canvas) 58%, var(--surface));
  }
  .member-table tbody tr[data-member-id] td:first-child::before { display: none; }
  .app-shell .member-table tbody tr[data-member-id] td:nth-child(2),
  .app-shell .member-table tbody tr[data-member-id] td:last-child { grid-column: 1 / -1; }
  .app-shell .member-table tbody tr[data-member-id] td:last-child { display: block; }
  .member-table tbody tr[data-member-id] td:last-child::before { display: none; }
  .member-table tbody tr:not([data-member-id]) { display: block; }
  .member-table tbody tr:not([data-member-id]) td { display: block; white-space: normal; }
}
