* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family);
}

body {
  line-height: 1.5;
  font-size: var(--font-body);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding-left: 20px;
}

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

th,
td {
  text-align: left;
}

body.entry-page {
  background: var(--bg);
}

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

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

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

.text-right {
  text-align: right;
}

.text-success {
  color: var(--internal);
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

.page-stack-sm {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.page-stack-md {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.page-stack-lg {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-5 {
  margin-top: var(--space-5);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mt-7 {
  margin-top: var(--space-7);
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all 0.18s ease;
}

.primary-button {
  background: var(--market);
  color: #fff;
  border: 1px solid var(--market);
}

.primary-button:hover {
  background: #504fbc;
  border-color: #504fbc;
}

.secondary-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.secondary-button:hover {
  background: var(--hover-bg);
  border-color: var(--line-strong);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.ghost-button:hover {
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.page-title {
  font-size: var(--font-page-title);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.page-subtitle {
  margin-top: 6px;
  color: var(--muted);
}

.section-title {
  font-size: var(--font-section-title);
  font-weight: 700;
}

.section-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.page-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: var(--header-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.page-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
}
