/*
────────────────────────────────────────────────────────────
Online Notepad – Stylesheet
Created by JJ Creator

This CSS is open for learning and experimentation.
You may copy, modify, and use it freely.

If reused in a public project,
credit is appreciated but not required ❤️

Design with care. Code with love.
────────────────────────────────────────────────────────────
*/

/* 1. CSS VARIABLES & THEMES */
:root {
  --vh: 1vh;
  --bg: #ffffff;
  --card: #ffffff;
  --text: #111827;
  --border: #e5e7eb;
  --textarea-bg: #ffffff;
  --textarea-text: #111827;
  --primary: #0066ff;
}

.dark {
  --bg: #0b1022;
  --card: #111827;
  --text: #e5e7eb;
  --border: #1f2937;
  --textarea-bg: #1f2937;
  --textarea-text: #d1d5db;
}

.sepia {
  --bg: #f4ecd8;
  --card: #f9f6ed;
  --text: #5c4a2f;
  --border: #d4c5a0;
  --textarea-bg: #fdf8ed;
  --textarea-text: #5c4a2f;
}

.ocean {
  --bg: #0a1929;
  --card: #1a2332;
  --text: #b0d4e8;
  --border: #1e3a5f;
  --textarea-bg: #132435;
  --textarea-text: #c5e3f6;
}

.forest {
  --bg: #0d1f1a;
  --card: #152822;
  --text: #b8d4c8;
  --border: #1e3d32;
  --textarea-bg: #0f2420;
  --textarea-text: #d0e8dc;
}

.sunset {
  --bg: #1a1221;
  --card: #251a2e;
  --text: #e8c5d4;
  --border: #3d2447;
  --textarea-bg: #1f1629;
  --textarea-text: #f0d8e4;
}

/* 2. BASE & LAYOUT */
body {
  background: var(--bg);
  color: var(--text);
  transition:
    background 1s ease,
    color 1s ease;
  visibility: hidden;
}

.notepad {
  padding: 20px;
  min-height: 100svh;
  box-sizing: border-box;
}

body:not(:has(textarea.auto-height)) .notepad {
  height: 100svh;
  overflow: hidden;
}

.notepad-card {
  background: var(--card);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 0px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

body:not(:has(textarea.auto-height)) .notepad-card {
  height: calc(100svh - 40px);
}

.notepad-card:has(textarea.auto-height) {
  height: auto;
  min-height: calc(100vh - 40px);
}

.notepad-card:fullscreen {
  display: flex;
  flex-direction: column;
}

.notepad-card:fullscreen textarea {
  flex: 1;
  min-height: 0;
}

.notepad-card:fullscreen textarea.auto-height {
  overflow-y: auto !important;
  max-height: 100%;
  flex: 1;
}

/* 3. TOOLBAR */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.toolbar-break {
  flex-basis: 100%;
  height: 0;
  border-bottom: 1px solid var(--border);
  margin: 4px 0;
}

.toolbar button,
.toolbar select {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transform: none !important;
}

.notepad-home-btn {
  padding: 0;
  width: 35px;
  height: 35px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
  flex-shrink: 0;
  text-decoration: none;
  box-sizing: border-box;
}

.notepad-home-btn:hover {
  background: rgba(0, 102, 255, 0.08);
  border-color: rgba(0, 102, 255, 0.3);
}

.notepad-home-btn img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  border-radius: 50%;
}

.toolbar button {
  user-select: none;
}

.toolbar button:hover:not(:disabled),
.toolbar select:hover {
  background: rgba(0, 102, 255, 0.08);
  border-color: rgba(0, 102, 255, 0.3);
}

.toolbar button.active {
  background: rgba(0, 102, 255, 0.15);
  border-color: var(--primary);
}

.toolbar button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.toolbar button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toggle-arrow {
  transition: transform 0.3s ease;
}

.toolbar:not(.toolbar-collapsed) .toggle-arrow {
  transform: rotate(180deg);
}

.toolbar-collapsed .toolbar-break {
  display: none;
}

select#font {
  width: 130px;
  position: relative;
}

select#size {
  width: 70px;
}

select#theme {
  width: 140px;
}

select#font:hover,
select#size:hover,
select#theme:hover {
  background: rgba(0, 102, 255, 0.08);
  border-color: rgba(0, 102, 255, 0.3);
}

select#font option,
select#size option,
select#theme option {
  background: var(--card);
  color: var(--text);
  padding: 8px;
}

