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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(191, 220, 255, 0.28), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 201, 220, 0.22), transparent 24%),
    linear-gradient(180deg, #f9fbff 0%, #f5f7fc 100%);
  color: var(--text);
}

body.has-open-modal,
body.has-expanded-card {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    border-color var(--transition),
    opacity var(--transition);
}

button:active {
  transform: translateY(1px);
}

a {
  color: inherit;
  text-decoration: none;
}

.footer {
  display: grid;
  grid-auto-flow: column;
}

textarea {
  resize: vertical;
}

input,
select,
textarea {
  width: 100%;
  min-height: clamp(44px, 2.2vw, 58px);
  border: 1px solid var(--border);
  background: #fff;
  border-radius: clamp(14px, 1vw, 18px);
  padding: clamp(12px, 0.75vw, 18px) clamp(14px, 1vw, 20px);
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  box-shadow: var(--focus);
  border-color: #9fbfff;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #8b98ab;
}

.muted {
  color: var(--muted);
}

.mini-heading {
  margin: 0 0 clamp(10px, 0.8vw, 16px);
  font-size: clamp(0.88rem, 0.42vw + 0.78rem, 1.12rem);
  line-height: 1.2;
  font-weight: 700;
}

.btn {
  border: 0;
  border-radius: 999px;
  background: #cfe1ff;
  color: #17365d;
  padding: clamp(10px, 0.65vw, 16px) clamp(16px, 1vw, 24px);
  min-height: clamp(40px, 2.1vw, 54px);
  font-size: clamp(0.9rem, 0.35vw + 0.82rem, 1.08rem);
  font-weight: 700;
  line-height: 1.1;
  box-shadow: var(--shadow);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-soft {
  background: #eef4ff;
  color: #29496f;
}

.btn-soft:hover {
  background: #e5efff;
}

.btn-mini {
  padding: clamp(7px, 0.5vw, 11px) clamp(11px, 0.75vw, 16px);
  min-height: clamp(34px, 1.75vw, 44px);
  font-size: clamp(0.78rem, 0.25vw + 0.72rem, 0.96rem);
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #27415f;
  box-shadow: 0 4px 12px rgba(34, 55, 94, 0.06);
}

.btn-mini:hover {
  transform: translateY(-1px);
}

.icon-btn {
  width: clamp(38px, 2vw, 52px);
  height: clamp(38px, 2vw, 52px);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  display: inline-grid;
  place-items: center;
  font-size: clamp(1rem, 0.45vw + 0.9rem, 1.35rem);
  line-height: 1;
  box-shadow: 0 4px 12px rgba(34, 55, 94, 0.06);
}

.icon-btn:hover {
  transform: translateY(-1px);
}

.empty-state,
.loading-state {
  padding: clamp(16px, 1vw, 24px);
  border-radius: clamp(16px, 1vw, 22px);
  background: rgba(255,255,255,0.68);
  border: 1px dashed rgba(157, 176, 208, 0.8);
  color: var(--muted);
  font-size: clamp(0.9rem, 0.25vw + 0.84rem, 1.02rem);
}

.save-pill {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 5000;
  background: #dff6df;
  color: #1e4d1e;
  border: 1px solid #bde8bd;
  border-radius: 999px;
  padding: clamp(10px, 0.65vw, 16px) clamp(14px, 0.9vw, 20px);
  box-shadow: 0 12px 30px rgba(34, 55, 94, 0.14);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  max-width: min(92vw, 520px);
  font-size: clamp(0.88rem, 0.22vw + 0.84rem, 1rem);
  font-weight: 700;
}

.save-pill.error {
  background: #ffe0e0;
  color: #7a1f1f;
  border-color: #ffc3c3;
}

.save-pill.show {
  opacity: 1;
  transform: translateY(0);
}

hr.soft-sep {
  border: none;
  border-top: 1px solid rgba(219, 227, 239, 0.9);
  margin: clamp(8px, 0.6vw, 14px) 0;
}

.whiteboard-control {
  display: inline-flex;
  align-items: center;
  padding: 0 clamp(10px, 0.7vw, 14px);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  font-size: clamp(0.8rem, 0.22vw + 0.76rem, 0.95rem);
  font-weight: 600;
  color: var(--text-color, #243b53);
}

.whiteboard-control span {
  white-space: nowrap;
  padding: clamp(6px, 0.45vw, 10px);
}

.whiteboard-control input[type="color"] {
  width: clamp(34px, 1.8vw, 42px);
  height: clamp(34px, 1.8vw, 42px);
  border: 0;
  padding: 5px;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
}

.whiteboard-color-group {
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.6vw, 12px);
  flex-wrap: wrap;
}

.whiteboard-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.whiteboard-swatch {
  width: clamp(28px, 1.45vw, 34px);
  height: clamp(28px, 1.45vw, 34px);
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.18);
  background: var(--swatch, #000);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.whiteboard-swatch:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14);
}

.whiteboard-swatch.is-active {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.35);
}

.whiteboard-swatch[data-color="#ffffff"] {
  border-color: rgba(15, 23, 42, 0.35);
}

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

.whiteboard-control input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.whiteboard-control input[type="range"] {
  width: clamp(92px, 6vw, 132px);
  cursor: pointer;
}

.whiteboard-control--size strong {
  min-width: 18px;
  text-align: center;
  font-size: clamp(0.75rem, 0.18vw + 0.72rem, 0.88rem);
}

.shared-whiteboard__toolbar,
.whiteboard-toolbar {
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.6vw, 12px);
  flex-wrap: wrap;
}

/* 4K polish */
@media (min-width: 2200px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(191, 220, 255, 0.32), transparent 30%),
      radial-gradient(circle at top right, rgba(255, 201, 220, 0.24), transparent 26%),
      linear-gradient(180deg, #f9fbff 0%, #f4f7fd 100%);
  }

  .save-pill {
    top: 22px;
    right: 22px;
  }
}

/* Tablet */
@media (max-width: 900px) {
  html {
    font-size: 16px;
  }

  .btn {
    min-height: 42px;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .save-pill {
    top: auto;
    bottom: 14px;
    right: 10px;
    left: 10px;
    max-width: none;
    text-align: center;
  }

  input,
  select,
  textarea {
    min-height: 42px;
    padding: 11px 12px;
  }

  .btn {
    width: auto;
    min-height: 40px;
    padding: 10px 14px;
  }

  .btn-mini {
    min-height: 34px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }
  
  
}


@media (min-width: 1000px) {
.btn {
    min-height: 0;
    font-size: 12px;
    font-weight: 700;
}

.whiteboard-swatch {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.18);
  background: var(--swatch, #000);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.whiteboard-control span {
    white-space: nowrap;
    padding: 0;
}

input, select, textarea {
    width: 100%;
    min-height: 0;
	height: 20px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: clamp(14px, 1vw, 18px);
    padding: clamp(12px, 0.75vw, 18px) clamp(14px, 1vw, 20px);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

}