    :root {
      --primary: #2d5c43;
      --accent: #e8a020;
      --bg: #f4f6f8;
      --card: #ffffff;
      --text: #1f2933;
      --muted: #6b7280;
      --border: #d8dee6;
      --danger: #b42318;
      --warning-bg: #fff4df;
      --warning-text: #8a5a00;
      --success: #2d5c43;
      --shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
      --radius: 14px;
      --header-height: 64px;
    }

    * {
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
    }

    html, body {
      margin: 0;
      padding: 0;
      font-family: Arial, Helvetica, sans-serif;
      background: var(--bg);
      color: var(--text);
    }

    body {
      min-height: 100vh;
    }

    .app {
      max-width: 480px;
      margin: 0 auto;
      min-height: 100vh;
      background: var(--bg);
      position: relative;
    }

    .header {
      position: sticky;
      top: 0;
      z-index: 40;
      height: var(--header-height);
      background: var(--primary);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 12px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    }

    .header-left,
    .header-right {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 72px;
    }

    .header-right {
      justify-content: flex-end;
    }

    .header-title {
      flex: 1;
      text-align: center;
      font-size: 16px;
      font-weight: 700;
      line-height: 1.2;
      padding: 0 8px;
    }

    .icon-btn,
    .btn,
    .list-action,
    .fab,
    .secondary-action {
      border: none;
      border-radius: 12px;
      cursor: pointer;
      font: inherit;
    }

    .icon-btn {
      height: 40px;
      min-width: 40px;
      padding: 0 12px;
      background: rgba(255, 255, 255, 0.14);
      color: #fff;
      font-weight: 700;
    }

    .icon-btn:disabled {
      opacity: 0.45;
      cursor: default;
    }

    .icon-btn:focus-visible,
    .btn:focus-visible,
    .list-action:focus-visible,
    .fab:focus-visible,
    .secondary-action:focus-visible,
    .text-link:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .screen {
      display: none;
      padding: 16px;
      padding-bottom: 108px;
    }

    .screen.active {
      display: block;
    }

    .stack {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 14px;
    }

    .section-title {
      margin: 0 0 12px;
      font-size: 16px;
      font-weight: 700;
      color: var(--primary);
    }

    .muted {
      color: var(--muted);
      font-size: 13px;
    }

    .small {
      font-size: 12px;
    }

    .empty-state {
      text-align: center;
      padding: 24px 16px;
      color: var(--muted);
    }

    .list-item {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 14px;
      box-shadow: var(--shadow);
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .list-item-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
    }

    .list-title {
      font-weight: 700;
      color: var(--primary);
      font-size: 15px;
      margin: 0 0 4px;
    }

    .list-subtitle {
      font-size: 13px;
      color: var(--muted);
      line-height: 1.35;
      margin: 0;
      white-space: pre-line;
    }

    .list-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .list-action {
      padding: 10px 12px;
      background: #eef2f6;
      color: var(--primary);
      font-weight: 700;
    }

    .list-action.danger {
      background: #fdecec;
      color: var(--danger);
    }

    .project-list-item {
      padding: 12px;
    }

    .project-list-layout {
      display: grid;
      grid-template-columns: minmax(0, 2fr) minmax(104px, 1fr);
      gap: 10px;
      align-items: stretch;
    }

    .project-list-main {
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-width: 0;
    }

    .project-list-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .project-open-action {
      height: 100%;
      min-height: 108px;
      width: 100%;
      font-size: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    @media (max-width: 340px) {
      .project-list-layout {
        grid-template-columns: 1fr;
      }

      .project-open-action {
        min-height: 48px;
      }
    }

    .form-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
    }

    .inline-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .field label {
      font-size: 13px;
      font-weight: 700;
      color: var(--primary);
    }

    .field input,
    .field select,
    .field textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px 14px;
      font: inherit;
      background: #fff;
      color: var(--text);
      min-height: 46px;
    }

    .field textarea {
      min-height: 92px;
      resize: vertical;
    }

    .readonly {
      background: #f7f9fb !important;
    }

    .actions-bottom {
      position: fixed;
      left: 50%;
      transform: translateX(-50%);
      bottom: 0;
      width: 100%;
      max-width: 480px;
      background: rgba(244, 246, 248, 0.98);
      border-top: 1px solid var(--border);
      padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
      display: flex;
      gap: 10px;
      z-index: 45;
    }

    .btn {
      min-height: 48px;
      padding: 12px 16px;
      font-weight: 700;
      flex: 1;
    }

    .btn-primary {
      background: var(--primary);
      color: #fff;
    }

    .btn-accent {
      background: var(--accent);
      color: #1d1d1d;
    }

    .btn-secondary,
    .secondary-action {
      background: #eef2f6;
      color: var(--primary);
    }

    .btn-danger {
      background: #fdecec;
      color: var(--danger);
    }

    .toolbar,
    .helper-row {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
    }

    .fab-wrap {
      position: fixed;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 480px;
      bottom: 84px;
      pointer-events: none;
      z-index: 35;
    }

    .fab {
      pointer-events: auto;
      position: absolute;
      right: 16px;
      bottom: 0;
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: var(--accent);
      color: #1d1d1d;
      font-size: 28px;
      font-weight: 700;
      box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
    }

    .status-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border-radius: 999px;
      padding: 6px 10px;
      background: #eef7f6;
      color: var(--success);
      font-size: 12px;
      font-weight: 700;
    }

    .sync-error-banner {
      display: none;
      margin: 8px 16px 0;
      padding: 10px 12px;
      border: 1px solid #f7b4b4;
      border-radius: 10px;
      background: #fff1f1;
      color: #8f1d1d;
      font-size: 12px;
      line-height: 1.4;
    }

    .lob-card {
      background: #fbfcfd;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .lob-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .lob-title {
      font-weight: 700;
      color: var(--primary);
      font-size: 14px;
      margin: 0;
    }

    .text-link {
      border: none;
      background: transparent;
      color: var(--danger);
      font: inherit;
      font-weight: 700;
      padding: 4px 0;
      cursor: pointer;
    }

    .warning-banner {
      position: sticky;
      top: var(--header-height);
      z-index: 30;
      margin: -16px -16px 12px;
      padding: 12px 16px;
      background: var(--warning-bg);
      border-bottom: 1px solid #f0d49a;
      color: var(--warning-text);
      display: none;
    }

    .warning-banner.active {
      display: block;
    }

    .warning-banner strong {
      display: block;
      margin-bottom: 6px;
      color: #6c4600;
    }

    .warning-list {
      margin: 0;
      padding-left: 18px;
      font-size: 13px;
      line-height: 1.4;
    }

    .photo-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
    }

    .photo-card,
    .lob-panel {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .photo-card {
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px;
      background: #fbfcfd;
    }

    .photo-card-actions {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .photo-preview {
      width: 100%;
      aspect-ratio: 4 / 3;
      border-radius: 10px;
      border: 1px solid var(--border);
      object-fit: cover;
      background: #f1f4f7;
      display: block;
    }

    .photo-empty {
      width: 100%;
      aspect-ratio: 4 / 3;
      border-radius: 10px;
      border: 1px dashed var(--border);
      background: #f8fafc;
      color: var(--muted);
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 16px;
      font-size: 13px;
    }

    .file-input {
      width: 100%;
      min-height: 46px;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 10px 12px;
      background: #fff;
      font: inherit;
    }

    .canvas-wrap {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .sketch-canvas {
      width: 100%;
      height: auto;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #fff;
      touch-action: manipulation;
    }

    .secondary-actions-row {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .secondary-action {
      padding: 10px 12px;
      font-weight: 700;
    }

    .input-note {
      font-size: 12px;
      color: var(--muted);
      margin-top: -2px;
    }


    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.55);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 16px;
      z-index: 100;
    }

    .modal-backdrop.active {
      display: flex;
    }

    .modal-card {
      width: 100%;
      max-width: 480px;
      background: #fff;
      border-radius: 16px;
      box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .modal-canvas {
      width: 100%;
      height: auto;
      max-height: 65vh;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #fff;
    }

    .modal-canvas-wrap {
      position: relative;
      border-radius: 12px;
      overflow: hidden;
    }

    .modal-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .rotation-readout {
      font-size: 12px;
      color: var(--muted);
    }

    .photo-upload-status {
      display: none;
      position: absolute;
      inset: 0;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 8px;
      padding: 12px;
      background: rgba(26, 37, 31, 0.46);
      color: #ffffff;
      font-size: 13px;
      font-weight: 700;
      text-align: center;
      z-index: 2;
    }

    .photo-upload-status.active {
      display: flex;
    }

    .photo-upload-error {
      display: none;
      flex-direction: column;
      gap: 10px;
      padding: 12px;
      margin-top: 10px;
      border-radius: 12px;
      background: #fff4f4;
      border: 1px solid #f5c2c2;
      color: var(--danger);
      font-size: 13px;
      line-height: 1.4;
    }

    .photo-upload-error.active {
      display: flex;
    }

    .photo-upload-error-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .photo-upload-error-actions .btn,
    .photo-upload-error-actions .secondary-action {
      flex: 1 1 auto;
      min-width: 120px;
    }

    .status-spinner {
      width: 22px;
      height: 22px;
      border: 3px solid rgba(255, 255, 255, 0.4);
      border-top-color: #ffffff;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
      flex: 0 0 auto;
    }

    .modal-card.uploading .modal-canvas {
      filter: grayscale(0.25) brightness(0.72);
    }

    .modal-card.uploading .modal-actions {
      opacity: 0.55;
    }

    .project-list-loading {
      display: none;
      position: fixed;
      top: var(--header-height);
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 480px;
      height: calc(100vh - var(--header-height));
      align-items: center;
      justify-content: center;
      gap: 10px;
      background: rgba(33, 41, 36, 0.36);
      color: #ffffff;
      font-size: 13px;
      font-weight: 700;
      z-index: 50;
      pointer-events: none;
    }

    .zip-export-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 220;
      align-items: center;
      justify-content: center;
      padding: 24px;
      background: rgba(33, 41, 36, 0.58);
      pointer-events: auto;
    }

    .zip-export-overlay.active {
      display: flex;
    }

    .zip-export-panel {
      display: flex;
      align-items: flex-start;
      gap: 14px;
      width: min(400px, 100%);
      padding: 18px 20px;
      border-radius: 14px;
      background: #212924;
      color: #ffffff;
      box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
    }

    .zip-export-panel-text {
      flex: 1;
      min-width: 0;
    }

    .zip-export-message {
      font-size: 15px;
      font-weight: 700;
      line-height: 1.35;
    }

    .zip-export-detail {
      margin-top: 6px;
      font-size: 13px;
      font-weight: 500;
      line-height: 1.45;
      color: rgba(255, 255, 255, 0.84);
    }

    .zip-export-detail:empty {
      display: none;
    }

    .zip-export-progress {
      margin-top: 12px;
      height: 8px;
      border-radius: 999px;
      overflow: hidden;
      background: rgba(255, 255, 255, 0.2);
    }

    .zip-export-progress-fill {
      width: 0%;
      height: 100%;
      border-radius: 999px;
      background: #ffffff;
      transition: width 0.2s ease;
    }

    .zip-export-percent {
      margin-top: 8px;
      font-size: 12px;
      font-weight: 700;
      color: rgba(255, 255, 255, 0.9);
    }

    .zip-export-percent:empty {
      display: none;
    }

    .project-list-loading.active {
      display: flex;
      pointer-events: auto;
    }

    .project-list-loading .status-spinner {
      width: 20px;
      height: 20px;
      border-width: 3px;
      border-color: rgba(255, 255, 255, 0.45);
      border-top-color: #ffffff;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    .login-stack {
      max-width: 420px;
      margin: 48px auto 0;
    }

    .login-card .field {
      margin-top: 16px;
    }

    .login-card .btn {
      width: 100%;
      margin-top: 20px;
    }

    .login-error {
      margin-top: 12px;
      color: var(--danger);
      font-size: 14px;
    }

    .user-initialer-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      height: 40px;
      min-width: 40px;
      padding: 0 12px;
      font-size: 13px;
      font-weight: 700;
      line-height: 1;
      letter-spacing: 0.02em;
      border: none;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.16);
      color: #fff;
      white-space: nowrap;
      cursor: pointer;
      vertical-align: middle;
    }

    .user-initialer-btn:hover {
      background: rgba(255, 255, 255, 0.24);
    }

    @media (max-width: 360px) {
      .inline-grid {
        grid-template-columns: 1fr;
      }
    }