:root {
  --primary: #1a73e8;
  --background: #f4f7fb;
  --surface: #ffffff;
  --border: #dce3ec;
  --hover: #e3efff;
  --mono: 'JetBrains Mono', monospace;
  --gray: #444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--gray);
}

.container {
  max-width: 850px;
  margin: 40px auto;
  padding: 24px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

h2 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* Search Bar */
.search-bar {
  display: flex;
  gap: 8px;
}

.search-bar input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

.search-bar button {
  background: var(--primary);
  color: white;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

.error {
  color: crimson;
  font-size: 0.95rem;
}

/* Viewer layout */
.viewer-outer {
  position: relative;
}

.file-viewer {
  font-family: var(--mono);
  font-size: 0.95em;
  background: #fdfefe;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
  max-height: 75vh;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.file-row {
  display: flex;
  border-bottom: 1px solid #f0f0f0;
}

.file-row:last-child {
  border-bottom: none;
}

.line-num {
  width: 50px;
  padding: 6px 10px;
  text-align: right;
  background: #f3f6f9;
  color: #888;
  border-right: 1px solid #e5e8ee;
  user-select: none;
  cursor: pointer;
  font-size: 0.9em;
}

.line-num:hover {
  background: var(--hover);
  color: var(--primary);
}

.line-text {
  padding: 6px 12px;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Clickable filenames (in filelist.txt) */
.file-link {
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}

.file-link:hover {
  color: #0b56c2;
}

/* Floating copy button */
.copy-file-fab {
  position: absolute;
  top: -16px;
  right: 16px;
  background: white;
  border: 1px solid #cfd9e4;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  width: 38px;
  height: 38px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.copy-file-fab:hover {
  background: var(--hover);
}

/* Feedback message */
.copy-feedback {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #1a932e;
  color: #fff;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.95em;
  display: none;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

mark {
  background: #fffaa6;
  color: #b26500;
  padding: 0 2px;
  border-radius: 2px;
}

@media (max-width: 600px) {
  .container {
    margin: 24px 12px;
    padding: 16px;
  }
  
  .line-num {
    width: 42px;
    font-size: 0.85em;
  }
  
  .file-viewer {
    font-size: 0.9em;
  }
  
  .copy-file-fab {
    right: 12px;
    top: -12px;
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
}