:root {
  --bg: #1a1d23;
  --surface: #252830;
  --text: #e6e9ef;
  --text-muted: #9ca0ab;
  --accent: #7c9cbf;
  --accent-hover: #94b3d4;
  --error: #c75c6f;
  --success: #7dba7d;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 1.5rem;
  line-height: 1.5;
}

header {
  margin-bottom: 2rem;
}

header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

header .tagline {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.privacy-notice {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

header .header-contact {
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
}

header .header-contact a {
  color: var(--accent);
  text-decoration: none;
}

header .header-contact a:hover {
  text-decoration: underline;
}

main {
  max-width: 900px;
  margin: 0 auto;
}

.upload-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.file-label {
  font-weight: 500;
  cursor: pointer;
}

#file-input {
  max-width: 20rem;
}

.thumbnail-container {
  min-height: 80px;
}

.thumbnail-container img {
  max-width: 200px;
  max-height: 150px;
  object-fit: contain;
  border: 1px solid var(--surface);
  border-radius: 4px;
}

.thumbnail-container .loading-tip {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.file-count {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.download-zip-btn {
  margin-left: 0.5rem;
}

.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-end;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.option-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

#mask-style {
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--surface);
  border-radius: 6px;
  min-width: 10rem;
}

.custom-names-group {
  margin-top: 0.5rem;
}

.custom-names-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

#custom-name-input {
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--surface);
  border-radius: 6px;
  min-width: 14rem;
}

#custom-name-input::placeholder {
  color: var(--text-muted);
}

.custom-names-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.custom-names-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  background: var(--surface);
  border-radius: 6px;
  font-size: 0.9rem;
}

.remove-name-btn {
  padding: 0 0.35rem;
  font-size: 1.1rem;
  line-height: 1;
  min-width: auto;
  background: transparent;
  color: var(--text-muted);
}

.remove-name-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

button {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  max-width: fit-content;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.progress-section {
  margin-bottom: 2rem;
}

.progress-section p {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
}

.progress-bar {
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.error-section {
  padding: 1rem;
  background: rgba(199, 92, 111, 0.15);
  border: 1px solid var(--error);
  border-radius: 6px;
  margin-bottom: 2rem;
}

.error-section p {
  margin: 0;
  color: var(--error);
}

.review-section {
  margin-top: 2rem;
}

.review-section h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.text-output-wrapper {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--surface);
  border-radius: 6px;
  background: var(--surface);
  margin-bottom: 1rem;
  padding: 1rem;
}

.redacted-text-output {
  margin: 0;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text);
}

.actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--surface);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.app-footer p {
  margin: 0.35rem 0;
}

.app-footer a {
  color: var(--accent);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}