/* 4. TOOLBAR SPACER & ROW 2 */
.toolbar-spacer {
  flex: 1;
}

.toolbar-row-2 {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  transition: all 0.3s ease;
}

.toolbar-collapsed .toolbar-row-2 {
  display: none;
}

/* 5. TEXTAREA */
textarea {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  margin-top: 10px;
  padding: 18px;
  overflow-y: auto;
  border-radius: 20px;
  resize: none;
  border: 1px solid var(--border);
  background: var(--textarea-bg);
  color: var(--textarea-text);
  font-family:
    DM Sans,
    sans-serif;
  font-size: 16px;
  scroll-behavior: auto;
  will-change: scroll-position;
  overflow-anchor: none;
  scroll-padding-top: 0;
  scroll-margin-top: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

textarea.auto-height {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: hidden;
  height: auto;
}

/* 6. FOOTER & SAVE INDICATOR */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-top: 10px;
  opacity: 0.8;
  flex-wrap: wrap;
}

.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  vertical-align: middle;
}

.save-indicator.saving {
  opacity: 1;
  color: #ff9800;
}

.save-indicator.saved {
  opacity: 1;
  color: #10b981;
}

.save-indicator.error {
  opacity: 1;
  color: #dc2626;
}

.save-indicator .spinner {
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.save-indicator.saving .spinner {
  display: inline-block;
}

.save-indicator .checkmark {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.save-indicator.saving .checkmark,
.save-indicator.saving .crossmark {
  display: none;
}

.save-indicator.saved .spinner {
  display: none;
}

.save-indicator.saved .crossmark {
  display: none;
}

.save-indicator .crossmark {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: none;
}

.save-indicator.error .checkmark {
  display: none;
}

.save-indicator.error .crossmark {
  display: inline;
}

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

/* 7. WORD LIMIT INDICATOR */
.word-limit-indicator {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  white-space: nowrap;
  order: 2;
}

/* 8. BUTTONS - CLEAR & FULLSCREEN STATES */
.toolbar button.clear-btn {
  border-color: var(--border);
  color: #ff9800;
}

.toolbar button.clear-btn:hover {
  background: rgba(255, 152, 0, 0.15) !important;
  border-color: rgba(255, 152, 0, 0.5) !important;
}

.notepad-card:fullscreen #autoHeightBtn,
.notepad-card:-webkit-full-screen #autoHeightBtn {
  display: none !important;
}

#fullscreenBtn .icon-close {
  display: none;
}

#fullscreenBtn.fullscreen-active {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.5);
  color: #dc2626;
}

#fullscreenBtn.fullscreen-active:hover {
  background: rgba(220, 38, 38, 0.28);
  border-color: rgba(220, 38, 38, 0.7);
}

#fullscreenBtn.fullscreen-active .icon-expand {
  display: none;
}

#fullscreenBtn.fullscreen-active .icon-close {
  display: inline;
}

/* 9. DIALOGS - BASE, HEADER, BUTTONS, CLOSE */
.custom-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.custom-dialog.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dialog-content {
  background: var(--card);
  border-radius: 20px;
  padding: 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: dialogSlide 0.25s ease;
  contain: layout paint;
}

@keyframes dialogSlide {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dialog-content h3 {
  margin: 0 0 16px;
  font-size: 1.3rem;
  color: var(--text);
}

.dialog-content input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--textarea-bg);
  color: var(--text);
  font-size: 15px;
  margin-bottom: 20px;
  font-family: inherit;
  box-sizing: border-box;
}

.dialog-content input:focus {
  outline: none;
  border-color: var(--primary);
}

