:root {
  --bg: #f6f8fa;
  --panel: #ffffff;
  --panel-muted: #f6f8fa;
  --text: #24292f;
  --muted: #57606a;
  --line: #d0d7de;
  --line-strong: #8c959f;
  --blue: #0969da;
  --green: #2da44e;
  --red: #cf222e;
  --red-soft: #ffebe9;
  --green-soft: #dafbe1;
  --shadow: 0 16px 40px rgba(31, 35, 40, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background:
    radial-gradient(circle at top left, rgba(9, 105, 218, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

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

.shell {
  width: 100%;
  min-height: 100vh;
}

.hero-card-label,
.eyebrow,
.meta-label {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.main-panel {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(31, 35, 40, 0.05);
}

.app-screen {
  display: grid;
  gap: 20px;
}

.docs-page {
  display: grid;
  gap: 20px;
}

.panel-header,
.topbar,
.docs-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar {
  padding: 4px 2px;
}

.docs-topbar {
  padding: 8px 2px;
}

.topbar h2,
.panel-header h3,
.panel-header h2,
.docs-topbar h1 {
  margin: 6px 0 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.docs-topbar h1 {
  font-size: clamp(30px, 4vw, 44px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-pill {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.projects-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
}

.project-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 40px;
}

.project-button,
.button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.project-button {
  padding: 10px 16px;
  font-weight: 600;
}

.project-button:hover,
.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 8px 22px rgba(31, 35, 40, 0.08);
}

.project-button.is-active {
  color: #ffffff;
  background: linear-gradient(180deg, #2f81f7, var(--blue));
  border-color: #0550ae;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  font-size: 24px;
  color: var(--blue);
}

.button {
  padding: 10px 16px;
  font-weight: 600;
}

.button-primary {
  color: #ffffff;
  background: linear-gradient(180deg, #2da44e, #218739);
  border-color: #1a7f37;
}

.button-secondary {
  background: #f6f8fa;
}

.button-danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(207, 34, 46, 0.22);
}

.project-meta {
  padding: 0 18px 18px;
}

.project-meta-card,
.project-meta-empty,
.integration-note {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-muted);
}

.project-meta-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.meta-value {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 14px;
  word-break: break-all;
}

.integration-note,
.project-meta-empty {
  margin-top: 12px;
  padding: 14px 16px;
  color: var(--muted);
  line-height: 1.6;
}

.table-panel {
  overflow: hidden;
}

.table-panel .panel-header {
  padding: 22px 24px 12px;
}

.table-wrap {
  overflow-x: auto;
  padding: 0 0 6px;
}

.tasks-table {
  width: 100%;
  border-collapse: collapse;
}

.tasks-table th,
.tasks-table td {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.tasks-table thead th {
  background: rgba(246, 248, 250, 0.98);
  text-align: left;
  color: var(--muted);
  font-size: 13px;
}

.task-number {
  font-weight: 700;
  white-space: nowrap;
}

.description-cell {
  max-width: 320px;
  line-height: 1.55;
}

.description-trigger {
  width: 100%;
  max-width: 360px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 500;
}

.description-trigger:hover {
  color: var(--blue);
}

.result-trigger {
  min-width: 128px;
}

.description-trigger:focus,
.result-modal-input:focus,
.field input:focus,
.status-select:focus {
  outline: 2px solid rgba(9, 105, 218, 0.2);
  border-color: var(--blue);
}

.status-select {
  min-width: 170px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.muted,
.empty-cell,
.projects-empty {
  color: var(--muted);
}

.empty-cell {
  text-align: center;
  padding: 36px 18px;
}

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

#login-screen {
  max-width: 520px;
  padding: 28px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 600;
  color: var(--muted);
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.page-footer {
  display: flex;
  justify-content: center;
  padding: 30px 0 12px;
}

.footer-link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  text-decoration: underline;
}

.docs-section {
  padding: 24px;
}

.docs-section h2,
.docs-section h3 {
  margin: 0 0 14px;
}

.docs-section h3 {
  margin-top: 22px;
  font-size: 18px;
}

.docs-lead,
.docs-text {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 78ch;
}

.docs-endpoint {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-muted);
}

.docs-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #1a7f37;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.docs-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.7;
}

.docs-code {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0d1117;
  color: #e6edf3;
  line-height: 1.6;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(36, 41, 47, 0.52);
  backdrop-filter: blur(6px);
  z-index: 40;
}

.modal-card {
  width: min(520px, 100%);
  border-radius: 20px;
  border: 1px solid rgba(208, 215, 222, 0.7);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 22px 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 22px;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.modal-form,
.api-key-card,
.attachment-viewer,
.modal-content-body {
  padding: 0 22px 22px;
}

.modal-content-text {
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--text);
}

.result-modal-input {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.api-key-output {
  display: block;
  margin: 16px 0;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-muted);
  color: var(--blue);
  font-size: 14px;
  word-break: break-all;
}

.attachment-media {
  display: block;
  width: 100%;
  max-height: 75vh;
  border-radius: 16px;
  background: #000000;
  object-fit: contain;
}

.toast-root {
  position: fixed;
  top: 24px;
  right: 24px;
  display: grid;
  gap: 12px;
  z-index: 60;
}

.toast {
  min-width: 240px;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.toast-success {
  border-color: rgba(45, 164, 78, 0.24);
  background: linear-gradient(180deg, #ffffff, var(--green-soft));
}

.toast-error {
  border-color: rgba(207, 34, 46, 0.22);
  background: linear-gradient(180deg, #ffffff, #fff5f5);
}

.toast-out {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .main-panel {
    padding: 18px;
  }

  .topbar,
  .docs-topbar,
  .project-meta-card,
  .projects-row {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .project-buttons {
    width: 100%;
  }
}
