:root {
  color-scheme: dark;
  --d2-bg: #151110;
  --d2-surface: #1c1712;
  --d2-surface-raised: #1e1813;
  --d2-surface-strong: #241d17;
  --d2-text: #ede3d3;
  --d2-muted: #ab9e8f;
  --d2-line: rgba(234, 224, 208, 0.14);
  --d2-line-strong: rgba(234, 224, 208, 0.24);
  --d2-accent: #e98b3d;
  --d2-accent-ink: #241505;
  --d2-accent-soft: rgba(233, 139, 61, 0.14);
  --d2-ok: #8fcb8e;
  --d2-warn: #d9a441;
  --d2-danger: #e07a6a;
  --d2-font: 'Pretendard Variable', 'Pretendard', 'Noto Sans KR', system-ui, sans-serif;
  --d2-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 40px;
  --s8: 48px;
  --r-control: 10px;
  --r-card: 14px;
  --r-pill: 999px;
  --d2-type-title: 28px;
  --d2-leading-title: 34px;
  --d2-type-section: 18px;
  --d2-leading-section: 26px;
  --d2-type-body: 15px;
  --d2-leading-body: 24px;
  --d2-type-meta: 13px;
  --d2-leading-meta: 20px;
  --d2-type-small: 12px;
  --d2-type-stat: 30px;
  --d2-leading-stat: 36px;
  --d2-page: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--d2-bg);
  scroll-behavior: smooth;
  scrollbar-color: var(--d2-surface-strong) var(--d2-bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--d2-bg);
  color: var(--d2-text);
  font: 400 var(--d2-type-body)/var(--d2-leading-body) var(--d2-font);
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
  word-break: keep-all;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  caret-color: var(--d2-accent);
}

a {
  color: var(--d2-text);
  text-decoration-color: rgba(237, 227, 211, 0.4);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--d2-accent);
  text-decoration-color: currentColor;
}

img,
svg {
  display: block;
}

::selection {
  background: var(--d2-accent);
  color: var(--d2-accent-ink);
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--d2-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--d2-surface-strong);
  border: 3px solid var(--d2-bg);
  border-radius: var(--r-pill);
}

:focus-visible {
  outline: 2px solid var(--d2-accent);
  outline-offset: 3px;
}

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

.d2-shell {
  min-height: 100vh;
}

.d2-rail {
  display: none;
}

.d2-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.d2-brand img {
  width: auto;
  height: 28px;
}

/* 화면 시험이 로고를 찾는 이름(옛 화면의 img.logo 와 같다) */
.d2-brand img.logo {
  display: block;
}

.d2-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s3);
  min-height: 68px;
  padding: var(--s3) max(var(--s4), env(safe-area-inset-right)) var(--s3) max(var(--s4), env(safe-area-inset-left));
  background: rgba(21, 17, 16, 0.98);
  border-bottom: 1px solid var(--d2-line);
}

.d2-topbar-title {
  min-width: 0;
  color: var(--d2-muted);
  font-size: var(--d2-type-meta);
  line-height: var(--d2-leading-meta);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.d2-menu {
  position: static;
}

.d2-menu summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-width: 72px;
  min-height: 44px;
  padding: 0 var(--s3);
  color: var(--d2-text);
  background: var(--d2-surface);
  border: 1px solid var(--d2-line-strong);
  border-radius: var(--r-control);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  list-style: none;
}

.d2-menu summary::-webkit-details-marker {
  display: none;
}

/* 닫힌 펼침 메뉴의 내용은 배치에서 뺀다(글꼴이 바뀌어 넓어져도 화면 밖으로 넘치지 않게). */
.d2-menu:not([open]) > .d2-menu-panel {
  display: none;
}

.d2-menu-panel {
  position: absolute;
  top: 68px;
  left: 0;
  right: 0;
  padding: var(--s3) max(var(--s4), env(safe-area-inset-right)) var(--s5) max(var(--s4), env(safe-area-inset-left));
  background: var(--d2-surface-raised);
  border-bottom: 1px solid var(--d2-line-strong);
}

.d2-nav {
  display: grid;
  gap: var(--s1);
}

.d2-nav a,
.d2-logout {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 44px;
  padding: 0 var(--s3) 0 var(--s6);
  color: var(--d2-muted);
  border-radius: var(--r-control);
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
}

.d2-nav a:hover,
.d2-logout:hover {
  color: var(--d2-text);
  background: var(--d2-surface-strong);
}

.d2-nav a[aria-current='page'] {
  color: var(--d2-text);
  background: var(--d2-surface-strong);
}

