/**
 * Cornell Notes Generator.
 *
 * Scoped palette like every other tool family: color-scheme.css carries only the
 * dark overrides, so the light values are declared here.
 */

.sk-cornell-root {
  --sk-ink: #28323a;
  --sk-muted: #66727b;
  --sk-accent: #68438b;
  --sk-accent-strong: #452b61;
  --sk-line: #dfe3e8;
  --sk-surface: #ffffff;
  --sk-soft: #f7f5fa;
  --sk-on-accent: #ffffff;

  display: block;
  box-sizing: border-box;
  margin: 20px auto 0;
  max-width: 980px;
  color: var(--sk-ink);
  font-family: inherit;
  line-height: 1.6;
}

html[data-sk-scheme="dark"] .sk-cornell-root {
  --sk-ink: #e6e2ee;
  --sk-muted: #a79fba;
  --sk-accent: #cba4ec;
  --sk-accent-strong: #e3cff7;
  --sk-line: #38314a;
  --sk-surface: #221d2e;
  --sk-soft: #2b2140;
  --sk-on-accent: #2f1c40;
}

.sk-cornell-root * {
  box-sizing: border-box;
}

.sk-cornell-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sk-line);
}

.sk-cornell-tab {
  padding: 6px 11px;
  border: 1px solid var(--sk-line);
  border-radius: 8px;
  background: var(--sk-surface);
  color: var(--sk-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sk-cornell-tab.is-active {
  border-color: var(--sk-accent);
  color: var(--sk-accent-strong);
}

.sk-cornell-tab--add {
  border-style: dashed;
}

.sk-cornell-tab:focus-visible {
  outline: 2px solid var(--sk-accent);
  outline-offset: 1px;
}

.sk-cornell-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.sk-cornell-h2 {
  margin: 0 0 10px;
  font-size: 1.02rem;
  font-weight: 700;
}

.sk-cornell-field {
  margin: 0 0 14px;
}

.sk-cornell-label {
  display: block;
  margin: 0 0 5px;
  font-size: 0.82rem;
  font-weight: 600;
}

.sk-cornell-optional {
  color: var(--sk-muted);
  font-size: 0.76rem;
  font-weight: 400;
}

.sk-cornell-hint {
  margin: 0 0 6px;
  color: var(--sk-muted);
  font-size: 0.78rem;
}

.sk-cornell-input,
.sk-cornell-textarea {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--sk-line);
  border-radius: 8px;
  background: var(--sk-surface);
  color: var(--sk-ink);
  font-family: inherit;
  font-size: 0.9rem;
}

.sk-cornell-textarea {
  resize: vertical;
  line-height: 1.55;
}

.sk-cornell-input::placeholder,
.sk-cornell-textarea::placeholder {
  color: #9a90a4;
}

html[data-sk-scheme="dark"] .sk-cornell-input::placeholder,
html[data-sk-scheme="dark"] .sk-cornell-textarea::placeholder {
  color: #8b83a0;
}

.sk-cornell-input:focus-visible,
.sk-cornell-textarea:focus-visible {
  border-color: var(--sk-accent);
  outline: 2px solid var(--sk-accent);
  outline-offset: -1px;
}

/* ---- the sheet ---------------------------------------------------------- */

/* The preview is the actual paper colour in both schemes, because it stands in
   for a printed page. In dark mode it keeps a light paper with dark ink for that
   reason: a "printable sheet" rendered in dark grey would misrepresent it. */
.sk-cornell-sheet {
  border: 1px solid #cfd6de;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.86rem;
  overflow: hidden;
}

.sk-cornell-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid #cfd6de;
}

.sk-cornell-name {
  font-weight: 700;
}

.sk-cornell-date {
  color: #5f6c78;
  font-variant-numeric: tabular-nums;
}

.sk-cornell-body {
  min-height: 120px;
}

/* The Cornell layout itself: a narrow cue column and a wide notes column, with
   the rule between them. This is the whole tool. */
.sk-cornell-row {
  display: grid;
  grid-template-columns: 34% minmax(0, 1fr);
  border-bottom: 1px solid #e6eaee;
}

.sk-cornell-row:last-child {
  border-bottom: 0;
}

.sk-cornell-cue {
  padding: 7px 10px;
  border-right: 1px solid #cfd6de;
  color: #2f1c40;
  font-weight: 600;
  word-break: break-word;
}

.sk-cornell-note {
  padding: 7px 10px;
  word-break: break-word;
  white-space: pre-wrap;
}

.sk-cornell-summary {
  display: grid;
  grid-template-columns: 34% minmax(0, 1fr);
  border-top: 2px solid #cfd6de;
}

.sk-cornell-summary-label {
  padding: 7px 10px;
  border-right: 1px solid #cfd6de;
  color: #5f6c78;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sk-cornell-summary-text {
  padding: 7px 10px;
  min-height: 34px;
  white-space: pre-wrap;
}

.sk-cornell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.sk-cornell-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--sk-accent);
  color: var(--sk-on-accent);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.sk-cornell-btn:hover {
  background: var(--sk-accent-strong);
}

.sk-cornell-btn--ghost {
  border-color: var(--sk-line);
  background: var(--sk-surface);
  color: var(--sk-muted);
}

.sk-cornell-btn--ghost:hover {
  border-color: var(--sk-accent);
  background: var(--sk-surface);
  color: var(--sk-accent-strong);
}

.sk-cornell-btn:focus-visible {
  outline: 2px solid var(--sk-accent);
  outline-offset: 2px;
}

.sk-cornell-note {
  margin: 16px 0 0;
  color: var(--sk-muted);
  font-size: 0.79rem;
}

@media (max-width: 860px) {
  .sk-cornell-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Printing prints the sheet only. Without this the whole site chrome, the tabs
   and the textareas come out, and the page is several sheets of paper. */
@media print {
  body * {
    visibility: hidden;
  }

  .sk-cornell-sheet,
  .sk-cornell-sheet * {
    visibility: visible;
  }

  .sk-cornell-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: 0;
  }

  .sk-cornell-actions,
  .sk-cornell-tabs,
  .sk-cornell-fields,
  .sk-cornell-note,
  .sk-cornell-h2 {
    display: none !important;
  }
}
