/* =========================================================================
   INK DEDICATED LAYOUT & STYLES (Pixel-Perfect from ink.png)
   ========================================================================= */

:root {
  --ink-bg-page: #FAF6F0;
  --ink-bg-card: #FFFFFF;
  --ink-bg-parchment: #FBF8F2;
  --ink-text-dark: #1E2522;
  --ink-text-secondary: #4A574E;
  --ink-text-muted: #8E9890;
  --ink-accent-green: #2B4237;
  --ink-accent-gold: #C69234;
  --ink-border: #EFE8DE;
}

body.ink-page {
  background-color: var(--ink-bg-page);
  color: var(--ink-text-dark);
  font-family: var(--font-sans);
  margin: 0;
  padding: 0;
}

/* Master 4-Section Grid */
.ink-master-grid {
  display: grid;
  grid-template-columns: 190px 220px 1fr 290px;
  gap: 1.25rem;
  width: 100%;
  max-width: 1480px;
  box-sizing: border-box;
  margin: 1.5rem auto;
  padding: 0 2rem;
  align-items: start;
}

/* -------------------------------------------------------------------------
   SECTION 1: LEFT NAVIGATION MENU
   ------------------------------------------------------------------------- */
.ink-left-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ink-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  color: #38463D;
  transition: all 0.15s ease;
}

.ink-nav-btn:hover {
  background: #FAF5EE;
}

.ink-nav-btn.active {
  background: #EFE4D6;
  color: #1E2522;
}

.ink-nav-btn-icon {
  font-size: 1.1rem;
}

.ink-nav-btn-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.ink-nav-btn-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: #1E2522;
}

.ink-nav-btn-sub {
  font-size: 0.68rem;
  color: var(--ink-text-muted);
}

.ink-left-quote-card {
  background: #FAF5EE;
  border: 1px solid #EFE4D6;
  border-radius: 18px;
  padding: 1rem;
  margin-top: 1rem;
}

.ink-left-quote-text {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  color: #38463D;
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.ink-left-quote-author {
  font-size: 0.74rem;
  color: var(--ink-text-muted);
}

/* -------------------------------------------------------------------------
   SECTION 2: FULL-LENGTH SERENA ARTWORK
   ------------------------------------------------------------------------- */
.ink-sara-col {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(43, 66, 55, 0.04);
}

.ink-sara-img {
  width: 100%;
  height: auto;
  min-height: 640px;
  object-fit: cover;
  display: block;
}

/* -------------------------------------------------------------------------
   SECTION 3: LETTER STUDIO COMPOSER (Center)
   ------------------------------------------------------------------------- */
.ink-center-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ink-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ink-header-title-box h1 {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: #1A284D;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.2rem 0;
}

.ink-header-title-box p {
  font-size: 0.88rem;
  color: var(--ink-text-muted);
  margin: 0;
}

.ink-feature-badges {
  display: flex;
  gap: 0.85rem;
}

.ink-badge-item {
  font-size: 0.78rem;
  color: #38463D;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ink-composer-card {
  background: #FFFFFF;
  border: 1px solid var(--ink-border);
  border-radius: 24px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 4px 20px rgba(43, 66, 55, 0.03);
}

.ink-recipient-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #FAF7F2;
  border: 1px solid #EFE4D6;
  border-radius: 14px;
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.85rem;
}

.ink-to-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #1E2522;
}

.ink-to-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.ink-to-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.86rem;
  color: #1E2522;
}

.ink-btn-occasion {
  background: #FFFFFF;
  border: 1px solid #E0D6C8;
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #2B4237;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Rich Text Toolbar */
.ink-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #FAF7F2;
  border: 1px solid #EFE4D6;
  border-radius: 12px;
  padding: 0.35rem 0.65rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.ink-tool-select {
  background: #FFF;
  border: 1px solid #E0D6C8;
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  color: #1E2522;
  cursor: pointer;
  outline: none;
}

.ink-tool-divider {
  width: 1px;
  height: 18px;
  background: #E0D6C8;
  margin: 0 0.15rem;
}

.ink-tool-btn {
  background: none;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #38463D;
  cursor: pointer;
}

.ink-tool-btn:hover {
  background: #EFE4D6;
}

/* Parchment Area */
.ink-parchment-sheet-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}

.ink-parchment-sheet {
  background: #FAF7F0;
  border: 1px solid #EDE3D4;
  border-radius: 16px;
  min-height: 380px;
  padding: 2rem 2.5rem;
  box-shadow: inset 0 0 40px rgba(198, 146, 52, 0.04), 0 4px 16px rgba(0,0,0,0.02);
  position: relative;
}

.ink-letter-textarea {
  width: 100%;
  min-height: 320px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: 'Caveat', cursive;
  font-size: 1.45rem;
  line-height: 1.7;
  color: #2B4237;
}

.ink-parchment-art-corner {
  position: absolute;
  bottom: 1.25rem;
  right: 1.5rem;
  opacity: 0.35;
  pointer-events: none;
  width: 120px;
}

/* Vertical Float Tools */
.ink-parchment-float-tools {
  position: absolute;
  top: 1.5rem;
  right: -52px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ink-float-tool-btn {
  width: 44px;
  height: 48px;
  background: #FFFFFF;
  border: 1px solid #EFE4D6;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #2B4237;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: all 0.15s;
}

.ink-float-tool-btn span {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--ink-text-muted);
}

.ink-float-tool-btn:hover {
  background: #FAF5EE;
  transform: translateX(2px);
}

