/* Shared visual shell used by BandServer and ProjectConverter.
   App-specific layout lives in each app's own public/styles.css file. */

:root {
  --bg: #f5f2ec;
  --panel: #ffffff;
  --text: #252525;
  --muted: #666666;
  --line: #d8d0c3;
  --accent: #176c72;
  --accent-dark: #0f4f55;
  --download: #a64224;
  --download-dark: #74301c;
  --danger: #a93434;
  --ready: #217245;
  --missing: #a05d16;
}

* {
  box-sizing: border-box;
}

body {
  /* Fixed header/footer with a scrollable central work pane. */
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.35;
}

a {
  color: var(--accent-dark);
}

.site-header,
.site-footer {
  background: #1f2526;
  color: #ffffff;
}

.site-header {
  /* Both apps use the same local-tool header with navigation and app switcher. */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 20px;
  border-bottom: 4px solid var(--accent);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  color: #d6ddde;
  font-size: 13px;
}

.header-left,
.header-nav,
.brand-lockup {
  display: flex;
  align-items: center;
}

.header-left {
  min-width: 0;
  gap: 18px;
}

.header-nav {
  gap: 8px;
  flex: 0 0 auto;
}

.brand-lockup {
  min-width: 0;
  gap: 10px;
}

.brand-logo {
  width: 120px;
  height: 60px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-logo-link {
  display: inline-flex;
  flex: 0 0 auto;
}

.server-name {
  display: inline-flex;
  align-items: center;
  color: #ffffff;
  font-size: 58px;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.server-name:hover {
  color: #ffffff;
  text-decoration: none;
}

.home-link,
.button-link,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.home-link:hover,
.button-link:hover,
button:hover {
  background: var(--accent-dark);
}

.nav-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2em;
  font-size: 20px;
  line-height: 1;
}

.nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.download-link {
  background: var(--download);
}

.download-link:hover {
  background: var(--download-dark);
}

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

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

.app-switch-link {
  flex: 0 0 auto;
}

.footer-actions {
  display: none;
}

.site-main {
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.work-pane {
  /* Desktop-oriented content width: wide enough for tables, not full monitor. */
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 14px 0;
}

.pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

h1,
h2 {
  margin: 0 0 5px;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 17px;
}

p {
  margin: 0;
}

.pane-header p,
.muted {
  color: var(--muted);
}

.notice,
.empty-state,
.section,
.song-card,
.note,
.decision-card {
  /* Reusable framed surfaces for rows, forms, reports, and wizard cards. */
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.notice {
  margin-bottom: 10px;
  padding: 9px 12px;
  border-left: 5px solid var(--accent);
}

.danger-notice {
  background: #fff5f5;
  color: #7f2222;
  border-color: #8d2a2a;
}

.empty-state,
.section {
  padding: 12px 14px;
}

.section {
  margin-bottom: 8px;
}

.song-list,
.audio-list,
.notes-list,
.form-grid,
.decision-list,
.summary-list {
  display: grid;
}

.song-list,
.audio-list,
.notes-list {
  gap: 0;
}

.form-grid,
.decision-list {
  gap: 10px;
}

.summary-list {
  gap: 6px;
}

.song-card,
.audio-row,
.track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.song-card {
  padding: 10px 12px;
}

.song-card h2 {
  font-size: 17px;
}

.song-card p {
  display: flex;
  gap: 12px;
  color: var(--muted);
}

.audio-row,
.track-row {
  min-height: 44px;
  padding: 4px 0;
  border-top: 1px solid var(--line);
}

.audio-row:first-child,
.track-row:first-child {
  border-top: 0;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-weight: 700;
}

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
}

textarea {
  resize: vertical;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: inherit;
  font-weight: 700;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.status {
  font-weight: 700;
}

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

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

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
}

.plain-list li {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  /* Mobile shell: fixed top identity/navigation and fixed bottom quick actions. */
  body {
    font-size: 15px;
  }

  .site-header {
    display: grid;
    gap: 6px;
    padding: calc(6px + env(safe-area-inset-top)) 12px 8px;
  }

  .header-left {
    display: grid;
    gap: 6px;
    min-width: 0;
  }

  .brand-lockup {
    order: 1;
    justify-content: center;
    gap: 8px;
    min-width: 0;
  }

  .header-nav {
    display: none;
  }

  .brand-logo {
    width: 74px;
    height: 36px;
  }

  .server-name {
    min-width: 0;
    max-width: 100%;
    font-size: 28px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home-link,
  .button-link,
  button {
    min-height: 44px;
    padding: 9px 12px;
  }

  .header-actions {
    display: none;
  }

  .site-footer {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 4px solid var(--accent);
  }

  .site-footer > span {
    display: none;
  }

  .footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .footer-actions .nav-button,
  .footer-actions .home-link {
    width: 56px;
    min-width: 56px;
  }

  .footer-actions .logout-form {
    display: grid;
    min-width: 88px;
    margin: 0;
    margin-left: auto;
  }

  .work-pane {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .pane-header,
  .split {
    display: grid;
    grid-template-columns: 1fr;
  }

  .song-card,
  .audio-row {
    align-items: stretch;
  }

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