:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 100%;
  line-height: 1.55;
  color: #18223b;
  background: #f4f6fb;
  --ink: #18223b;
  --muted: #596783;
  --line: #dce3ef;
  --accent: #4036a9;
  --accent-dark: #332a89;
  --tint: #eeecff;
  --radius: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent-dark); }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #796ae6; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.18; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5vw, 3.4rem); letter-spacing: -.065em; }
h2 { font-size: 1.35rem; letter-spacing: -.035em; }
h3 { font-size: 1.14rem; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: 12px; left: 12px; z-index: 3; padding: 8px 12px; color: var(--accent); background: white; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { min-width: 0; min-height: 100vh; position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; padding: 32px 19px 22px; background: #1b2140; color: #f7f7ff; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 11px; color: inherit; font-size: 1.235rem; font-weight: 750; letter-spacing: -.035em; text-decoration: none; }
.sidebar .brand { margin: 0 0 45px 10px; }
.brand:hover { color: inherit; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 8px); gap: 3px; border-radius: 10px; padding: 8px; background: #9284ff; }
.brand-mark i { display: block; width: 8px; height: 8px; border-radius: 2px; background: #262054; }
.brand-mark i:nth-child(2) { opacity: .65; }
.brand-mark i:nth-child(4) { background: #fff; }
.nav { display: grid; gap: 5px; }
.nav a { min-width: 0; display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 9px 12px; border-radius: 8px; color: #c7cee8; text-decoration: none; font-size: .925rem; font-weight: 600; overflow-wrap: anywhere; }
.nav a[aria-current], .nav a:hover { background: #343a66; color: #fff; }
.nav-icon { display: inline-block; flex: 0 0 15px; position: relative; width: 15px; height: 15px; }
.icon-grid { background: linear-gradient(currentColor 0 0) left top / 6px 6px no-repeat, linear-gradient(currentColor 0 0) right top / 6px 6px no-repeat, linear-gradient(currentColor 0 0) left bottom / 6px 6px no-repeat, linear-gradient(currentColor 0 0) right bottom / 6px 6px no-repeat; }
.icon-settings { border: 2px solid currentColor; border-radius: 5px; }
.icon-settings::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: currentColor; }
.sidebar-foot { padding-top: 22px; margin-top: auto; }
.identity { display: flex; align-items: center; gap: 9px; padding: 14px 8px 11px; border-top: 1px solid #414767; }
.avatar { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; background: #393865; color: #ad9fff; border-radius: 50%; font-size: .8rem; }
.identity > div { min-width: 0; }
.identity strong, .identity small { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.identity strong { font-size: .875rem; }
.identity small { font-size: .8rem; color: #c4c9e2; }
.sign-out { background: transparent; color: #c7cee8; padding: 6px 8px; border: 0; font-size: .875rem; border-radius: 6px; }
.sign-out:hover { color: #fff; background: #343a66; }

.workspace { width: min(100%, 1400px); margin: 0 auto; padding: clamp(28px, 4.6vw, 76px) clamp(20px, 4.2vw, 72px) 65px; }
.page-head, .section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 17px; }
.page-head { margin-bottom: 32px; }
.page-head > div:first-child { min-width: 0; }
.eyebrow { margin-bottom: 9px; color: var(--accent); font-size: .875rem; font-weight: 700; }
.page-subtitle { color: var(--muted); max-width: 62ch; margin-top: 12px; line-height: 1.55; }
.page-actions, .row-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-actions { justify-content: flex-end; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .45rem; min-height: 42px; border: 1px solid transparent; padding: .57rem .94rem; border-radius: 8px; font-size: .91rem; font-weight: 650; line-height: 1.3; text-decoration: none; text-align: center; }
.button span[aria-hidden] { font-size: 1.16em; font-weight: 500; }
.button.primary { color: white; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button.secondary, .button.google { background: #fff; color: var(--ink); border-color: var(--line); }
.button.secondary:hover, .button.google:hover { color: var(--accent); border-color: #9489d2; }
.button.quiet { color: var(--accent); background: transparent; }
.button.quiet:hover { background: var(--tint); }
.button.small { min-height: 36px; padding: .39rem .65rem; font-size: .875rem; }
.button.destructive { background: #a3263c; color: #fff; }
.button.destructive:hover { background: #841a2d; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.subtle-link { font-size: .875rem; font-weight: 650; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 21px; }
.search-field { position: relative; flex: 0 1 382px; min-width: 160px; }
.search-field input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); padding: .51rem .8rem .51rem 2.6rem; }
.group-filter { display: flex; align-items: center; gap: .5rem; flex: 0 1 220px; min-width: 0; color: var(--muted); font-size: .875rem; font-weight: 650; }
.group-filter select { width: 100%; min-width: 0; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); padding: .51rem .55rem; font-weight: 400; }
.search-icon { position: absolute; top: 12px; left: 14px; width: 13px; height: 13px; border: 2px solid #63718d; border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 2px; bottom: -3px; right: -5px; background: #63718d; transform: rotate(47deg); }
.result-count { margin-bottom: 12px; font-size: .875rem; color: var(--muted); font-weight: 650; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(235px, 100%), 1fr)); gap: 16px; }
.project-card, .panel, .empty-state { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.project-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px; min-width: 0; }
.project-card:hover { border-color: #aaa2d5; }
.project-card-top { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; }
.project-icon { display: inline-grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 11px; background: var(--tint); color: var(--accent); }
.project-icon i { position: relative; display: block; width: 17px; height: 12px; border: 1.7px solid currentColor; border-radius: 2px; }
.project-icon i::before { content: ""; position: absolute; bottom: 100%; left: -1.7px; width: 8px; height: 4.5px; border: 1.7px solid currentColor; border-bottom: 0; border-radius: 2px 2px 0 0; }
.project-card h2 { margin-top: 5px; overflow-wrap: anywhere; }
.project-card h2 a { color: var(--ink); text-decoration: none; }
.project-card h2 a:hover { color: var(--accent); text-decoration: underline; }
.project-card p { color: var(--muted); overflow-wrap: anywhere; }
.tag-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0; margin: 0; list-style: none; }
.tag { display: inline-flex; align-items: center; max-width: 100%; overflow-wrap: anywhere; border-radius: 6px; padding: .19rem .51rem; background: #eff2f8; color: #3e4b68; font-size: .875rem; line-height: 1.3; font-weight: 650; }
.group-tag { color: #3d338d; background: var(--tint); }
.environment-tag { font-family: ui-monospace, Consolas, monospace; }
.env-dev { background: #e4f1ff; color: #224f86; }
.env-demo { background: #fff0d8; color: #785010; }
.env-prod { background: #ddf4e8; color: #215e42; }
.admin-tag { background: #e5f4ef; color: #215e49; }
.no-groups { font-size: .875rem; color: var(--muted); }
.card-meta { display: flex; gap: 14px; width: 100%; margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.empty-state { text-align: center; padding: clamp(26px, 6vw, 62px) 20px; display: grid; justify-items: center; gap: 10px; }
.empty-state p { color: var(--muted); }
.empty-state .button { margin-top: 5px; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 14px; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.project-head { padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.project-head h1 { overflow-wrap: anywhere; }
.project-head .tag-list { margin-top: 14px; }
.project-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.section-head { margin-bottom: 15px; align-items: center; }
.count-pill { display: inline-block; margin-left: .25rem; padding: .12rem .48rem; vertical-align: .1em; border-radius: 10px; background: #e8ebf5; color: #4a5576; font-size: .875rem; letter-spacing: normal; }
.service-list, .form-stack { display: grid; gap: 15px; }
.panel { min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 15px 18px; }
.service-title { display: flex; align-items: center; min-width: 0; gap: 11px; overflow-wrap: anywhere; }
.service-icon i { width: 13px; height: 13px; border-radius: 3px; transform: rotate(45deg); }
.service-icon i::before { display: none; }
.service-kind { display: block; color: var(--muted); font-size: .875rem; margin-top: 2px; }
.endpoint-list > summary { padding: 8px 18px; border-top: 1px solid var(--line); color: var(--accent); font-size: .875rem; font-weight: 650; }
.endpoint-list > summary:hover { color: var(--accent-dark); background: #f6f7fb; }
.endpoint-table { width: 100%; border-collapse: collapse; text-align: left; table-layout: fixed; }
.endpoint-table th, .endpoint-table td { padding: 9px 15px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.endpoint-table th { background: #f6f7fb; font-size: .875rem; color: var(--muted); font-weight: 650; }
.endpoint-table th:first-child { width: 19%; }
.endpoint-table th:last-child { width: min(24%, 160px); }
.endpoint-url { font-family: ui-monospace, Consolas, monospace; font-size: .875rem; }
.panel-empty { padding: 14px 18px; color: var(--muted); border-top: 1px solid var(--line); }
.admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.admin-list { margin: 0; padding: 0; list-style: none; }
.admin-list > li { border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 18px; }
.admin-list > li > div { min-width: 0; overflow-wrap: anywhere; }
.admin-list strong, .admin-list > li > div > span { display: block; }
.admin-list > li > div > span { color: var(--muted); font-size: .875rem; }
.admin-list > li > div > .page-actions { display: flex; }
.users-panel { margin-top: 15px; }
.project-admin-panel { margin-bottom: 15px; }
.project-admin-panel strong a { color: var(--ink); }

.form-stack { max-width: 780px; }
.record-form { display: grid; gap: 19px; padding: clamp(17px, 4vw, 28px); }
.field { display: grid; gap: 6px; font-size: .94rem; font-weight: 650; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #bac5d9; border-radius: 7px; background-color: #fff; color: var(--ink); font-weight: 400; padding: .58rem .72rem; }
.field textarea { resize: vertical; }
.field select { appearance: none; padding-right: 37px; background-image: linear-gradient(45deg, transparent 50%, #596783 50%), linear-gradient(135deg, #596783 50%, transparent 50%); background-position: right 17px center, right 12px center; background-size: 5px 5px; background-repeat: no-repeat; }
.checks { min-width: 0; margin: 0; padding: 9px 13px 12px; border: 1px solid var(--line); border-radius: 8px; }
.checks legend { padding: 0 4px; font-size: .94rem; font-weight: 650; }
.field-hint { color: var(--muted); font-size: .875rem; }
.check { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: .94rem; overflow-wrap: anywhere; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-actions { margin-top: 4px; }
.delete-panel { border-color: #f0c5cd; }
.delete-panel summary { padding: 12px 17px; color: #a3263c; font-weight: 650; }
.delete-panel form { display: grid; justify-items: start; gap: 11px; padding: 0 17px 15px; }
.feedback { margin-bottom: 19px; padding: 11px 14px; border: 1px solid transparent; border-radius: 8px; overflow-wrap: anywhere; }
.feedback.danger { background: #fff0f2; border-color: #f0c5cd; color: #842133; }
.feedback.success { background: #e6f6ed; border-color: #bedecb; color: #1f613c; }
.toast { position: fixed; z-index: 2; right: 20px; bottom: 20px; padding: 11px 15px; border-radius: 8px; background: #1b2140; color: #fff; box-shadow: 0 5px 18px #1923422b; }
.error-page { display: grid; justify-items: start; gap: 15px; }
.import-help { padding: 16px 20px; }
.import-help ol { margin: 9px 0 12px; padding-left: 1.35rem; color: var(--muted); }
.import-help li + li { margin-top: 5px; }

.guest { display: grid; place-items: center; min-height: 100vh; padding: 26px; }
.login-shell { width: min(100%, 900px); min-height: 490px; display: grid; grid-template-columns: 1.08fr 1fr; border: 1px solid var(--line); border-radius: 23px; overflow: hidden; background: white; box-shadow: 0 15px 50px #1c284715; }
.login-content { display: flex; flex-direction: column; padding: clamp(25px, 5vw, 57px); }
.login-brand { color: #1b2140; }
.login-form { display: grid; justify-items: start; gap: 18px; margin: auto 0; padding-top: 28px; }
.login-form h1 { font-size: clamp(2.45rem, 5vw, 3.55rem); }
.login-form p { max-width: 30ch; color: var(--muted); }
.login-form .feedback { margin-bottom: 0; max-width: 100%; }
.button.google { gap: .66rem; }
.google-mark { display: inline-grid; place-items: center; width: 19px; height: 19px; background: conic-gradient(#4285f4 0 26%, #34a853 26% 51%, #fbbc05 51% 63%, #ea4335 63% 83%, #4285f4 83%); color: transparent; background-clip: text; font-size: 1.23rem !important; font-weight: 900 !important; line-height: 1; }
.login-art { display: grid; place-items: center; padding: 20px; background-color: #252650; background-image: radial-gradient(#7474b26e 1px, transparent 1.5px), radial-gradient(ellipse at 60% 98%, #514b99, transparent 78%); background-size: 21px 21px, auto; color: #fff; }
.diagram { width: min(100%, 322px); padding: 19px 13px; }
.diagram-project, .diagram-service { border: 1px solid #7573a7; border-radius: 11px; background: #363763; box-shadow: 0 8px 16px #17173565; }
.diagram-project { max-width: 165px; margin: 0 auto; display: flex; justify-content: center; gap: 9px; align-items: center; padding: 12px; font-size: 1rem; font-weight: 650; }
.diagram-square { width: 11px; height: 11px; border-radius: 3px; background: #b39dff; }
.diagram-line { width: 1px; height: 25px; background: #ada7db; margin: 0 auto; }
.diagram-services { display: grid; position: relative; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 15px; }
.diagram-services::before { content: ""; position: absolute; top: 0; left: 23.5%; right: 23.5%; height: 15px; border: 1px solid #ada7db; border-bottom: 0; border-radius: 6px 6px 0 0; }
.diagram-service { font-size: .875rem; padding: 10px; font-weight: 650; }
.diagram-service span { display: inline-block; margin: 6px 3px 0 0; padding: 1px 5px; border-radius: 4px; background: #504d83; color: #f2eeff; font-size: .8rem; font-family: ui-monospace, Consolas, monospace; }

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 180px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .workspace { padding-inline: 24px; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .app-shell { display: block; }
  .sidebar { min-height: 0; position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 8px; padding: 12px 15px; }
  .sidebar .brand { margin: 0; }
  .nav { display: flex; flex-wrap: wrap; grid-row: 2; grid-column: 1/-1; }
  .nav a { min-height: 37px; padding: 5px 8px; }
  .sidebar-foot { padding: 0; margin: 0; align-self: center; }
  .sidebar-foot .identity { display: none; }
  .workspace { padding: 25px 15px 40px; }
  .page-head { margin-bottom: 23px; }
  .search-field { flex: 1 1 180px; }
  .endpoint-table th, .endpoint-table td { padding: 7px; }
  .endpoint-table th:first-child { width: 24%; }
  .endpoint-table th:last-child { width: 67px; }
  .endpoint-table .button { padding-inline: .32rem; }
  .guest { padding: 14px; }
  .login-shell { min-height: 385px; grid-template-columns: 1fr; }
  .login-content { min-height: 365px; }
  .login-art { display: none; }
}