.d2-nav a[aria-current='page']::before {
  content: '';
  position: absolute;
  left: 13px;
  width: 7px;
  height: 7px;
  background: var(--d2-accent);
  border-radius: 50%;
}

.d2-nav-icon,
.d2-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.d2-main {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: calc(var(--d2-page) + var(--s6) * 2);
  margin: 0 auto;
  padding: var(--s6) var(--s4) var(--s8);
}

.d2-main::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: -120px;
  left: 0;
  width: min(520px, 100%);
  height: 320px;
  background: radial-gradient(ellipse at center, rgba(233, 139, 61, 0.06) 0%, rgba(233, 139, 61, 0.025) 42%, rgba(233, 139, 61, 0) 74%);
  pointer-events: none;
}

.d2-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s5);
  margin-bottom: var(--s7);
}

.d2-head-copy {
  max-width: 68ch;
}

.d2-head h1,
.d2-public h1 {
  margin: 0;
  font-size: var(--d2-type-title);
  line-height: var(--d2-leading-title);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.d2-head p {
  margin: var(--s2) 0 0;
  color: var(--d2-muted);
  font-size: var(--d2-type-body);
  line-height: var(--d2-leading-body);
}

.d2-head-actions,
.d2-actions,
.d2-toolbar,
.d2-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
}

.d2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 0 var(--s4);
  color: var(--d2-accent-ink);
  background: var(--d2-accent);
  border: 1px solid var(--d2-accent);
  border-radius: var(--r-control);
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.d2-btn:hover {
  color: #1b0f03;
  background: #f09b54;
  border-color: #f09b54;
}

.d2-btn-secondary {
  color: var(--d2-text);
  background: var(--d2-surface-raised);
  border-color: var(--d2-line-strong);
}

.d2-btn-secondary:hover {
  color: var(--d2-text);
  background: var(--d2-surface-strong);
  border-color: rgba(234, 224, 208, 0.34);
}

.d2-btn-quiet {
  color: var(--d2-muted);
  background: transparent;
  border-color: transparent;
}

.d2-btn-quiet:hover {
  color: var(--d2-text);
  background: var(--d2-surface-strong);
  border-color: transparent;
}

.d2-btn--danger {
  color: var(--d2-danger);
  background: transparent;
  border-color: var(--d2-danger);
}

.d2-btn--danger:hover {
  color: #f19b8e;
  background: rgba(224, 122, 106, 0.08);
  border-color: #f19b8e;
}

.d2-btn-small {
  min-height: 36px;
  padding: 0 var(--s3);
  font-size: 13px;
}

.d2-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 var(--s7);
  border-top: 1px solid var(--d2-line);
  border-bottom: 1px solid var(--d2-line);
}

.d2-stat {
  min-width: 0;
  padding: var(--s5) var(--s3);
}

.d2-stat:nth-child(odd) {
  border-right: 1px solid var(--d2-line);
}

.d2-stat:nth-child(-n + 2) {
  border-bottom: 1px solid var(--d2-line);
}

.d2-stat dt {
  margin: 0 0 var(--s2);
  color: var(--d2-muted);
  font-size: var(--d2-type-meta);
  line-height: var(--d2-leading-meta);
}

.d2-stat dd {
  margin: 0;
  font-size: var(--d2-type-stat);
  line-height: var(--d2-leading-stat);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.d2-stat small {
  display: block;
  margin-top: var(--s1);
  color: var(--d2-muted);
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
}

.d2-stat .d2-stat-result {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.d2-stat-result .d2-badge {
  min-height: 20px;
  padding: 0 7px;
}

.d2-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s5);
  margin-bottom: var(--s7);
}

.d2-cell {
  min-width: 0;
}

.d2-section-link {
  display: flex;
  justify-content: flex-end;
  margin: calc(-1 * var(--s7)) 0 var(--s3);
}

.d2-section-link a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--d2-muted);
  font-size: 13px;
}

.d2-overview-stack {
  display: grid;
  gap: var(--s7);
}

.d2-ask {
  display: grid;
  gap: var(--s3);
  align-items: end;
}

.d2-ask-copy h2 {
  margin-bottom: var(--s1);
}

.d2-ask-copy .d2-help {
  display: block;
}

.d2-spaced {
  margin-top: var(--s5);
}

.d2-section {
  min-width: 0;
  padding: var(--s5);
  background: var(--d2-surface);
  border: 1px solid var(--d2-line);
  border-radius: var(--r-card);
}

.d2-section-plain {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.d2-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s5);
}

.d2-section h2 {
  margin: 0;
  font-size: var(--d2-type-section);
  line-height: var(--d2-leading-section);
  font-weight: 650;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.d2-section-head a {
  flex: 0 0 auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--d2-muted);
  font-size: 13px;
}

