:root {
  color-scheme: light;
  --background: #f5f7fb;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #5b6477;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--text);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

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

.logo {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 64px;
}

.header h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}

.header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.2;
}

.main {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.board-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
}

.board-section h2 {
  margin-top: 0;
}

.pad-button:focus-visible,
.upload-dropzone:focus-visible,
.upload-actions button:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.45);
  outline-offset: 2px;
}

.status {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
}

.status[data-kind="error"] {
  background: #fee2e2;
  color: #7f1d1d;
}

.status[data-kind="success"] {
  background: #dcfce7;
  color: #166534;
}

.status[data-kind="info"] {
  background: #e0f2fe;
  color: #0c4a6e;
}

.board-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 8px;
  padding-right: 48px;
}

.board-header h2 {
  margin: 0;
}

.hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.hint-tooltip {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.hint-button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.hint-button:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.45);
  outline-offset: 2px;
}

.hint-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.85rem;
  line-height: 1.3;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.hint-tooltip:hover .hint-popover,
.hint-tooltip:focus-within .hint-popover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 900px) {
  .hint-tooltip {
    display: none;
  }
}

.board {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
  gap: 16px;
  justify-content: start;
}

.pad-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8fafc;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  max-width: 240px;
}

.pad-card.draggable {
  cursor: grab;
}

.pad-card.is-dragging {
  opacity: 0.6;
  cursor: grabbing;
}

.pad-card.is-drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.pad-button {
  min-height: 120px;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
  touch-action: manipulation;
}

.pad-button:active {
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}


.upload-card {
  border-style: dashed;
  background: #f8fafc;
}

.upload-dropzone {
  min-height: 120px;
  border: 2px dashed #cbd5f5;
  border-radius: 12px;
  background: #eef2ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-weight: 600;
  color: #312e81;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  width: 100%;
}

.upload-dropzone.is-dragging {
  border-color: var(--primary);
  background: #e0e7ff;
}

.upload-subtitle {
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #4c51bf;
}

.upload-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.upload-file {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.upload-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text);
  width: 100%;
}

.upload-field input[type="text"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
  width: 100%;
}

.upload-field input[type="color"] {
  height: 42px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  padding: 2px;
  overflow: hidden;
}

.upload-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.upload-field input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 10px;
}

.upload-field input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 10px;
}

.upload-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

.upload-actions button {
  flex: 1 1 120px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.upload-actions button.secondary {
  background: #e2e8f0;
  color: #1e293b;
}

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

@media (max-width: 600px) {
  .brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .hint-tooltip {
    top: 16px;
    right: 16px;
  }

  .hint-popover {
    left: 0;
    right: auto;
  }
}

@media (max-width: 720px) {
  .board {
    grid-template-columns: repeat(2, minmax(170px, 240px));
  }
}

@media (max-width: 420px) {
  .board {
    grid-template-columns: minmax(200px, 240px);
  }
}
