:root {
  color-scheme: dark;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0d1117;
  color: #e6edf3;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(100%, 520px);
  padding: 32px;
  border: 1px solid #30363d;
  border-radius: 16px;
  background: #161b22;
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.35);
}

body[data-mode="dashboard"] .shell {
  place-items: start center;
  padding-block: 40px;
}

body[data-mode="dashboard"] .card {
  width: min(100%, 920px);
}

.eyebrow {
  margin: 0 0 12px;
  color: #7ee787;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
}

p {
  line-height: 1.7;
}

h2 {
  margin: 24px 0 8px;
  font-size: 1.15rem;
}

code {
  overflow-wrap: anywhere;
}

.stack {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

label {
  color: #c9d1d9;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #484f58;
  border-radius: 9px;
  background: #0d1117;
  color: #f0f6fc;
  font: inherit;
}

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

input:focus,
textarea:focus {
  outline: 2px solid #2f81f7;
  outline-offset: 2px;
}

button {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 9px;
  background: #238636;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #2ea043;
}

button.secondary,
.button-link.secondary {
  border: 1px solid #484f58;
  background: #21262d;
  color: #f0f6fc;
}

button.secondary:hover,
.button-link.secondary:hover {
  background: #30363d;
}

button.danger {
  background: #a4262c;
}

button.danger:hover {
  background: #c1373f;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.secret-box {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #30363d;
  border-radius: 10px;
  background: #0d1117;
}

.secret-box dt {
  color: #8b949e;
  font-size: 0.85rem;
}

.secret-box dd {
  margin: 0 0 8px;
}

.recovery-codes {
  padding-left: 24px;
  line-height: 2;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.check input {
  width: auto;
}

.status {
  min-height: 1.7em;
  margin-bottom: 0;
  color: #ff7b72;
}

.status[data-kind="success"] {
  color: #7ee787;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

summary {
  cursor: pointer;
  color: #79c0ff;
}

progress {
  width: 100%;
  height: 10px;
  accent-color: #2f81f7;
}

.muted {
  color: #8b949e;
}

#security-summary[data-kind="success"] {
  color: #7ee787;
}

#security-summary[data-kind="warning"] {
  color: #e3b341;
}

.notice {
  padding: 12px 14px;
  border-left: 3px solid #d29922;
  background: #1f1a10;
  color: #e3b341;
}

.storage-panel,
.file-section,
.content-section,
.security-section {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #30363d;
  border-radius: 12px;
  background: #0d1117;
}

.security-section {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #30363d;
  border-radius: 12px;
  background: #0d1117;
}

.security-section h2,
.security-section h3 {
  margin: 0;
}

.content-section {
  display: grid;
  gap: 14px;
}

.content-section > h2 {
  margin: 0;
}

.content-section details {
  padding: 16px;
  border: 1px solid #30363d;
  border-radius: 12px;
  background: #0d1117;
}

.content-section details > summary {
  font-weight: 700;
}

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

.content-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #30363d;
  border-radius: 10px;
  background: #161b22;
}

.content-item button {
  min-width: 84px;
}

.content-meta {
  color: #8b949e;
  font-size: 0.88rem;
}

.editor {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid #30363d;
}

.cover-preview {
  width: min(100%, 420px);
  border: 1px solid #30363d;
  border-radius: 12px;
}

.storage-panel {
  display: grid;
  gap: 10px;
}

.storage-panel h2,
.file-section h2 {
  margin-top: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid #30363d;
  border-radius: 10px;
  background: #161b22;
}

.file-information {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.file-name {
  overflow-wrap: anywhere;
}

.file-meta {
  color: #8b949e;
  font-size: 0.9rem;
}

.file-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.button-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 9px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.empty {
  color: #8b949e;
}

@media (max-width: 620px) {
  .card {
    padding: 22px;
  }

  .file-item {
    align-items: stretch;
    flex-direction: column;
  }

  .file-actions > * {
    flex: 1;
  }
}