.d2-section > p:first-child,
.d2-section-head + p {
  margin-top: 0;
}

.d2-muted,
.d2-help {
  color: var(--d2-muted);
  font-size: 13px;
  line-height: 20px;
}

.d2-input,
.d2-select {
  width: 100%;
  min-height: 44px;
  padding: 9px var(--s3);
  color: var(--d2-text);
  background: var(--d2-bg);
  border: 1px solid var(--d2-line-strong);
  border-radius: var(--r-control);
}

.d2-input::placeholder {
  color: #a99d8f;
  opacity: 1;
}

.d2-input:focus,
.d2-select:focus {
  border-color: var(--d2-accent);
  outline: 2px solid rgba(233, 139, 61, 0.25);
  outline-offset: 0;
}

.d2-field {
  display: grid;
  gap: var(--s2);
}

.d2-field + .d2-field {
  margin-top: var(--s4);
}

.d2-field label,
.d2-label {
  font-size: 13px;
  line-height: 20px;
  font-weight: 650;
}

.d2-question-form,
.d2-issue-form,
.d2-auth-form {
  display: grid;
  gap: var(--s3);
}

.d2-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  min-width: 0;
  background: var(--d2-bg);
  border: 0;
  border-radius: var(--r-control);
}

.d2-copy code {
  min-width: 0;
  padding: 10px var(--s3);
  color: var(--d2-text);
  font: 500 13px/22px var(--d2-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.d2-copy .d2-btn {
  align-self: stretch;
  border-width: 0 0 0 1px;
  border-color: var(--d2-line-strong);
  border-radius: 0 var(--r-control) var(--r-control) 0;
}

.d2-note {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  margin-bottom: var(--s5);
  padding: var(--s4);
  color: var(--d2-text);
  background: rgba(217, 164, 65, 0.09);
  border: 1px solid rgba(217, 164, 65, 0.38);
  border-radius: var(--r-card);
}

.d2-note p {
  margin: 0;
}

.d2-note .d2-icon {
  color: var(--d2-warn);
  margin-top: 2px;
}

.d2-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: d2-step;
}

.d2-step {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: var(--s4);
  padding: 0 0 var(--s5);
  counter-increment: d2-step;
}

.d2-step:last-child {
  padding-bottom: 0;
}

.d2-step::before {
  content: counter(d2-step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--d2-accent-ink);
  background: var(--d2-accent);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 750;
}

.d2-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 36px;
  bottom: 4px;
  left: 15px;
  width: 1px;
  background: var(--d2-line-strong);
}

.d2-step h3 {
  margin: 2px 0 var(--s1);
  font-size: 15px;
  line-height: 24px;
  font-weight: 650;
}

.d2-step p {
  margin: 0;
  color: var(--d2-muted);
  font-size: 13px;
  line-height: 20px;
}

.d2-step .d2-copy {
  margin-top: var(--s3);
}

.d2-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-bottom: var(--s5);
  box-shadow: inset 0 -1px 0 var(--d2-line);
}

.d2-tabs label,
.d2-tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--s2);
  color: var(--d2-muted);
  box-shadow: inset 0 -2px 0 transparent;
  cursor: pointer;
  font-size: 13px;
  line-height: 18px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

.d2-tab-panels > section {
  display: none;
}

#d2-web:checked ~ .d2-tabs label[for='d2-web'],
#d2-desktop:checked ~ .d2-tabs label[for='d2-desktop'],
#d2-terminal:checked ~ .d2-tabs label[for='d2-terminal'] {
  color: var(--d2-text);
  box-shadow: inset 0 -2px 0 var(--d2-accent);
}

#d2-web:checked ~ .d2-tab-panels #d2-web-panel,
#d2-desktop:checked ~ .d2-tab-panels #d2-desktop-panel,
#d2-terminal:checked ~ .d2-tab-panels #d2-terminal-panel {
  display: block;
}

.d2-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.d2-table th,
.d2-table td {
  height: 52px;
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--d2-line);
  text-align: left;
  vertical-align: middle;
}

.d2-table th {
  color: var(--d2-muted);
  font-size: 13px;
  line-height: 20px;
  font-weight: 550;
}

.d2-table td {
  font-size: 14px;
  line-height: 20px;
}

.d2-table th:first-child,
.d2-table td:first-child {
  padding-left: 0;
}

.d2-table th:last-child,
.d2-table td:last-child {
  padding-right: 0;
}

.d2-table tbody tr:last-child td {
  border-bottom: 0;
}

.d2-table .d2-num {
  text-align: right;
}

