* {
  box-sizing: border-box;
}

:root {
  color: #1e293b;
  background: #f4f7fb;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

.loading,
.login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(14, 116, 144, 0.08)),
    #eef4f8;
}

.loading {
  color: #475569;
  font-size: 16px;
  font-weight: 700;
}

.login-panel {
  display: grid;
  width: min(420px, 100%);
  gap: 20px;
  padding: 32px;
  border: 1px solid #d7e0eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 52px rgba(30, 41, 59, 0.13);
}

.eyebrow {
  margin: 0 0 6px;
  color: #536f8a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #172033;
  font-size: 28px;
  line-height: 1.15;
}

label {
  display: grid;
  gap: 8px;
  color: #3f5268;
  font-weight: 800;
}

input {
  width: 100%;
  border: 1px solid #c8d5e3;
  border-radius: 8px;
  padding: 12px 14px;
  color: #172033;
  background: #ffffff;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(37, 99, 235, 0.15);
  border-color: #2563eb;
}

.error {
  margin: -8px 0 0;
  color: #b42323;
  font-size: 14px;
  font-weight: 800;
}

.primary,
.empty-action {
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  color: #ffffff;
  background: #2563eb;
  font-weight: 800;
}

.board {
  min-height: 100vh;
  background: #f8fafc;
}

.toolbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid #dbe4ee;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.toolbar h1 {
  font-size: 22px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.pill {
  min-height: 32px;
  border: 1px solid #cbd7e4;
  border-radius: 999px;
  padding: 7px 12px;
  color: #475569;
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.pill.live {
  border-color: #b9dec9;
  color: #126b45;
  background: #effaf4;
}

.pill.warn {
  border-color: #f0cd9a;
  color: #915a13;
  background: #fff8ec;
}

.canvas {
  position: relative;
  min-height: calc(100vh - 76px);
  overflow: auto;
  background:
    linear-gradient(#e0e8f1 1px, transparent 1px),
    linear-gradient(90deg, #e0e8f1 1px, transparent 1px),
    #f8fafc;
  background-size: 32px 32px;
}

.empty-action {
  position: absolute;
  top: 110px;
  left: 50%;
  min-width: 176px;
  transform: translateX(-50%);
}

.note {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  gap: 8px;
  min-width: 190px;
  max-width: min(440px, calc(100vw - 28px));
  min-height: 132px;
  padding: 10px;
  border: 1px solid rgba(92, 107, 124, 0.28);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(30, 41, 59, 0.16);
  touch-action: none;
}

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

.note select {
  min-width: 88px;
  border: 1px solid rgba(92, 107, 124, 0.32);
  border-radius: 7px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.delete {
  border: 1px solid rgba(172, 55, 55, 0.28);
  border-radius: 7px;
  padding: 6px 9px;
  color: #9d2f2f;
  background: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 88px;
  resize: none;
  border: 1px solid rgba(92, 107, 124, 0.24);
  border-radius: 8px;
  padding: 10px;
  color: #172033;
  background: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.resize-handle {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 18px;
  height: 18px;
  border-right: 3px solid rgba(71, 85, 105, 0.5);
  border-bottom: 3px solid rgba(71, 85, 105, 0.5);
  border-radius: 2px;
  cursor: nwse-resize;
  touch-action: none;
}

.resize-handle::before {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(71, 85, 105, 0.35);
  border-bottom: 2px solid rgba(71, 85, 105, 0.35);
  content: "";
}

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

  .toolbar-actions {
    justify-content: flex-start;
  }

  .login-panel {
    padding: 24px;
  }
}
