/* src/styles.css */
:root {
  --paper: #f5efe2;
  --paper-2: #efe7d5;
  --ink: #251e12;
  --ink-2: #6a5f4b;
  --line: #dcd1ba;
  --red: #8d2f21;
  --red-dark: #6f2418;
  --tile: #fbf7ec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191510;
    --paper-2: #211c14;
    --ink: #ece4d0;
    --ink-2: #a3977e;
    --line: #38301f;
    --red: #c96a52;
    --red-dark: #a34e39;
    --tile: #201a12;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Georgia,
    "Iowan Old Style",
    "Palatino Linotype",
    serif;
  font-size: 15px;
  line-height: 1.5;
  padding: max(0px, env(safe-area-inset-top)) max(0px, env(safe-area-inset-right)) max(0px, env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left));
}
h1,
h2,
h3 {
  font-weight: normal;
  margin: 0;
}
button {
  font-family: inherit;
}
input,
textarea,
select {
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 10px;
}
input:focus,
textarea:focus {
  outline: 2px solid var(--accent, var(--red));
  outline-offset: 0;
}
input[type=color] {
  -webkit-appearance: none;
  appearance: none;
  padding: 2px;
  cursor: pointer;
}
input[type=color]::-webkit-color-swatch-wrapper {
  padding: 2px;
}
input[type=color]::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}
.side-color {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.shell {
  display: flex;
  min-height: 100dvh;
}
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--paper-2);
  border-right: 2px solid var(--ink);
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.side-title {
  font-size: 24px;
  border-bottom: 2px solid var(--ink);
  padding: 0 6px 8px;
  margin-bottom: 6px;
}
.side-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  background: var(--pc, var(--red));
  border: none;
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--v-aux-white, #fff);
  font-size: 15px;
  text-align: left;
  width: 100%;
  transition: box-shadow 0.15s, filter 0.15s;
}
.side-item:hover {
  filter: brightness(1.1);
}
.side-item.on {
  box-shadow: inset 0 0 0 2px var(--paper), 0 0 0 2px var(--ink);
  font-weight: bold;
}
.side-item.on:hover {
  filter: none;
}
.side-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-new {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 8px;
}
.side-new-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.side-new-row input:not([type=color]) {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}
.main {
  flex: 1;
  min-width: 0;
  padding: 22px 26px 40px;
}
.v-button {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
  border-radius: 3px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  min-height: 44px;
}
.v-button:hover {
  background: var(--red-dark);
}
.v-button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink-2);
}
.v-button.secondary:hover {
  border-color: var(--ink);
  background: var(--paper-2);
}
.v-button.danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}
.v-button.danger:hover {
  background: var(--red);
  color: #fff;
}
.v-button.ghost {
  border-color: transparent;
}
.v-button:disabled {
  opacity: 0.5;
  cursor: default;
}
.project-page {
  max-width: 1100px;
}
.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.project-name {
  font-size: 26px;
  border-bottom: 3px solid var(--accent, var(--red));
  padding-bottom: 2px;
}
.project-head-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.project-head-side .side-color {
  width: 34px;
  height: 34px;
}
.project-head-side .v-button {
  min-height: 36px;
  padding: 4px 10px;
  font-size: 13px;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas: "mail todos" "jot todos" "docs docs" "cal clips" "photos photos" "chats chats";
  gap: 18px;
}
.mail-panel {
  grid-area: mail;
}
.todo-panel {
  grid-area: todos;
}
.docs-panel {
  grid-area: docs;
}
.clips-panel {
  grid-area: clips;
}
.jot-panel {
  grid-area: jot;
}
.cal-panel {
  grid-area: cal;
}
.photos-panel {
  grid-area: photos;
}
.chats-panel {
  grid-area: chats;
}
@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
    grid-template-areas: "mail" "todos" "docs" "jot";
  }
}
.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.panel-head h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink-2);
}
.panel-head .v-button {
  min-height: 36px;
  padding: 4px 10px;
  font-size: 13px;
}
.email-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.email-tile {
  position: relative;
  background: var(--tile);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent, var(--red));
  border-radius: 3px;
  padding: 10px 12px;
  cursor: pointer;
  min-width: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.email-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}