.d2-num {
  font-variant-numeric: tabular-nums;
}

.d2-table code {
  font: 500 12px/20px var(--d2-mono);
  overflow-wrap: anywhere;
  word-break: break-all;
}

.d2-table a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

.d2-table-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s2);
}

.d2-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  color: var(--d2-text);
  background: var(--d2-surface-strong);
  border-radius: var(--r-pill);
  font-size: 12px;
  line-height: 20px;
  font-weight: 650;
  white-space: nowrap;
}

.d2-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

.d2-badge-ok {
  color: var(--d2-ok);
}

.d2-badge-warn {
  color: var(--d2-warn);
}

.d2-badge-muted {
  color: #c3b7a8;
}

.d2-badge-default {
  color: var(--d2-text);
}

.d2-badge-check::before {
  display: none;
}

.d2-badge-check .d2-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.d2-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: var(--s6) var(--s4);
  text-align: center;
}

.d2-empty h3 {
  margin: 0;
  font-size: 18px;
  line-height: 26px;
  font-weight: 650;
}

.d2-empty p {
  max-width: 48ch;
  margin: var(--s2) 0 0;
  color: var(--d2-muted);
}

.d2-empty-action {
  margin-top: var(--s4);
}

.d2-bars {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: 180px auto;
  column-gap: var(--s2);
  row-gap: var(--s3);
  min-width: 0;
}

.d2-bars-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  color: var(--d2-muted);
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}

.d2-bars-plot {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  align-items: end;
  gap: var(--s1);
  min-width: 0;
  height: 180px;
  padding-top: 1px;
  border-bottom: 1px solid var(--d2-line-strong);
}

.d2-bar {
  width: 100%;
  min-height: 3px;
  height: var(--d2-value);
  background: rgba(233, 139, 61, 0.34);
  border-radius: 4px 4px 0 0;
}

.d2-bar-today {
  background: var(--d2-accent);
}

.d2-bars-labels {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: var(--s1);
  color: var(--d2-muted);
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.d2-bars-labels span {
  min-width: 0;
  white-space: nowrap;
}

.d2-bars-total {
  margin: var(--s4) 0 0;
  color: var(--d2-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.d2-details {
  margin: 0;
}

.d2-details > div {
  display: grid;
  grid-template-columns: minmax(100px, 0.4fr) minmax(0, 1fr);
  gap: var(--s4);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--d2-line);
}

.d2-details > div:last-child {
  border-bottom: 0;
}

.d2-details dt {
  color: var(--d2-muted);
  font-size: 13px;
}

.d2-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.d2-periods {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-bottom: var(--s5);
  padding: var(--s1);
  background: var(--d2-surface-raised);
  border: 1px solid var(--d2-line);
  border-radius: var(--r-control);
}

.d2-periods .d2-btn {
  min-width: 52px;
}

.d2-periods [aria-current='page'] {
  color: var(--d2-text);
  background: var(--d2-surface-strong);
}

.d2-pagination {
  justify-content: flex-end;
  margin-top: var(--s5);
}

.d2-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  margin-bottom: 0;
  color: var(--d2-muted);
  font-size: 13px;
  line-height: 20px;
}

.d2-breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--d2-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.d2-breadcrumbs a:hover {
  color: var(--d2-text);
}

.d2-meter {
  min-width: 0;
  padding: var(--s4);
  background: var(--d2-surface);
  border: 1px solid var(--d2-line);
  border-radius: var(--r-card);
}

.d2-meter-head {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  color: var(--d2-muted);
  font-size: 13px;
}

.d2-meter-value,
.d2-meter-note {
  margin: var(--s2) 0 0;
}

.d2-meter-note {
  color: var(--d2-muted);
  font-size: 13px;
}

.d2-meter-track {
  height: 8px;
  margin-top: var(--s3);
  overflow: hidden;
  background: var(--d2-surface-strong);
  border-radius: var(--r-pill);
}

.d2-meter-fill {
  display: block;
  height: 100%;
  background: var(--d2-accent);
  border-radius: inherit;
}

.d2-quota-card .d2-section-head {
  align-items: center;
}

.d2-quota-card {
  margin-bottom: var(--s5);
}

.d2-quota-axes {
  margin-bottom: var(--s6);
}

.d2-quota-card .d2-meter {
  height: 100%;
  background: var(--d2-surface-raised);
}

.d2-quota-tiers-title {
  margin: 0 0 var(--s3);
  font-size: 15px;
  line-height: 24px;
  font-weight: 650;
}

.d2-quota-tiers th[scope='row'] {
  font-size: 14px;
  font-weight: 650;
}

.d2-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--d2-muted);
}

