* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #202020;
}

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

button { cursor: pointer; }

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .55;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
}

select,
input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  background: #fff;
  color: inherit;
}

.header select { min-width: 180px; width: auto; }

textarea { resize: vertical; line-height: 1.5; }

.message {
  min-height: 24px;
  margin: 0 0 16px;
  color: #666;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  padding: 20px;
  border: 1px solid #e2e2e2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status {
  padding: 5px 9px;
  border-radius: 999px;
  background: #eee;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.date {
  color: #777;
  font-size: 12px;
}

.profile {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.reference {
  margin: 10px 0 0;
  color: #666;
  font-size: 14px;
}

.metadata {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.metadata div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.metadata dt { color: #777; }
.metadata dd { margin: 0; text-align: right; font-weight: 600; }

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.card-actions button,
.editor-actions button {
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: #202020;
  color: #fff;
  font-weight: 700;
}

.card-actions button:hover,
.editor-actions button:hover { opacity: .9; }

.editor-actions .secondary {
  background: #eee;
  color: #202020;
}

.id {
  margin: 18px 0 0;
  overflow: hidden;
  color: #aaa;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

dialog {
  width: min(620px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
}

dialog::backdrop { background: rgba(0, 0, 0, .35); }

.editor {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.editor-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.editor-header h2 { margin: 0; font-size: 22px; }

.editor label {
  display: grid;
  gap: 7px;
  color: #555;
  font-size: 13px;
  font-weight: 700;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eee;
  font-size: 24px;
  line-height: 1;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

@media (max-width: 640px) {
  .container { width: min(100% - 20px, 1180px); padding-top: 24px; }
  .header { align-items: stretch; flex-direction: column; }
  .header select { width: 100%; }
}
