:root {
  color: #272b2a;
  background: #f3eee4;
  font-family: "DM Sans", "Noto Sans JP", sans-serif;
  font-synthesis: none;
  --ink: #25312e;
  --muted: #7d827f;
  --green: #275c4c;
  --paper: #fbfaf7;
  --note-width: 224px;
  --note-height: 194px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(255,255,255,.9), transparent 30%),
    #f3eee4;
}

button, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.app-shell {
  width: min(100% - 64px, 1480px);
  margin: 0 auto;
  padding: 34px 0 24px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 12px;
  height: 42px;
  border-radius: 999px;
  background: #e4a94f;
  box-shadow: inset 0 -12px 0 #d77e56;
}
.eyebrow { margin: 0 0 3px; color: #9a8e7a; font-size: 10px; font-weight: 700; letter-spacing: .18em; }
h1 { margin: 0; color: var(--ink); font-size: clamp(24px, 3vw, 34px); line-height: 1; letter-spacing: -.04em; }

.search-box {
  display: flex;
  align-items: center;
  width: min(30vw, 340px);
  min-width: 210px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(39,49,46,.11);
  border-radius: 14px;
  background: rgba(255,255,255,.57);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.search-box:focus-within { border-color: rgba(39,92,76,.45); background: rgba(255,255,255,.8); box-shadow: 0 0 0 3px rgba(39,92,76,.08); }
.search-box svg { flex: 0 0 auto; width: 18px; margin-right: 9px; fill: none; stroke: #79827d; stroke-width: 1.8; stroke-linecap: round; }
.search-box input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.search-box input::placeholder { color: #989c98; }
.search-box input::-webkit-search-cancel-button { cursor: pointer; }

.header-actions { display: flex; align-items: center; gap: 18px; }
.note-count { flex: 0 0 auto; min-width: 70px; margin-left: 10px; padding-left: 12px; border-left: 1px solid rgba(39,49,46,.11); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; white-space: nowrap; }
.new-note-colors {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(39,49,46,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.5);
}
.new-color,
.note-color-menu button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid rgba(255,255,255,.78);
  border-radius: 50%;
  background: var(--choice-color);
  box-shadow: 0 1px 3px rgba(40,45,42,.18);
  cursor: pointer;
}
[data-color="yellow"] { --choice-color: #f6df85; }
[data-color="pink"] { --choice-color: #f3b8a7; }
[data-color="blue"] { --choice-color: #bcd6ee; }
[data-color="green"] { --choice-color: #b9ddca; }
.new-color { opacity: .72; transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease; }
.new-color:hover { opacity: 1; transform: scale(1.08); }
.new-color.is-selected { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--green); }
.add-button {
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(39,92,76,.2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.add-button:hover { background: #1d4d40; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(39,92,76,.25); }
.add-button:active { transform: translateY(1px); }
.add-button span:first-child { font-size: 22px; font-weight: 400; line-height: 1; }

.project-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -6px 0 14px;
  padding: 9px 12px 9px 16px;
  border: 1px solid rgba(39,49,46,.09);
  border-radius: 15px;
  background: rgba(255,255,255,.46);
}
.project-selector { display: flex; align-items: center; min-width: 0; gap: 11px; }
.project-label { color: #9a8e7a; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.project-selector select { max-width: min(320px, 42vw); min-height: 36px; padding: 0 34px 0 12px; border: 1px solid rgba(39,49,46,.12); border-radius: 9px; outline: 0; color: var(--ink); background: rgba(255,255,255,.72); font-size: 13px; font-weight: 600; cursor: pointer; }
.project-selector select:focus { border-color: rgba(39,92,76,.5); box-shadow: 0 0 0 3px rgba(39,92,76,.08); }
.project-actions { display: flex; align-items: center; gap: 4px; }
.project-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 0 10px; border: 0; border-radius: 9px; color: #607069; background: transparent; font-size: 11px; font-weight: 600; cursor: pointer; }
.project-actions button:hover { color: var(--ink); background: rgba(255,255,255,.75); }
.project-actions button:disabled { opacity: .3; cursor: not-allowed; background: transparent; }
.project-actions svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.project-actions .danger-action:not(:disabled):hover { color: #934b42; background: rgba(183,79,67,.08); }

.status-filters {
  display: flex;
  width: fit-content;
  gap: 4px;
  margin: -8px auto 16px;
  padding: 4px;
  border: 1px solid rgba(39,49,46,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.48);
}

.project-dialog { width: min(calc(100% - 32px), 420px); padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: #fbfaf7; box-shadow: 0 24px 70px rgba(35,43,39,.28); }
.project-dialog::backdrop { background: rgba(30,39,35,.38); backdrop-filter: blur(3px); }
.project-dialog form { padding: 28px; }
.dialog-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 17px; border-radius: 13px; color: #fff; background: var(--green); font-size: 20px; }
.dialog-icon.warning { background: #b15c50; }
.project-dialog h2 { margin: 0 0 7px; font-size: 21px; letter-spacing: -.02em; }
.project-dialog p { margin: 0 0 22px; color: #7c827e; font-size: 13px; line-height: 1.7; }
.project-dialog p strong { color: var(--ink); }
.project-dialog label span { display: block; margin-bottom: 7px; color: #66706b; font-size: 11px; font-weight: 700; }
.project-dialog input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid rgba(39,49,46,.16); border-radius: 11px; outline: 0; background: #fff; font-size: 15px; }
.project-dialog input:focus { border-color: rgba(39,92,76,.55); box-shadow: 0 0 0 3px rgba(39,92,76,.09); }
.project-dialog .form-error { min-height: 21px; margin: 6px 0 2px; color: #a34f45; font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog-actions button { min-height: 42px; padding: 0 17px; border: 0; border-radius: 10px; font-weight: 600; cursor: pointer; }
.dialog-cancel { color: #69716d; background: #ecece8; }
.dialog-submit { color: #fff; background: var(--green); }
.dialog-submit.danger { background: #a85147; }
.status-filter { min-width: 76px; min-height: 34px; padding: 0 14px; border: 0; border-radius: 9px; color: #747d78; background: transparent; font-size: 12px; font-weight: 600; cursor: pointer; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.status-filter:hover { color: var(--ink); }
.status-filter.is-active { color: #fff; background: var(--green); box-shadow: 0 4px 10px rgba(39,92,76,.18); }

.board-wrap {
  padding: 9px;
  border: 1px solid rgba(55,62,58,.1);
  border-radius: 25px;
  background: rgba(255,255,255,.35);
  box-shadow: 0 20px 50px rgba(73,64,48,.08);
}
.board {
  position: relative;
  width: 100%;
  min-height: clamp(560px, calc(100vh - 190px), 820px);
  overflow: hidden;
  border-radius: 18px;
  background-color: #dce3dc;
  background-image: radial-gradient(rgba(50,70,60,.13) 1px, transparent 1px);
  background-size: 22px 22px;
  box-shadow: inset 0 0 55px rgba(37,49,46,.06);
  touch-action: none;
}

.done-zone {
  position: absolute;
  z-index: 0;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 290px;
  height: 170px;
  border: 2px dashed rgba(39,92,76,.25);
  border-radius: 20px;
  color: #66756e;
  background: rgba(250,252,249,.34);
  text-align: left;
  pointer-events: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.done-zone.is-over { border-color: #398166; background: rgba(225,242,232,.82); box-shadow: 0 0 0 7px rgba(57,129,102,.1); transform: scale(1.02); }
.done-zone-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-right: 12px; border-radius: 50%; color: #fff; background: #5e9a7d; font-size: 21px; font-weight: 700; }
.done-zone p { margin: 0 0 4px; color: #405c50; font-size: 15px; font-weight: 700; }
.done-zone span { font-size: 11px; }

.empty-state,
.no-results {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  color: #77857d;
  pointer-events: none;
  text-align: center;
}
.empty-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 14px; border: 1px solid rgba(66,91,77,.18); border-radius: 18px; color: #d29344; background: rgba(255,255,255,.45); font-size: 23px; }
.empty-state p,
.no-results p { margin: 0 0 7px; color: #59675f; font-size: 16px; font-weight: 600; }
.empty-state span,
.no-results span { font-size: 12px; }
.empty-state[hidden],
.no-results[hidden],
.sticky-note[hidden] { display: none; }

.sticky-note {
  position: absolute;
  z-index: 1;
  width: var(--note-width);
  height: var(--note-height);
  padding: 10px 14px 16px;
  border: 1px solid rgba(61,55,37,.07);
  border-radius: 5px 5px 12px 5px;
  background:
    linear-gradient(115deg, rgba(255,255,255,.18), transparent 42%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, rgba(67,58,31,.018) 1px 2px),
    var(--note-color, #f6df85);
  box-shadow:
    1px 2px 2px rgba(44,47,38,.08),
    5px 10px 17px rgba(44,47,38,.16),
    12px 20px 28px rgba(44,47,38,.08),
    inset 0 1px 0 rgba(255,255,255,.32),
    inset 0 -3px 0 rgba(107,85,26,.05);
  transform: rotate(var(--rotation, 0deg));
  transform-origin: 50% 8%;
  transition: box-shadow .2s ease, transform .2s ease;
  animation: note-in .23s ease-out both;
}
.sticky-note::before {
  content: "";
  position: absolute;
  inset: 5px 9px auto;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  filter: blur(4px);
  pointer-events: none;
}
.sticky-note::after { content: ""; position: absolute; right: 0; bottom: 0; border-style: solid; border-width: 0 0 18px 18px; border-color: transparent transparent rgba(90,80,50,.14) transparent; filter: drop-shadow(-2px -2px 2px rgba(255,255,255,.16)); }
.sticky-note.dragging { z-index: 20; box-shadow: 2px 4px 5px rgba(44,47,38,.1), 10px 24px 38px rgba(44,47,38,.24); transform: rotate(0) scale(1.025); transition: box-shadow .2s ease, transform .2s ease; }
.sticky-note.arranging { transition: left .26s ease, top .26s ease, box-shadow .2s ease, transform .2s ease; }
@keyframes note-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }

.note-toolbar { position: relative; height: 27px; display: flex; align-items: center; justify-content: space-between; cursor: grab; touch-action: none; user-select: none; }
.drag-handle { color: rgba(40,48,43,.33); font-size: 17px; line-height: 1; letter-spacing: 2px; }
.note-actions { display: flex; align-items: center; gap: 1px; }
.complete-button { display: grid; place-items: center; width: 34px; height: 34px; margin-top: -5px; padding: 0; border: 0; border-radius: 50%; color: rgba(42,48,44,.45); background: transparent; cursor: pointer; }
.complete-button:hover, .complete-button:focus-visible { color: #275c4c; background: rgba(255,255,255,.4); }
.complete-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.complete-button.is-active { color: #fff; background: #4f8c70; box-shadow: 0 3px 8px rgba(43,94,70,.2); }
.note-color-control { position: relative; }
.color-button { display: grid; place-items: center; width: 34px; height: 34px; margin-top: -5px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.color-button:hover, .color-button:focus-visible, .color-button[aria-expanded="true"] { background: rgba(255,255,255,.38); }
.color-button span { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.72); border-radius: 50%; background: var(--choice-color); box-shadow: 0 1px 3px rgba(44,47,38,.2); }
.note-color-menu { position: absolute; z-index: 30; top: 31px; right: -5px; display: none; grid-template-columns: repeat(2, 30px); gap: 6px; padding: 8px; border: 1px solid rgba(43,50,46,.1); border-radius: 13px; background: rgba(251,250,247,.97); box-shadow: 0 10px 25px rgba(38,43,40,.2); }
.note-color-menu.is-open { display: grid; }
.note-color-menu button { width: 28px; height: 28px; }
.note-color-menu button:hover, .note-color-menu button:focus-visible { transform: scale(1.08); outline: 2px solid var(--green); outline-offset: 1px; }
.delete-button { display: grid; place-items: center; width: 34px; height: 34px; margin: -5px -7px 0 0; border: 0; border-radius: 50%; color: rgba(42,48,44,.48); background: transparent; cursor: pointer; }
.delete-button:hover, .delete-button:focus-visible { color: #793f36; background: rgba(255,255,255,.38); }
.delete-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.note-text { display: block; width: 100%; height: calc(100% - 27px); padding: 6px 2px; resize: none; overflow: auto; border: 0; outline: 0; color: #393b34; background: transparent; font-family: "Klee One", "Hiragino Maru Gothic ProN", cursive; font-size: 16px; font-weight: 600; line-height: 1.8; letter-spacing: .035em; }
.note-text::placeholder { color: rgba(54,57,50,.42); }
.sticky-note.is-complete { filter: saturate(.58); opacity: .82; box-shadow: 1px 2px 2px rgba(44,47,38,.06), 4px 8px 13px rgba(44,47,38,.11), inset 0 1px 0 rgba(255,255,255,.3); }
.sticky-note.is-complete .note-text { color: rgba(57,59,52,.63); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.sticky-note.is-complete::before { content: "DONE"; inset: auto 14px 10px auto; width: auto; height: auto; color: rgba(39,92,76,.38); background: transparent; filter: none; font-family: "DM Sans", sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .14em; }

.app-footer { display: flex; justify-content: space-between; gap: 16px; padding: 13px 10px 0; color: #8a877f; font-size: 11px; }
.app-footer span { display: inline-flex; align-items: center; gap: 7px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #68a181; box-shadow: 0 0 0 3px rgba(104,161,129,.12); }

@media (max-width: 767px) {
  :root { --note-width: 180px; --note-height: 170px; }
  .app-shell { width: min(100% - 24px, 680px); padding-top: 20px; }
  .app-header { position: relative; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
  .brand { gap: 10px; }
  .brand-mark { width: 9px; height: 34px; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: 25px; }
  .header-actions { gap: 8px; }
  .note-count { display: inline; }
  .search-box { order: 3; width: 100%; min-width: 0; min-height: 48px; }
  .new-note-colors { gap: 4px; padding: 4px; }
  .new-color { width: 25px; height: 25px; }
  .add-button { min-width: 48px; min-height: 48px; padding: 0 15px; border-radius: 14px; }
  .board-wrap { padding: 6px; border-radius: 20px; }
  .board { min-height: calc(100vh - 135px); border-radius: 15px; background-size: 18px 18px; overflow: auto; }
  .sticky-note { padding: 8px 12px 13px; }
  .delete-button { width: 42px; height: 42px; margin-top: -8px; margin-right: -8px; }
  .complete-button { width: 42px; height: 42px; margin-top: -8px; }
  .color-button { width: 42px; height: 42px; margin-top: -8px; }
  .color-button span { width: 18px; height: 18px; }
  .note-color-menu { top: 35px; right: -10px; grid-template-columns: repeat(4, 34px); }
  .note-color-menu button { width: 32px; height: 32px; }
  .note-text { font-size: 14px; }
  .app-footer { display: none; }
  .status-filters { margin-top: -4px; }
  .status-filter { min-width: 72px; min-height: 42px; }
  .done-zone { right: 12px; bottom: 12px; width: calc(100% - 24px); height: 150px; }
  .project-bar { padding: 8px; }
  .project-label { display: none; }
  .project-selector { flex: 1; }
  .project-selector select { width: 100%; max-width: none; min-height: 44px; }
  .project-actions button { width: 42px; min-height: 42px; padding: 0; }
  .project-actions button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .project-actions svg { width: 18px; }
}

@media (max-width: 420px) {
  :root { --note-width: 156px; --note-height: 160px; }
  .add-button span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .add-button { padding: 0; justify-content: center; }
  .add-button span:first-child { font-size: 26px; }
  .new-note-colors { position: absolute; top: 76px; left: 50%; z-index: 5; transform: translateX(-50%); box-shadow: 0 5px 15px rgba(50,55,52,.08); }
  .new-color { width: 36px; height: 36px; }
  .note-color-menu { right: -8px; grid-template-columns: repeat(2, 40px); }
  .note-color-menu button { width: 40px; height: 40px; }
  .search-box { margin-top: 56px; }
  .board-wrap { margin-top: 0; }
  .board { min-height: calc(100vh - 105px); }
  .empty-state p { font-size: 14px; }
  .empty-state span { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
