@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg-a: #fff7ec;
  --bg-b: #fdecea;
  --bg-c: #f0ecff;
  --panel: #ffffff;
  --panel-soft: #fff4e8;
  --panel-border: #f3e2d0;
  --text: #2c2540;
  --text-soft: #514a65;
  --muted: #8a839c;
  --accent: #ff7a59;
  --accent-ink: #401008;
  --purple: #7c6cf7;
  --purple-ink: #1e1648;
  --mint: #36c7b8;
  --sun: #ffc75a;
  --sky: #6fb8f5;
  --rose: #f48fb5;
  --lime: #a6dd7a;
  --lav: #b9a6f5;
  --peach: #ffaf7a;
  --danger: #e85d6f;
  --ok: #4fbd86;
  --shadow: 0 1px 2px rgba(44, 37, 64, 0.05), 0 8px 28px rgba(44, 37, 64, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  font: 15px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1000px 600px at 0% 0%, #ffe3d0 0%, transparent 55%),
    radial-gradient(900px 700px at 100% 10%, #e6deff 0%, transparent 50%),
    radial-gradient(800px 600px at 60% 100%, #ffe0ec 0%, transparent 55%),
    linear-gradient(180deg, #fff7ec 0%, #fff4e6 60%, #fdecea 100%);
  overflow: hidden;
}

.serif {
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: -0.01em;
}

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

button {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 7px 12px;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.15s;
}

button:hover {
  box-shadow: 0 2px 10px rgba(44, 37, 64, 0.08);
}

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

button.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #ff9766 100%);
  color: white;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(255, 122, 89, 0.35);
}

button.primary:hover {
  filter: brightness(1.03);
}

button.ghost {
  background: transparent;
  border-color: transparent;
}

button.ghost:hover {
  background: rgba(255, 255, 255, 0.6);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 89, 0.15);
}

.app {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
}

header.topbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.brand {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
}

header .spacer {
  flex: 1;
}

main.body {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 0;
}

aside.sidebar {
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(8px);
  border-right: 1px solid rgba(255, 255, 255, 0.7);
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  min-height: 0;
}

.sidebar .home-btn {
  margin: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255, 122, 89, 0.12), rgba(124, 108, 247, 0.12));
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.sidebar .home-btn:hover {
  filter: brightness(1.02);
}

.sidebar .home-btn.active {
  background: linear-gradient(135deg, rgba(255, 122, 89, 0.22), rgba(124, 108, 247, 0.22));
}

.sidebar .search {
  padding: 0 10px 6px;
}

.sidebar .search input {
  width: 100%;
}

.filters {
  padding: 8px 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  background: #fff;
  color: var(--text-soft);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--panel-border);
  user-select: none;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-chip.active {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.task-list {
  overflow: auto;
  padding: 4px 4px 12px;
}

.group-title {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 14px 4px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.group-count {
  color: var(--muted);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 1px 8px;
  border: 1px solid var(--panel-border);
}

.task {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  margin: 2px 6px;
  border-radius: 10px;
  cursor: pointer;
}

.task:hover {
  background: rgba(255, 255, 255, 0.75);
}

.task.selected {
  background: white;
  box-shadow: var(--shadow);
}

.task.done .task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.task .check {
  width: 18px;
  height: 18px;
  border: 1.6px solid #cfc6dc;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  background: transparent;
  padding: 0;
}

.task.done .check {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.task-title {
  font-size: 13.5px;
}

.task-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dot-cat {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 2px;
}

.badge {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-soft);
  letter-spacing: 0.2px;
  border: 1px solid transparent;
}

.badge.prio-high {
  background: #fee4e8;
  color: #b4223a;
}

.badge.prio-medium {
  background: #fff1cc;
  color: #8a5c06;
}

.badge.prio-low {
  background: #e4f4e0;
  color: #2e6e38;
}

section.content {
  overflow: auto;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 28px 80px;
}

.greeting {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 22px;
}

.greeting h1 {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 38px;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.02em;
}

.greeting .emoji {
  font-size: 42px;
}

.greeting .date {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.stat {
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat .value {
  font-family: "Fraunces", serif;
  font-size: 28px;
  font-weight: 700;
  margin-top: 2px;
}

.stat .delta {
  color: var(--ok);
  font-size: 12px;
}

.chat-card {
  background: linear-gradient(135deg, #ffffff 0%, #fff8f2 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.chat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 200px at -10% -20%, rgba(255, 122, 89, 0.15), transparent 60%),
    radial-gradient(500px 180px at 110% 0%, rgba(124, 108, 247, 0.18), transparent 60%);
  pointer-events: none;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  position: relative;
}

.chat-header .title {
  font-family: "Fraunces", serif;
  font-size: 20px;
  font-weight: 700;
}

.chat-header .hint {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  position: relative;
}

.chat-input-row textarea {
  flex: 1;
  min-height: 56px;
  max-height: 200px;
  resize: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 12px 14px;
}

.mic {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--panel-border);
  background: #fff;
}

.mic.recording {
  background: var(--accent);
  color: white;
  border-color: transparent;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 122, 89, 0.5);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(255, 122, 89, 0);
  }
}

.chat-send {
  height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 600;
}

.chat-log {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.chat-log .msg {
  padding: 10px 12px;
  border-radius: 12px;
  max-width: 85%;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-log .msg.user {
  background: rgba(124, 108, 247, 0.1);
  align-self: flex-end;
  border: 1px solid rgba(124, 108, 247, 0.2);
}

.chat-log .msg.assistant {
  background: #fff;
  align-self: flex-start;
  border: 1px solid var(--panel-border);
}

.chat-log .msg.system {
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  align-self: center;
}

.chat-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  position: relative;
}

.chat-suggestions .chip {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--panel-border);
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-soft);
}

.chat-suggestions .chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.section-title {
  font-family: "Fraunces", serif;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 12px;
}

.section-title .pill {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--text-soft);
}

