:root {
  --bg: #f5f5f5;
  --panel: rgba(255, 255, 255, 0.92);
  --text: #2a2321;
  --text-soft: #5a4e49;
  --primary-700: #88373c;
  --primary-800: #7b3338;
  --border: rgba(97, 80, 73, 0.2);
  --shadow-soft: 0 18px 45px rgba(93, 68, 60, 0.12);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at top, #f7f4ef 0%, #f5f5f5 45%);
  color: var(--text);
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  padding: 0.65rem 1.25rem;
  background: var(--primary-700);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand-wordmark {
  color: #fff;
  font-size: 1.12rem;
  font-family: "Avenir Next", "Avenir", "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.header-note {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
}

.models-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem;
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

.panel-title-row h2 {
  margin: 0 0 0.4rem;
  color: var(--primary-700);
}

.hint {
  color: var(--text-soft);
  margin-top: 0;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
}

input[type="text"],
input[type="file"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: #fff;
}

.accent-btn {
  border: 0;
  border-radius: 10px;
  padding: 0.62rem 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary-700);
  cursor: pointer;
  width: fit-content;
}

.accent-btn:hover:not(:disabled) {
  background: var(--primary-800);
}

.accent-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  margin: 0.7rem 0 0;
  font-size: 0.95rem;
}

.status.ok { color: #1b7f4a; }
.status.error { color: #b42318; }
.status.info { color: #7a4f18; }

.progress {
  margin-top: 0.8rem;
  height: 10px;
  background: rgba(136, 55, 60, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 35%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #88373c, #b5656b);
  animation: loadingSlide 1.2s ease-in-out infinite;
}

@keyframes loadingSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 0.8rem;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

.log-table th,
.log-table td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(97, 80, 73, 0.16);
  vertical-align: top;
}

.log-table thead th {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-soft);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.floating-info-overlay-btn {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px 0 0 0;
  background: rgba(136, 55, 60, 0.92);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.floating-info-overlay-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(42, 35, 33, 0.25);
  backdrop-filter: blur(1px);
}

.guide-overlay-hint {
  position: absolute;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.guide-bubble {
  position: absolute;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(97, 80, 73, 0.18);
  border-radius: 14px;
  padding: 0.7rem 0.8rem;
  box-shadow: var(--shadow-soft);
  width: 280px;
}

.guide-bubble strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.83rem;
  color: var(--primary-700);
}

.guide-bubble p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.35;
}

.guide-bubble--left {
  left: clamp(
    16px,
    calc(50% - var(--guide-offset, 56px) - 280px),
    calc(100vw - 296px)
  );
}

.guide-bubble--right {
  left: clamp(
    16px,
    calc(50% + var(--guide-offset, 56px)),
    calc(100vw - 296px)
  );
}
