      :root {
        --app-word-style-ready: 1;
        --font-ui: "Segoe UI", "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif;
        --app-shell-max-width: 860px;
        --app-shell-half-width: calc(var(--app-shell-max-width) / 2);
        --bg: #eef7f9;
        --bg2: #f9f4e9;
        --page-bg: rgb(231, 244, 242);
        --panel: #ffffff;
        --border: rgba(24, 50, 72, 0.12);
        --text: #12324a;
        --muted: #61788e;
        --accent: #0f8f7b;
        --accent-dark: #0c7464;
        --accent-rgb: 15,143,123;
        --shared-card-header-font-size: 16px;
        --shared-card-header-font-weight: 600;
      }

      * {
        box-sizing: border-box;
      }

      [hidden] {
        display: none !important;
      }

      body {
        margin: 0;
        min-height: 100vh;
        font-family: var(--font-ui);
        color: var(--text);
        background: var(--page-bg);
        padding: 24px 16px;
        display: grid;
        place-items: start center;
        overflow-x: hidden;
      }

      input,
      button,
      select,
      textarea,
      pre {
        font-family: inherit;
      }

      .app.app-word {
        position: relative;
        --card-fixed-edge-gap: max(16px, calc(50% - var(--app-shell-half-width)));
        --top-nav-button-size: calc(38px + var(--app-font-size-offset, 0px));
        --top-nav-icon-size: calc(20px + var(--app-font-size-offset, 0px));
        --top-nav-radius: calc(12px + (var(--app-font-size-offset, 0px) / 2));
        --top-nav-ticket-font-size: calc(13px + var(--app-font-size-offset, 0px));
        --top-nav-ticket-gap: calc(4px + (var(--app-font-size-offset, 0px) / 2));
        --top-nav-ticket-padding-x: calc(8px + (var(--app-font-size-offset, 0px) / 2));
        --top-nav-top: calc(30px + var(--app-font-size-offset, 0px));
        --top-nav-side-offset: calc(8px + (var(--app-font-size-offset, 0px) / 2));
        --top-search-top: calc(72px + var(--app-font-size-offset, 0px));
        --top-search-width: calc(150px + (var(--app-font-size-offset, 0px) * 3));
        --top-search-height: calc(28px + var(--app-font-size-offset, 0px));
        --top-search-radius: calc(10px + (var(--app-font-size-offset, 0px) / 2));
        --top-search-gap: calc(6px + (var(--app-font-size-offset, 0px) / 2));
        --top-search-font-size: calc(11px + var(--app-font-size-offset, 0px));
        --top-search-padding-x: calc(9px + (var(--app-font-size-offset, 0px) / 2));
        width: min(100%, var(--app-shell-max-width));
        border-radius: 24px;
        border: 1px solid var(--border);
        background: var(--panel);
        box-shadow: 0 24px 45px rgba(18, 41, 61, 0.14);
        padding: 28px;
        min-width: 0;
      }

      .app.app-word .top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
        margin-top: calc(30px + var(--app-font-size-offset, 0px));
        min-height: var(--top-nav-button-size);
        padding-right: calc(192px + (var(--app-font-size-offset, 0px) * 3));
      }

      .link-group {
        display: flex;
        gap: 12px;
      }

      .nav-link {
        color: var(--accent);
        text-decoration: none;
        font-weight: 700;
      }

      .app.app-word .top-nav {
        display: contents;
      }

      .app.app-word .top-nav-link {
        width: var(--top-nav-button-size);
        min-height: var(--top-nav-button-size);
        border: none;
        border-radius: var(--top-nav-radius);
        background: rgba(255, 255, 255, 0.85);
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--accent);
        text-decoration: none;
      }

      .app.app-word .top-nav-link:hover {
        background: rgba(var(--accent-rgb), 0.10);
      }

      .app.app-word .top-nav-link svg {
        width: var(--top-nav-icon-size);
        height: var(--top-nav-icon-size);
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
      }

      .app.app-word .ticket-nav-link {
        width: auto;
        min-width: 0;
        padding: 0 var(--top-nav-ticket-padding-x);
        gap: var(--top-nav-ticket-gap);
        font-size: var(--top-nav-ticket-font-size);
        font-weight: 700;
        white-space: nowrap;
      }

      .app.app-word .ticket-nav-link svg {
        flex: 0 0 auto;
      }

      .app.app-word .ticket-points {
        line-height: 1;
        font-variant-numeric: tabular-nums;
      }

      .pending-persistence-notice {
        margin: 0 0 12px;
        padding: 10px 12px;
        border-radius: 12px;
        background: rgba(255, 191, 71, 0.16);
        border: 1px solid rgba(201, 135, 0, 0.28);
        color: #8a5a00;
        font-size: 13px;
        line-height: 1.5;
      }

      .app.app-word .nav-right-1 {
        position: fixed;
        top: var(--top-nav-top);
        right: calc(var(--card-fixed-edge-gap) + 88px + (var(--app-font-size-offset, 0px) * 2));
        z-index: 20;
      }

      .app.app-word .nav-right-2 {
        position: fixed;
        top: var(--top-nav-top);
        right: calc(var(--card-fixed-edge-gap) + 88px + (var(--app-font-size-offset, 0px) * 2));
        z-index: 20;
      }

      .app.app-word .nav-right-3 {
        position: fixed;
        top: var(--top-nav-top);
        right: calc(var(--card-fixed-edge-gap) + 48px + var(--app-font-size-offset, 0px));
        z-index: 20;
      }

      .app.app-word .nav-right-4 {
        position: fixed;
        top: var(--top-nav-top);
        right: calc(var(--card-fixed-edge-gap) + var(--top-nav-side-offset));
        z-index: 20;
      }

      .app.app-word .nav-right-1 {
        right: calc(var(--card-fixed-edge-gap) + 136px + (var(--app-font-size-offset, 0px) * 3));
      }

      .app.app-word .back-nav-button {
        position: fixed;
        top: var(--top-nav-top);
        left: calc(var(--card-fixed-edge-gap) + var(--top-nav-side-offset));
        z-index: 20;
      }

      .app.app-word .back-search-form {
        position: fixed;
        top: var(--top-search-top);
        right: calc(var(--card-fixed-edge-gap) + calc(10px + (var(--app-font-size-offset, 0px) / 2)));
        z-index: 20;
        width: max-content;
        display: grid;
        grid-template-columns: var(--top-search-width) auto;
        gap: var(--top-search-gap);
        align-items: stretch;
      }

      .app.app-word .back-search-input {
        min-width: 0;
        width: var(--top-search-width);
        height: var(--top-search-height);
        border: 1px solid rgba(var(--accent-rgb), 0.2);
        border-radius: var(--top-search-radius);
        background: rgba(255, 255, 255, 0.96);
        padding: 0 var(--top-search-padding-x);
        font-size: max(16px, var(--top-search-font-size));
        color: var(--text);
      }

      .app.app-word .back-search-input:focus {
        outline: none;
        border-color: rgba(var(--accent-rgb), 0.6);
        box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
      }

      .app.app-word .back-search-submit {
        height: var(--top-search-height);
        border: none;
        border-radius: var(--top-search-radius);
        background: var(--accent);
        color: #ffffff;
        padding: 0 calc(10px + (var(--app-font-size-offset, 0px) / 2));
        font-size: var(--top-search-font-size);
        font-weight: 700;
        cursor: pointer;
      }

      .app.app-word .back-search-submit:hover {
        background: var(--accent-dark);
      }

      .related-words {
        padding: 10px 14px 14px;
        min-width: 0;
      }

      .related-words-top {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        gap: 0 10px;
        min-width: 0;
      }

      .related-words > .empty {
        margin: 0;
        padding: 4px 2px 2px;
        text-align: center;
      }

      .related-word-group {
        min-width: 0;
      }

      .related-word-label {
        font-size: 11px;
        font-weight: 700;
        color: var(--muted);
        padding: 4px 2px 6px;
        letter-spacing: 0.05em;
        text-transform: uppercase;
      }

      .detail-stack {
        width: 100%;
      }

      .detail-stack > .card,
      .detail-stack > .delete-row {
        width: 100%;
      }

      .related-word-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        gap: 6px;
        min-width: 0;
      }

      .related-word-list li {
        min-width: 0;
      }

      .related-word-button {
        --shared-entry-padding: 8px 10px;
        --shared-entry-border-color: rgba(var(--accent-rgb), 0.16);
        --shared-entry-radius: 10px;
        --shared-entry-bg: rgba(var(--accent-rgb), 0.05);
        --shared-entry-hover-bg: rgba(var(--accent-rgb), 0.14);
        --shared-entry-color: var(--text);
        --shared-entry-gap: 6px;
        --shared-entry-font-size: 13px;
        --shared-entry-font-weight: 600;
        --shared-entry-height: 38px;
        transform: none;
      }

      .related-word-button:hover {
        transform: none;
      }

      .card-header.linkable.related-words-heading-action {
        --shared-card-header-link-color: var(--accent-dark);
        --shared-card-header-link-hover-color: var(--accent-dark);
        --shared-card-header-link-bg: rgba(var(--accent-rgb), 0.14);
        --shared-card-header-link-hover-bg: rgba(var(--accent-rgb), 0.10);
        cursor: pointer;
        user-select: none;
      }

      .card-header.linkable.related-words-heading-action:hover {
        color: var(--accent-dark) !important;
      }

      .card-header.linkable.related-words-heading-action:focus {
        outline: none;
        color: var(--accent-dark) !important;
      }

      .card-header-switch {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: nowrap;
      }

      .ai-output-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: nowrap;
        min-width: 0;
      }

      .ai-output-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        min-width: 0;
        flex-shrink: 0;
      }

      .card-hidden {
        display: none;
      }

      .detail-primary-card {
        min-height: 0;
      }

      .detail-output-card {
        min-height: 250px;
      }

      .detail-related-card {
        min-height: 112px;
      }

      .detail-info-card .inline-meta:first-of-type {
        padding-top: 12px;
      }

      .detail-info-card .inline-meta:last-of-type {
        padding-bottom: 12px;
      }

      .detail-body-block,
      .detail-body-row {
        transition: opacity 0.14s ease;
      }

      body[data-detail-loading="true"] .detail-body-block,
      body[data-detail-loading="true"] .detail-body-row {
        opacity: 0.65;
      }
      #wordText::selection,
      #resultText::selection {
        background: rgba(var(--accent-rgb), 0.32);
        color: var(--text);
      }

      #wordText::-moz-selection,
      #resultText::-moz-selection {
        background: rgba(var(--accent-rgb), 0.32);
        color: var(--text);
      }

      ::highlight(meaning-selection) {
        background: rgba(var(--accent-rgb), 0.32);
        color: var(--text);
      }

      #meaningSelectionPopup.meaning-selection-popup {
        position: fixed;
        z-index: 1200;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        pointer-events: none;
        transform: translateX(-50%);
      }

      #meaningSelectionPopup .meaning-selection-popup-row {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        pointer-events: none;
      }

      #meaningSelectionPopup .meaning-selection-popup-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        border: 1px solid rgba(var(--accent-rgb), 0.24);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.98);
        color: var(--accent-dark);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        font-weight: 800;
        cursor: pointer;
        touch-action: manipulation;
        box-shadow: 0 10px 24px rgba(18, 41, 61, 0.18);
        pointer-events: auto;
      }

      #meaningSelectionPopup .meaning-selection-popup-btn svg {
        width: 18px;
        height: 18px;
        stroke-width: 2.4;
        flex: 0 0 auto;
      }

      #meaningSelectionPopup .meaning-selection-popup-btn:disabled {
        cursor: default;
        background: rgba(228, 234, 239, 0.96);
        color: rgba(97, 120, 142, 0.85);
        border-color: rgba(97, 120, 142, 0.22);
        box-shadow: none;
      }

      #meaningSelectionPopup .meaning-selection-popup-btn:hover {
        background: rgba(var(--accent-rgb), 0.10);
      }

      #meaningSelectionPopup .meaning-selection-popup-btn:disabled:hover {
        background: rgba(228, 234, 239, 0.96);
      }

      #meaningSelectionPopup .meaning-selection-popup-btn.commit-btn {
        min-width: 54px;
        width: auto;
        flex: 0 0 auto;
        background: var(--accent-dark);
        border-color: var(--accent-dark);
        color: #ffffff;
        font-size: 14px;
        line-height: 1;
        padding: 0 14px;
        white-space: nowrap;
        word-break: keep-all;
      }

      #meaningSelectionPopup .meaning-selection-popup-btn.commit-btn:hover {
        background: var(--accent);
        border-color: var(--accent);
      }

      #meaningSelectionPopup .meaning-selection-popup-btn.close-btn {
        min-width: 36px;
        width: 36px;
        height: 36px;
        padding: 0;
        border-color: rgba(216, 95, 95, 0.28);
        background: rgba(255, 226, 226, 0.96);
        color: #c25757;
        font-size: 14px;
        font-weight: 700;
        line-height: 1;
        box-shadow: 0 8px 18px rgba(181, 85, 85, 0.14);
      }

      #meaningSelectionPopup .meaning-selection-popup-btn.close-btn:hover {
        background: rgba(255, 214, 214, 0.98);
        border-color: rgba(216, 95, 95, 0.36);
      }

      #meaningSelectionPopup .meaning-selection-popup-btn.back-to-top-btn {
        min-width: 36px;
        width: 36px;
        height: 36px;
        padding: 0;
      }

      .app.app-word .meaning-selection-toggle {
        appearance: none;
        -webkit-tap-highlight-color: transparent;
      }

      .app.app-word #meaningSelectionToggle.meaning-save-btn {
        min-width: 0;
        min-height: 28px;
        height: 28px;
        padding: 0 10px;
        border-radius: 10px;
        font-size: 12px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
      }

      .app.app-word .meaning-selection-toggle:not(.is-active) {
        background: rgba(255, 255, 255, 0.96);
        border-color: rgba(var(--accent-rgb), 0.34);
        color: #7a8591;
        box-shadow: none;
      }

      .app.app-word .meaning-selection-toggle:not(.is-active):hover {
        border-color: rgba(var(--accent-rgb), 0.42);
        color: #6e7882;
      }

      .app.app-word .meaning-selection-toggle.is-active {
        background: rgba(var(--accent-rgb), 0.12);
        border-color: rgba(var(--accent-rgb), 0.42);
        color: var(--accent-dark);
        box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.12);
      }

      .card-header.with-marks {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
      }

      .marking-control {
        display: inline-flex;
        align-items: center;
        gap: 8px;
      }

      .marking-adjust-buttons {
        display: inline-flex;
        align-items: center;
        gap: 6px;
      }

      .app.app-word .word {
        margin: 0;
        padding: 12px 14px;
        font-size: 30px;
        font-weight: 800;
        min-width: 0;
        user-select: text;
        -webkit-user-select: text;
        -webkit-touch-callout: default;
      }

      .marking-adjust-btn {
        border: 1px solid #d6b33c;
        background: #fff4bf;
        color: #6e5600;
        border-radius: 10px;
        min-height: 28px;
        min-width: 28px;
        padding: 0 8px;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        line-height: 1;
      }

      .card-header .marking-adjust-btn {
        min-height: 28px;
        min-width: 28px;
        padding: 0 8px;
        font-size: 12px;
      }

      .marking-count-display {
        border: 1px solid #d6b33c;
        background: #fff4bf;
        color: #6e5600;
        border-radius: 12px;
        min-height: 46px;
        width: 50px;
        padding: 0 12px;
        font-size: 16px;
        font-weight: 700;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
        box-sizing: border-box;
      }

      .card-header .marking-count-display {
        min-height: 34px;
        width: auto;
        min-width: 50px;
        font-size: 13px;
      }

      .marking-adjust-btn:focus {
        outline: none;
        border-color: #b8921d;
        box-shadow: 0 0 0 3px rgba(214, 179, 60, 0.25);
      }

      .app.app-word .word.word-text {
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
      }

      .app.app-word .word.sentence-text {
        font-size: 18px;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
      }

      html[data-detail-mode="question"] .word {
          font-size: 20px;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
      }

      .app.app-word pre {
        margin: 0;
        padding: 12px 14px;
        min-height: 180px;
        white-space: pre-wrap;
        word-break: break-word;
        overflow-wrap: anywhere;
        line-height: 1.75;
      }

      .inline-meta {
        margin: 0;
        padding: 0 14px 3px;
        color: var(--muted);
        font-size: 14px;
        line-height: 1.6;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0;
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
      }

      .inline-meta:last-of-type {
        padding-bottom: 8px;
      }

      .inline-meta .meta-item {
        display: flex;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 4px;
        max-width: 100%;
        min-width: 0;
        white-space: normal;
        font-size: inherit;
        line-height: inherit;
        color: inherit;
      }

      .inline-meta .meta-label {
        flex: 0 0 auto;
        margin-right: 1px;
        white-space: nowrap;
        font-size: inherit;
        line-height: inherit;
        color: inherit;
      }

      .inline-meta .meta-item > :not(.meta-label) {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
        font-size: inherit;
        line-height: inherit;
        color: inherit;
      }

      .inline-meta .meta-separator {
        margin: 0 8px;
      }

      .inline-meta.with-marks-row {
        justify-content: space-between;
        gap: 10px;
      }

      .memo-meta {
        align-items: flex-start;
        padding-bottom: 12px;
        font-size: inherit;
        line-height: inherit;
      }

      .memo-meta .meta-item {
        display: flex;
        align-items: flex-start;
        flex-wrap: nowrap;
        gap: 4px;
        width: 100%;
        min-width: 0;
        white-space: normal;
      }

      .memo-meta .meta-label {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 16px;
        line-height: 1.5;
      }

      .memo-input {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        max-width: 100%;
        min-height: calc(1em * 1.5);
        height: auto;
        border: none;
        background: transparent;
        color: inherit;
        caret-color: inherit;
        padding: 0;
        margin: 0;
        display: block;
        resize: none;
        box-sizing: border-box;
        overflow-y: hidden;
        overflow-x: hidden;
        line-height: 1.5;
        font-size: 16px !important;
        font-family: inherit;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        word-break: break-word;
      }

      .memo-input:focus {
        outline: none;
      }

      .memo-input::placeholder {
        color: inherit;
        opacity: 1;
      }

      .inline-meta .meta-separator {
        display: none;
      }

        .app.app-word .marks {
          display: flex;
          flex-wrap: wrap;
          gap: 6px;
          padding: 0;
          align-items: center;
          width: 100%;
          min-width: 0;
        }

        .word-tag-picker {
          position: relative;
          display: inline-flex;
          flex-wrap: wrap;
          align-items: center;
          gap: 8px;
          width: 100%;
          min-width: 0;
        }

        .word-selected-tags {
          display: inline-flex;
          flex-wrap: wrap;
          align-items: center;
          gap: 6px;
          min-width: 0;
          flex: 0 0 auto;
          max-width: 100%;
        }

        .word-selected-tags:empty {
          display: none;
        }

        .word-tag-add-trigger {
          border: none;
          background: none;
          color: #8a9bb0;
          border-radius: 10px;
          min-height: 32px;
          padding: 0 12px;
          font-size: 16px;
          font-weight: 700;
          line-height: 1;
          margin: 0;
          cursor: pointer;
          white-space: nowrap;
          flex: 0 0 auto;
        }

        .word-tag-add-trigger:hover:not(:disabled) {
          background: transparent;
        }

        .word-tag-add-trigger:disabled {
          opacity: 0.6;
          cursor: default;
        }

        .word-tag-dropdown {
          position: fixed;
          top: 0;
          left: 0;
          width: min(320px, calc(100vw - 24px));
          min-width: min(240px, calc(100vw - 24px));
          max-width: calc(100vw - 24px);
          box-sizing: border-box;
          max-height: min(260px, calc(100vh - 24px));
          overflow-x: hidden;
          overflow-y: auto;
          scrollbar-gutter: stable;
          scrollbar-width: thin;
          border: 1px solid rgba(var(--accent-rgb), 0.16);
          border-radius: 14px;
          background: rgba(255, 255, 255, 0.98);
          backdrop-filter: blur(8px);
          box-shadow: 0 22px 48px rgba(20, 42, 62, 0.2);
          padding: 6px;
          z-index: 1200;
          display: grid;
          grid-template-columns: 1fr;
          gap: 0;
        }

        .word-tag-dropdown::-webkit-scrollbar {
          width: 8px;
        }

        .word-tag-dropdown::-webkit-scrollbar-track {
          background: rgba(15, 143, 123, 0.08);
          border-radius: 999px;
        }

        .word-tag-dropdown::-webkit-scrollbar-thumb {
          background: rgba(15, 143, 123, 0.36);
          border-radius: 999px;
        }

        .word-tag-dropdown .marks {
          display: grid;
          grid-template-columns: 1fr;
          gap: 0;
          padding: 0;
        }

        .word-tag-dropdown .mark-filter-option {
          min-height: 38px;
          border: none;
          border-radius: 10px;
          background: transparent;
          color: var(--text);
          padding: 7px 10px;
          width: 100%;
          box-sizing: border-box;
          min-width: 0;
          max-width: 100%;
          display: flex;
          align-items: flex-start;
          justify-content: flex-start;
          text-align: left;
          font-size: 13px;
          font-weight: 700;
          cursor: pointer;
          white-space: normal;
          overflow: visible;
          overflow-wrap: break-word;
          word-break: break-word;
          line-height: 1.25;
        }

        .word-tag-dropdown .mark-filter-option:hover {
          background: rgba(var(--accent-rgb), 0.08);
        }

        .word-tag-dropdown .mark-filter-create-wrap {
          display: grid;
          grid-template-columns: minmax(0, 1fr) 52px;
          align-items: start;
          gap: 2px;
          width: 100%;
          box-sizing: border-box;
          padding: 6px 4px 4px;
        }

        .word-tag-dropdown .mark-filter-create-input {
          grid-column: 1;
          min-width: 0;
          width: 100%;
          max-width: 100%;
          height: 32px;
          border: 1px solid rgba(var(--accent-rgb), 0.3);
          border-radius: 8px;
          padding: 0 8px;
          font-size: 16px;
          font-weight: 600;
          color: var(--text);
          background: #f4f7fb;
          outline: none;
        }

        .word-tag-dropdown .mark-filter-create-input:focus {
          border-color: var(--accent);
          background: #ffffff;
        }

        .word-tag-dropdown .mark-filter-create-confirm {
          grid-column: 2;
          justify-self: stretch;
          width: 52px;
          min-width: 52px;
          height: 32px;
          padding: 0;
          border: none;
          border-radius: 8px;
          background: var(--accent);
          color: #ffffff;
          font-size: 12px;
          font-weight: 700;
          cursor: pointer;
        }

        .word-tag-dropdown .mark-filter-create-confirm:disabled {
          opacity: 1;
          background: #c3ccd6;
          color: #eef2f6;
          cursor: default;
        }

        .word-tag-dropdown .mark-filter-create-cancel {
          flex-shrink: 0;
          height: 32px;
          width: 32px;
          border: none;
          border-radius: 8px;
          background: transparent;
          color: var(--text-muted, #8a9bb0);
          font-size: 16px;
          font-weight: 700;
          cursor: pointer;
          display: flex;
          align-items: center;
          justify-content: center;
        }

        .word-tag-dropdown .mark-filter-create-cancel:hover {
          background: rgba(var(--accent-rgb), 0.08);
        }

        .word-tag-dropdown .mark-filter-create-error {
          grid-column: 1 / -1;
          font-size: 11px;
          color: #d93025;
          padding: 0 4px 2px;
        }

        .word-tag-dropdown .mark-filter-count-display {
          grid-column: 1 / -1;
          font-size: 12px;
          font-weight: 700;
          color: var(--muted);
          white-space: nowrap;
          display: flex;
          align-items: flex-end;
          line-height: 1;
          height: calc(1em + 2px);
          padding: 0 4px;
        }

        .app.app-word .mark-btn {
          border: 1px solid rgba(var(--accent-rgb), 0.22);
          background: #fff;
          color: var(--muted);
          border-radius: 10px;
          padding: 4px 10px;
          min-height: calc(24px + var(--app-font-size-offset, 0px));
          max-width: 100%;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          text-align: center;
          line-height: 1.25;
          white-space: normal;
          overflow-wrap: anywhere;
          word-break: break-word;
          cursor: pointer;
          touch-action: manipulation;
          font-size: 12px;
          font-weight: 700;
        }

        .mark-btn.mark-tag-chip {
          max-width: 100%;
          white-space: normal;
          overflow-wrap: anywhere;
          word-break: break-word;
        }

        .mark-btn.active,
        .mark-tag-chip.active {
          border-color: #8a9bb0;
          background: transparent;
          color: var(--accent);
        }

        .mark-create-btn {
          border-style: dashed;
        }

        .mark-empty {
          color: var(--muted);
          font-size: 12px;
        }

        .meaning-save-btn {
          border: 1px solid rgba(var(--accent-rgb), 0.28);
          background: rgba(var(--accent-rgb), 0.1);
          color: var(--accent-dark);
          border-radius: 10px;
          min-height: 28px;
          padding: 0 10px;
          font-size: 12px;
          font-weight: 700;
          cursor: pointer;
          white-space: nowrap;
        }

        #rerunAiSearchButton {
          border-color: rgba(234, 179, 8, 0.42);
          background: rgba(255, 235, 59, 0.22);
          color: #7a5d00;
          box-shadow: 0 2px 8px rgba(234, 179, 8, 0.18);
        }

        #rerunAiSearchButton:hover:not(:disabled) {
          border-color: rgba(234, 179, 8, 0.52);
          background: rgba(255, 244, 163, 0.4);
          color: #6f5500;
        }

        #rerunAiSearchButton.state-muted {
          border-color: rgba(97, 120, 142, 0.38);
          background: rgba(97, 120, 142, 0.12);
          color: #4f6273;
          box-shadow: none;
        }

        .meaning-save-btn.state-muted {
          border-color: rgba(97, 120, 142, 0.38);
          background: rgba(97, 120, 142, 0.12);
          color: #4f6273;
        }

        .meaning-save-btn:disabled {
          opacity: 0.65;
          cursor: default;
        }

        .related-words-actions {
          display: flex;
          justify-content: flex-end;
          padding: 8px 14px 10px;
          border-top: 1px solid var(--border);
          gap: 8px;
        }

        .related-words-action-btn {
          border: 1px solid rgba(var(--accent-rgb), 0.24);
          background: transparent;
          color: var(--muted);
          border-radius: 8px;
          padding: 4px 12px;
          font-size: 12px;
          font-weight: 700;
          cursor: pointer;
          min-height: 28px;
        }

        .related-words-action-btn:hover {
          background: rgba(var(--accent-rgb), 0.08);
          color: var(--accent-dark);
        }

        .selected-text-search-btn {
          border-color: rgba(var(--accent-rgb), 0.42);
          background: rgba(var(--accent-rgb), 0.12);
          color: var(--accent-dark);
          max-width: 160px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }

        .memo-char-counter {
          flex: 0 0 auto;
          margin-left: auto;
          font-size: calc(11px + var(--app-font-size-offset, 0px));
          color: var(--muted);
          white-space: nowrap;
          line-height: 1.5;
          align-self: flex-end;
        }

        .danger-btn {
          border: 1px solid rgba(185, 56, 56, 0.22);
          background: #fff5f5;
          color: #a12d2d;
          border-radius: 12px;
          padding: 12px 14px;
          font-size: 14px;
          font-weight: 700;
          cursor: pointer;
          touch-action: manipulation;
        }

        .delete-row {
          margin-top: 16px;
        }

        .delete-row .danger-btn {
          width: 100%;
          min-height: 44px;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          gap: 8px;
        }

        .delete-row .danger-btn svg {
          width: 16px;
          height: 16px;
          flex: 0 0 auto;
          stroke: currentColor;
          fill: none;
          stroke-width: 2;
          stroke-linecap: round;
          stroke-linejoin: round;
        }

        .danger-btn:disabled {
          opacity: 0.65;
          cursor: default;
        }

        .mobile-only-break {
          display: none;
        }

      @media (max-width: 640px) {
        body:has(.app.app-word) {
          padding-bottom: 34px;
        }

        .app.app-word {
          margin-bottom: 12px;
          padding: 20px;
          border-radius: 20px;
        }

        .mobile-only-break {
          display: block;
        }

        .card-header.with-marks {
          flex-wrap: wrap;
        }

        .ai-output-header {
          flex-wrap: nowrap;
          align-items: center;
          gap: 6px;
        }

        .ai-output-actions {
          width: auto;
          justify-content: flex-end;
          gap: 6px;
        }

        .word-tag-add-trigger {
          min-height: 32px;
          padding: 0 12px;
          font-size: 16px;
        }

        .word-tag-dropdown .mark-filter-option {
          min-height: calc(28px + var(--app-font-size-offset, 0px));
          padding: 6px 8px;
          font-size: 12px;
        }

        .word-tag-dropdown .mark-filter-create-cancel {
          height: 30px;
          width: 30px;
        }

        .memo-input {
          font-size: 16px !important;
        }

      }