:root {
  --bg: #f3ede2;
  --card: #fff9ef;
  --text: #251f18;
  --muted: #6d6355;
  --line: #dccdb6;
  --primary: #0f7056;
  --primary-dark: #0b5440;
  --danger: #7c3429;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 10%, #ffe4bf 0%, #f3ede2 45%),
    linear-gradient(140deg, #efe4d0 0%, #faf6ef 80%);
}

.layout {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: var(--card);
  box-shadow: 0 12px 28px rgba(24, 17, 10, 0.1);
}

.card + .card {
  margin-top: 1rem;
}

h1,
h2 {
  margin: 0 0 0.5rem;
}

.subline {
  margin: 0 0 1rem;
  color: var(--muted);
}

.label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}

.row {
  display: flex;
  gap: 0.5rem;
}

input[type="password"],
input[type="file"],
input[type="text"],
textarea {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem 0.75rem;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}

textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  font-family: "Courier New", monospace;
}

button,
.site-link {
  border: 0;
  border-radius: 10px;
  padding: 0.62rem 0.88rem;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

button:hover,
.site-link:hover {
  transform: translateY(-1px);
  background: var(--primary-dark);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

#logoutBtn {
  background: var(--danger);
}

#logoutBtn:hover {
  background: #5f261f;
}

#status {
  margin-top: 1rem;
  color: var(--muted);
  min-height: 1.2rem;
}

.sep {
  margin: 1.2rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.files-list {
  margin-top: 0.8rem;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.file-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem;
  border-bottom: 1px solid #eee2d1;
}

.file-row:last-child {
  border-bottom: 0;
}

.file-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.file-meta code {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta small {
  color: var(--muted);
}

.file-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.danger-btn:hover {
  background: #5f261f;
}

.editor {
  margin-top: 1rem;
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .row,
  .actions {
    flex-direction: column;
  }
}
