/* Drag placeholder */
.nf-drag-placeholder {
  border: 2px dashed var(--nf-accent);
  border-radius: var(--nf-radius-md);
  opacity: 0.5;
}

/* ── E-Konte Sheet Styles ── */

.ek-document {
  --ek-paper: #f5f0e8;
  --ek-paper-dark: #e8e0d0;
  --ek-ink: #2a2520;
  --ek-ink-light: #6b5f52;
  --ek-ink-faint: #9e9285;
  --ek-red: #c23b22;
  --ek-red-light: #e8d4cf;
  --ek-blue: #2d5a7b;
  --ek-blue-light: #d4e0ea;
  --ek-grid: #c8bfb0;
  --ek-highlight: #f0e6c8;

  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Noto Sans JP', 'Segoe UI', system-ui, sans-serif;
  color: var(--ek-ink);
  line-height: 1.5;
}

/* Breadcrumb */
.ek-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ek-ink-faint);
  margin-bottom: 16px;
}

.ek-breadcrumb a {
  color: var(--ek-blue);
  text-decoration: none;
  cursor: pointer;
}

.ek-breadcrumb a:hover {
  text-decoration: underline;
}

.ek-breadcrumb__sep {
  color: var(--ek-ink-faint);
}

/* Title Page */
.ek-title-page {
  background: var(--ek-paper);
  border: 2px solid var(--ek-ink);
  padding: 48px 40px;
  margin-bottom: 30px;
  position: relative;
}

.ek-title-page::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid var(--ek-grid);
  pointer-events: none;
}

.ek-title-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}

.ek-title-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 8px;
}

.ek-title-stamp {
  width: 60px;
  height: 60px;
  border: 3px solid var(--ek-red);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif JP', serif;
  font-size: 20px;
  color: var(--ek-red);
  transform: rotate(-3deg);
  opacity: 0.85;
}

.ek-title-en {
  font-size: 16px;
  font-weight: 300;
  color: var(--ek-ink-light);
  margin-bottom: 32px;
  letter-spacing: 2px;
}

.ek-title-meta {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 20px;
  font-size: 13px;
  color: var(--ek-ink-light);
  border-top: 1px solid var(--ek-grid);
  padding-top: 20px;
}

.ek-title-meta dt {
  font-weight: 500;
  color: var(--ek-ink);
}

.ek-title-meta dd {
  font-weight: 300;
}

/* Section Headers */
.ek-section-header {
  background: var(--ek-ink);
  color: var(--ek-paper);
  padding: 10px 20px;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
}

.ek-section-header .ek-section-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 18px;
}

.ek-section-header .ek-section-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  opacity: 0.7;
}

/* E-Konte Sheet */
.ek-sheet {
  background: var(--ek-paper);
  border: 2px solid var(--ek-ink);
  border-top: none;
  margin-bottom: 30px;
}

/* Column Headers */
.ek-columns {
  display: grid;
  grid-template-columns: 60px 280px 1fr 200px 60px;
  border-bottom: 2px solid var(--ek-ink);
  background: var(--ek-paper-dark);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  letter-spacing: 2px;
}

.ek-columns > div {
  padding: 6px 8px;
  border-right: 1px solid var(--ek-grid);
}

.ek-columns > div:last-child {
  border-right: none;
}

.ek-col-label-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 13px;
  display: block;
}

