/* Base styles */
:root {
    /* Common variables */
    --font-primary: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-xxl: 2rem;
    --line-height-base: 1.5;
    --border-radius: 5px;

    /* Primary brand color (based on Index "Get started" button) */
    --color-primary: #2b6cb0; /* blue with a calmer tone */

    /* Light theme (default) */
    --color-bg: #f8f8f8;
    --color-text: #333;
    --color-text-light: #666;
    --color-text-muted: #aaa;
    --color-link: #0202ee;
    --color-border: #ddd;
    /* Slightly elevated card background */
    --color-card: #ffffff;
    /* Calendar empty tile background */
    --color-empty-tile-bg: #ffffff;
    /* AI review background */
    --color-ai-review-bg: #f3f7ff; /* light bluish to distinguish */
    /* Corrected section background */
    --color-corrected-bg: #fff4da; /* slightly stronger warm tint for corrected text */
}

/* Dark theme */
[data-theme="dark"] {
    --color-bg: #222;
    --color-text: #eee;
    --color-text-light: #ccc;
    --color-text-muted: #999;
    --color-link: #6b9fff;
    --color-border: #555;
    --color-card: #2a2a2a;
    --color-empty-tile-bg: #000000;
    /* Slightly brighter primary in dark mode for contrast */
    --color-primary: #4c86c6;
    /* AI review background (dark) */
    --color-ai-review-bg: #1f2733;
    /* Corrected section background (dark) */
    --color-corrected-bg: #3a2f1f;
}

/* Follow system preference when no explicit theme is set */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --color-bg: #222;
        --color-text: #eee;
        --color-text-light: #ccc;
        --color-text-muted: #999;
        --color-link: #6b9fff;
        --color-border: #555;
        --color-card: #2a2a2a;
        --color-empty-tile-bg: #000000;
        /* Mirror dark-mode primary when following system */
        --color-primary: #4c86c6;
        /* AI review background when following system dark */
        --color-ai-review-bg: #1f2733;
        /* Corrected section background when following system dark */
        --color-corrected-bg: #3a2f1f;
    }
}

/* Global styles */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg);
    margin: var(--spacing-md);
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
}