/* Actions Row */
.ink-composer-bottom-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ink-btn-draft {
  background: #FAF5EE;
  border: 1px solid #EFE4D6;
  border-radius: 12px;
  padding: 0.6rem 1.25rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #2B4237;
  cursor: pointer;
}

.ink-btn-preview {
  background: #FAF5EE;
  border: 1px solid #EFE4D6;
  border-radius: 12px;
  padding: 0.6rem 1.25rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #2B4237;
  cursor: pointer;
}

.ink-btn-schedule {
  background: #2B4237;
  color: #FFF;
  border: none;
  border-radius: 12px;
  padding: 0.65rem 1.65rem;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* -------------------------------------------------------------------------
   SECTION 4: RIGHT CONTROLS
   ------------------------------------------------------------------------- */
.ink-right-col {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.ink-card {
  background: #FFFFFF;
  border: 1px solid var(--ink-border);
  border-radius: 20px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 2px 14px rgba(43, 66, 55, 0.02);
}

.ink-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.ink-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1E2522;
}

.ink-card-link {
  font-size: 0.76rem;
  color: var(--ink-accent-green);
  text-decoration: none;
  font-weight: 600;
}

.ink-papers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.ink-paper-thumb-wrap {
  aspect-ratio: 3/4;
  border-radius: 8px;
  border: 1.5px solid #EFE4D6;
  background: #FFF;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.ink-paper-thumb-wrap.active {
  border-color: #2B4237;
}

.ink-paper-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #2B4237;
  color: #FFF;
  border-radius: 50%;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ink-paper-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ink-swatches-row {
  display: flex;
  justify-content: space-between;
}

.ink-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 0.75rem;
  transition: transform 0.15s;
}

.ink-swatch:hover {
  transform: scale(1.1);
}

.ink-delivery-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ink-delivery-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #EFE4D6;
  background: #FAF7F2;
  cursor: pointer;
}

.ink-delivery-item.active {
  background: #EFE4D6;
  border-color: #2B4237;
}

.ink-delivery-icon {
  font-size: 1rem;
}

.ink-delivery-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.ink-delivery-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1E2522;
}

.ink-delivery-sub {
  font-size: 0.7rem;
  color: var(--ink-text-muted);
}

.ink-ember-banner {
  background: #FAF5EE;
  border: 1px solid #EFE4D6;
  border-radius: 18px;
  padding: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ink-ember-seal-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.ink-ember-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ink-ember-title {
  font-size: 0.78rem;
  color: #38463D;
  line-height: 1.35;
}

.ink-ember-link {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-accent-green);
  text-decoration: none;
}

.ink-footer-quote {
  width: calc(100% - 4rem);
  max-width: 1480px;
  margin: 1.5rem auto 1rem auto;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: #38463D;
}

/* Responsive */
@media (max-width: 1300px) {
  .ink-master-grid {
    grid-template-columns: 180px 1fr 280px;
    padding: 0 1.5rem;
  }
  .ink-sara-col {
    display: none;
  }
}

@media (max-width: 860px) {
  .ink-master-grid {
    grid-template-columns: 1fr;
    padding: 0 0.75rem;
    margin: 0.75rem auto;
    gap: 1rem;
  }
  .ink-left-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.4rem;
    padding: 0.5rem;
    background: #FAF5EE;
    border-radius: 16px;
    border: 1px solid var(--ink-border);
  }
  .ink-left-nav::-webkit-scrollbar {
    display: none;
  }
  .ink-nav-btn {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: #FFF;
    border: 1px solid var(--ink-border);
    flex-shrink: 0;
    font-size: 0.82rem;
  }
  .ink-nav-btn-sub,
  .ink-left-quote-card {
    display: none;
  }
  .ink-letter-sheet {
    padding: 1.25rem 1rem;
    border-radius: 18px;
  }
  .ink-letter-textarea {
    font-size: 16px !important;
    min-height: 240px;
  }
  .ink-letter-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
}


/* ── Serena Prompt Bar ────────────────────────────────────────────────────── */
.ink-sara-prompt-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, #FBF5EB 0%, #F7F0E4 100%);
  border: 1.5px solid #EAD9C2;
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(43, 66, 55, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ink-sara-prompt-bar:focus-within {
  border-color: #C69234;
  box-shadow: 0 3px 18px rgba(198, 146, 52, 0.12);
}

.ink-sara-prompt-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  color: #8B6A30;
  line-height: 1;
}

.ink-sara-prompt-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: #2B3028;
  outline: none;
  line-height: 1.4;
}

.ink-sara-prompt-input::placeholder {
  color: #A89880;
  font-style: italic;
}

.ink-sara-prompt-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #C69234 0%, #A87828 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

.ink-sara-prompt-btn:hover:not(:disabled) {
  opacity: 0.88;
  transform: translateY(-1px);
}

.ink-sara-prompt-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Floating Selection Improver ────────────────────────────────────────── */
.ink-selection-tooltip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #2B3028;
  border-radius: 12px;
  padding: 0.55rem 0.9rem;
  margin-top: 0.6rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  animation: inkTooltipIn 0.18s ease;
  flex-wrap: wrap;
}

@keyframes inkTooltipIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ink-sel-tooltip-label {
  font-size: 0.74rem;
  color: #A8B4A0;
  font-style: italic;
  white-space: nowrap;
}

.ink-sel-improve-btn {
  background: linear-gradient(135deg, #C69234 0%, #A87828 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.38rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.1s ease;
  letter-spacing: 0.01em;
}

.ink-sel-improve-btn:hover:not(:disabled) {
  opacity: 0.88;
  transform: translateY(-1px);
}

.ink-sel-improve-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