.ek-col-label-en {
  font-size: 9px;
  color: var(--ek-ink-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Cut Row */
.ek-cut-row {
  display: grid;
  grid-template-columns: 60px 280px 1fr 200px 60px;
  border-bottom: 1px solid var(--ek-grid);
  min-height: 140px;
}

.ek-cut-row:last-child {
  border-bottom: none;
}

.ek-cut-row.ek-scene-break {
  border-bottom: 2px solid var(--ek-ink-light);
}

.ek-cut-row > div {
  padding: 10px;
  border-right: 1px solid var(--ek-grid);
  font-size: 13px;
}

.ek-cut-row > div:last-child {
  border-right: none;
}

/* Cut Number */
.ek-cut-number {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14px !important;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  font-size: 14px;
  color: var(--ek-ink);
  background: var(--ek-paper-dark);
}

/* Frame Box */
.ek-cut-frame {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px !important;
}

.ek-frame-box {
  width: 260px;
  height: 146px;
  border: 1.5px solid var(--ek-ink);
  background: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ek-frame-box::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border: 1px dashed var(--ek-grid);
  pointer-events: none;
  z-index: 1;
}

.ek-frame-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 0;
}

.ek-frame-box__placeholder {
  font-size: 11px;
  color: var(--ek-ink-faint);
  text-align: center;
  pointer-events: none;
}

.ek-frame-box--dragover {
  border-color: var(--ek-blue);
  border-style: dashed;
  background: var(--ek-blue-light);
}

.ek-frame-description {
  padding: 4px 0;
  font-size: 11px;
  color: var(--ek-ink-light);
  line-height: 1.6;
  font-weight: 300;
}

.ek-frame-tag {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 2px;
  margin-right: 4px;
  cursor: pointer;
  user-select: none;
}

.ek-tag-8mm { background: var(--ek-highlight); color: var(--ek-ink); border: 1px solid #d4c9a0; }
.ek-tag-apt { background: var(--ek-blue-light); color: var(--ek-blue); border: 1px solid #a8c4d8; }
.ek-tag-leader { background: var(--ek-red-light); color: var(--ek-red); border: 1px solid #d4aba0; }
.ek-tag-freeze { background: #e0e8d8; color: #4a6040; border: 1px solid #b8c8a8; }
.ek-tag-chart { background: #e8daf0; color: #5a3a70; border: 1px solid #c8b0d8; }

.ek-camera-note {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ek-blue);
  margin-top: 3px;
}

/* Content Column */
.ek-cut-content {
  line-height: 1.7;
}

.ek-content-action {
  font-size: 12px;
  color: var(--ek-ink-light);
  margin-bottom: 6px;
  font-weight: 300;
  line-height: 1.6;
}

.ek-content-visual {
  font-size: 12px;
  color: var(--ek-ink);
  line-height: 1.7;
}

/* Dialogue Column */
.ek-cut-dialogue {
  background: rgba(245, 240, 232, 0.5);
}

.ek-dialogue-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 4px;
  color: var(--ek-ink);
}

.ek-dialogue-en {
  font-size: 11px;
  color: var(--ek-ink-light);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 8px;
}

.ek-dialogue-direction {
  font-size: 10px;
  color: var(--ek-blue);
  font-style: italic;
  margin-top: 4px;
}

.ek-dialogue-note {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--ek-red);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dotted var(--ek-grid);
}

/* Duration Column */
.ek-cut-duration {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 14px !important;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  background: var(--ek-paper-dark);
  color: var(--ek-ink);
}

.ek-duration-seconds {
  font-size: 16px;
  font-weight: 500;
}

.ek-duration-label {
  font-size: 9px;
  color: var(--ek-ink-faint);
  letter-spacing: 1px;
}

/* Sound Row */
.ek-sound-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  border-bottom: 1px solid var(--ek-grid);
  background: rgba(45, 90, 123, 0.04);
}

.ek-sound-row > div:first-child {
  background: var(--ek-paper-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--ek-grid);
  font-size: 10px;
  color: var(--ek-ink-faint);
  padding: 6px;
}

.ek-sound-row .ek-sound-detail {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--ek-blue);
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1.6;
}

/* Breathing Space Row */
.ek-breathing-row {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  border-bottom: 1px solid var(--ek-grid);
  background: var(--ek-paper-dark);
}

.ek-breathing-row > div {
  padding: 8px 14px;
  border-right: 1px solid var(--ek-grid);
}

.ek-breathing-row > div:last-child {
  border-right: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}

.ek-breathing-label {
  font-size: 12px;
  color: var(--ek-ink-faint);
  font-style: italic;
  letter-spacing: 1px;
}

.ek-breathing-desc {
  font-size: 11px;
  color: var(--ek-ink-light);
  font-weight: 300;
}

/* Sheet Footer */
.ek-sheet-footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 10px;
  color: var(--ek-ink-faint);
  border-top: 1px solid var(--ek-grid);
  background: var(--ek-paper-dark);
}

/* Inline Editing */
.ek-editable {
  cursor: text;
  border-radius: 2px;
  padding: 1px 3px;
  margin: -1px -3px;
  transition: outline 100ms, background 100ms;
  outline: 1px solid transparent;
  min-height: 1.2em;
}

.ek-editable:hover {
  outline: 1px solid var(--ek-grid);
}

.ek-editable:focus {
  outline: 2px solid var(--ek-blue);
  background: #fff;
}

.ek-editable:empty::before {
  content: attr(data-placeholder);
  color: var(--ek-ink-faint);
  font-style: italic;
  pointer-events: none;
}

/* Row Actions */
.ek-row-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 150ms;
}

.ek-row:hover .ek-row-actions {
  opacity: 1;
}

.ek-row-action-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: var(--ek-paper-dark);
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  color: var(--ek-ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ek-row-action-btn:hover {
  background: var(--ek-red-light);
  color: var(--ek-red);
}

.ek-row {
  position: relative;
}

/* Drag Handle */
.ek-drag-handle {
  cursor: grab;
  opacity: 0;
  transition: opacity 150ms;
  font-size: 12px;
  color: var(--ek-ink-faint);
  user-select: none;
}

.ek-row:hover .ek-drag-handle {
  opacity: 0.6;
}

.ek-drag-handle:hover {
  opacity: 1 !important;
}

/* Add Row Buttons */
.ek-add-row-bar {
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  background: var(--ek-paper);
  border-bottom: 1px solid var(--ek-grid);
}

.ek-add-btn {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px dashed var(--ek-grid);
  background: none;
  color: var(--ek-ink-light);
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 150ms, color 150ms;
}

.ek-add-btn:hover {
  border-color: var(--ek-blue);
  color: var(--ek-blue);
}

.ek-add-section-btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--ek-grid);
  background: none;
  color: var(--ek-ink-light);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 4px;
  transition: border-color 150ms, color 150ms;
  margin-top: 16px;
}

.ek-add-section-btn:hover {
  border-color: var(--ek-blue);
  color: var(--ek-blue);
}

/* Tag Picker Dropdown */
.ek-tag-picker {
  position: absolute;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--ek-grid);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  padding: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 160px;
}

.ek-tag-picker .ek-frame-tag {
  cursor: pointer;
  opacity: 0.5;
}

.ek-tag-picker .ek-frame-tag.ek-tag--active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--ek-blue);
}

.ek-tag-picker .ek-frame-tag:hover {
  opacity: 0.8;
}

/* Lightbox */
.ek-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
}

.ek-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

/* Edit metadata button */
.ek-edit-meta-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid var(--ek-grid);
  background: var(--ek-paper);
  color: var(--ek-ink-light);
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}

.ek-edit-meta-btn:hover {
  border-color: var(--ek-blue);
  color: var(--ek-blue);
}
