:root {
  --bg: #f7f5ef;
  --bg-soft: #efece3;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --ink: #26241f;
  --ink-soft: #5c574c;
  --ink-faint: #8a8476;
  --line: #dcd7c9;
  --line-strong: #c5bead;
  --accent: #3b6b55;
  --accent-ink: #f4f7f4;
  --accent-soft: #e3ede6;
  --accent-strong: #2c513f;
  --warn: #a3602c;
  --warn-soft: #f6e9dc;
  --danger: #a03a34;
  --danger-soft: #f7e5e2;
  --ok: #3b6b55;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(38, 36, 31, 0.05), 0 4px 14px rgba(38, 36, 31, 0.05);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181a17;
    --bg-soft: #20231f;
    --surface: #212521;
    --surface-2: #262a25;
    --ink: #ece9df;
    --ink-soft: #b7b2a4;
    --ink-faint: #8a8578;
    --line: #35382f;
    --line-strong: #4a4d41;
    --accent: #7aa98c;
    --accent-ink: #10150f;
    --accent-soft: #2c3d33;
    --accent-strong: #9cc2a8;
    --warn: #d09a63;
    --warn-soft: #3a2f22;
    --danger: #d4837c;
    --danger-soft: #3d2827;
    --ok: #7aa98c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Header --- */
.dk-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.dk-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: 0.01em;
}

.dk-brand:hover {
  text-decoration: none;
}

.dk-brand__mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
}

.dk-brand__name {
  font-family: var(--font-serif);
  font-size: 20px;
}

.dk-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dk-nav__link {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 550;
}

.dk-nav__link:hover {
  background: var(--surface-2);
  text-decoration: none;
  color: var(--ink);
}

.dk-nav__link[data-current] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.dk-nav__sep {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 4px;
}

/* --- Buttons --- */
.dk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.dk-btn:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.dk-btn:active {
  transform: translateY(1px);
}

.dk-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.dk-btn--primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.dk-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}

.dk-btn--ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.dk-btn--danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.dk-btn--danger:hover {
  background: var(--danger-soft);
}

.dk-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* --- Layout --- */
.dk-view {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

.dk-view:focus {
  outline: none;
}

.dk-shell {
  max-width: 1040px;
  margin: 0 auto;
}

.dk-grid {
  display: grid;
  gap: 18px;
}

.dk-grid--browse {
  grid-template-columns: 260px 1fr;
  align-items: start;
}

@media (max-width: 860px) {
  .dk-grid--browse {
    grid-template-columns: 1fr;
  }
}

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

.dk-card--flat {
  box-shadow: none;
}

.kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

h1,
h2,
h3,
h4 {
  line-height: 1.22;
  margin: 0 0 10px;
  font-weight: 650;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 40px);
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 16px;
}

p {
  margin: 0 0 12px;
}

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

.faint {
  color: var(--ink-faint);
}

.small {
  font-size: 13px;
}

/* --- Hero / home --- */
.dk-hero {
  padding: 28px 0 34px;
  max-width: 640px;
}

.dk-hero p {
  font-size: 17px;
  color: var(--ink-soft);
}

.dk-hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.dk-hero__note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-faint);
}

.dk-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 34px 0 14px;
}

.dk-section-head h2 {
  margin: 0;
}

/* --- Profile cards (browse) --- */
.dk-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.dk-card--profile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.dk-card--profile:hover {
  border-color: var(--accent);
}

.dk-profile-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dk-profile-line .dk-avatar {
  flex: 0 0 auto;
}

.dk-profile-line__name {
  font-weight: 650;
  font-size: 16px;
  line-height: 1.25;
}

.dk-profile-line__name a {
  color: var(--ink);
}

.dk-profile-line__name a:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.dk-profile-line__meta {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 2px;
}

.dk-card__bio {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dk-card__row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--ink-soft);
}

.dk-card__row b {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.dk-card__footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* --- Avatar --- */
.dk-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  color: #f7f5ef;
  font-weight: 700;
  font-size: 20px;
  font-family: var(--font-serif);
  user-select: none;
  overflow: hidden;
  background: var(--accent);
}

.dk-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dk-avatar--sm {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 16px;
}

.dk-avatar--lg {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  font-size: 34px;
}

/* --- Tags --- */
.dk-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dk-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-soft);
  white-space: nowrap;
}

.dk-tag--accent {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-strong);
}

.dk-tag--muted {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-faint);
}

/* --- Filters --- */
.dk-filters {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  max-height: calc(100vh - 96px);
  overflow: auto;
}

.dk-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dk-field > label,
.dk-field > span {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dk-field input,
.dk-field select,
.dk-field textarea {
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.dk-field input:focus,
.dk-field select:focus,
.dk-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.dk-field textarea {
  resize: vertical;
  min-height: 84px;
}

.dk-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dk-field-row .dk-field {
  flex: 1;
}

.dk-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.dk-check input {
  accent-color: var(--accent);
}

.dk-filter-actions {
  display: flex;
  gap: 8px;
}

.dk-filter-actions .dk-btn {
  flex: 1;
}

/* --- Public profile --- */
.dk-profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
  padding: 24px;
}

@media (max-width: 560px) {
  .dk-profile-hero {
    grid-template-columns: 1fr;
  }
}

.dk-profile-hero__name {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 32px);
  margin: 0 0 4px;
}

.dk-profile-hero__username {
  color: var(--ink-faint);
  font-size: 14px;
}

.dk-profile-hero__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.dk-stat-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 8px;
}

.dk-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
}

.dk-section__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.dk-section__body {
  font-size: 15px;
  color: var(--ink);
}

.dk-quote {
  border-left: 3px solid var(--accent);
  padding: 6px 14px;
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px;
}

.dk-link {
  word-break: break-all;
}

/* --- Forms --- */
.dk-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 520px;
}

.dk-form--wide {
  max-width: 720px;
}

.dk-form__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.dk-form-status {
  font-size: 14px;
  margin: 0;
  min-height: 20px;
}

.dk-form-status--ok {
  color: var(--ok);
}

.dk-form-status--error {
  color: var(--danger);
}

.dk-editor {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.dk-editor-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dk-editor-section h3 {
  margin: 0;
}

.dk-tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dk-tag-option {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 550;
}

.dk-tag-option[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.dk-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .dk-editor-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Introductions --- */
.dk-intro-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dk-intro {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dk-intro__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dk-intro__message {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  white-space: pre-wrap;
  margin: 0;
}

.dk-intro__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dk-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-soft);
  color: var(--ink-soft);
}

.dk-badge--pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.dk-badge--accepted {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.dk-badge--declined,
.dk-badge--withdrawn {
  background: var(--line);
  color: var(--ink-faint);
}

/* --- Moderation --- */
.dk-admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dk-admin-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--surface);
  font-size: 14px;
}

.dk-admin-item__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dk-admin-item__body {
  margin-top: 8px;
  color: var(--ink-soft);
  white-space: pre-wrap;
  font-size: 13.5px;
}

.dk-admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* --- Toast --- */
.dk-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 550;
  box-shadow: var(--shadow);
  z-index: 60;
  max-width: 90vw;
}

/* --- Empty / misc --- */
.dk-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-faint);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.dk-empty h3 {
  color: var(--ink-soft);
}

.dk-toolbar-margin {
  height: 0;
}

.dk-footer {
  border-top: 1px solid var(--line);
  padding: 22px 20px 40px;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  color: var(--ink-faint);
  flex-wrap: wrap;
}

.dk-footer a {
  color: var(--ink-faint);
}
