:root {
      --bg: #f4f1ec;
      --panel: #ffffff;
      --ink: #070707;
      --muted: #5c5c5c;
      --line: #0a0a0a;
      --head: #dedee0;
      --accent: #f59f24;
      --soft: #e6dfd5;
      --radius: 8px;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      color: var(--ink);
      background: var(--bg);
      font-family: "Anek Devanagari", system-ui, sans-serif;
    }

    button,
    textarea,
    input,
    select {
      font: inherit;
    }

    .app {
      min-height: 100vh;
      display: grid;
      grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
      gap: 16px;
      padding: 16px;
    }

    .controls {
      display: flex;
      min-height: calc(100vh - 32px);
      flex-direction: column;
      gap: 16px;
      padding: 18px;
      background: linear-gradient(180deg, #fff 0%, #fbfaf8 100%);
      border: 1px solid rgba(0, 0, 0, 0.08);
      border-radius: var(--radius);
      box-shadow: 0 18px 42px rgba(0, 0, 0, 0.11);
    }

    .brand-row {
      display: flex;
      align-items: center;
      gap: 13px;
      padding-bottom: 14px;
      border-bottom: 1px solid #ece6dd;
    }

    .mark {
      width: 52px;
      height: 52px;
      flex: 0 0 auto;
      object-fit: contain;
      object-position: center;
      filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
    }

    h1 {
      margin: 0;
      font-size: 27px;
      line-height: 1;
      font-weight: 800;
    }

    .hint {
      margin: 2px 0 0;
      color: var(--muted);
      font-size: 15px;
      line-height: 1.25;
    }

    .input-card {
      display: grid;
      gap: 10px;
      position: relative;
    }

    .section-label {
      display: flex;
      align-items: center;
      justify-content: space-between;
      color: #2a2927;
      font-size: 14px;
      font-weight: 800;
    }

    .format-chip {
      padding: 3px 8px 1px;
      border-radius: 999px;
      background: #fff4e2;
      color: #8b4d02;
      font-size: 12px;
      font-weight: 800;
    }

    .column-tools {
      display: flex;
      gap: 6px;
    }

    .chip-btn {
      width: 30px;
      height: 30px;
      border: 1px solid #1b1b1b;
      border-radius: 8px;
      background: #1b1b1b;
      color: #fff;
      cursor: pointer;
      font-size: 20px;
      font-weight: 800;
      line-height: 1;
      display: grid;
      place-items: center;
    }

    .chip-btn.secondary {
      background: #fff;
      color: #1b1b1b;
    }

    .floating-subhead-btn {
      position: absolute;
      right: 10px;
      top: 42px;
      z-index: 5;
      min-height: 34px;
      padding: 6px 12px 5px;
      border: 1px solid #1b1b1b;
      border-radius: 999px;
      background: #1b1b1b;
      color: #fff;
      cursor: pointer;
      font-size: 13px;
      font-weight: 800;
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    }

    .floating-subhead-btn[hidden] {
      display: none;
    }

    textarea {
      width: 100%;
      min-height: 360px;
      resize: vertical;
      border: 1px solid #d8d0c5;
      border-radius: var(--radius);
      padding: 15px;
      color: var(--ink);
      background: #fffdfb;
      font-size: 18px;
      line-height: 1.45;
      outline: none;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }

    textarea:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(245, 159, 36, 0.22);
    }

    .source-textarea {
      min-height: 74px;
      font-size: 15px;
      line-height: 1.35;
    }

    .grid-controls {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    label {
      display: grid;
      gap: 5px;
      color: #222;
      font-size: 14px;
      font-weight: 700;
    }

    input,
    select {
      width: 100%;
      min-height: 42px;
      border: 1px solid #bdb7af;
      border-radius: var(--radius);
      padding: 8px 10px;
      background: #fff;
      color: var(--ink);
    }

    .check {
      display: flex;
      align-items: center;
      gap: 9px;
      font-size: 15px;
      font-weight: 700;
    }

    .check input {
      width: 18px;
      min-height: 18px;
      accent-color: var(--accent);
    }

    .hidden-options {
      display: none;
    }

    .actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: auto;
      padding-top: 12px;
      border-top: 1px solid #ece6dd;
    }

    .btn {
      min-height: 48px;
      border: 1px solid var(--ink);
      border-radius: var(--radius);
      background: var(--ink);
      color: #fff;
      cursor: pointer;
      font-weight: 800;
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
      transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    }

    .btn.secondary {
      background: #fff;
      color: var(--ink);
      box-shadow: none;
    }

    .btn:hover,
    .file-btn:hover,
    .small-btn:hover {
      transform: translateY(-1px);
    }

    .btn:active,
    .file-btn:active,
    .small-btn:active {
      transform: translateY(0);
    }

    .photo-tools {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
      padding: 12px;
      border: 1px solid #e7dfd4;
      border-radius: var(--radius);
      background: #fff;
    }

    .language-field {
      display: grid;
      gap: 7px;
      padding: 12px;
      border: 1px solid #e7dfd4;
      border-radius: var(--radius);
      background: #fff;
    }

    .language-field select {
      min-height: 44px;
      border: 1px solid #d8d0c5;
      background: #fffdfb;
      font-weight: 700;
    }

    .file-btn {
      min-height: 42px;
      display: grid;
      place-items: center;
      border: 1px solid #1b1b1b;
      border-radius: var(--radius);
      background: #1b1b1b;
      color: #fff;
      cursor: pointer;
      font-weight: 800;
      transition: transform 0.15s ease;
    }

    .file-btn input {
      display: none;
    }

    .small-btn {
      min-height: 42px;
      padding: 0 14px;
      border: 1px solid #bdb7af;
      border-radius: var(--radius);
      background: #faf7f2;
      color: var(--ink);
      cursor: pointer;
      font-weight: 800;
      transition: transform 0.15s ease;
    }

    .stage {
      min-width: 0;
      overflow: auto;
      padding: 22px;
      border-radius: var(--radius);
      background: #d9d2c7;
    }

    .sheet-wrap {
      min-width: 730px;
      display: flex;
      justify-content: center;
    }

    .sheet {
      width: 730px;
      height: auto;
      position: relative;
      padding: 17px 14px 18px;
      background: #fff;
      color: #000;
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    }

    .table-titlebar {
      display: block;
      position: relative;
      margin-bottom: 13px;
    }

    .table-titlebar::after {
      content: "";
      display: block;
      clear: both;
    }

    .news-logo {
      width: 68px;
      height: 68px;
      position: absolute;
      left: 14px;
      top: 17px;
      z-index: 2;
      object-fit: contain;
      object-position: center;
      filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
    }

    .heading-box {
      min-width: 0;
      padding-top: 22px;
      width: 100%;
    }

    .headline {
      margin: 0;
      font-size: var(--title-size, 41px);
      line-height: 1.2;
      font-weight: 700;
      letter-spacing: 0;
      text-align: center;
      overflow-wrap: anywhere;
      min-height: 1.2em;
    }

    .headline-line {
      display: block;
      position: relative;
      white-space: nowrap;
    }

    .subheadline {
      margin: 8px 0 0;
      font-size: var(--subtitle-size, 30px);
      line-height: 1.25;
      font-weight: 600;
      color: #1f1f1f;
      text-align: center;
      overflow-wrap: anywhere;
      position: relative;
      left: var(--subtitle-shift, 25px);
      width: calc(100% - var(--subtitle-shift, 25px));
    }

    .photo-frame {
      width: calc(100% + 28px);
      aspect-ratio: 4 / 2;
      margin: -17px -14px 13px;
      background: #f1f1f1;
      overflow: hidden;
      position: relative;
      cursor: zoom-in;
      user-select: none;
      touch-action: none;
    }

    .photo-frame[hidden] {
      display: none;
    }

    .photo-frame.editing {
      cursor: move;
      outline: 2px solid var(--accent);
      outline-offset: -2px;
    }

    .photo-frame.editing::after {
      content: "Drag to move • Scroll to zoom • Double-click to finish";
      position: absolute;
      left: 12px;
      right: 12px;
      bottom: 10px;
      padding: 6px 8px 4px;
      border-radius: 6px;
      background: rgba(0, 0, 0, 0.72);
      color: #fff;
      font-size: 13px;
      font-weight: 700;
      text-align: center;
      pointer-events: none;
    }

    .photo-frame img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
      object-position: center;
      transform-origin: center;
      will-change: transform;
    }

    .data-table {
      width: 100%;
      border-collapse: collapse;
      table-layout: fixed;
      border: var(--border-size, 1px) solid var(--line);
    }

    .data-table th,
    .data-table td {
      border: var(--border-size, 1px) solid var(--line);
      padding: 16px 18px 11px;
      color: #000;
      vertical-align: middle;
      letter-spacing: 0;
      overflow-wrap: anywhere;
    }

    .data-table th {
      background: var(--head);
      font-size: var(--header-size, 22px);
      line-height: 32px;
      font-weight: 600;
      text-align: left;
      color: var(--header-text, #000);
    }

    .data-table td {
      min-height: 60px;
      font-size: var(--body-size, 24px);
      line-height: 32px;
      font-weight: 500;
      text-align: var(--body-align, left);
    }

    .table-source {
      margin: 19px 0 0;
      color: #9c9c9c;
      font-size: 20px;
      line-height: 1.25;
      font-weight: 400;
      overflow-wrap: anywhere;
    }

    .table-source[hidden] {
      display: none;
    }

    .error {
      display: none;
      padding: 10px 12px;
      border: 1px solid #c64242;
      border-radius: var(--radius);
      background: #fff1f1;
      color: #8c1515;
      font-size: 15px;
      font-weight: 700;
    }

    .error.show {
      display: block;
    }

    @media (max-width: 940px) {
      .app {
        grid-template-columns: 1fr;
      }

      .controls {
        min-height: auto;
      }

      .sheet-wrap {
        min-width: 730px;
      }
    }
  