:root {
  --bg: #fbfdfb;
  --panel: #ffffff;
  --panel-raised: #eef9f1;
  --border: #dbeade;
  --border-strong: #bcdcc4;
  --text: #142019;
  --muted: #5c7768;
  --dim: #93aa9d;
  --accent: #12e07a;
  --accent-2: #0aa863;
  --accent-soft: rgba(18, 224, 122, 0.12);
  --accent-glow: rgba(18, 224, 122, 0.35);
  --accent-ink: #0a3a22;
  --ink-deep: #071912;
  --danger: #d64545;
  --danger-soft: rgba(214, 69, 69, 0.1);
  --shadow-sm: 0 1px 2px rgba(10, 30, 20, 0.05);
  --shadow-md: 0 10px 28px -14px rgba(10, 58, 34, 0.28), 0 2px 6px -2px rgba(10, 30, 20, 0.06);
  --shadow-lg: 0 24px 60px -20px rgba(10, 58, 34, 0.32), 0 4px 12px -4px rgba(10, 30, 20, 0.08);
  --shadow-inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --radius: 6px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
}

.mono {
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

/* ---------- Fundo (estático, sem movimento) ---------- */

body {
  background-image: radial-gradient(circle at 1px 1px, rgba(10, 40, 26, 0.05) 1px, transparent 0);
  background-size: 24px 24px;
}

/* ---------- Marca (REC dot) ---------- */

.rec-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 7px;
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulseDot 2.6s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes pulseDot {
  0%, 100% {
    box-shadow: 0 0 0 0 var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(18, 224, 122, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rec-dot {
    animation: none;
  }
}

.kicker {
  display: inline-flex;
  align-items: center;
}

/* ---------- Loading ---------- */

.boot-loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  z-index: 50;
}

.boot-mark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 22px;
}

.boot-mark span {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: waveform 1.1s ease-in-out infinite;
}

.boot-mark span:nth-child(1) { height: 40%; animation-delay: 0s; }
.boot-mark span:nth-child(2) { height: 100%; animation-delay: 0.12s; }
.boot-mark span:nth-child(3) { height: 65%; animation-delay: 0.24s; }
.boot-mark span:nth-child(4) { height: 85%; animation-delay: 0.36s; }

@keyframes waveform {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .boot-mark span {
    animation: none;
    transform: scaleY(0.7);
  }
}

.boot-loading .boot-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- Login ---------- */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-wrap {
  width: 100%;
  max-width: 380px;
  animation: riseIn 0.5s var(--ease-out) both;
}

.brand {
  text-align: center;
  margin-bottom: 40px;
}

.brand .kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand h1 {
  margin-top: 10px;
  font-size: 24px;
}

.login-card {
  position: relative;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 32px 26px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.login-card::before,
.login-card::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--accent);
  opacity: 0.55;
  pointer-events: none;
}

.login-card::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.login-card::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--panel-raised);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: calc(var(--radius) - 2px);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
textarea:focus,
.idea-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.error-box {
  border: 1px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  padding: 8px 12px;
  margin-bottom: 16px;
  border-radius: calc(var(--radius) - 2px);
  animation: riseIn 0.25s var(--ease-out) both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: calc(var(--radius) - 2px);
  transition: opacity 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-accent {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm), 0 0 0 0 var(--accent-glow);
}

.btn-accent::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.btn-accent:hover:not(:disabled)::after {
  left: 130%;
}

.btn-accent:hover:not(:disabled) {
  box-shadow: var(--shadow-sm), 0 0 20px 0 var(--accent-glow);
}

@media (prefers-reduced-motion: reduce) {
  .btn-accent::after {
    display: none;
  }
}

.btn-block {
  width: 100%;
}

/* ---------- App shell ---------- */

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  display: none;
  width: 240px;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--panel-raised);
}

.sidebar-brand {
  padding: 28px 24px;
}

.sidebar-brand .kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-brand h1 {
  margin-top: 6px;
  font-size: 18px;
}

