:root {
  --bg: #e0e5ec;
  --bg-soft: #e6ebf3;
  --shadow-dark: #a3b1c6;
  --shadow-light: #ffffff;
  --text-main: #2d3748;
  --text-sub: #718096;
  --accent: #4f46e5;
  --radius-window: 26px;
  --radius-panel: 20px;
}

/* Base */

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

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #f5f7fb 0, #e0e5ec 55%, #d1d9e6 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Helvetica Neue", sans-serif;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.app-shell {
  width: 100%;
  max-width: 1120px;
}

/* Neumorphism window */

.window {
  border-radius: var(--radius-window);
  background: var(--bg);
  box-shadow:
    18px 18px 35px var(--shadow-dark),
    -18px -18px 35px var(--shadow-light);
  overflow: hidden;
  animation: pop 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes pop {
  0% { transform: scale(0.96) translateY(8px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Titlebar */

.titlebar {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 2px 2px 4px rgba(163, 177, 198, 0.4),
    inset -2px -2px 4px rgba(255, 255, 255, 0.9);
  background: linear-gradient(145deg, #e6ebf3, #d1d9e6);
}

.traffic {
  display: flex;
  gap: 6px;
  margin-right: 10px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow:
    1px 1px 2px rgba(163, 177, 198, 0.7),
    -1px -1px 2px rgba(255, 255, 255, 0.9);
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.title {
  font-size: 13px;
  color: var(--text-sub);
}

.title-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chip {
  border-radius: 999px;
  border: none;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  background: var(--bg);
  color: var(--text-sub);
  box-shadow:
    3px 3px 6px var(--shadow-dark),
    -3px -3px 6px var(--shadow-light);
}

/* Layout */

.content {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

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

/* Panels */

.panel {
  border-radius: var(--radius-panel);
  background: var(--bg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow:
    12px 12px 24px var(--shadow-dark),
    -12px -12px 24px var(--shadow-light);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
}

.panel-sub {
  font-size: 11px;
  color: var(--text-sub);
}

/* Fields */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: var(--text-sub);
}

.input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Inputs */

.input-color {
  width: 48px;
  height: 38px;
  border-radius: 14px;
  border: none;
  padding: 0;
  background: var(--bg);
  cursor: pointer;
  box-shadow:
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
}

.input-hex {
  flex: 1;
  border-radius: 999px;
  border: none;
  padding: 9px 14px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  background: var(--bg-soft);
  color: var(--text-main);
  box-shadow:
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
}

.input-hex:focus {
  outline: none;
  box-shadow:
    inset 1px 1px 2px var(--shadow-dark),
    inset -1px -1px 2px var(--shadow-light),
    0 0 0 1px rgba(79, 70, 229, 0.4);
}

/* Buttons */

.btn {
  border-radius: 999px;
  border: none;
  font-size: 13px;
  padding: 9px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.btn.primary {
  background: linear-gradient(145deg, #4f46e5, #6366f1);
  color: #f9fafb;
  box-shadow:
    6px 6px 12px rgba(79, 70, 229, 0.45),
    -4px -4px 10px rgba(255, 255, 255, 0.9);
}

.btn.ghost {
  background: var(--bg);
  color: var(--text-sub);
  box-shadow:
    4px 4px 8px var(--shadow-dark),
    -4px -4px 8px var(--shadow-light);
}

.btn.full {
  width: 100%;
}

.btn.small {
  padding: 6px 12px;
  font-size: 11px;
}

/* Preview */

.preview-main {
  display: flex;
  gap: 12px;
  align-items: center;
}

.preview-swatch {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: #4f46e5;
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-hex {
  font-size: 18px;
  font-weight: 600;
}

.preview-hsl {
  font-size: 12px;
  color: var(--text-sub);
}

.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 10px;
  color: var(--text-sub);
  background: var(--bg);
  box-shadow:
    3px 3px 6px var(--shadow-dark),
    -3px -3px 6px var(--shadow-light);
}

/* Schemes */

.schemes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.scheme-block {
  border-radius: 16px;
  background: var(--bg);
  padding: 10px;
  box-shadow:
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scheme-title {
  font-size: 13px;
  font-weight: 600;
}

.scheme-sub {
  font-size: 11px;
  color: var(--text-sub);
}

.swatch-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 6px;
}

/* Swatch */

.swatch {
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-soft);
  cursor: pointer;
  box-shadow:
    4px 4px 8px var(--shadow-dark),
    -4px -4px 8px var(--shadow-light);
  transition: transform 0.14s ease-out, box-shadow 0.14s ease-out;
}

.swatch:hover {
  transform: translateY(-3px);
  box-shadow:
    6px 6px 12px var(--shadow-dark),
    -6px -6px 12px var(--shadow-light);
}

.swatch-color {
  height: 46px;
}

.swatch-meta {
  padding: 5px 7px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.swatch-hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.swatch-label {
  color: var(--text-sub);
}

/* Advice */

.advice-box {
  border-radius: 16px;
  background: var(--bg-soft);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.6;
  white-space: pre-wrap;
  box-shadow:
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
}

/* Code */

.code-block {
  border-radius: 16px;
  background: #1a202c;
  color: #e2e8f0;
  padding: 10px 12px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  max-height: 220px;
  overflow: auto;
  box-shadow:
    inset 2px 2px 4px rgba(0, 0, 0, 0.6),
    inset -2px -2px 4px rgba(255, 255, 255, 0.1);
}

.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* Footer */

.footer {
  padding: 10px 18px 14px;
  font-size: 11px;
  color: var(--text-sub);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(113, 128, 150, 0.7);
}

/* Responsive */

@media (max-width: 720px) {
  .content {
    padding: 14px;
  }
  .panel {
    padding: 14px;
  }
  .window {
    border-radius: 22px;
  }
  .footer {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }
}
