:root {
  --bg: #14161a;
  --paper: #fbf8f1;
  --paper-line: #e7e0d0;
  --ink: #1a1a1a;
  --hermes: #2456a6;
  --hermes-bg: rgba(36, 86, 166, 0.08);
  --ok: #3fb26f;
  --warn: #d9a03f;
  --bad: #d95050;
  --muted: #8a8f98;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: #e8e8e8;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}

#topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.9rem;
  height: 2.6rem;
}

#page-title { font-weight: 600; font-size: 0.95rem; }

#indicators { display: flex; align-items: center; gap: 0.7rem; }

#cost-panel {
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid #2a2e35;
  border-radius: 0.6rem;
  padding: 0.1rem 0.5rem;
}

.dot { font-size: 0.7rem; transition: color 0.3s; }
#sync-dot.synced { color: var(--ok); }
#sync-dot.pending { color: var(--warn); }
#sync-dot.error { color: var(--bad); }
#offline-dot.online { color: var(--ok); }
#offline-dot.offline { color: var(--bad); }

#page-container {
  height: calc(100% - 2.6rem - 1.6rem);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  padding: 0.3rem;
}

/* The page keeps the logical 1000x1414 aspect ratio at any size. */
#page-surface {
  position: relative;
  background: var(--paper);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(4.95% - 1px),
    var(--paper-line) calc(4.95% - 1px),
    var(--paper-line) 4.95%
  );
  border-radius: 4px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  aspect-ratio: 1000 / 1414;
  height: 100%;
  max-width: 100%;
}

#ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none; /* required for Pointer Events drawing */
  cursor: crosshair;
}

#objects { position: absolute; inset: 0; pointer-events: none; }

.task-object {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0 0.6em;
  border: 1.5px solid var(--hermes);
  border-radius: 0.5em;
  background: var(--hermes-bg);
  color: var(--hermes);
  font-size: 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task-object .box { font-size: 0.85em; }

.task-object.completed {
  text-decoration: line-through;
  opacity: 0.55;
}

#statusbar {
  height: 1.6rem;
  display: flex;
  align-items: center;
  padding: 0 0.9rem;
  font-size: 0.75rem;
  color: var(--muted);
}