.sidebar-nav {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.nav-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 40px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px 0 var(--accent-glow);
  opacity: 0;
  transition: transform 0.4s var(--ease-out), height 0.4s var(--ease-out), opacity 0.3s ease;
  will-change: transform;
}

.nav-indicator.ready {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .nav-indicator {
    transition: opacity 0.2s ease;
  }
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  border-radius: calc(var(--radius) - 1px);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nav-link .code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: transparent;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(10, 58, 34, 0.04);
  transform: translateX(2px);
}

.nav-link.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

.nav-link.active .code {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.sidebar-footer {
  padding: 12px;
  padding-bottom: 24px;
}

.logout-btn {
  width: 100%;
  border: none;
  border-left: 2px solid transparent;
  background: none;
  text-align: left;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.logout-btn:hover {
  border-left-color: var(--border-strong);
  color: var(--muted);
}

/* Mobile top bar */

.topbar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(238, 249, 241, 0.92);
  box-shadow: 0 8px 20px -14px rgba(7, 25, 18, 0.25);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.topbar-row h1 {
  font-size: 15px;
}

.topbar-row .kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 12px 8px;
}

.topbar-nav .nav-link {
  flex-shrink: 0;
  white-space: nowrap;
  border-left: none;
  border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
  border-bottom: 2px solid transparent;
}

.topbar-nav .nav-link.active {
  background: none;
  box-shadow: none;
  border-bottom-color: var(--accent);
}

@media (min-width: 768px) {
  .sidebar {
    display: flex;
  }
  .topbar {
    display: none;
  }
}

.main {
  position: relative;
  flex: 1;
  padding: 24px 16px;
  box-shadow: inset 10px 0 16px -16px rgba(7, 25, 18, 0.1);
}

.main-inner {
  max-width: 760px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .main {
    padding: 40px;
  }
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: viewIn 0.4s var(--ease-out) both;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .view.active,
  .login-wrap,
  .error-box {
    animation: none;
  }
}

.view-header {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.view-index {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent-ink);
  opacity: 0;
  animation: riseIn 0.4s var(--ease-out) 0.05s both;
}

.view-index::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--accent);
}

.view-header h2 {
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
  font-size: 26px;
}

.view-header h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 60%, transparent);
  border-radius: 2px;
  animation: drawLine 0.55s var(--ease-out) 0.15s both;
}

@keyframes drawLine {
  from { width: 0; opacity: 0; }
  to { width: 28px; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .view-index,
  .view-header h2::after {
    animation: none;
    opacity: 1;
  }
}

.view-header p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Idea boards ---------- */

.add-form {
  display: flex;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--panel-raised);
  padding: 8px;
  margin-bottom: 28px;
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.add-form:focus-within {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.idea-input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text);
  font-size: 14px;
  padding: 6px 8px;
  font-family: var(--font-sans);
}

.empty-note {
  border: 1px dashed var(--border-strong);
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--dim);
  border-radius: var(--radius);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 8px;
}

.idea-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.idea-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 10px 12px 10px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: rowIn 0.3s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 28ms);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.idea-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 0 2px 2px 0;
  transition: width 0.2s var(--ease-out);
}

.idea-row:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px) translateX(1px);
}

.idea-row:hover::before {
  width: 3px;
}

@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .idea-row {
    animation: none;
  }
}

.check-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  background: none;
  color: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: 5px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, transform 0.2s var(--ease-spring);
}

.check-icon {
  width: 11px;
  height: 11px;
  overflow: visible;
}

.check-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  transition: stroke-dashoffset 0.25s var(--ease-out) 0.05s;
}

.check-btn:hover {
  border-color: var(--accent);
}

.check-btn.checked {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: 0 0 8px 0 var(--accent-glow);
  animation: checkPop 0.32s var(--ease-spring);
}

.check-btn.checked .check-icon path {
  stroke-dashoffset: 0;
}

@keyframes checkPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .check-btn.checked {
    animation: none;
  }
}

.idea-text {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
  transition: color 0.3s ease;
}

.idea-text.done {
  color: var(--dim);
  text-decoration: line-through;
}

