
    :root {
      --bg-primary: #f8f9fa;
      --bg-secondary: #ffffff;
      --bg-tertiary: #f1f3f5;
      --text-primary: #212529;
      --text-secondary: #6c757d;
      --border-color: #dee2e6;
      --accent-color: #0d6efd;
      --danger-color: #dc3545;
      --success-color: #198754;
      --font-family-base: 'Inter', 'Noto Sans JP', sans-serif;
      --font-size-base: 1rem;
      --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
      --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
      --border-radius-sm: 0.25rem;
      --border-radius-md: 0.5rem;
    }
    body.theme-dark {
      --bg-primary: #121212;
      --bg-secondary: #1e1e1e;
      --bg-tertiary: #2c2c2c;
      --text-primary: #e8e6e3;
      --text-secondary: #adb5bd;
      --border-color: #495057;
    }
    body {
      font-family: var(--font-family-base);
      font-size: var(--font-size-base);
      background-color: var(--bg-primary);
      color: var(--text-primary);
      margin: 0;
      padding: 2em;
      display: flex;
      justify-content: center;
      min-height: 100vh;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      transition: background-color 0.3s, color 0.3s;
    }
    .container {
      width: 100%;
      max-width: 800px;
      background-color: var(--bg-secondary);
      padding: 2em;
      border-radius: var(--border-radius-md);
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border-color);
      transition: background-color 0.3s;
    }
    h1, h2, h3 { color: var(--text-primary); }
    h1 { text-align: center; }
    h2, h3 { border-bottom: 2px solid var(--accent-color); padding-bottom: 0.5em; margin-top: 1.5em; }
    h3 { font-size: 1.2em; border-bottom-width: 1px; }
    form {
      display: flex;
      flex-direction: column;
      gap: 1em;
      margin-bottom: 1.5em;
      padding: 1.5em;
      background-color: var(--bg-tertiary);
      border-radius: var(--border-radius-md);
      border: 1px solid var(--border-color);
    }
    input, textarea, select {
      padding: 0.8em 1em;
      border: 1px solid var(--border-color);
      border-radius: var(--border-radius-sm);
      font-size: 1em;
      background-color: var(--bg-secondary);
      color: var(--text-primary);
      font-family: inherit;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    input:focus, textarea:focus, select:focus {
      outline: none;
      border-color: var(--accent-color);
      box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
    }
    button {
      padding: 0.8em 1.5em;
      background-color: var(--accent-color);
      color: white;
      border: none;
      border-radius: var(--border-radius-sm);
      cursor: pointer;
      font-size: 1em;
      font-weight: 500;
      align-self: flex-end;
      transition: transform 0.2s, filter 0.2s;
    }
    button:hover {
      transform: translateY(-2px);
      filter: brightness(1.1);
    }
    button:focus-visible {
      outline: none;
      box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.4);
    }
    button.secondary {
      background-color: var(--text-secondary);
    }
    button.danger {
      background-color: var(--danger-color);
    }
    a.button {
      /* Apply button styles to links with class 'button' */
      display: inline-block; /* Make it behave like a block for padding, but fit content */
      padding: 0.8em 1.5em;
      background-color: var(--accent-color);
      color: white;
      border: none;
      border-radius: var(--border-radius-sm);
      cursor: pointer;
      font-size: 1em;
      font-weight: 500;
      text-align: center;
      text-decoration: none; /* Remove underline */
      transition: transform 0.2s, filter 0.2s;
    }
    a.button:hover {
      transform: translateY(-2px);
      filter: brightness(1.1);
    }
    a.button:focus-visible {
      outline: none;
      box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.4);
    }
    a.button.secondary {
      background-color: var(--text-secondary);
    }
    a.button.danger {
      background-color: var(--danger-color);
    }
    a { color: var(--accent-color); text-decoration: none; }
    a:hover { text-decoration: underline; }
    .back-link { display: inline-block; margin-bottom: 1em; }
    #loading, #auth-message { text-align: center; padding: 1em; font-size: 1.2em; min-height: 1.5em;}
    #app-container, #auth-container { display: none; }
    #user-info-nav { text-align: right; margin-bottom: 1em; color: var(--text-secondary); display: flex; justify-content: flex-end; align-items: center; gap: 1em; flex-wrap: wrap;}
    .form-label { font-weight: bold; margin-bottom: -0.4em; }
    #threads-view, #thread-detail-view, #settings-view, .id-selector-group, #settings-link { display: none; }
    #managed-ids-list, #threads-list, #responses-list {
      list-style: none;
      padding: 0;
    }
    #managed-ids-list li {
      background-color: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      padding: 1em;
      margin-bottom: 0.5em;
      border-radius: var(--border-radius-sm);
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.5em;
    }
    #threads-list li {
      border-bottom: 1px solid var(--border-color);
      padding: 1.25em 1em;
      transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.5em;
    }
    #threads-list li:first-child {
      border-top: 1px solid var(--border-color);
    }
    #threads-list li:hover {
      background-color: var(--bg-tertiary);
      transform: scale(1.01);
      box-shadow: var(--shadow-sm);
      z-index: 10;
      position: relative;
    }
    #threads-list li a {
      font-weight: 500;
      font-size: 1.1em;
      color: var(--text-primary);
    }
    #threads-list .thread-meta {
      font-size: 0.9em;
      color: var(--text-secondary);
      text-align: right;
      white-space: nowrap;
    }
    .response {
      border-bottom: 1px solid var(--border-color);
      padding: 1.5em 1em;
    }
    .response:last-child {
      border-bottom: none;
    }
    .response-header {
      font-size: 0.9em;
      color: var(--text-primary); /* Changed for better contrast */
      margin-bottom: 0.75em;
    }
    .response-header strong {
        color: var(--text-primary);
        font-weight: 500;
    }
    .response-message {
      font-size: 1.05em;
      margin: 0;
      white-space: pre-wrap;
      word-wrap: break-word;
      line-height: 1.6;
    }
    #new-managed-id-form { flex-direction: row; align-items: center; }
    .settings-grid { display: grid; grid-template-columns: auto 1fr; gap: 1em 2em; align-items: center; margin-bottom: 1.5em; }
    .settings-grid label { font-weight: bold; }
    .settings-field-group { display: flex; gap: 1em; }
    .account-danger-zone { border: 2px solid var(--danger-color); border-radius: 8px; padding: 1em; margin-top: 2em; }
    .image-preview {
      max-height: 150px;
      max-width: 100%;
      margin-top: 0.8em;
      border-radius: 4px;
      object-fit: contain;
    }
    .image-preview-wrapper {
      position: relative;
      width: fit-content;
      width: -moz-fit-content;
      margin-top: 0.8em;
    }
    .clear-preview {
      position: absolute;
      top: -10px;
      right: -10px;
      background: rgba(0,0,0,0.7);
      color: white;
      border-radius: 50%;
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      line-height: 24px;
      cursor: pointer;
      font-family: sans-serif;
    }
    #lightbox-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.85);
      z-index: 1000;
      display: none;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }
    #lightbox-image {
      max-width: 90%;
      max-height: 90%;
      object-fit: contain;
    }
    #lightbox-close {
      position: absolute;
      top: 20px;
      right: 30px;
      font-size: 40px;
      color: white;
      font-weight: bold;
      cursor: pointer;
    }
    #changelog-list {
      list-style: none;
      padding: 0;
    }
    #changelog-list li {
      background-color: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      padding: 1.5em;
      margin-bottom: 1em;
      border-radius: 8px;
    }
    #changelog-list h3 {
      margin-top: 0;
      border-bottom: none;
      font-size: 1.3em;
    }
    #changelog-list .changelog-meta {
      font-size: 0.9em;
      color: var(--text-secondary);
      margin-bottom: 1em;
      display: block;
    }
    #changelog-list .changelog-changes {
      list-style: disc;
      padding-left: 20px;
    }
    #global-footer-links {
      text-align: center;
      padding: 2em 0;
      font-size: 0.9em;
      color: var(--text-secondary);
    }
  