/* Shared studio primitives: architectural neutrals, forest accent, precise controls. */
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/InstrumentSans-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --bg: #f5f6f5;
  --bg-warm: #f0f3f1;
  --surface: #ffffff;
  --ink: #202927;
  --ink-2: #3e4946;
  --muted: #66736e;
  --faint: #737e79;
  --line: #dfe5e1;
  --line-strong: #bac9c1;
  --soft: #f3f6f4;
  --hover: #eaf0ed;

  --sidebar: #202a29;
  --sidebar-2: #293633;
  --sidebar-3: #314d44;
  --sidebar-ink: #ececec;
  --sidebar-muted: #9a9a96;
  --sidebar-line: #2a2a2a;

  --accent: #236451;
  --accent-soft: #eaf3ee;
  --cta: #236451;
  --cta-hover: #194c3d;

  --warn: #8a6116;
  --warn-bg: #fbf6ee;
  --warn-line: #ead9b6;
  --danger: #c43c1c;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-pill: 8px;

  --shadow-sm: 0 1px 2px #0d0d0d08;
  --shadow-md: 0 10px 36px #0d0d0d0c;
  --shadow-lg: 0 28px 80px #0d0d0d1a;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus: 0 0 0 3px #10a37f33;
  --control-h: 38px;

  color-scheme: light;
  font-family: var(--font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button,
.button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-h);
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 160ms var(--ease),
    border-color 160ms var(--ease),
    color 160ms var(--ease),
    box-shadow 160ms var(--ease),
    transform 160ms var(--ease);
}

button:hover:not(:disabled),
.button:hover {
  background: var(--hover);
  border-color: var(--line-strong);
}

button:active:not(:disabled),
.button:active {
  transform: scale(0.985);
}

button:disabled,
.button:disabled,
.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

button.primary,
.primary,
.primary-button {
  background: var(--cta);
  color: #fff;
  border-color: var(--cta);
  box-shadow: none;
}

button.primary:hover:not(:disabled),
.primary:hover,
.primary-button:hover {
  background: var(--cta-hover);
  color: #fff;
  border-color: var(--cta-hover);
}

.quiet-button,
.text-button {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  min-height: 36px;
  padding-inline: 10px;
}

.quiet-button:hover:not(:disabled),
.text-button:hover:not(:disabled) {
  background: var(--soft);
  color: var(--ink);
  border-color: transparent;
}

.icon-button {
  min-width: var(--control-h);
  padding: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--control-h);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition:
    border-color 160ms var(--ease),
    box-shadow 160ms var(--ease),
    background 160ms var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: #b0b0aa;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5' fill='none' stroke='%236f6f6b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: var(--focus);
}

label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}

label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 450;
  color: var(--ink-2);
}

input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  min-height: 0;
  min-width: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

input[type="checkbox"]:hover {
  border-color: var(--ink);
}

input[type="checkbox"]:checked {
  background: var(--cta);
  border-color: var(--cta);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='m3 7.2 2.6 2.6L11 4.2' fill='none' stroke='white' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
}

input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

input[type="search"] {
  border-radius: var(--radius-pill);
  padding-left: 16px;
}

a {
  color: var(--ink);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: #c8c8c2;
  transition: color 160ms var(--ease), text-decoration-color 160ms var(--ease);
}

a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

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

button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.eyebrow,
.section-index {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.muted {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  letter-spacing: 0.01em;
}

.warning {
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.55;
}

.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

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

th,
td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--soft);
  color: var(--muted);
  white-space: nowrap;
}

tbody tr {
  transition: background 140ms var(--ease);
}

tbody tr:hover {
  background: #fafaf7;
}

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

.key-hint,
kbd {
  font-family: var(--mono);
  font-size: 11px;
  min-width: 20px;
  height: 22px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
}

.loading-ring {
  width: 18px;
  height: 18px;
  border: 1.5px solid #e0e0da;
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

form:tool-form-active {
  outline: light-dark(#2563eb, #67e8f9) dashed 2px;
  outline-offset: 4px;
}

button:tool-submit-active,
input:tool-submit-active,
select:tool-submit-active,
textarea:tool-submit-active {
  outline: light-dark(#dc2626, #fda4af) dashed 2px;
  outline-offset: 2px;
}

.webmcp-line {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--sidebar-muted, var(--muted));
}
