﻿@import url("https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;700;800&family=Outfit:wght@400;600;700&display=swap");

:root {
  --bg: radial-gradient(circle at 20% -10%, #ffd7d2 0%, #fff7d6 35%, #f3fbff 100%);
  --card: #ffffffee;
  --text: #233046;
  --text-soft: #60708d;
  --brand: #ff6f61;
  --brand-2: #ffb347;
  --mint: #26c6a6;
  --line: #d9e2f1;
  --danger: #e54b4b;
  --shadow: 0 14px 30px rgba(43, 68, 110, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "M PLUS Rounded 1c", "Yu Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  backdrop-filter: blur(8px);
  background: #ffffffc4;
  border-bottom: 1px solid #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 6px #ffd4cf77;
}

.app-shell {
  max-width: 1100px;
  margin: 18px auto 40px;
  padding: 0 16px;
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--card);
  border: 1px solid #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel.center {
  text-align: center;
  padding: 30px;
}

.panel-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  font-weight: 700;
  font-size: 0.9rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

button {
  border: none;
  border-radius: 999px;
  padding: 9px 15px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand), #ff8f57);
  color: white;
  font-weight: 700;
}

button.secondary {
  background: #ecf2ff;
  color: #3e5480;
}

button.ghost {
  background: transparent;
  color: #3e5480;
  border: 1px solid var(--line);
}

button.warn {
  background: var(--danger);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #eef2fa;
}

.link-button {
  background: transparent;
  border: none;
  color: #2f5fd5;
  padding: 0;
  border-radius: 0;
}

.muted {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  background: #eff7ff;
  color: #31558f;
}

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

.route-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.before-after-wrap {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e4ecfa;
  background: #f2f6ff;
}

.before-after-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f2f6ff;
}

.before-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.slider-row {
  max-width: 720px;
}

.slider-row input[type="range"] {
  margin-top: 10px;
}

.marker-stage {
  position: relative;
  width: 100%;
  max-width: 720px;
  border-radius: 16px;
  border: 1px solid #e4ecfa;
  background: #f2f6ff;
  overflow: hidden;
}

.marker-stage img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.marker-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.marker-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.color-pick {
  display: flex;
  gap: 6px;
  align-items: center;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #c9d4ea;
  cursor: pointer;
}

.color-dot.active {
  box-shadow: 0 0 0 2px #17263f;
}

@media (max-width: 900px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

  .app-shell {
    margin-top: 12px;
    padding: 0 10px;
  }
}
