* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Avenir Next', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: #f5f6f8;
  color: #2d2d33;
}

/* The [hidden] attribute must win over Bootstrap's .btn { display:inline-block }. */
[hidden] {
  display: none !important;
}

/* ---- App layout & components ------------------------------------------- */

.app {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  text-align: left;
}

.app-header {
  text-align: center;
  margin-bottom: 1.75em;
}

.app-header h1 {
  margin: 0 0 0.25em;
  font-size: 2.2em;
  font-weight: 300;
}

.app-header p {
  margin: 0;
  color: #6b7280;
}

.download-form .input-group {
  margin-bottom: 0.75em;
}

.options {
  margin-top: 0.25em;
  font-size: 0.92em;
}

.options > summary {
  display: inline-block;
  cursor: pointer;
  color: #2f6fb0;
  list-style-position: inside;
  margin-bottom: 0.5em;
}

.options > summary:hover {
  text-decoration: underline;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85em 1.5em;
  padding: 1em;
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 8px;
}

.options-grid label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  gap: 0.3em;
  margin: 0;
}

.options-grid label.checkbox-line {
  flex-direction: row;
  align-items: center;
  font-weight: 400;
  gap: 0.5em;
}

.options-grid input[type='text'],
.options-grid input[type='number'] {
  padding: 5px 8px;
  border: 1px solid #ccd0d5;
  border-radius: 4px;
}

.status-panel {
  margin-top: 1.5em;
  padding: 1.1em 1.2em;
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 8px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.6em;
}

.status-line .label {
  text-transform: capitalize;
}

.status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25em;
  font-size: 0.85em;
  color: #555;
  margin-top: 0.6em;
}

.current-file {
  font-family: monospace;
  word-break: break-all;
}

.log {
  max-width: 100%;
  max-height: 180px;
  overflow: auto;
  margin-top: 0.75em;
  text-align: left;
  font-size: 0.78em;
  line-height: 1.45;
  background: #1e1e1e;
  color: #cfcfcf;
  padding: 0.75em;
  border: none;
  border-radius: 6px;
  white-space: pre-wrap;
}

.log:empty {
  display: none;
}

#download-link {
  margin-top: 1em;
}

.history-panel {
  margin-top: 2.25em;
}

.history-panel h3 {
  font-size: 1.15em;
  font-weight: 500;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0.5em 0 0;
}

.history-list li {
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.5em 0;
  border-bottom: 1px solid #ececef;
}

.history-meta {
  font-size: 0.8em;
}

.history-delete {
  margin-left: auto;
  color: #c9302c;
}

.muted {
  color: #9aa0a6;
}