.section-title .btn-right {
  margin-left: auto;
}

.focus-list {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.focus-item {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  border-left-width: 4px;
  border-left-style: solid;
}

.focus-item:hover {
  transform: translateY(-1px);
  transition: transform 0.12s;
}

.focus-item .rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: white;
  font-weight: 700;
  font-size: 13px;
}

.focus-item .meta {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  align-items: center;
}

.focus-item .title {
  font-weight: 600;
}

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.cat-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cat-card .stripe {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}

.cat-card .name {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
  padding-left: 6px;
}

.cat-card .row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  padding-left: 6px;
}

.cat-card .bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  margin-top: 10px;
  overflow: hidden;
  margin-left: 6px;
}

.cat-card .bar > div {
  height: 100%;
  border-radius: 999px;
}

.detail-title {
  border: none;
  background: transparent;
  width: 100%;
  font-family: "Fraunces", serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 2px 0;
  margin-bottom: 4px;
}

.detail-title:focus {
  outline: none;
}

.sub {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 16px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.markdown {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 20px 24px;
  min-height: 200px;
  box-shadow: var(--shadow);
}

.markdown h1,
.markdown h2,
.markdown h3 {
  font-family: "Fraunces", serif;
  margin-top: 1em;
}

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

.markdown h2 {
  font-size: 18px;
}

.markdown h3 {
  font-size: 15.5px;
}

.markdown pre {
  background: #f7f2ea;
  padding: 10px 12px;
  border-radius: 8px;
  overflow: auto;
}

.markdown code {
  background: #f7f2ea;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}

.markdown blockquote {
  border-left: 3px solid var(--accent);
  margin: 0;
  padding: 4px 14px;
  color: var(--text-soft);
  background: #fff8f2;
  border-radius: 6px;
}

.markdown a {
  color: var(--purple);
}

.markdown hr {
  border: 0;
  border-top: 1px dashed var(--panel-border);
  margin: 20px 0;
}

.editor textarea {
  width: 100%;
  min-height: 320px;
  font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  border-radius: 14px;
  padding: 14px 16px;
}

.mode-toggle {
  display: inline-flex;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.mode-toggle button {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 7px 12px;
}

.mode-toggle button.active {
  background: var(--text);
  color: white;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 33, 58, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  width: min(560px, 92vw);
  padding: 20px 22px;
  box-shadow: 0 16px 48px rgba(44, 37, 64, 0.25);
}

.modal h2 {
  font-family: "Fraunces", serif;
  margin: 0 0 12px;
  font-size: 20px;
}

.modal .row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.modal .row label {
  color: var(--text-soft);
  font-size: 12px;
}

.modal .footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--panel-border);
  padding: 11px 16px;
  border-radius: 12px;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.25s, transform 0.2s;
  pointer-events: none;
  z-index: 100;
  max-width: 80vw;
  box-shadow: var(--shadow);
  font-size: 13.5px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.toast.err {
  border-color: var(--danger);
  color: #9b1e30;
  background: #fef1f3;
}

.toast.ok {
  border-color: var(--ok);
  color: #1f5f40;
  background: #eef8f2;
}

.spin {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: s 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

@keyframes s {
  to {
    transform: rotate(360deg);
  }
}

.empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-direction: column;
  gap: 8px;
}

.kbd {
  background: #fff;
  border: 1px solid var(--panel-border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

@media (max-width: 800px) {
  main.body {
    grid-template-columns: 1fr;
  }

  aside.sidebar {
    display: none;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

