:root {
  --navy: #142a42;
  --navy-light: #24476e;
  --accent: #d97a3f;
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e2e5ea;
  --text: #1c2430;
  --text-muted: #6b7480;
  --error: #c0392b;
}

* { box-sizing: border-box; }

/* Native <button> elements don't get a pointer cursor by default the way <a href>
   does — add it explicitly so every clickable control feels clickable on desktop. */
button:not(:disabled),
.crumb {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  background: var(--navy);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: calc(14px + env(safe-area-inset-top));
}

.topbar h1 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
}

.user-label {
  font-size: 0.85rem;
  color: #c9d4e0;
  margin-right: 10px;
}

.primary-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.text-btn {
  background: none;
  border: none;
  color: #c9d4e0;
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 4px;
}

main {
  padding: 12px 16px 40px;
  max-width: 640px;
  margin: 0 auto;
}

.signed-out-msg {
  padding: 40px 12px;
  text-align: center;
  color: var(--text-muted);
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 10px 0;
}

.crumb {
  background: none;
  border: none;
  color: var(--navy-light);
  font-size: 0.9rem;
  padding: 0;
  text-decoration: underline;
}

.status {
  min-height: 1.2em;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.status:empty {
  min-height: 0;
}

.status.error {
  color: var(--error);
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-list .empty {
  color: var(--text-muted);
  padding: 20px 0;
  text-align: center;
}

.file-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px;
  gap: 4px;
}

.file-main {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 12px 10px;
  text-align: left;
  font-size: 1rem;
}

.file-main--static {
  cursor: default;
}

.file-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  gap: 6px;
  padding: 4px 6px 4px 0;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  color: var(--navy);
  flex-shrink: 0;
}

.icon-btn:active {
  background: #eef2f6;
}

.icon-btn:disabled {
  background: #dde2e8;
  color: #9aa3af;
  border-color: #dde2e8;
  cursor: not-allowed;
}

.preview-modal {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.preview-modal[hidden] {
  display: none;
}

.preview-header {
  background: var(--navy);
  color: white;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.preview-frame {
  flex: 1;
  border: none;
}
