    :root {
      --bg: rgba(255, 255, 255, 0.22);
      --surface: rgba(255, 255, 255, 0.34);
      --surface-solid: #ffffff;
      --text: #000000;
      --text-secondary: #000000;
      --accent: #4E7C32;
      --border: #d1d1d6;
      --safe-top: env(safe-area-inset-top, 0px);
      --safe-bottom: env(safe-area-inset-bottom, 0px);
      --safe-left: env(safe-area-inset-left, 0px);
      --chrome: #F3F0F2;
    }

    @media (prefers-color-scheme: dark) {
      :root {
        --chrome: #545354;
      }
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    html, body {
      height: 100%;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      background: var(--chrome);
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
      background: var(--chrome);
      color: var(--text);
      -webkit-font-smoothing: antialiased;
      overflow: hidden;
    }

    .app {
      position: relative;
      display: flex;
      flex-direction: column;
      height: 100%;
      width: 100%;
      max-width: 430px;
      margin: 0 auto;
      background: var(--chrome);
      overflow: hidden;
      min-width: 0;
      border-radius: 24px 24px 0 0;
    }

    .mascot-landscape {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 1000;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
      pointer-events: auto;
    }

    @media (orientation: landscape) and (pointer: coarse) {
      .mascot-landscape {
        display: block;
      }

      .todo-floaters:not([hidden]) {
        display: block;
      }
    }

    .todo-floaters {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 1001;
      overflow: hidden;
      pointer-events: none;
    }

    .todo-floater {
      position: absolute;
      left: 0;
      top: 0;
      max-width: 148px;
      padding: 7px 9px;
      background: rgba(255, 252, 247, 0.92);
      border-radius: 4px;
      box-shadow: 0 2px 10px rgba(28, 20, 18, 0.22);
      font-size: 12px;
      font-weight: 600;
      line-height: 1.25;
      color: #1c1412;
      will-change: transform;
      word-break: break-word;
    }

    html.is-flashing,
    html.is-flashing body,
    .app.is-flashing {
      background: #ffffff;
    }

    .camera-flash {
      position: absolute;
      inset: 0;
      z-index: 400;
      background: #ffffff;
      opacity: 0;
      pointer-events: none;
      border-radius: 24px 24px 0 0;
      transition: opacity 0.35s ease;
    }

    .camera-flash.is-on {
      opacity: 1;
      transition: none;
    }

    .companion-stage {
      position: absolute;
      inset: 0;
      z-index: 0;
      overflow: hidden;
      pointer-events: none;
      background: var(--chrome);
      border-radius: 24px 24px 0 0;
    }

    .companion-still {
      position: absolute;
      inset: 0;
      z-index: 1;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 8%;
      opacity: 1;
    }

    .companion-still.is-placeholder {
      z-index: 3;
    }

    .companion-still.is-swapped {
      opacity: 0;
    }

    .companion-clip {
      position: absolute;
      inset: 0;
      z-index: 1;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 8%;
      opacity: 0;
      pointer-events: none;
    }

    .companion-clip.is-active {
      z-index: 2;
      opacity: 1;
    }

    .companion-clip.is-active.is-fading {
      opacity: 0;
      transition: opacity 0.55s ease;
    }

    #companion-celebrate.is-active {
      z-index: 3;
    }

    .companion-spacer {
      flex: 1 1 auto;
      min-height: 0;
    }

    html.is-landscape-dev,
    html.is-landscape-dev body {
      overflow: hidden;
    }

    html.is-landscape-dev .app {
      position: absolute;
      top: 0;
      left: 100%;
      width: 100vh;
      height: 100vw;
      max-width: none;
      margin: 0;
      border-radius: 0;
      transform: rotate(90deg);
      transform-origin: top left;
    }

    .icon-btn {
      position: absolute;
      top: calc(10px + var(--safe-top));
      z-index: 10;
      width: 44px;
      height: 44px;
      border: none;
      border-radius: 22px;
      background: rgba(255, 255, 255, 0.82);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      color: #000;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      -webkit-tap-highlight-color: transparent;
    }

    .icon-btn[hidden] {
      display: none !important;
    }

    .icon-btn .material-symbols-outlined {
      font-size: 22px;
      line-height: 1;
    }

    .list-add-btn {
      left: 12px;
      top: calc(10px + var(--safe-top) + 52px);
    }

    .list-remove-btn {
      left: 12px;
      top: calc(10px + var(--safe-top) + 104px);
    }

    .secretary-btn {
      left: 12px;
    }

    .secretary-btn .material-symbols-outlined {
      font-size: 22px;
      line-height: 1;
    }

    .secretary-icon-close {
      display: none;
    }

    .app.secretary-open .secretary-icon-open {
      display: none;
    }

    .app.secretary-open .secretary-icon-close {
      display: block;
    }

    .app.secretary-open .secretary-btn {
      z-index: 1101;
    }

    @media (orientation: landscape) and (pointer: coarse) {
      .app.secretary-open .secretary-btn {
        position: fixed;
        top: calc(10px + var(--safe-top));
        left: calc(12px + var(--safe-left));
        right: auto;
      }
    }

    .secretary-overlay {
      position: fixed;
      inset: 0;
      z-index: 1100;
      background: #fff;
    }

    .secretary-overlay[hidden] {
      display: none;
    }

    .secretary-overlay iframe {
      display: block;
      width: 100%;
      height: 100%;
      border: 0;
    }

    .camera-btn {
      right: 12px;
    }

    .peek-btn {
      top: calc(10px + var(--safe-top) + 52px);
      right: 12px;
    }

    .icon-btn svg {
      width: 22px;
      height: 22px;
      fill: currentColor;
    }

    .peek-icon-show {
      display: none;
    }

    .app.ui-hidden .peek-icon-hide {
      display: none;
    }

    .app.ui-hidden .peek-icon-show {
      display: block;
    }

    .app.ui-hidden .icon-btn {
      background: rgba(255, 255, 255, 0.72);
    }

    .app.ui-hidden .content,
    .app.ui-hidden .companion-dev {
      display: none;
    }

    .companion-dev {
      position: relative;
      z-index: 2;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      padding: 8px 64px 8px 16px;
      background: rgba(255, 255, 255, 0.88);
      border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    }

    .companion-dev[hidden] {
      display: none;
    }

    .companion-dev-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-secondary);
      margin-right: 4px;
    }

    .companion-dev button {
      font-family: inherit;
      font-size: 11px;
      font-weight: 600;
      padding: 5px 8px;
      border: none;
      border-radius: 8px;
      background: var(--bg);
      color: var(--accent);
      cursor: pointer;
    }

    .content {
      position: relative;
      z-index: 1;
      flex: 1;
      min-width: 0;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-x pan-y;
      background: transparent;
      padding: calc(12px + var(--safe-top)) 16px calc(20px + var(--safe-bottom));
    }

    .tab-panel {
      display: none;
    }

    .tab-panel.active {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      animation: page-in 0.22s ease;
    }

    #tab-todo.tab-panel.active,
    .tab-panel.active[id^="tab-list-"] {
      flex: 1;
      min-height: 0;
      overflow: hidden;
    }

    @keyframes page-in {
      from {
        transform: translateX(var(--page-dx, 0px));
        opacity: 0.75;
      }
      to {
        transform: none;
        opacity: 1;
      }
    }

    .front-card {
      flex: 0 0 auto;
      height: auto;
      min-height: 25%;
      margin-bottom: 0;
      display: flex;
      flex-direction: column;
      overflow: visible;
    }

    .front-card h3 {
      flex-shrink: 0;
      margin-bottom: 8px;
    }

    .todo-preview {
      list-style: none;
      margin: 0;
      padding: 0;
      overflow: visible;
    }

    .todo-preview li {
      font-size: 16px;
      line-height: 1.35;
      padding: 3px 0;
      word-break: break-word;
    }

    .todo-num {
      font-weight: 700;
    }

    .section-card {
      background: var(--surface);
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 12px;
      box-shadow: 0 8px 24px rgba(28, 20, 18, 0.12);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }


    .section-card h3 {
      font-size: 17px;
      font-weight: 600;
      margin-bottom: 12px;
    }

    .app-version {
      font-size: 12px;
      font-weight: 500;
      opacity: 0.45;
      margin-left: 6px;
    }

    .log-card > h3 {
      text-align: center;
    }

    .todo-card {
      flex: 0 1 auto;
      max-height: 100%;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .todo-card h3 {
      flex-shrink: 0;
    }

    .todo-list {
      list-style: none;
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      touch-action: pan-y;
      scrollbar-width: none;
      -ms-overflow-style: none;
      margin: 0 -4px 12px;
      padding: 0 4px;
    }

    .todo-list::-webkit-scrollbar {
      display: none;
    }

    .todo-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 0;
      border-bottom: 0.5px solid var(--border);
      cursor: pointer;
    }

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

    .todo-handle {
      flex-shrink: 0;
      width: 40px;
      height: 40px;
      border: none;
      background: none;
      color: var(--text-secondary);
      cursor: grab;
      display: flex;
      align-items: center;
      justify-content: center;
      -webkit-tap-highlight-color: transparent;
      padding: 0;
      touch-action: none;
    }

    .todo-item.is-dragging {
      opacity: 0.55;
    }

    .todo-handle .material-symbols-outlined {
      font-size: 22px;
      line-height: 1;
      font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    }

    .todo-text {
      flex: 1;
      min-width: 0;
      font-size: 16px;
      line-height: 1.35;
      word-break: break-word;
    }

    .todo-handle:active {
      opacity: 0.6;
    }

    .todo-modal[hidden] {
      display: none;
    }

    .todo-modal {
      position: fixed;
      inset: 0;
      z-index: 200;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px 16px;
      padding-top: calc(24px + var(--safe-top));
      padding-bottom: calc(24px + var(--safe-bottom));
      background: rgba(0, 0, 0, 0.5);
    }

    #todo-modal,
    #log-edit-modal {
      align-items: flex-start;
      padding-top: calc(12px + var(--safe-top));
      overflow-y: auto;
    }

    .todo-modal-card {
      width: 100%;
      max-width: 398px;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .todo-modal-card input,
    .todo-modal-card textarea {
      width: 100%;
      font-family: inherit;
      font-size: 16px;
      color: var(--text);
      border: none;
      background: var(--bg);
      border-radius: 8px;
      padding: 10px 12px;
      -webkit-appearance: none;
      appearance: none;
    }

    .todo-modal-card textarea {
      min-height: 140px;
      resize: vertical;
      line-height: 1.4;
    }

    #log-submit-passphrase {
      text-align: center;
      letter-spacing: 0.4em;
      -webkit-text-security: disc;
    }

    #log-submit-passphrase::placeholder {
      letter-spacing: normal;
    }

    .todo-modal-actions {
      display: grid;
      grid-template-columns: 2fr 1fr 1fr;
      gap: 8px;
    }

    .todo-modal-actions .icon-action {
      width: 100%;
    }

    .log-confirm-actions {
      grid-template-columns: 1fr 1fr;
    }

    #log-received-modal .log-confirm-actions {
      grid-template-columns: 1fr;
    }

    .todo-modal-save {
      background: #1c1412;
      color: #fff;
    }

    .todo-modal-save:active {
      opacity: 0.75;
    }

    .todo-modal-remove {
      background: var(--surface-solid);
      color: #000;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .todo-modal-remove:active {
      opacity: 0.75;
    }

    .todo-form {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-shrink: 0;
    }

    .todo-form input {
      flex: 1;
      min-width: 0;
      font-family: inherit;
      font-size: 16px;
      color: var(--text);
      border: none;
      background: var(--bg);
      border-radius: 8px;
      padding: 10px 12px;
      -webkit-appearance: none;
      appearance: none;
    }

    .todo-add {
      flex-shrink: 0;
      font-family: inherit;
      font-size: 16px;
      font-weight: 600;
      padding: 10px 14px;
      border: none;
      border-radius: 10px;
      background: var(--accent);
      color: #fff;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .todo-add:active {
      opacity: 0.75;
    }

    .icon-action {
      width: 44px;
      height: 44px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .icon-action .material-symbols-outlined {
      font-size: 24px;
      line-height: 1;
      font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    }

    #todo-modal-complete .material-symbols-outlined,
    #todo-modal-save .material-symbols-outlined {
      font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    }

    #tab-log.tab-panel.active {
      padding-top: 50px;
    }

    .log-card {
      flex: 1;
      min-height: 0;
      max-height: none;
      margin-bottom: 0;
      display: flex;
      flex-direction: column;
    }

    .log-list {
      list-style: none;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      flex: 1;
      min-height: 0;
      margin: 0 -4px 12px;
      padding: 0 4px;
    }

    .log-item {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 10px 0;
      border-bottom: 0.5px solid var(--border);
    }

    .log-item-editable {
      cursor: pointer;
    }

    .log-undo {
      flex-shrink: 0;
      background: var(--surface-solid);
      color: #000;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .log-undo:active {
      opacity: 0.75;
    }

    .log-undo-message {
      font-size: 16px;
      line-height: 1.4;
      margin: 0;
    }

    .list-name-error {
      font-size: 14px;
      line-height: 1.35;
      margin: 0;
      color: #8a1c1c;
    }

    .list-name-error[hidden] {
      display: none;
    }

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

    .log-body {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .log-time {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-secondary);
    }

    .log-text {
      font-size: 16px;
      line-height: 1.35;
      word-break: break-word;
    }

    .log-actions {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .log-actions .todo-add,
    .log-clear {
      flex: 1;
    }

    .log-clear {
      font-family: inherit;
      font-size: 16px;
      font-weight: 600;
      padding: 10px 14px;
      border: none;
      border-radius: 10px;
      background: var(--surface-solid);
      color: var(--text);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .log-clear:active {
      opacity: 0.75;
    }

    .todo-add.icon-action,
    .log-clear.icon-action,
    .log-undo.icon-action,
    .todo-modal-save,
    .todo-modal-remove {
      width: 44px;
      min-width: 44px;
      height: 44px;
      padding: 0;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .todo-modal-actions .icon-action {
      width: 100%;
      min-width: 0;
    }
