:root {
  --bg: #262626;
  --fg: #f2f2f2;
  --muted: #a3a3a3;
  --primary: #1677ff;
  --surface: #2f2f2f;
  --surface-2: #3a3a3a;
  --border: #444;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: clamp(14px, 3.6vw, 16px);
  line-height: 1.45;
}

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.page--form {
  max-width: 680px;
}

.page--wide {
  max-width: 100%;
  padding: 12px;
}

.page--stack {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.panel {
  width: 100%;
  min-width: 0;
  overflow-x: clip;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

label {
  color: var(--fg);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid #4a4a4a;
  background: var(--surface-2);
  color: var(--fg);
  font: inherit;
  font-size: max(16px, 1em);
  padding: 8px 10px;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

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

.btn {
  min-height: 44px;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: var(--surface-2);
  color: var(--fg);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--fg);
}

.btn-danger {
  background: #c42b2b;
  color: #fff;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

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

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

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

  .actions {
    flex-direction: column;
  }

  .btn:not(.gallery-btn--fixed):not(.btn--i18n-fixed) {
    width: 100%;
  }
}
