:root {
  --night: #0b1312;
  --night-2: #111c1a;
  --mist: #a9b7b5;
  --mist-dim: #7f8e8c;
  --parchment: #efe6d0;
  --gilt: #c8a764;
  --gilt-light: #e9d29b;
  --ember: #ec9283;
  --lumos: #8cc8ff;
  --hairline: rgba(200, 167, 100, 0.24);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(200, 167, 100, 0.12), transparent 70%),
    var(--night);
  color: var(--parchment);
  font: 15px/1.55 'Segoe UI', system-ui, sans-serif;
}

h1,
h2 {
  margin: 0 0 12px;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  color: var(--gilt-light);
  text-wrap: balance;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 20px;
}

p {
  margin: 0 0 12px;
  text-wrap: pretty;
}

a {
  color: var(--gilt);
}

:focus-visible {
  outline: 2px solid var(--gilt-light);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--mist-dim);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 860px;
  margin: 0 auto;
  padding: 22px 16px;
}

.brand {
  font-family: Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gilt-light);
}

.brand .muted {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-weight: 400;
  margin-left: 6px;
}

.mark {
  color: var(--gilt);
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user img {
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--hairline);
}

.user form {
  margin: 0;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 48px;
  display: grid;
  gap: 18px;
}

.gate main {
  min-height: 100vh;
  place-items: center;
  padding: 16px;
}

#view-app,
.tab-panel {
  display: grid;
  gap: 18px;
}

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--hairline);
}

.tab {
  padding: 10px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--mist);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tab:hover {
  color: var(--parchment);
}

.tab[aria-selected='true'] {
  color: var(--gilt-light);
  border-bottom-color: var(--gilt);
}

.small {
  font-size: 13.5px;
}

.news-form {
  display: grid;
  gap: 14px;
}

.field.wide input,
.field.wide textarea {
  width: 100%;
}

.field textarea {
  min-height: 140px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(239, 230, 208, 0.16);
  background: rgba(4, 8, 7, 0.6);
  color: var(--parchment);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
}

.field textarea:focus {
  outline: none;
  border-color: var(--gilt);
}

.field small {
  margin-left: 6px;
  font-size: 12.5px;
}

.field input[type='date'] {
  color-scheme: dark;
}

.row.start {
  justify-content: flex-start;
}

.actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13.5px;
}

.button.danger:hover:not(:disabled) {
  border-color: var(--ember);
  color: var(--ember);
}

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

.news-entry {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(200, 167, 100, 0.16);
  background: rgba(4, 8, 7, 0.35);
}

.news-entry h3 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 17px;
  color: var(--parchment);
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--mist);
}

.news-tag {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(200, 167, 100, 0.4);
  color: var(--gilt-light);
  font-size: 12px;
}

.news-text {
  margin: 0;
  white-space: pre-line;
  color: var(--mist);
}

.news-url {
  overflow-wrap: anywhere;
  font-size: 13.5px;
}

.card {
  padding: 24px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: rgba(17, 28, 26, 0.85);
}

.card.narrow {
  max-width: 520px;
  width: 100%;
  margin: 48px auto 0;
  text-align: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid rgba(239, 230, 208, 0.16);
  background: rgba(239, 230, 208, 0.05);
  color: var(--parchment);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    filter 0.15s;
}

.button:hover:not(:disabled) {
  border-color: var(--gilt);
}

.button.primary {
  border-color: rgba(94, 71, 32, 0.6);
  background: linear-gradient(180deg, #ecd59a, #c9a862);
  color: #22190a;
}

.button.primary:hover:not(:disabled) {
  filter: brightness(1.07);
}

.button:disabled {
  opacity: 0.5;
  cursor: default;
}

.link {
  border: 0;
  background: none;
  color: var(--gilt);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.current dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 0;
}

.current dt {
  color: var(--mist-dim);
}

.current dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.drop {
  position: relative;
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 34px 20px;
  border-radius: 12px;
  border: 1.5px dashed rgba(200, 167, 100, 0.45);
  background: rgba(200, 167, 100, 0.04);
  text-align: center;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.drop:hover,
.drop.over {
  border-color: var(--gilt-light);
  background: rgba(200, 167, 100, 0.09);
}

.drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop strong {
  font-size: 17px;
  color: var(--gilt-light);
}

.drop span {
  color: var(--mist);
  max-width: 460px;
}

.analysis,
.progress {
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(200, 167, 100, 0.14);
}

th {
  color: var(--mist-dim);
  font-weight: 500;
}

td.kept {
  color: var(--lumos);
}

td.dropped {
  color: var(--mist-dim);
}

td.backup {
  color: var(--gilt);
}

tr.gone td {
  color: var(--mist-dim);
}

.history {
  overflow-x: auto;
}

.history table {
  font-size: 14px;
  min-width: 520px;
}

tr.dropped td:first-child {
  text-decoration: line-through;
  color: var(--mist-dim);
}

.sizes {
  margin-top: 12px;
  color: var(--mist);
}

.row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--mist);
}

.field input {
  width: 180px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(239, 230, 208, 0.16);
  background: rgba(4, 8, 7, 0.6);
  color: var(--parchment);
  font: inherit;
  font-size: 16px;
}

.field input:focus {
  outline: none;
  border-color: var(--gilt);
}

.field input[aria-invalid='true'] {
  border-color: var(--ember);
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-bottom: 10px;
}

.bar div {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #8e7036, var(--gilt-light));
  transition: width 0.2s linear;
}

.bar.busy div {
  width: 35%;
  animation: busy 1.3s ease-in-out infinite;
}

@keyframes busy {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(300%);
  }
}

.message {
  margin: 16px 0 0;
  min-height: 1.5em;
}

.message.error {
  color: var(--ember);
}

.message.success {
  color: var(--lumos);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