.d2-dot-ok { background: var(--d2-ok); }
.d2-dot-warn { background: var(--d2-warn); }
.d2-dot-muted { background: var(--d2-muted); }

.d2-list {
  margin: 0;
  padding-left: var(--s5);
}

.d2-form {
  display: grid;
  gap: var(--s3);
}

.d2-form label {
  display: grid;
  gap: var(--s2);
  font-size: 13px;
  font-weight: 650;
}

.d2-menu-extra,
.d2-rail-footer {
  display: grid;
  gap: var(--s1);
}

.d2-menu-extra a,
.d2-rail-footer a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s3);
  color: var(--d2-muted);
  border-radius: var(--r-control);
  text-decoration: none;
  font-size: 14px;
}

.d2-menu-extra a:hover,
.d2-rail-footer a:hover {
  color: var(--d2-text);
  background: var(--d2-surface-strong);
}

.d2-auth,
.d2-public {
  min-height: 100vh;
  min-height: 100svh;
  padding: max(var(--s5), env(safe-area-inset-top)) max(var(--s4), env(safe-area-inset-right)) max(var(--s5), env(safe-area-inset-bottom)) max(var(--s4), env(safe-area-inset-left));
}

.d2-public {
  width: min(100%, 1200px);
  margin: 0 auto;
}

.d2-public-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: 68px;
  margin-bottom: var(--s7);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--d2-line);
}

.d2-public-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--s1);
}

.d2-public-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s3);
  text-decoration: none;
}

.d2-public-nav a[href='/signup'] {
  padding: 0 var(--s4);
  color: var(--d2-accent-ink);
  background: var(--d2-accent);
  border-radius: var(--r-control);
  font-weight: 700;
}

.d2-public-nav a[href='/signup']:hover {
  background: var(--d2-accent-strong, #f09a4d);
}

.d2-public-body {
  width: min(100%, var(--d2-page));
  margin: 0 auto;
}

.d2-public-body > .d2-head {
  margin-bottom: var(--s6);
}

.d2-public-body > .d2-section + .d2-section {
  margin-top: var(--s5);
}

.d2-public-footer,
.d2-legacy-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s8);
  padding-top: var(--s5);
  color: var(--d2-muted);
  border-top: 1px solid var(--d2-line);
  font-size: 13px;
}

.d2-public-footer a,
.d2-legacy-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* U3: 시작하기의 「관련 화면」 링크 셋은 누름 영역 44px 를 지킨다. */
.d2-legacy [data-related-screens] a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Existing server bodies keep their markup and behavior inside this scope. */
.d2-legacy {
  min-width: 0;
  color: var(--d2-text);
}

.d2-legacy > :first-child { margin-top: 0; }
.d2-legacy > :last-child { margin-bottom: 0; }

.d2-legacy h1 {
  margin: 0 0 var(--s6);
  font-size: var(--d2-type-title);
  line-height: var(--d2-leading-title);
  letter-spacing: -0.02em;
}

.d2-public .d2-legacy h1 {
  margin-bottom: var(--s4);
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.d2-legacy h2 {
  margin: var(--s7) 0 var(--s4);
  font-size: var(--d2-type-section);
  line-height: var(--d2-leading-section);
}

.d2-legacy h3 {
  margin: var(--s5) 0 var(--s3);
  font-size: 16px;
  line-height: 24px;
}

.d2-legacy p,
.d2-legacy ul,
.d2-legacy ol,
.d2-legacy dl {
  margin-top: 0;
  margin-bottom: var(--s4);
}

.d2-legacy .muted,
.d2-legacy .lede,
.d2-legacy .eyebrow,
.d2-legacy small {
  color: var(--d2-muted);
  font-size: 13px;
  line-height: 20px;
  letter-spacing: 0;
  text-transform: none;
}

.d2-legacy .eyebrow {
  margin-bottom: var(--s2);
  font-weight: 400;
}

.d2-legacy .card,
.d2-legacy .path,
.d2-legacy .stat {
  min-width: 0;
  margin: 0 0 var(--s5);
  padding: var(--s5);
  background: var(--d2-surface);
  border: 1px solid var(--d2-line);
  border-radius: 0;
}

.d2-legacy .card h2:first-child,
.d2-legacy .card h3:first-child,
.d2-legacy .path h2:first-child,
.d2-legacy .path h3:first-child {
  margin-top: 0;
}

.d2-legacy .note {
  margin: var(--s4) 0;
  padding: var(--s4);
  color: var(--d2-text);
  background: rgba(217, 164, 65, 0.09);
  border: 1px solid rgba(217, 164, 65, 0.38);
  border-radius: var(--r-control);
}

.d2-legacy .badge,
.d2-legacy .chips span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 9px;
  color: var(--d2-text);
  background: var(--d2-surface-strong);
  border-radius: var(--r-pill);
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

.d2-legacy .grid,
.d2-legacy .paths,
.d2-legacy .steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4);
  min-width: 0;
}

