*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f0;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NAVBAR */
nav {
  background: #fff;
  border-bottom: 1px solid #e5e5e0;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.nav-logo i {
  color: #7f77dd;
  font-size: 22px;
}
.nav-info {
  font-size: 13px;
  color: #888;
}

/* MAIN */
main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e5e5e0;
  padding: 2rem;
  width: 100%;
  max-width: 560px;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}
.card-sub {
  font-size: 14px;
  color: #666;
  margin-bottom: 1.5rem;
}

/* DROP ZONE */
.drop-zone {
  border: 2px dashed #d0cff5;
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  background: #faf9ff;
}
.drop-zone:hover,
.drop-zone.drag {
  background: #f0effe;
  border-color: #7f77dd;
}
.drop-zone .drop-icon {
  font-size: 40px;
  color: #7f77dd;
  display: block;
  margin-bottom: 12px;
}
.drop-zone p {
  color: #555;
  font-size: 15px;
  line-height: 1.6;
}
.drop-zone span {
  color: #7f77dd;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.drop-zone .drop-hint {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}
#file-input {
  display: none;
}

/* FILE CARD */
.file-card {
  margin-top: 1rem;
  display: none;
  background: #f9f9f9;
  border: 1px solid #e5e5e0;
  border-radius: 10px;
  padding: 12px 14px;
  align-items: center;
  gap: 12px;
}
.file-card.visible {
  display: flex;
}
.file-card .fc-icon {
  font-size: 26px;
  color: #7f77dd;
  flex-shrink: 0;
}
.file-info {
  flex: 1;
  min-width: 0;
}
.file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-size {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}
.remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 20px;
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
  display: flex;
  align-items: center;
}
.remove-btn:hover {
  color: #e24b4a;
}

/* FILE LIST (multi-upload queue) */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-list:not(:empty) {
  margin-top: 1rem;
}
.file-list .file-card {
  margin-top: 0;
}
.file-card.incompatible {
  border-color: #f3c3c3;
  background: #fef7f7;
}
.file-card.incompatible .fc-icon {
  color: #e24b4a;
}

.batch-summary {
  display: none;
  margin-top: 10px;
  font-size: 12px;
  color: #888;
  text-align: right;
}
.batch-summary.visible {
  display: block;
}

/* PROGRESS */
.progress-wrap {
  margin-top: 12px;
  display: none;
}
.progress-wrap.visible {
  display: block;
}
.progress-bar-bg {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: #7f77dd;
  border-radius: 3px;
  transition: width 0.2s;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #888;
  margin-top: 5px;
}

/* ERROR */
.error-msg {
  margin-top: 10px;
  padding: 10px 14px;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 8px;
  font-size: 13px;
  display: none;
  align-items: center;
  gap: 8px;
}
.error-msg.visible {
  display: flex;
}

/* UPLOAD BUTTON */
.btn-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 1.25rem;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  background: #7f77dd;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.15s,
    opacity 0.15s;
}
.btn-upload:hover {
  background: #6a62c9;
}
.btn-upload:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* RESULT */
.result-card {
  display: none;
}
.result-card.visible {
  display: block;
}

.result-success {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #065f46;
  background: #ecfdf5;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.result-success i {
  font-size: 18px;
  color: #059669;
}

.result-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  margin-bottom: 6px;
}

.link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
}
.link-box {
  flex: 1;
  background: #f5f5f0;
  border: 1px solid #e5e5e0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: "Courier New", monospace;
  color: #333;
  word-break: break-all;
  line-height: 1.4;
}
.copy-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  background: none;
  border: 1px solid #e5e5e0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: #333;
  transition: background 0.12s;
}
.copy-btn:hover {
  background: #f5f5f0;
}
.copy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* TIMER */
.timer-section {
  background: #f9f9f9;
  border: 1px solid #e5e5e0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 1rem;
}
.timer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.timer-label {
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}
.timer-val {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  font-family: "Courier New", monospace;
}
.timer-val.warn {
  color: #e24b4a;
}
.timer-bar-bg {
  height: 5px;
  background: #e5e5e0;
  border-radius: 3px;
  overflow: hidden;
}
.timer-bar {
  height: 100%;
  width: 100%;
  background: #7f77dd;
  border-radius: 3px;
  transition: width 1s linear;
}
.timer-bar.warn {
  background: #e24b4a;
}

/* NEW FILE BUTTON */
.btn-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: 1px solid #e5e5e0;
  border-radius: 10px;
  cursor: pointer;
  color: #555;
  transition: background 0.12s;
}
.btn-new:hover {
  background: #f5f5f0;
}

/* INFO CHIPS */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e5e0;
}
.chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #888;
}
.chip i {
  font-size: 14px;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 12px;
  color: #bbb;
}

.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1.25rem;
}
.mode-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border: 1.5px solid #e5e5e0;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  transition: all 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.mode-tab.active {
  border-color: #7f77dd;
  background: #f0effe;
  color: #7f77dd;
}
.mode-desc {
  font-size: 11px;
  font-weight: 400;
  color: #999;
}
.mode-tab.active .mode-desc {
  color: #9d97e8;
}

button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}