.remove-btn {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.remove-btn:hover {
  color: var(--danger);
  transform: scale(1.15);
}

/* ---------- Cronograma ---------- */

.week-grid {
  position: relative;
  border: 1px solid var(--border);
  background: var(--panel);
  margin-bottom: 40px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.week-grid::before,
.week-grid::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--accent);
  opacity: 0.45;
  pointer-events: none;
  z-index: 1;
}

.week-grid::before {
  top: 3px;
  left: 3px;
  border-right: none;
  border-bottom: none;
}

.week-grid::after {
  bottom: 3px;
  right: 3px;
  border-left: none;
  border-top: none;
}

.week-grid-head {
  display: none;
  grid-template-columns: 100px 1fr 1fr;
}

.week-grid-head > div {
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  border-left: 1px solid var(--border);
}

.week-grid-head > div:first-child {
  border-left: none;
}

.week-row {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--border);
}

.week-row:first-of-type {
  border-top: none;
}

.week-day {
  padding: 12px 16px 4px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-ink);
}

.week-slot {
  padding: 8px 16px 12px;
  font-size: 14px;
  border-top: 1px solid var(--border);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.week-slot[contenteditable="true"] {
  cursor: text;
}

.week-slot[contenteditable="true"]:hover {
  background: var(--panel-raised);
}

.week-slot[contenteditable="true"]:focus {
  outline: none;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.slot-time {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 4px;
}

@media (min-width: 768px) {
  .week-grid-head {
    display: grid;
  }
  .week-row {
    grid-template-columns: 100px 1fr 1fr;
  }
  .week-day {
    display: flex;
    align-items: center;
    padding: 14px 16px;
  }
  .week-slot {
    padding: 14px 16px;
    border-top: none;
    border-left: 1px solid var(--border);
  }
  .slot-time {
    display: none;
  }
}

/* ---------- Tarefas da semana ---------- */

.tasks-panel {
  position: relative;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.tasks-panel::before,
.tasks-panel::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--accent);
  opacity: 0.4;
  pointer-events: none;
}

.tasks-panel::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.tasks-panel::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.tasks-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.tasks-head h2 {
  font-size: 17px;
}

.tasks-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.tasks-body {
  padding: 20px;
}

.progress-wrap {
  margin-top: 24px;
}

.progress-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-label .pct {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--accent-ink);
}

.progress-label .count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--dim);
}

.progress-track {
  height: 10px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: 999px;
}

.progress-fill {
  position: relative;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 10px 0 var(--accent-glow);
  transition: width 0.4s var(--ease-out);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.45) 45%,
    transparent 60%
  );
  background-size: 200% 100%;
  animation: sheen 2.8s ease-in-out infinite;
}

@keyframes sheen {
  0% { background-position: 140% 0; }
  100% { background-position: -40% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill::after {
    animation: none;
  }
}

/* ---------- Notas (post-its) ---------- */

.notes-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
  padding-top: 4px;
}

.note-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease;
  animation: riseIn 0.3s var(--ease-out) both;
}

.note-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, transparent 50%, rgba(10, 30, 20, 0.08) 50%);
  border-radius: 0 var(--radius) 0 0;
}

.note-card.tone-0 {
  background: var(--panel);
}

.note-card.tone-1 {
  background: var(--panel-raised);
}

.note-card.tone-2 {
  background: rgba(18, 224, 122, 0.07);
}

.note-card.tilt-0 { transform: rotate(-1.1deg); }
.note-card.tilt-1 { transform: rotate(0.9deg); }
.note-card.tilt-2 { transform: rotate(-0.5deg); }
.note-card.tilt-3 { transform: rotate(1.4deg); }

.note-card:hover,
.note-card:focus-within {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: var(--shadow-md);
  z-index: 1;
}

.note-content {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: none;
  background: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  padding: 4px 20px 4px 2px;
}

.note-content:focus {
  outline: none;
}

.note-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: none;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.note-remove:hover {
  color: var(--danger);
  transform: scale(1.15);
}

@media (prefers-reduced-motion: reduce) {
  .note-card {
    animation: none;
  }
}
