:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --ink: #202124;
  --muted: #6b6f76;
  --line: #dfe3e7;
  --line-strong: #c6cdd3;
  --accent: #176b5b;
  --accent-dark: #0f4c41;
  --accent-soft: #e5f3ef;
  --danger: #b3261e;
  --warning: #8a5b00;
  --shadow: 0 24px 70px rgba(32, 33, 36, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(23, 107, 91, 0.08), transparent 38%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: 1.15rem;
  letter-spacing: 0;
}

.privacy-note {
  max-width: 260px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: right;
}

.tool-panel {
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(223, 227, 231, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  background: #eef1f3;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.mode-tab.is-active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08);
}

.mode-view {
  display: none;
}

.mode-view.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading p {
  margin-top: 4px;
  color: var(--muted);
}

.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 7px;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.ghost-button {
  min-height: 36px;
  padding: 0 12px;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
}

.ghost-button:hover,
.icon-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #f8fafb;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 28px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 8px;
  background: #fafbfc;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.drop-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 38px;
  line-height: 1.1;
}

.drop-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
}

.drop-detail {
  display: block;
  max-width: 430px;
  margin-top: 6px;
  color: var(--muted);
}

.file-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.file-item,
.split-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.file-item {
  cursor: grab;
  transition: border-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.file-item:active {
  cursor: grabbing;
}

.file-item.is-dragging {
  opacity: 0.55;
}

.file-item.is-drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.14);
  transform: translateY(-1px);
}

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

.file-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.file-actions {
  display: flex;
  gap: 6px;
}

.range-field,
.text-field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  font-weight: 750;
}

.range-field input,
.text-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.range-field input:focus,
.text-field input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(23, 107, 91, 0.16);
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.status-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.status-text.is-error {
  color: var(--danger);
  font-weight: 700;
}

.status-text.is-warning {
  color: var(--warning);
  font-weight: 700;
}

.status-text.is-success {
  color: var(--accent-dark);
  font-weight: 700;
}

.primary-button {
  min-width: 150px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(23, 107, 91, 0.2);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.primary-button:disabled {
  opacity: 0.45;
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 980px);
    padding: 22px 0;
  }

  .topbar,
  .section-heading,
  .action-row {
    display: grid;
    gap: 12px;
  }

  .privacy-note {
    max-width: none;
    text-align: left;
  }

  .tool-panel {
    padding: 12px;
  }

  .drop-zone {
    min-height: 210px;
    padding: 22px 16px;
  }

  .file-item,
  .split-summary {
    grid-template-columns: 1fr;
  }

  .file-actions {
    justify-content: end;
  }

  .primary-button {
    width: 100%;
  }
}
