:root {
  --bg: #f9f8f4;
  --surface: #fdfcf8;
  --text: #25231f;
  --muted: #7a7467;
  --border: #e9e5da;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.app-shell {
  display: grid;
  grid-template-columns: 244px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-top-icons {
  display: flex;
  gap: 7px;
  color: #8a8373;
  font-size: 0.75rem;
  padding: 4px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
}

.mode-tab {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: 0.72rem;
  padding: 5px 0;
  color: #615c51;
  cursor: pointer;
}

.mode-tab.active {
  background: #f4f1e8;
  color: #2f2d28;
  font-weight: 600;
}

.new-task-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
}

.menu-group {
  display: grid;
  gap: 6px;
  padding: 4px 2px;
}

.menu-group a {
  text-decoration: none;
  color: #454038;
  font-size: 0.75rem;
}

.beta {
  font-size: 0.62rem;
  background: #f0ece3;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 4px;
}

.side-section {
  padding-top: 4px;
  display: grid;
  gap: 6px;
}

.side-section.grow {
  flex: 1;
}

.section-title {
  margin: 0;
  font-size: 0.82rem;
  color: #8f8776;
  font-weight: 500;
}

.side-item {
  font-size: 0.72rem;
  color: #3e3a32;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.side-item.plain {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recents-list {
  display: grid;
  gap: 2px;
  margin-top: 2px;
  min-height: 420px;
  align-content: start;
}

.recents-item {
  border: none;
  background: transparent;
  color: #2b2822;
  text-align: left;
  font-size: 0.91rem;
  line-height: 1.25;
  border-radius: 12px;
  padding: 5px 8px;
  cursor: pointer;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.recents-item:hover {
  background: #f3f0e7;
}

.recents-item.active {
  background: #ebe7de;
}

.recents-item-title {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recents-item-menu {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #8f8778;
  font-size: 0.95rem;
  line-height: 1;
  padding: 2px 5px;
  flex-shrink: 0;
}

.recents-item-menu:hover {
  border-color: var(--border);
  background: #f7f4eb;
}

.view-all-btn {
  border: none;
  background: transparent;
  color: #8a8373;
  font-size: 0.86rem;
  padding: 6px 8px 0;
  text-align: left;
  cursor: pointer;
}

.badge {
  font-size: 0.63rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  color: #5f5a4f;
  background: #fff;
}

.side-footer {
  border-top: 1px solid var(--border);
  padding-top: 9px;
  font-size: 0.76rem;
  color: #666053;
}

.main {
  padding: 40px 26px;
  position: relative;
}

.main::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 20%;
  width: 260px;
  height: 260px;
  background-image: radial-gradient(#ece8dc 1.2px, transparent 1.2px);
  background-size: 12px 12px;
  opacity: 0.9;
  pointer-events: none;
}

.main::after {
  content: "";
  position: absolute;
  top: 35px;
  right: 13%;
  width: 220px;
  height: 220px;
  background-image: radial-gradient(#ece8dc 1.2px, transparent 1.2px);
  background-size: 12px 12px;
  opacity: 0.8;
  pointer-events: none;
}

.content-wrap {
  width: min(760px, 100%);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero {
  margin-top: 32px;
}

.hero-title {
  margin: 0;
  font-size: 2rem;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
}

.hero-subtitle {
  margin: 6px 0 0;
  font-size: 0.79rem;
  color: var(--muted);
}

.composer {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
}

.composer input {
  width: 100%;
  border: none;
  font-size: 1rem;
  outline: none;
  background: transparent;
}

.composer-meta {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #625d51;
  font-size: 0.82rem;
}

.meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #696357;
}

.composer-actions button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: 0.74rem;
  padding: 5px 8px;
  cursor: pointer;
}

.usage {
  margin-left: auto;
  font-size: 0.73rem;
}

.opened-chat-card {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.opened-chat-eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.opened-chat-card h2 {
  margin: 6px 0 0;
  font-size: 1.08rem;
}

.opened-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.opened-chat-card p:last-child {
  margin: 7px 0 0;
  font-size: 0.86rem;
  color: #5f594e;
  line-height: 1.45;
}

.list-block {
  margin-top: 24px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 7px;
}

.list-header p {
  margin: 0;
  font-size: 0.76rem;
  color: #777162;
}

.list-header button {
  border: none;
  background: none;
  color: #8a8373;
  font-size: 0.73rem;
  cursor: pointer;
}

.task-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid #f1eee6;
}

.task-row-clickable {
  cursor: pointer;
}

.task-row-clickable:hover {
  background: #fbf9f4;
}

.task-row p {
  margin: 0;
  font-size: 0.85rem;
}

.task-row small {
  color: var(--muted);
  font-size: 0.72rem;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  margin-top: 8px;
  background: #3391ff;
}

.clock {
  color: #a9a193;
  margin-top: 2px;
}

.empty-text {
  font-size: 0.8rem;
  color: #847f71;
  margin: 10px 0;
}

.rename-modal {
  position: fixed;
  inset: 0;
  background: rgba(25, 22, 18, 0.18);
  display: grid;
  place-items: center;
  z-index: 20;
}

.rename-modal.hidden {
  display: none;
}

.rename-modal-card {
  width: min(360px, calc(100vw - 24px));
  background: #fffdf9;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 14px 34px rgba(28, 23, 16, 0.15);
}

.rename-modal-title {
  margin: 0;
  font-size: 0.85rem;
  color: #665f52;
}

#rename-input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 0.86rem;
  background: #fff;
}

.rename-modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.rename-modal-actions button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.76rem;
  background: #fff;
  color: #4b453a;
  cursor: pointer;
}

#rename-save-btn {
  background: #f1ede4;
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 18px 14px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 0.82rem;
  }

  .recents-item {
    font-size: 0.88rem;
  }

  .view-all-btn {
    font-size: 0.85rem;
  }
}