.d2-legacy .step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: var(--s3);
  align-items: start;
  min-width: 0;
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--d2-line);
}

.d2-legacy .step > .step-n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  color: var(--d2-accent-ink);
  background: var(--d2-accent);
  border-radius: var(--r-pill);
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.d2-legacy .note {
  max-width: 76ch;
}

.d2-legacy p,
.d2-legacy li {
  max-width: 72ch;
}

.d2-legacy .step h2,
.d2-legacy .step h3 {
  margin: 0 0 var(--s1);
  font-size: 15px;
  line-height: 22px;
  font-weight: 700;
}

.d2-legacy .step > div:not(.step-n) > :first-child {
  margin-top: 0;
}

.d2-legacy table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.d2-legacy th,
.d2-legacy td {
  min-width: 0;
  padding: var(--s3);
  border-bottom: 1px solid var(--d2-line);
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.d2-legacy th {
  color: var(--d2-muted);
  font-size: 13px;
  font-weight: 550;
}

.d2-legacy td { font-size: 14px; }

.d2-legacy form {
  min-width: 0;
  margin: var(--s4) 0;
}

.d2-legacy label {
  display: block;
  margin: var(--s3) 0 var(--s2);
  color: var(--d2-text);
  font-size: 13px;
  font-weight: 650;
}

.d2-legacy input:not([type='hidden']):not([type='checkbox']):not([type='radio']),
.d2-legacy select,
.d2-legacy textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px var(--s3);
  color: var(--d2-text);
  background: var(--d2-bg);
  border: 1px solid var(--d2-line-strong);
  border-radius: var(--r-control);
}

.d2-legacy textarea {
  min-height: 112px;
  resize: vertical;
}

.d2-legacy input::placeholder,
.d2-legacy textarea::placeholder {
  color: #a99d8f;
  opacity: 1;
}

.d2-legacy button,
.d2-legacy a > button,
.d2-legacy input[type='submit'] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: var(--s2) 0;
  padding: 0 var(--s4);
  color: var(--d2-accent-ink);
  background: var(--d2-accent);
  border: 1px solid var(--d2-accent);
  border-radius: var(--r-control);
  cursor: pointer;
  font-weight: 700;
}

.d2-legacy table button,
.d2-legacy table a > button {
  min-height: 36px;
  margin: 0;
  padding: 0 var(--s3);
  font-size: 13px;
}

.d2-legacy button.ghost,
.d2-legacy .ghost,
.d2-legacy .secondary,
.d2-legacy #try-den button[name='question'][value] {
  color: var(--d2-text);
  background: var(--d2-surface-raised);
  border-color: var(--d2-line-strong);
}

.d2-legacy code,
.d2-legacy pre,
.d2-legacy .mono,
.d2-legacy .key {
  font-family: var(--d2-mono);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.d2-legacy pre {
  max-width: 100%;
  padding: var(--s4);
  background: var(--d2-bg);
  border: 1px solid var(--d2-line);
  border-radius: var(--r-control);
}

.d2-legacy .scroll-x {
  max-width: 100%;
  overflow: visible;
}

.d2-legacy .cb {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  min-width: 0;
  margin: var(--s3) 0;
  background: var(--d2-bg);
  border-radius: var(--r-control);
}

.d2-legacy .cb code {
  min-width: 0;
  padding: 10px var(--s3);
}

.d2-legacy .cb .cb-btn {
  align-self: stretch;
  margin: 0;
  border-width: 0 0 0 1px;
  border-color: var(--d2-line-strong);
  border-radius: 0 var(--r-control) var(--r-control) 0;
}

.d2-legacy details.more,
.d2-legacy details {
  margin: var(--s3) 0;
  border-bottom: 1px solid var(--d2-line);
}

.d2-legacy details summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-weight: 650;
}

.d2-legacy .pw-wrap {
  position: relative;
}

/* 입력한 글자가 「보기」 단추 아래로 들어가지 않게 오른쪽을 비운다(일반 입력 칸 규칙보다 구체적으로). */
.d2-legacy .pw-wrap input:not([type='hidden']):not([type='checkbox']):not([type='radio']):not([type='submit']) {
  padding-right: 76px;
}