/* Layout */
main {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

/* Typography */
h2, h3 {
    font-weight: normal;
    line-height: 1.3;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

h2 {
    font-size: var(--font-size-xxl);
}

.centered { text-align: center; }

.owner {
    color: #aaa;
    text-align: center;
    margin-top: -20px;
    font-size: 0.8rem;
}

h3 {
    font-size: var(--font-size-xl);
}

p {
    margin-top: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

/* Links */
a {
    text-decoration: none;
    color: var(--color-link);
}

a:hover:not(.submit-button) {
    text-decoration: none;
    border-bottom: none;
}

a.linkBlack {
    color: var(--color-text);
}

a.linkBlack:hover {
    border-bottom: none;
    text-decoration: none;
}

/* Diary entries */
.diary-entries {
    margin-top: var(--spacing-lg);
}

.diary-entry {
    margin-bottom: var(--spacing-xl);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 10px;
    position: relative;
}

.diary-entry.has-inline-tabs {
    border-top-right-radius: 0;
}

.diary-entry:last-child {
    /* no special bottom border override needed anymore, but keep rule harmless */
}

.entry-content {
    margin-bottom: 24px;
}

time.titleDate {
    margin-left: var(--spacing-md);
    display: inline-block;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Login form */
.login-section {
    max-width: 400px;
    margin: var(--spacing-xl) auto;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border-radius: var(--border-radius);
    border: 1px solid #ffcdd2;
    border-left: 4px solid #c62828;
    box-shadow: 0 2px 5px rgba(198, 40, 40, 0.2);
    animation: errorPulse 2s ease-in-out 1;
}

@keyframes errorPulse {
    0% { background-color: #ffebee; }
    50% { background-color: #ffcdd2; }
    100% { background-color: #ffebee; }
}

.form-group {
    margin-bottom: var(--spacing-sm);
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: bold;
}

input {
    width: 100%;
    font-size: var(--font-size-lg);
    padding: var(--spacing-xs);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
}

.submit-button {
    /* Unified primary button style */
    background-color: var(--color-primary); /* fallback */
    background: linear-gradient(180deg, color-mix(in oklab, var(--color-primary), white 6%), var(--color-primary));
    color: #fff;
    border: none;
    border-radius: 8px; /* standard corners for normal buttons */
    padding: 7px 16px; /* slimmer buttons */
    font-size: var(--font-size-base);
    font-weight: 400;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.10);
    transition: background 180ms ease, transform 120ms ease, box-shadow 180ms ease;
}

.submit-button:hover {
    background: linear-gradient(180deg, var(--color-primary), color-mix(in oklab, var(--color-primary), black 12%));
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.submit-button:active {
    transform: translateY(1px);
    background: linear-gradient(180deg, color-mix(in oklab, var(--color-primary), white 2%), color-mix(in oklab, var(--color-primary), black 6%));
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.submit-button:focus-visible {
    outline: 3px solid color-mix(in oklab, var(--color-primary), white 30%);
    outline-offset: 2px;
}

/* Slim variant for compact buttons */
.submit-button.slim {
    padding: 5px 12px;
    font-size: 0.9rem;
    border-radius: 6px;
}

/* Vocabulary section */
.vocab-details {
    margin-top: var(--spacing-sm);
}

.vocab-summary {
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.vocab-content {
    margin-top: var(--spacing-xs);
    padding-left: var(--spacing-md);
    border-left: 2px solid var(--color-border);
}
/* Add spacing below the normal vocab list on diary entries */
.entry-footer .vocab-content {
    margin-bottom: 18px;
    border-left: none;
    padding-left: 0;
}

.vocab-item {
    margin: var(--spacing-xs) 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
}

/* Vocab table */
.vocab-table {
    width: auto;
    margin: 6px 0;
    font-size: var(--font-size-sm);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden; /* ensure zebra rows are clipped to rounded corners */
}
.vocab-table th,
.vocab-table td {
    border: none;
    padding: 2px 6px;
    text-align: left;
}
/* Zebra striping for vocab rows */
.vocab-table tbody tr:nth-child(even) {
    background: color-mix(in oklab, var(--color-card), var(--color-border) 14%);
}
[data-theme="dark"] .vocab-table tbody tr:nth-child(even) {
    background: color-mix(in oklab, var(--color-card), white 6%);
}
/* In the AI rewrite/review box, ensure odd rows are solid card color (not transparent) */
.ai-review-result .vocab-table tbody tr:nth-child(odd) {
    background: var(--color-card);
}
/* Add bordered panels for the two vocab lists in the rewrite UI */
.ai-review-result .vocab-details {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 8px;
    background: var(--color-card);
    overflow: hidden;
}
/* In the rewrite UI, remove the left border line and extra left padding on vocab content */
.ai-review-result .vocab-content {
    border-left: none;
    padding-left: 0;
}
/* Remove left border and extra padding for the vocab section on the edit page */
.diary-entry > .vocab-content {
    border-left: none;
    padding-left: 0;
}
.vocab-table tr td:first-child { padding-right: 12px; }
.vocab-table th {
    background: color-mix(in oklab, var(--color-card), var(--color-border) 20%);
    color: var(--color-text-light);
}
[data-theme="dark"] .vocab-table th {
    background: color-mix(in oklab, var(--color-card), black 10%);
}
.vocab-term { font-weight: normal; padding-right: 18px; padding-left: 0; }
.vocab-gloss { color: var(--color-text-light); padding-left: 0; }
/* Drag handle styles */
.grab-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    cursor: grab;
    color: var(--color-text-light);
}
.grab-handle:active { cursor: grabbing; }
.grab-handle .icon-grab { width: 16px; height: 16px; display: block; }
/* Highlight row on drag over */
.vocab-table tbody tr.drag-over { outline: 2px dashed var(--color-border); }
/* Placeholder row to show gap during drag */
.vocab-table tbody tr.drag-placeholder td { padding: 0; height: 8px; }
.vocab-table tbody tr.drag-placeholder { background: color-mix(in oklab, var(--color-card), var(--color-border) 45%); box-shadow: inset 0 0 0 1px var(--color-border); opacity: 1; }

/* Actions under vocab table on edit page */
.vocab-under-table-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
    margin-top: 24px;
}
.vocab-under-table-actions a {
    margin-left: 18px;
    margin-right: 18px; }

rt { font-size: 0.6em; color: var(--color-text-muted); font-weight: normal; }

/* Toggle to hide Furigana within a container */
.no-furigana rt { display: none; }

/* Footer */
.page-footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}
.page-footer a {
    margin-left: 12px;
    margin-right: 12px; }

/* Logrio Plus badge */
.plus-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: linear-gradient(180deg, color-mix(in oklab, var(--color-primary), white 20%), var(--color-primary));
    color: #fff;
    font-size: 0.8rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* Utility classes */
.text-right {
    text-align: right;
}

.small-text {
    font-size: var(--font-size-sm);
}

.marginLeft {
    margin-left: 20px;
}

textarea {
    width: 100%;
    background-color: #fff;
    padding: 12px;
    border: 1px solid #aaa;
    border-radius: 6px;
    font: inherit;
    color: inherit;
    line-height: inherit;
    resize: vertical;
}

/* Dark mode improvements for textarea */
[data-theme="dark"] textarea {
    background-color: var(--color-card);
    border-color: var(--color-border);
    color: var(--color-text);
}
[data-theme="dark"] textarea::placeholder {
    color: var(--color-text-muted);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) textarea {
        background-color: var(--color-card);
        border-color: var(--color-border);
        color: var(--color-text);
    }
    :root:not([data-theme]) textarea::placeholder {
        color: var(--color-text-muted);
    }
}

menu {
    text-align: right;
    list-style-type: none;
    padding: 0;
    margin: 0;
    font-size: var(--font-size-sm);
}
menu li a {
    color: var(--color-text-muted);
    margin-right: 20px;
}
menu li a {
    border-bottom-color: #aaa !important;
}

/* Delete link style: icon button (grey by default, dark red on hover) */
a.linkDelete {
    color: #ae7171;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    vertical-align: middle;
}
a.linkDelete:hover {
    color: #ae7171;
    border-bottom-color: transparent !important; /* avoid underline color artifacts */
}
a.linkDelete .icon-delete {
    width: 18px;
    height: 18px;
    display: block;
}

/* Text delete link (same color as delete icon, without icon sizing) */
a.linkDanger,
button.linkDanger {
    color: #ae7171;
}
a.linkDanger:hover,
button.linkDanger:hover {
    color: #ae7171;
    border-bottom-color: transparent !important;
}

/* Time reveal on title hover */
.diary-entry h3 .timePart {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.diary-entry h3:hover .timePart {
    opacity: 1;
}


/* Login button spacing within login section */
.login-section .submit-button {
    margin-top: var(--spacing-sm);
}

/* Ensure language selector visually matches date input on edit/new form */
#lang {
    width: 100%;
    font-size: var(--font-size-lg);
    padding: var(--spacing-xs);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    min-height: 2.5rem; /* approximate height of date input for consistency */
}

/* Calendar future days */
.future-day {
    background-color: transparent !important;
    border-color: transparent !important;
}

/* Spacing between header/owner and form on edit/new page */
.edit-form-spacer {
    margin-top: var(--spacing-sm);
}


/* Disabled state for submit buttons: make visibly grey and non-interactive */
.submit-button:disabled,
.submit-button[disabled] {
    background-color: var(--color-border);
    color: var(--color-text);
    cursor: not-allowed;
    opacity: 1; /* keep solid color for readability */
}
/* Prevent hover/active effects when disabled */
.submit-button:disabled:hover,
.submit-button[disabled]:hover,
.submit-button:disabled:active,
.submit-button[disabled]:active {
    opacity: 1;
}


/* AI review container */
.ai-review-result {
    background-color: var(--color-ai-review-bg);
    max-width: 100%;
    overflow-x: hidden; /* prevent horizontal scroll on small devices */
}
/* Ensure AI tabs can wrap on small screens */
[id^="ai-review-tabs-"] {
    display: flex;
    flex-wrap: wrap;
}

/* Corrected section styling */
.ai-corrected-block {
    background-color: var(--color-corrected-bg);
    /* Extend to the edges of the parent box (which has 10px padding) to avoid a blue gutter */
    margin: -10px; /* pull over parent padding on all sides */
    padding: 10px; /* preserve inner spacing for the corrected content */
    border: none; /* no own border */
    border-radius: 0; /* no rounding inside parent */
    /* Add a subtle inset left accent without adding a border */
    box-shadow: inset 3px 0 0 rgba(246, 173, 85, 0.8); /* warm accent */
}

/* No-correction banner styled like corrected block, but green and centered */
.ai-no-correction-block {
    background-color: rgba(134, 239, 172, 0.25); /* light green */
    margin: -10px; /* match corrected block layout */
    margin-bottom: 12px;
    padding: 10px;
    border: none;
    border-radius: 0;
    box-shadow: inset 3px 0 0 rgba(16, 185, 129, 0.7); /* green accent */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}
.ai-no-correction-block .ai-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    color: #10b981; /* emerald */
}
.ai-no-correction-text {
    font-size: 0.9rem; /* a bit smaller */
    color: var(--color-text);
}

/* AI diff highlighting */
.ai-diff-add {
    background-color: rgba(134, 239, 172, 0.5); /* stronger green highlight */
    border-radius: 2px;
    box-shadow: inset 0 -1px 0 rgba(16, 185, 129, 0.6); /* subtle underline */
}
.ai-diff-del {
    background-color: rgba(255, 0, 0, 0.10);
    color: #b00020;
    text-decoration: line-through;
    border-radius: 2px;
}

/* AI level layout */
.ai-level-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
}
.ai-level-left {
    width: 1%;
    white-space: nowrap;
    vertical-align: top;
    padding-right: 12px;
    color: var(--color-text-muted);
    text-align: center;
}
/* Scale both the level and the boxes from a common wrapper so heights match */
.ai-level-left-wrap {
    display: inline-flex;
    align-items: flex-end; /* keep baselines aligned at the bottom */
    gap: 0.12em; /* relative spacing next to a large label */
    font-size: 7em; /* controls size of both label and boxes (slightly larger) */
}
.ai-level-value {
    font-size: 1em; /* equals wrapper */
    line-height: 0.9; /* compact block; used as target height for the boxes */
    color: var(--color-text-muted);
    font-weight: 400; /* not bold */
    display: flex;
    align-items: flex-end;
}
.ai-level-system {
    color: var(--color-text-muted);
}
.ai-level-system a,
.ai-level-system a:visited,
.ai-level-system a:hover,
.ai-level-system a:active,
.ai-level-system a:focus {
    color: inherit;
    text-decoration: underline;
}
.ai-level-reason {
    color: var(--color-text-muted);
}
.ai-level-suggestion {
    color: var(--color-text-muted);
    margin-top: var(--spacing-xs);
}
.ai-level-right {
    vertical-align: top;
}

/* AI level quartile indicator (panel) */
.ai-level-pos {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 0.06em; /* proportional gap */
    margin-left: 0;
    height: 0.9em; /* exactly match the level block height */
}
.ai-level-box {
    width: 0.18em; /* slender column */
    height: auto; /* fill the grid row height */
    border: 0.03em solid var(--color-text-muted);
    border-radius: 0.03em;
    display: block;
}
.ai-level-box.solid {
    background-color: var(--color-text-muted);
}
.ai-level-box.hollow {
    background-color: transparent;
}


/* Spacing for Ai review button in the entry menu (match link spacing) */
menu li button.linkAiReview.submit-button {
    margin-right: 20px;
}

/* Inline level badge on entry header (right side, compact) */
.entry-level-inline {
    float: right;
    font-size: 0.8em; /* slightly bigger label and boxes */
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: flex-end;
    gap: 0.4em; /* proportional spacing */
}
.entry-level-inline .entry-level-label {
    font-weight: 400; /* not bold */
    line-height: 1; /* make text block height = 1em */
}
.entry-level-inline .entry-inline-pos {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 0; /* no gap between boxes in the small inline indicator */
    height: 1em; /* total height matches the label height */
}
.entry-level-inline .ai-level-box {
    width: 0.28em; /* smaller, slender boxes */
    height: auto; /* fill row height */
    box-sizing: border-box; /* ensure borders don't alter layout unexpectedly */
    border-left: 0.06em solid var(--color-text-muted);
    border-right: 0.06em solid var(--color-text-muted);
    border-top: 0;  /* will be set on first box only */
    border-bottom: 0; /* will be set on last box only */
    border-radius: 0; /* no rounding on small boxes */
}
.entry-level-inline .entry-inline-pos .ai-level-box:first-child { border-top: 0.06em solid var(--color-text-muted); }
.entry-level-inline .entry-inline-pos .ai-level-box:last-child  { border-bottom: 0.06em solid var(--color-text-muted); }
/* Add a single separator line between stacked boxes (no double borders) */
.entry-level-inline .entry-inline-pos .ai-level-box + .ai-level-box { border-top: 0.06em solid var(--color-text-muted); }
.entry-level-inline .ai-level-box.solid { background-color: var(--color-text-muted); }
.entry-level-inline .ai-level-box.hollow { background-color: transparent; }

/* Mobile adjustments for AI review pane and level table */
@media (max-width: 768px) {
  .ai-review-result,
  .ai-corrected-block {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  /* Switch to stacked layout earlier (table cells become blocks) */
  .ai-level-table { width: 100%; display: block; }
  .ai-level-table tr { display: block; }
  .ai-level-table td { display: block; width: 100%; box-sizing: border-box; }
  /* Center the level block when stacked */
  .ai-level-left { text-align: center; padding-right: 0; margin-bottom: 8px; }
  .ai-level-left-wrap { font-size: 5em; /* smaller on tablets/large phones */ gap: 0.1em; }
  .ai-level-system { margin-top: 4px; }
}
@media (max-width: 480px) {
  /* Further reduce sizes for very small phones */
  .ai-level-left-wrap { font-size: 3.2em; gap: 0.08em; }
  .ai-corrected-block { margin: -8px; padding: 8px; }
}




/* Pricing lists: add checkmark before each feature row */
.pricing-list li::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    /* Simple check mark (no circle) */
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    color: var(--color-success);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6.5 12.5l3.5 3.5L18 8.5' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* Pricing list rows: left-align text but center the content group (checkmark + text) */
.pricing-list li {
    display: flex;
    align-items: center;
    justify-content: center; /* center the compact content group within the full-width row */
    text-align: left;        /* keep the text itself left-aligned */
}

:root { --color-success: #10b981; }
[data-theme="dark"] { --color-success: #10b981; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --color-success: #10b981; } }

/* iPhone-like toggle for billing */
.billing-toggle {
    position: relative;
    display: inline-block;
    width: 48px; /* slightly slimmer for better balance with small text */
    height: 28px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: color-mix(in oklab, var(--color-card), black 6%);
    vertical-align: middle;
    cursor: pointer;
    padding: 0;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.billing-toggle .knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: transform 180ms ease, box-shadow 160ms ease;
}
.billing-toggle:hover {
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.12);
}
.billing-toggle:focus-visible {
    outline: 3px solid color-mix(in oklab, var(--color-primary), white 30%);
    outline-offset: 2px;
}
.billing-toggle[aria-checked="true"] {
    background: var(--color-success);
    border-color: color-mix(in oklab, var(--color-success), black 10%);
}
.billing-toggle[aria-checked="true"] .knob {
    transform: translateX(20px);
}

/* Dark mode adjustments for toggle */
[data-theme="dark"] .billing-toggle {
    background: color-mix(in oklab, var(--color-card), white 6%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .billing-toggle { background: color-mix(in oklab, var(--color-card), white 6%); box-shadow: inset 0 1px 2px rgba(0,0,0,0.25); }
}

/* Pricing: bigger price text */
.pricing-price {
    font-size: 1.35rem; /* slightly reduced for balance */
    line-height: 1.3;
}

/* Billing labels next to the toggle */
.billing-label {
    vertical-align: middle;
    user-select: none;
    color: var(--color-text-light);
    cursor: pointer;
    transition: color 140ms ease;
}
.billing-label.active {
    color: var(--color-text);
    font-weight: 600;
}


/* Top spacing above entry action menu */
.diary-entry > menu {
    margin-top: 12px;
}


/* Entry action menu positioning: bottom-right and no wrap */
.diary-entry > menu {
    position: absolute;
    right: 10px;
    bottom: 10px;
    white-space: nowrap;
    z-index: 1;
}