.email-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
}
.email-from {
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-date {
  flex-shrink: 0;
}
.email-subject {
  margin-top: 4px;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-snippet {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-2);
  font-style: italic;
}
.tile-x {
  position: absolute;
  top: 4px;
  right: 4px;
  display: none;
  background: none;
  border: none;
  color: var(--ink-2);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}
.email-tile:hover .tile-x {
  display: block;
}
.tile-x:hover {
  color: var(--red);
}
.todo-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  margin-bottom: 10px;
}
@media (max-width: 480px) {
  .todo-form {
    grid-template-columns: 1fr;
  }
}
.todo-form input[type=date] {
  font-size: 14px;
}
.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.todo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 2px;
  border-bottom: 1px dashed var(--line);
}
.todo-check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.todo-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, var(--red));
}
.todo-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
.todo-item.done .todo-text {
  text-decoration: line-through;
  color: var(--ink-2);
}
.row-x {
  background: none;
  border: none;
  color: var(--ink-2);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
}
.row-x:hover {
  color: var(--red);
}
.due-pill {
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  flex-shrink: 0;
}
.due-pill.soon {
  border-color: var(--red);
  color: var(--red);
}
.due-pill.today {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.due-pill.over {
  border-color: var(--red-dark);
  color: #fff;
  background: var(--red-dark);
}
.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.doc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 12px 14px;
  cursor: pointer;
  min-width: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.doc-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}
.doc-row svg {
  flex-shrink: 0;
  color: var(--accent, var(--red));
}
.doc-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-len {
  font-size: 12px;
  color: var(--ink-2);
  flex-shrink: 0;
}
.jot-panel {
  display: flex;
  flex-direction: column;
}
.jot-state {
  font-size: 12px;
  color: var(--ink-2);
  font-style: italic;
}
.jot-area {
  flex: 1;
  min-height: 140px;
  resize: vertical;
  line-height: 28px;
  padding: 0 10px;
  background:
    repeating-linear-gradient(
      transparent,
      transparent 27px,
      var(--line) 27px,
      var(--line) 28px),
    var(--tile);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.inline-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--tile);
  border: 1px dashed var(--ink-2);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.form-wide {
  width: 100%;
}
.inline-form textarea {
  min-height: 90px;
  resize: vertical;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 6, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}
.overlay.full {
  padding: 0;
  background: var(--paper);
  overflow-y: auto;
  display: block;
}
.sheet {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 22px;
  position: relative;
}
.sheet-full {
  max-width: 860px;
  margin: 40px auto;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px 32px;
  position: relative;
}
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 36px;
  padding: 4px 12px;
  font-size: 13px;
}
.email-full h2,
.doc-full h2 {
  font-size: 22px;
  margin: 8px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent, var(--red));
  padding-right: 90px;
}
.email-body,
.doc-body {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 15px;
  margin: 0;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 30;
  animation: rise 0.2s ease-out;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.v-empty-state {
  color: var(--ink-2);
  font-style: italic;
  padding: 18px 8px;
  text-align: center;
}
@media (max-width: 780px) {
  .shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 2px solid var(--ink);
    padding: 12px;
  }
  .side-list {
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
  }
  .side-item {
    width: auto;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  .side-item.on {
    border-bottom-color: var(--pc, var(--red));
  }
  .main {
    padding: 16px 14px 40px;
  }
}
.td-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line, #d8cdb8);
}
.td-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.td-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2, #6b5d4f);
  text-transform: uppercase;
}
.td-link {
  font: inherit;
  font-size: 12px;
  color: var(--ink, #2b2117);
  background: var(--tile, #f4ecdc);
  border: 1px solid var(--line, #d8cdb8);
  border-radius: 4px;
  padding: 3px 6px;
  max-width: 60%;
}
.td-item .todo-text {
  font-style: italic;
}
.td-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent, var(--red));
  flex: none;
}
.td-check {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  border: 1.4px solid var(--accent, var(--red));
  background: transparent;
  color: transparent;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.td-check:hover {
  background: var(--accent, var(--red));
  color: #fff;
}
.cal-when {
  font-size: 12px;
  color: #6b5d52;
  min-width: 96px;
  flex: none;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.photo-cell {
  position: relative;
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
}
.photo-cell img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}
.photo-cell .row-x {
  position: absolute;
  top: 4px;
  right: 4px;
}
.mail-rule {
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  background: var(--tile, #f4ecdc);
  border: 1px solid var(--line, #d8cdb8);
  border-radius: 4px;
  padding: 4px 8px;
  width: 200px;
}
.gmail-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line, #d8cdb8);
}
.gmail-tile {
  border-left: 3px solid var(--accent, var(--red));
}
.chat-saved {
  font: italic 13px Georgia, serif;
  color: var(--line, #9a8f7a);
  margin: -4px 0 10px;
}
.doc-window {
  position: fixed;
  width: min(720px, 92vw);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
}
.doc-window-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  cursor: move;
  touch-action: none;
  user-select: none;
}
.doc-window-head h2 {
  margin: 0;
  font-size: 16px;
}
.doc-window-body {
  padding: 14px 16px;
  max-height: 70vh;
  overflow: auto;
}
