:root {
  --bg: #f6f1e8;
  --bg-accent: #efe2cf;
  --card: rgba(255, 252, 246, 0.92);
  --card-strong: #fffaf2;
  --ink: #221b17;
  --muted: #67564d;
  --line: rgba(34, 27, 23, 0.12);
  --brand: #b64a22;
  --brand-strong: #8e3413;
  --ok: #1e7d4d;
  --warn: #8a5b11;
  --danger: #8f2b2b;
  --shadow: 0 24px 50px rgba(74, 47, 27, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
  --font-head: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-body: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(182, 74, 34, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(143, 52, 19, 0.1), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, #fbf8f1 100%);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

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

.brand__mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #d66433, #8e3413);
  color: #fffaf2;
  font-family: var(--font-head);
  font-size: 26px;
  box-shadow: 0 12px 30px rgba(182, 74, 34, 0.25);
}

.brand__eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand__title {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
}

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

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid rgba(182, 74, 34, 0.35);
  outline-offset: 2px;
}

.button--primary {
  color: #fffaf2;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 14px 26px rgba(182, 74, 34, 0.24);
}

.button--ghost {
  color: var(--ink);
  background: rgba(255, 252, 246, 0.8);
  border: 1px solid var(--line);
}

.button[disabled] {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid--dashboard {
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
}

.grid--claim {
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.8fr);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.card__body {
  padding: 26px;
}

.card__title {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: clamp(24px, 3vw, 34px);
}

.card__title--small {
  font-size: clamp(20px, 2vw, 26px);
}

.card__copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.stack {
  display: grid;
  gap: 16px;
}

.form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

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

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 252, 246, 0.86);
}

.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 252, 246, 0.86);
  resize: vertical;
  min-height: 140px;
}

.field input[type="file"] {
  padding: 12px;
}

.field__hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.notice {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid transparent;
  line-height: 1.5;
}

.notice--info {
  background: rgba(255, 252, 246, 0.86);
  border-color: var(--line);
  color: var(--muted);
}

.notice--success {
  background: rgba(30, 125, 77, 0.1);
  border-color: rgba(30, 125, 77, 0.18);
  color: var(--ok);
}

.notice--error {
  background: rgba(143, 43, 43, 0.1);
  border-color: rgba(143, 43, 43, 0.18);
  color: var(--danger);
}

.notice--warn {
  background: rgba(138, 91, 17, 0.1);
  border-color: rgba(138, 91, 17, 0.18);
  color: var(--warn);
}

.breadcrumbs {
  margin-bottom: -4px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.actions--compact {
  margin-top: 12px;
}

.stack--compact {
  gap: 12px;
}

.button--small {
  padding: 9px 14px;
  font-size: 14px;
}

.summary {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--card-strong);
  border: 1px solid var(--line);
}

.metric__label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric__value {
  font-family: var(--font-head);
  font-size: 22px;
}

.meta-list {
  display: grid;
  gap: 12px;
}

.meta-list__item {
  display: grid;
  gap: 4px;
}

.meta-list__label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-list__value {
  overflow-wrap: anywhere;
}

.code-pill,
.code-block {
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
}

.code-pill {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(182, 74, 34, 0.1);
  color: var(--brand-strong);
  overflow-wrap: anywhere;
}

.code-panel {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card-strong);
  display: grid;
  gap: 10px;
}

.code-panel--secret {
  border-color: rgba(30, 125, 77, 0.2);
  background: rgba(30, 125, 77, 0.06);
}

.code-block {
  display: block;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(34, 27, 23, 0.05);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.list__item {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card-strong);
  display: grid;
  gap: 10px;
}

.list__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.handle {
  font-weight: 700;
}

.subtle {
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(182, 74, 34, 0.1);
  color: var(--brand-strong);
}

.badge--warn {
  background: rgba(138, 91, 17, 0.1);
  color: var(--warn);
}

.badge--muted {
  background: rgba(34, 27, 23, 0.08);
  color: var(--muted);
}

.avatar-panel {
  display: grid;
  gap: 16px;
}

.avatar-preview {
  width: 104px;
  height: 104px;
  border-radius: 28px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(34, 27, 23, 0.06);
  box-shadow: 0 18px 32px rgba(74, 47, 27, 0.12);
}

.form--compact {
  margin-top: 0;
}

.metadata-grid {
  display: grid;
  gap: 12px;
}

.metadata-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.metadata-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 252, 246, 0.86);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 27, 23, 0.06);
  color: var(--ink);
  font-size: 12px;
}

.inline-link {
  color: var(--brand-strong);
  text-decoration: none;
}

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

.empty {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 246, 0.72);
  border: 1px dashed var(--line);
  color: var(--muted);
}

@media (max-width: 880px) {
  .grid--dashboard {
    grid-template-columns: 1fr;
  }

  .grid--claim {
    grid-template-columns: 1fr;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .metadata-row {
    grid-template-columns: 1fr;
  }

  .masthead {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar .button {
    width: 100%;
  }
}
