/* Mobile-first, Google-inspired */
:root {
  --bg: #ffffff;
  --muted: #5f6368;
  --text: #202124;
  --line: #dadce0;
  --primary: #1a73e8;
  --primary-hover: #1558b0;
  --surface: #f8f9fa;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 2px 6px rgba(60, 64, 67, 0.15);
  --radius: 999px;
  --radius-md: 12px;
  --maxw: 920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.app-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
  opacity: 0.85;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px;
}

.hero {
  padding: 28px 16px 8px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 16px;
}

.grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.stat .label {
  color: var(--muted);
  font-size: 0.85rem;
}

.stat .value {
  font-size: 1.25rem;
  font-weight: 600;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 10px 18px;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  background: var(--surface);
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

.alert {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff8e1;
  color: #5f4b00;
}

.alert-error {
  background: #fdecea;
  color: #611a15;
  border-color: #f5c6cb;
}

.alert-success {
  background: #e6f4ea;
  color: #137333;
  border-color: #ceead6;
}

.chat-shell {
  max-width: 720px;
  margin: 0 auto;
}

.chat-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 160px;
  background: #fff;
  white-space: pre-wrap;
}

.pill {
  border-radius: var(--radius);
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 24px 16px 40px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

.doc pre,
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
}

.doc pre {
  margin: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.doc h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 28px 0 10px;
}

.doc h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 18px 0 8px;
}

.doc ul {
  margin: 0 0 12px;
  padding-left: 1.2rem;
  color: var(--muted);
}

.doc p {
  color: var(--muted);
  font-size: 0.95rem;
}