.d2-legacy .pw-wrap button {
  position: absolute;
  right: 0;
  bottom: 0;
  min-height: 44px;
  min-width: 64px;
  margin: 0;
  padding: 0 var(--s3);
  color: var(--d2-text);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--d2-line);
  border-radius: 0 var(--r-control) var(--r-control) 0;
  box-shadow: none;
  font-size: 13px;
  font-weight: 650;
}

.d2-legacy .pw-wrap button:hover {
  color: var(--d2-accent);
  background: transparent;
}

.d2-auth {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.d2-auth-card {
  width: min(100%, 440px);
  padding: var(--s6);
  background: var(--d2-surface);
  border: 1px solid var(--d2-line);
  border-radius: var(--r-card);
  margin: auto 0;
}

.d2-auth-card .d2-brand {
  margin-bottom: var(--s6);
}

.d2-auth-card h1 {
  margin-bottom: var(--s5);
  font-size: var(--d2-type-title);
  line-height: var(--d2-leading-title);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.d2-auth-card .d2-btn {
  width: 100%;
  margin-top: var(--s2);
}

.d2-auth-links {
  margin: var(--s5) 0 0;
  color: var(--d2-muted);
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}

.d2-auth-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.d2-check {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  min-height: 44px;
  padding: var(--s2) 0;
  color: var(--d2-muted);
  font-size: 13px;
  line-height: 20px;
}

.d2-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 1px 0 0;
  accent-color: var(--d2-accent);
}

.d2-check a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.d2-entry {
  width: min(100%, 880px);
  margin: 0 auto;
}

.d2-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  margin-bottom: clamp(56px, 12vh, 112px);
}

.d2-entry-hero {
  max-width: 720px;
}

.d2-entry-hero h1 {
  max-width: 15ch;
  font-size: clamp(36px, 8vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.d2-entry-hero > p {
  max-width: 58ch;
  margin: var(--s5) 0 0;
  color: var(--d2-muted);
  font-size: 17px;
  line-height: 28px;
}

.d2-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s6);
}

.d2-entry-connect {
  display: grid;
  gap: var(--s5);
  margin-top: clamp(64px, 14vh, 128px);
  padding-top: var(--s7);
  border-top: 1px solid var(--d2-line);
}

.d2-entry-connect h2 {
  margin: 0;
  font-size: 18px;
  line-height: 26px;
  font-weight: 650;
}

