:root {
  --bg: #f6f3ee;
  --bg-alt: #e9e4db;
  --text: #1e1b16;
  --muted: #6b6257;
  --accent: #1f6f78;
  --danger: #a13a2a;
  --card: #ffffff;
  --border: #e1d9cf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg-alt));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav a {
  margin-left: 16px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.container {
  max-width: 1100px;
  margin: 24px auto 48px;
  padding: 0 16px;
}

.banner {
  background: #fff3c9;
  border-bottom: 1px solid #e8d89b;
  padding: 10px 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.card.narrow {
  max-width: 420px;
  margin: 80px auto;
}

h1, h2, h3 {
  margin-top: 0;
}

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

button {
  border: 1px solid var(--border);
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.danger {
  background: var(--danger);
}

input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

.error {
  background: #fde8e6;
  border: 1px solid #f5c2bd;
  color: #a13a2a;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.hint {
  color: var(--muted);
  margin-top: 12px;
}

.runtime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  background: #f9f6f1;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.settings-actions {
  align-self: end;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

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

.thumb {
  width: 160px;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}

.log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.log-row {
  display: grid;
  grid-template-columns: 180px 120px 1fr;
  gap: 8px;
  font-size: 14px;
}

.log-time {
  color: var(--muted);
}

.log-type {
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
}

@media (max-width: 720px) {
  .log-row {
    grid-template-columns: 1fr;
  }
  .nav a {
    margin-left: 8px;
  }
}