.dialog-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.dialog-buttons button {
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.dialog-buttons button:hover {
  background: rgba(0, 102, 255, 0.08);
  border-color: rgba(0, 102, 255, 0.3);
}

.dialog-buttons button.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.dialog-buttons button.primary:hover {
  background: #0052cc;
  border-color: #0052cc;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dialog-header h3 {
  margin: 0;
}

.dialog-close {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  padding: 4px;
}

.dialog-close:hover {
  opacity: 1;
}

.dialog-content.wide {
  max-width: 700px;
}

/* 10. DIALOG VARIANTS */
.shortcuts-dialog {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.shortcut-scroll {
  overflow-y: auto;
  padding-right: 6px;
  margin-top: 16px;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  will-change: transform;
}

.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--textarea-bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.shortcut-keys {
  display: flex;
  gap: 4px;
}

.key {
  padding: 4px 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
}

.key.muted {
  opacity: 0.5;
}

.stats-dialog {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.stats-scroll {
  overflow-y: auto;
  margin-top: 16px;
  padding-right: 6px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  will-change: transform;
}

.stats-scroll::after {
  content: "";
  display: block;
  height: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.stat-item {
  padding: 16px;
  background: var(--textarea-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
}

.find-dialog {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.find-scroll {
  overflow-y: auto;
  margin-top: 14px;
  padding-right: 6px;
}

.find-options {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 10px 0 16px;
}

.find-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.find-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.find-result {
  margin: 12px 0 8px;
  font-size: 14px;
  opacity: 0.8;
  min-height: 20px;
}

.find-preview {
  display: none;
  max-height: 140px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--textarea-bg);
  font-size: 13px;
  line-height: 1.4;
}

.find-preview.show {
  display: block;
  margin-bottom: 20px;
}

.find-preview-item {
  padding: 6px 4px;
  border-bottom: 1px dashed var(--border);
  opacity: 0.85;
}

.find-preview-item:last-child {
  border-bottom: none;
}

.find-preview mark {
  background: rgba(0, 102, 255, 0.25);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}

.dialog-content input[type="search"] {
  margin-bottom: 16px;
}

.file-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-picker-btn {
  padding: 25px;
  margin-top: 15px;
  border-radius: 12px;
  border: 2px dashed var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  text-align: center;
}

.file-picker-btn:hover {
  border-color: var(--primary);
  background: rgba(0, 102, 255, 0.05);
}

.file-picker-box {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 10px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: transparent;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-picker-box:hover {
  border-color: var(--primary);
  background: rgba(0, 102, 255, 0.05);
}

.file-picker-box.drag-over {
  border-color: var(--primary);
  background: rgba(0, 102, 255, 0.1);
  border-style: solid;
  transform: scale(1.02);
}

.file-picker-box.has-file {
  border-style: solid;
  border-color: var(--primary);
  background: rgba(0, 102, 255, 0.05);
}

.file-picker-box.has-file:hover {
  background: rgba(0, 102, 255, 0.08);
}

.picker-default {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.picker-default svg {
  opacity: 0.5;
  color: var(--text);
}

.picker-text {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  opacity: 0.8;
}

.picker-or {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  opacity: 0.5;
  font-weight: 500;
}

.picker-button {
  margin: 0;
  font-size: 15px;
  color: var(--primary);
  font-weight: 600;
}

.picker-selected {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.picker-selected svg {
  color: var(--primary);
  opacity: 0.8;
}

.selected-filename {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  max-width: 100%;
}

.export-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.export-row input {
  flex: 1;
}

.export-row select {
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--textarea-bg);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.export-row select:focus {
  outline: none;
  border-color: var(--primary);
}

.pdf-mode-wrap {
  display: none;
  margin-bottom: 25px;
  align-items: center;
  gap: 40px;
}

.custom-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

.custom-radio input {
  display: none;
}

.radio-ui {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  position: relative;
  transition: border-color 0.2s ease;
  flex-shrink: 0;
}

.radio-ui::after {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.2s ease;
}

.custom-radio input:checked + .radio-ui {
  border-color: var(--primary);
}

.custom-radio input:checked + .radio-ui::after {
  transform: translate(-50%, -50%) scale(1);
}

.radio-label {
  font-size: 14px;
  color: var(--text);
}

/* 11. TOAST NOTIFICATIONS */
.toast {
  position: fixed;
  top: 35px;
  right: 35px;
  background: var(--card);
  color: var(--text);
  padding: 16px 24px;
  border-radius: 50px;
  box-shadow: 0 0px 40px rgba(0, 0, 0, 0.3);
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  animation: toastSlide 0.3s ease;
  max-width: 90%;
}

.toast.show {
  display: flex;
}

.toast.success {
  border: 1px solid #10b981;
  border-left-width: 6px;
}

.toast.error {
  border: 1px solid #dc2626;
  border-left-width: 6px;
}

.toast.warning {
  border: 1px solid #ff9800;
  border-left-width: 6px;
}

.toast.info {
  border: 1px solid var(--primary);
  border-left-width: 6px;
}

@keyframes toastSlide {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 12. INFO SECTION */
.notepad-info {
  background: var(--bg);
  color: var(--text);
  padding: 80px 20px 20px;
  transition:
    background 1s ease,
    color 1s ease;
}

.info-container {
  max-width: 1200px;
  margin: 0 auto;
}

.info-hero {
  text-align: center;
  margin-bottom: 60px;
}

.info-hero h1 {
  font-family: "Clash Display", sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
  line-height: 1.2;
}

.info-hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  opacity: 0.8;
  margin: 0 auto;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 50px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 102, 255, 0.15);
  border-color: var(--primary);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  line-height: 1;
}

.feature-card h3 {
  font-family: "Clash Display", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.feature-card p {
  margin: 0;
  opacity: 0.8;
  line-height: 1.6;
  font-size: 0.95rem;
}

.info-toggle-wrapper {
  text-align: center;
  margin: 30px 0;
}

.info-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.info-toggle-btn:hover {
  background: rgba(0, 102, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.15);
}

.info-toggle-btn .toggle-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform 0.3s ease;
}

.info-toggle-btn.expanded .toggle-icon {
  transform: rotate(180deg);
}

.info-sections-collapsible {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.5s ease,
    opacity 0.3s ease;
  opacity: 0;
}

.info-sections-collapsible.show {
  max-height: 10000px;
  opacity: 1;
}

.info-section {
  margin: 0 auto 25px;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.info-section h2 {
  font-family: "Clash Display", sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text);
}

.info-section p {
  margin: 0 0 16px;
  line-height: 1.7;
  opacity: 0.85;
}

.info-section p:last-child {
  margin-bottom: 0;
}

.tips-list {
  margin: 0;
  padding: 0 0 0 20px;
  line-height: 1.8;
}

.tips-list li {
  margin-bottom: 12px;
  opacity: 0.85;
}

.tips-list li:last-child {
  margin-bottom: 0;
}

kbd {
  background: var(--textarea-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: "Courier New", monospace;
  font-size: 0.85em;
  font-weight: 600;
}

.faq-item {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.faq-item h3 {
  font-family: "DM Sans", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.faq-item p {
  margin: 0;
  line-height: 1.7;
  opacity: 0.85;
}

/* 13. PRINT STYLES */
@media print {
  body > *:not(.notepad) {
    display: none !important;
  }

  body[data-custom-print] .notepad {
    padding: 0;
    background: var(--bg);
  }

  body[data-custom-print] .notepad-card {
    box-shadow: none;
    border-radius: 0;
    height: auto !important;
    background: var(--bg);
    padding: 20px;
  }

  body[data-custom-print] .toolbar {
    display: flex !important;
    visibility: visible !important;
  }

  body[data-custom-print] .notepad-card textarea {
    display: none !important;
  }

  body[data-custom-print] [print-text] {
    display: block !important;
    page-break-inside: auto;
  }

  body[data-custom-print] .card-footer {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    width: 100% !important;
    margin-top: 10px !important;
    font-size: 0.85rem !important;
  }

  body[data-custom-print] .card-footer > div:first-child {
    width: auto !important;
    order: 1 !important;
    flex-shrink: 0 !important;
  }

  body[data-custom-print] .card-footer > div:last-child {
    width: auto !important;
    order: 3 !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }

  body[data-custom-print] .word-limit-indicator {
    display: none !important;
  }

  body[data-custom-print] .save-indicator {
    display: none !important;
  }
}

/* 14. MEDIA QUERIES */
@supports (-webkit-touch-callout: none) {
  body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }

  .notepad {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }
}

@media (min-width: 479px) {
  .toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  #theme {
    margin-left: auto;
  }

  #theme,
  #autoHeightBtn,
  #fullscreenBtn {
    flex-shrink: 0;
  }
}

@media (min-width: 769px) {
  .toolbar-row-2 .clear-btn,
  .toolbar-row-2 .theme-mobile {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .toast {
    top: 20px;
    right: 15px;
    left: auto;
    bottom: auto;
  }

  .shortcuts-dialog,
  .stats-dialog,
  .find-dialog {
    max-height: 85vh;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .shortcut-item {
    margin-bottom: 14px;
  }

  .notepad {
    padding: 10px;
  }

  body:not(:has(textarea.auto-height)) .notepad {
    height: 100svh;
    overflow: hidden;
  }

  body:not(:has(textarea.auto-height)) .notepad-card {
    height: calc(100svh - 20px);
  }

  .notepad-card {
    min-height: 0;
    overflow: hidden;
  }

  .toolbar {
    gap: 4px;
  }

  .toolbar button,
  .toolbar select {
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .toolbar button svg {
    width: 14px;
    height: 14px;
  }

  .toolbar .btn-text {
    display: none;
  }

  .toolbar-row-2 {
    display: none;
  }

  .toolbar-break {
    display: none;
  }

  .toolbar:not(.toolbar-collapsed) .toolbar-row-2 {
    display: flex;
  }

  .toolbar:not(.toolbar-collapsed) .toolbar-break {
    display: block;
  }

  .toolbar-row-2 .toolbar-spacer {
    display: none !important;
  }

  .toolbar > .clear-btn,
  .toolbar > #theme {
    display: none !important;
  }

  .toolbar-row-2 .clear-btn,
  .toolbar-row-2 #theme {
    display: inline-flex !important;
  }

  .notepad-home-btn {
    width: 35px;
    height: 30px;
  }

  .notepad-home-btn img {
    width: 27px;
    height: 27px;
  }

  select#font {
    width: 100px;
    font-size: 13px;
  }

  select#size {
    width: 55px;
    font-size: 13px;
  }

  select#theme {
    width: 110px;
    font-size: 13px;
  }

  textarea {
    flex: 1;
    min-height: 0;
  }

  .card-footer {
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
    align-items: flex-start;
  }

  .card-footer > div:first-child {
    width: 100%;
    order: 1;
  }

  .word-limit-indicator {
    width: 100%;
    order: 2;
    margin: 4px 0;
    position: relative;
    left: auto;
    transform: none;
  }

  .card-footer > div:last-child {
    width: 100%;
    order: 3;
  }

  .dialog-content {
    padding: 20px;
  }

  .dialog-content input[type="search"],
  .dialog-content input[type="text"] {
    font-size: 16px;
    padding: 14px 16px;
  }

  .find-options {
    gap: 16px;
    margin: 14px 0;
  }

  .find-check {
    font-size: 15px;
  }

  .find-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }

  .file-picker-box {
    padding: 30px 15px;
    min-height: 180px;
  }

  .picker-default svg {
    width: 40px;
    height: 40px;
  }

  .picker-selected svg {
    width: 36px;
    height: 36px;
  }

  .picker-text {
    font-size: 15px;
  }

  .selected-filename {
    font-size: 15px;
  }

  .notepad-info {
    padding: 40px 15px;
  }

  .info-hero {
    margin-bottom: 40px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 40px;
  }

  .feature-card {
    padding: 20px;
  }

  .feature-icon {
    font-size: 2rem;
  }

  .info-section {
    padding: 24px;
    margin-bottom: 24px;
  }

  .info-section h2 {
    font-size: 1.5rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .notepad {
    padding: 15px;
  }

  .notepad-card {
    height: calc(100vh - 30px);
    padding: 20px;
  }

  .toolbar {
    gap: 5px;
  }

  .toolbar button,
  .toolbar select {
    padding: 7px 11px;
    font-size: 14px;
  }

  .toolbar button svg {
    width: 15px;
    height: 15px;
  }

  select#font {
    width: 115px;
  }

  select#size {
    width: 62px;
  }

  select#theme {
    width: 125px;
  }

  textarea {
    font-size: 15px;
    padding: 16px;
  }

  .card-footer {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.82rem;
    align-items: center;
    justify-content: space-between;
  }

  .card-footer > div:first-child {
    width: auto;
    order: 1;
    flex-shrink: 0;
  }

  .word-limit-indicator {
    position: relative;
    left: auto;
    transform: none;
    order: 2;
    flex: 1;
    text-align: center;
    min-width: 200px;
  }

  .card-footer > div:last-child {
    width: auto;
    order: 3;
    flex-shrink: 0;
    margin-left: auto;
  }

  .save-indicator {
    font-size: 0.75rem;
  }

  .dialog-content {
    max-width: 500px;
    padding: 22px;
  }

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

  .shortcut-item {
    padding: 11px;
  }

  .toast {
    top: 30px;
    right: 30px;
    max-width: 85%;
  }
}

@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
  .notepad-card {
    height: calc(100vh - 20px);
  }

  .card-footer {
    flex-wrap: nowrap;
  }

  .word-limit-indicator {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 1024px) {
  button[onclick="cut()"],
  button[onclick="copy()"],
  button[onclick="paste()"],
  button[onclick="showShortcuts()"],
  button[onclick="printDocument()"] {
    display: none !important;
  }
}

/*
────────────────────────────────────────────────────────────
End of Online Notepad Styles

Thanks for reading the code.
Hope this helps you learn something new.

Keep styling. Keep growing.
– JJ Creator
────────────────────────────────────────────────────────────
*/