@media (min-width: 600px) {
  .d2-main {
    padding: var(--s7) var(--s5) var(--s8);
  }

  .d2-head {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

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

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

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

  .d2-span-2 { grid-column: span 2; }
  .d2-span-3 { grid-column: span 3; }
  .d2-span-4 { grid-column: span 4; }

  .d2-grid-feature {
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  }

  .d2-question-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .d2-question-form .d2-help {
    grid-column: 1 / -1;
  }

  .d2-ask {
    grid-template-columns: minmax(220px, 0.7fr) minmax(240px, 1.5fr) auto;
  }

  .d2-entry-connect {
    grid-template-columns: 180px minmax(0, 1fr);
  }

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

@media (min-width: 760px) {
  .d2-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .d2-stat {
    padding: var(--s5);
    border-right: 1px solid var(--d2-line);
    border-bottom: 0;
  }

  .d2-stat:nth-child(-n + 2) {
    border-bottom: 0;
  }

  .d2-stat:last-child {
    border-right: 0;
  }
}

@media (min-width: 960px) {
  .d2-shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .d2-topbar {
    display: none;
  }

  .d2-rail {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    width: 248px;
    height: 100vh;
    padding: var(--s5) var(--s4);
    background: var(--d2-surface);
    border-right: 1px solid var(--d2-line);
  }

  .d2-rail .d2-brand {
    margin: 0 var(--s3) var(--s7);
  }

  .d2-rail-footer {
    margin-top: auto;
    padding-top: var(--s5);
    border-top: 1px solid var(--d2-line);
  }

  .d2-account-mail {
    display: block;
    padding: 0 var(--s3) var(--s2);
    color: var(--d2-muted);
    font-size: 12px;
    line-height: 20px;
    overflow-wrap: anywhere;
  }

  .d2-main {
    max-width: calc(var(--d2-page) + var(--s7) * 2);
    padding: var(--s8) var(--s7) 64px;
  }
}

@media (max-width: 959px) {
  .d2-section {
    padding: var(--s4);
  }

  .d2-table thead {
    display: none;
  }

  .d2-table tbody {
    display: block;
  }

  .d2-table tr {
    border-bottom: 1px solid var(--d2-line-strong);
  }

  .d2-table tbody tr:last-child {
    border-bottom: 0;
  }

  .d2-table td,
  .d2-table td:first-child,
  .d2-table td:last-child {
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
  }

  .d2-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: var(--s1);
    color: var(--d2-muted);
    font-size: 12px;
    line-height: 16px;
  }

  .d2-table:not(.d2-table--calls):not(.d2-table--keys):not(.d2-table--counts) tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s3);
    padding: var(--s4) 0;
  }

  .d2-quota-tiers th[scope='row'] {
    grid-column: 1 / -1;
    height: auto;
    padding: 0;
    border: 0;
  }

  .d2-table--calls tr {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-rows: 36px minmax(20px, auto);
    align-items: center;
    gap: var(--s1) var(--s2);
    width: 100%;
    padding: 6px 0;
  }

  .d2-table--calls td:nth-child(1) {
    grid-column: 1;
    grid-row: 2;
  }

  .d2-table--calls td:nth-child(2) {
    grid-column: 1 / 4;
    grid-row: 1;
    min-width: 0;
    font-weight: 700;
  }

  .d2-table--calls td:nth-child(3) {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
  }

  .d2-table--calls td:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
  }

  .d2-table--calls td:nth-child(5) {
    grid-column: 3 / 5;
    grid-row: 2;
    min-width: 0;
  }

  .d2-table--calls td:nth-child(1),
  .d2-table--calls td:nth-child(4),
  .d2-table--calls td:nth-child(5) {
    color: var(--d2-muted);
    font-size: 12px;
    line-height: 20px;
    text-align: left;
  }

  .d2-table--calls td:nth-child(4)::before,
  .d2-table--calls td:nth-child(5)::before {
    content: '·';
    display: inline;
    margin-right: var(--s2);
    color: var(--d2-muted);
  }

  .d2-table--calls td:nth-child(1)::before,
  .d2-table--calls td:nth-child(2)::before,
  .d2-table--calls td:nth-child(3)::before {
    display: none;
  }

  .d2-table--calls td:nth-child(2) a {
    justify-content: flex-start;
    font-weight: 700;
  }

  .d2-table--calls td:nth-child(5) code {
    display: inline;
    max-width: 100%;
    color: inherit;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .d2-table--keys tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s2) var(--s3);
    width: 100%;
    padding: var(--s3) 0;
  }

  .d2-table--keys td:nth-child(2),
  .d2-table--keys td:nth-child(4),
  .d2-table--keys td:nth-child(6) {
    text-align: right;
  }

  .d2-table--keys td:nth-child(3),
  .d2-table--keys td:nth-child(4) {
    color: var(--d2-muted);
    font-size: 12px;
    line-height: 20px;
  }

  .d2-table--keys td:nth-child(2) code {
    overflow-wrap: anywhere;
  }

  .d2-table--keys .d2-btn {
    width: 100%;
    min-height: 40px;
  }

  .d2-table--keys td::before,
  .d2-table--counts td::before {
    display: none;
  }

  .d2-table--counts tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s3);
    min-height: 52px;
    padding: var(--s2) 0;
  }

  .d2-table--counts td:last-child {
    text-align: right;
  }

  .d2-bars-labels span {
    visibility: hidden;
  }

  .d2-bars-labels span:nth-child(1),
  .d2-bars-labels span:nth-child(4),
  .d2-bars-labels span:nth-child(7),
  .d2-bars-labels span:nth-child(10),
  .d2-bars-labels span:nth-child(12),
  .d2-bars-labels span:last-child {
    visibility: visible;
  }

  .d2-public-head {
    align-items: flex-start;
  }

  .d2-public-nav {
    max-width: 72%;
  }

  .d2-legacy table,
  .d2-legacy thead,
  .d2-legacy tbody,
  .d2-legacy tr,
  .d2-legacy th,
  .d2-legacy td {
    display: block;
    width: 100%;
  }

  .d2-legacy thead { display: none; }

  .d2-legacy tr {
    padding: var(--s3) 0;
    border-bottom: 1px solid var(--d2-line-strong);
  }

  .d2-legacy td,
  .d2-legacy th {
    padding: var(--s2) 0;
    border: 0;
  }
}

@media (max-width: 520px) {
  .d2-public-head {
    display: grid;
  }

  .d2-public-nav {
    max-width: none;
    justify-content: flex-start;
  }

  .d2-copy code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .d2-legacy .cb {
    grid-template-columns: minmax(0, 1fr);
  }

  .d2-legacy .cb .cb-btn {
    border-width: 1px 0 0;
    border-radius: 0 0 var(--r-control) var(--r-control);
  }
}

@media (max-width: 679px) {
  .d2-auth-card {
    padding: var(--s5);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}
